depmod: fix tabs in help output
[module-init-tools.git] / tests / test-modprobe / 27cmdline-install-remove.sh
blob9411222aeec6edd850db755da45bdbb0aa8a0ae9
1 #! /bin/sh
3 BITNESS=32
5 rm -rf tests/tmp/*
7 MODULE_DIR=tests/tmp/lib/modules/$MODTEST_UNAME
8 mkdir -p $MODULE_DIR
9 ln tests/data/$BITNESS/normal/noexport_nodep-$BITNESS.ko \
10 $MODULE_DIR
12 # Set up modules.dep file.
13 echo "# A comment" > $MODULE_DIR/modules.dep
14 echo "/lib/modules/$MODTEST_UNAME/noexport_nodep-$BITNESS.ko:" >> $MODULE_DIR/modules.dep
16 # Set up modprobe.conf file: one at end, one with text either side.
17 mkdir -p tests/tmp/etc/modprobe.d
18 echo "options noexport_nodep-$BITNESS file-options" > tests/tmp/etc/modprobe.d/modprobe.conf
19 echo "install noexport_nodep-$BITNESS modprobe --ignore-install noexport_nodep-$BITNESS \$CMDLINE_OPTS" >> tests/tmp/etc/modprobe.d/modprobe.conf
20 echo "install othertarget echo \$CMDLINE_OPTS otheropts" >> tests/tmp/etc/modprobe.d/modprobe.conf
22 # Empty /sys/module/ for install commands
23 mkdir -p tests/tmp/sys/module
25 # With quoted args
26 [ "`modprobe noexport_nodep-$BITNESS 'foo="bar baz"' 2>&1`" = "SYSTEM: modprobe --ignore-install noexport_nodep-$BITNESS foo=\"bar baz\"" ]
27 # With unquoted args
28 [ "`modprobe noexport_nodep-$BITNESS foo=\"bar baz\" 2>&1`" = "SYSTEM: modprobe --ignore-install noexport_nodep-$BITNESS foo=\"bar baz\"" ]
30 # Same with other target.
31 [ "`modprobe othertarget 'foo="bar baz"' 2>&1`" = "SYSTEM: echo foo=\"bar baz\" otheropts" ]
32 # With unquoted args
33 [ "`modprobe othertarget foo=\"bar baz\" 2>&1`" = "SYSTEM: echo foo=\"bar baz\" otheropts" ]