modindex: getopt_long returns int not char (fix ppc64 bug)
[mit.git] / tests / test-modprobe / 18multiremove.sh
blob296536de26a52424249e358626832b7919bfc64e
1 #! /bin/sh
2 # modprobe -r supports multiple module names now.
4 BITNESS=32
6 rm -rf tests/tmp/*
8 # Create inputs
9 MODULE_DIR=tests/tmp/lib/modules/$MODTEST_UNAME
10 mkdir -p $MODULE_DIR
11 ln tests/data/$BITNESS/normal/export_dep-$BITNESS.ko \
12 tests/data/$BITNESS/normal/noexport_dep-$BITNESS.ko \
13 tests/data/$BITNESS/normal/export_nodep-$BITNESS.ko \
14 tests/data/$BITNESS/normal/noexport_nodep-$BITNESS.ko \
15 tests/data/$BITNESS/normal/noexport_doubledep-$BITNESS.ko \
16 $MODULE_DIR
18 # Now create modules.dep
19 cat > $MODULE_DIR/modules.dep <<EOF
20 # Should handle comments.
21 noexport_nodep-$BITNESS.ko:
22 noexport_doubledep-$BITNESS.ko: export_dep-$BITNESS.ko export_nodep-$BITNESS.ko
23 noexport_dep-$BITNESS.ko: export_nodep-$BITNESS.ko
24 export_nodep-$BITNESS.ko:
25 export_dep-$BITNESS.ko: export_nodep-$BITNESS.ko
26 EOF
28 # Now make a fake /sys/module structure for the test
29 mkdir -p tests/tmp/sys/module
30 mkdir -p tests/tmp/sys/module/noexport_nodep_$BITNESS
31 mkdir -p tests/tmp/sys/module/noexport_dep_$BITNESS
32 mkdir -p tests/tmp/sys/module/export_nodep_$BITNESS
33 mkdir -p tests/tmp/sys/module/export_dep_$BITNESS
34 mkdir -p tests/tmp/sys/module/noexport_doubledep_$BITNESS
35 echo live > tests/tmp/sys/module/noexport_nodep_$BITNESS/initstate
36 echo live > tests/tmp/sys/module/noexport_dep_$BITNESS/initstate
37 echo live > tests/tmp/sys/module/export_nodep_$BITNESS/initstate
38 echo live > tests/tmp/sys/module/export_dep_$BITNESS/initstate
39 echo live > tests/tmp/sys/module/noexport_doubledep_$BITNESS/initstate
41 # Removal
42 [ "`modprobe -r noexport_nodep-$BITNESS export_nodep-$BITNESS 2>&1`" = "DELETE_MODULE: noexport_nodep_$BITNESS EXCL
43 DELETE_MODULE: export_nodep_$BITNESS EXCL " ]