source: MondoRescue/branches/3.0/mindi-busybox/testsuite/mount.tests@ 2899

Last change on this file since 2899 was 2725, checked in by Bruno Cornec, 13 years ago
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
  • Property svn:executable set to *
File size: 1.3 KB
Line 
1#!/bin/sh
2# Copyright 2007 by Denys Vlasenko <vda.linux@googlemail.com>
3# Licensed under GPLv2, see file LICENSE in this source tree.
4
5. ./testing.sh
6test -f "$bindir/.config" && . "$bindir/.config"
7
8test "`id -u`" = 0 || {
9 echo "SKIPPED: mount (must be root to test this)"
10 exit 0
11}
12
13if test x"$CONFIG_MKFS_MINIX" != x"y" \
14|| test x"$CONFIG_FEATURE_MINIX2" != x"y" \
15|| test x"$CONFIG_FEATURE_MOUNT_LOOP" != x"y" \
16|| test x"$CONFIG_FEATURE_MOUNT_FLAGS" != x"y" \
17|| test x"$CONFIG_FEATURE_DEVFS" = x"y" \
18; then
19 echo "SKIPPED: mount"
20 exit 0
21fi
22
23testdir=$PWD/mount.testdir
24
25dd if=/dev/zero of=mount.image1m count=1 bs=1M 2>/dev/null || { echo "dd error"; exit 1; }
26mkfs.minix -v mount.image1m >/dev/null 2>&1 || { echo "mkfs.minix error"; exit 1; }
27modprobe minix 2>/dev/null
28mkdir "$testdir" 2>/dev/null
29umount -d "$testdir" 2>/dev/null
30
31# testing "test name" "command" "expected result" "file input" "stdin"
32# file input will be file called "input"
33# test can create a file "actual" instead of writing to stdout
34
35testing "mount -o remount,mand" \
36"mount -o loop mount.image1m $testdir "\
37"&& grep -Fc $testdir </proc/mounts "\
38"&& mount -o remount,mand $testdir "\
39"&& grep -F $testdir </proc/mounts | grep -c '[, ]mand[, ]'" \
40 "1\n""1\n" \
41 "" ""
42
43umount -d "$testdir"
44rmdir "$testdir"
45rm mount.image1m
46
47exit $FAILCOUNT
Note: See TracBrowser for help on using the repository browser.