depmod: export static device node information to modules.devname
[mit.git] / tests / test-modprobe / 15env.sh
blob461e34add7013d94a4596c6c1d1a1f60f842202c
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 # Now create modules.dep and modules.conf
13 echo /lib/modules/$MODTEST_UNAME/noexport_nodep-$BITNESS.ko: > $MODULE_DIR/modules.dep
15 mkdir -p tests/tmp/etc/modprobe.d
16 echo install foo modprobe noexport_nodep-$BITNESS > tests/tmp/etc/modprobe.d/modprobe.conf
17 echo install foo modprobe bar > tests/tmp/etc/modprobe2.conf
18 echo install bar echo DOING BAR >> tests/tmp/etc/modprobe2.conf
20 SIZE_NOEXPORT_NODEP=`wc -c < tests/data/$BITNESS/normal/noexport_nodep-$BITNESS.ko`
22 # Test normal args, then in env.
23 [ "`modprobe -v noexport_nodep-$BITNESS 2>&1`" = "insmod /lib/modules/$MODTEST_UNAME/noexport_nodep-$BITNESS.ko
24 INIT_MODULE: $SIZE_NOEXPORT_NODEP " ]
25 [ "`MODPROBE_OPTIONS=-v modprobe noexport_nodep-$BITNESS 2>&1`" = "insmod /lib/modules/$MODTEST_UNAME/noexport_nodep-$BITNESS.ko
26 INIT_MODULE: $SIZE_NOEXPORT_NODEP " ]
28 [ "`modprobe -q noexport_nodep-$BITNESS 2>&1`" = "INIT_MODULE: $SIZE_NOEXPORT_NODEP " ]
29 [ "`MODPROBE_OPTIONS=-q modprobe noexport_nodep-$BITNESS 2>&1`" = "INIT_MODULE: $SIZE_NOEXPORT_NODEP " ]
31 [ "`modprobe -n noexport_nodep-$BITNESS 2>&1`" = "" ]
32 [ "`MODPROBE_OPTIONS=-n modprobe noexport_nodep-$BITNESS 2>&1`" = "" ]
34 [ "`modprobe -n -v noexport_nodep-$BITNESS 2>&1`" = "insmod /lib/modules/$MODTEST_UNAME/noexport_nodep-$BITNESS.ko " ]
35 [ "`MODPROBE_OPTIONS="-n -v" modprobe noexport_nodep-$BITNESS 2>&1`" = "insmod /lib/modules/$MODTEST_UNAME/noexport_nodep-$BITNESS.ko " ]
37 # Test argument inheritence.
38 MODTEST_DO_SYSTEM=1
39 export MODTEST_DO_SYSTEM
41 [ "`modprobe -v foo 2>&1`" = "install modprobe noexport_nodep-$BITNESS
42 insmod /lib/modules/$MODTEST_UNAME/noexport_nodep-$BITNESS.ko
43 INIT_MODULE: $SIZE_NOEXPORT_NODEP " ]
44 [ "`MODPROBE_OPTIONS=-v modprobe foo 2>&1`" = "install modprobe noexport_nodep-$BITNESS
45 insmod /lib/modules/$MODTEST_UNAME/noexport_nodep-$BITNESS.ko
46 INIT_MODULE: $SIZE_NOEXPORT_NODEP " ]
48 [ "`modprobe -C /etc/modprobe2.conf foo 2>&1`" = "DOING BAR" ]
49 [ "`MODPROBE_OPTIONS='-C /etc/modprobe2.conf' modprobe foo 2>&1`" = "DOING BAR" ]
51 [ "`modprobe -C /etc/modprobe2.conf -v foo 2>&1`" = "install modprobe bar
52 install echo DOING BAR
53 DOING BAR" ]
54 [ "`MODPROBE_OPTIONS='-C /etc/modprobe2.conf' modprobe -v foo 2>&1`" = "install modprobe bar
55 install echo DOING BAR
56 DOING BAR" ]