9 MODULE_DIR
=tests
/tmp
/lib
/modules
/$MODTEST_UNAME
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 \
18 # Now create modules.dep
19 cat > $MODULE_DIR/modules.dep
<<EOF
20 # Should handle comments.
21 /lib/modules/$MODTEST_UNAME/noexport_nodep-$BITNESS.ko:
22 /lib/modules/$MODTEST_UNAME/noexport_doubledep-$BITNESS.ko: /lib/modules/$MODTEST_UNAME/export_dep-$BITNESS.ko /lib/modules/$MODTEST_UNAME/export_nodep-$BITNESS.ko
23 /lib/modules/$MODTEST_UNAME/noexport_dep-$BITNESS.ko: /lib/modules/$MODTEST_UNAME/export_nodep-$BITNESS.ko
24 /lib/modules/$MODTEST_UNAME/export_nodep-$BITNESS.ko:
25 /lib/modules/$MODTEST_UNAME/export_dep-$BITNESS.ko: /lib/modules/$MODTEST_UNAME/export_nodep-$BITNESS.ko
28 [ "`modprobe --show-depends noexport_nodep-$BITNESS 2>>tests/tmp/stderr`" = "insmod /lib/modules/$MODTEST_UNAME/noexport_nodep-$BITNESS.ko " ]
29 [ "`modprobe --show-depends export_nodep-$BITNESS 2>>tests/tmp/stderr`" = "insmod /lib/modules/$MODTEST_UNAME/export_nodep-$BITNESS.ko " ]
30 [ "`modprobe --show-depends noexport_dep-$BITNESS 2>>tests/tmp/stderr`" = "insmod /lib/modules/$MODTEST_UNAME/export_nodep-$BITNESS.ko
31 insmod /lib/modules/$MODTEST_UNAME/noexport_dep-$BITNESS.ko " ]
32 [ "`modprobe --show-depends export_dep-$BITNESS 2>>tests/tmp/stderr`" = "insmod /lib/modules/$MODTEST_UNAME/export_nodep-$BITNESS.ko
33 insmod /lib/modules/$MODTEST_UNAME/export_dep-$BITNESS.ko " ]
34 [ "`modprobe --show-depends noexport_doubledep-$BITNESS 2>>tests/tmp/stderr`" = "insmod /lib/modules/$MODTEST_UNAME/export_nodep-$BITNESS.ko
35 insmod /lib/modules/$MODTEST_UNAME/export_dep-$BITNESS.ko
36 insmod /lib/modules/$MODTEST_UNAME/noexport_doubledep-$BITNESS.ko " ]
38 # Nothing in stderr...
39 [ `wc -c < tests/tmp/stderr` = 0 ]
41 # All in /sys/module/; should make no difference.
42 mkdir
-p tests
/tmp
/sys
/module
43 mkdir
-p tests
/tmp
/sys
/module
/noexport_nodep_
$BITNESS
44 mkdir
-p tests
/tmp
/sys
/module
/export_nodep_
$BITNESS
45 echo live
> tests
/tmp
/sys
/module
/noexport_nodep_
$BITNESS/initstate
46 echo live
> tests
/tmp
/sys
/module
/export_nodep_
$BITNESS/initstate
48 [ "`modprobe --show-depends noexport_nodep-$BITNESS 2>>tests/tmp/stderr`" = "insmod /lib/modules/$MODTEST_UNAME/noexport_nodep-$BITNESS.ko " ]
49 [ "`modprobe --show-depends export_nodep-$BITNESS 2>>tests/tmp/stderr`" = "insmod /lib/modules/$MODTEST_UNAME/export_nodep-$BITNESS.ko " ]
50 [ "`modprobe --show-depends noexport_dep-$BITNESS 2>>tests/tmp/stderr`" = "insmod /lib/modules/$MODTEST_UNAME/export_nodep-$BITNESS.ko
51 insmod /lib/modules/$MODTEST_UNAME/noexport_dep-$BITNESS.ko " ]
52 [ "`modprobe --show-depends export_dep-$BITNESS 2>>tests/tmp/stderr`" = "insmod /lib/modules/$MODTEST_UNAME/export_nodep-$BITNESS.ko
53 insmod /lib/modules/$MODTEST_UNAME/export_dep-$BITNESS.ko " ]
54 [ "`modprobe --show-depends noexport_doubledep-$BITNESS 2>>tests/tmp/stderr`" = "insmod /lib/modules/$MODTEST_UNAME/export_nodep-$BITNESS.ko
55 insmod /lib/modules/$MODTEST_UNAME/export_dep-$BITNESS.ko
56 insmod /lib/modules/$MODTEST_UNAME/noexport_doubledep-$BITNESS.ko " ]
58 # Nothing in stderr...
59 [ `wc -c < tests/tmp/stderr` = 0 ]
61 # Module commands printed, ignored.
62 mkdir
-p tests
/tmp
/etc
/modprobe.d
63 cat > tests
/tmp
/etc
/modprobe.d
/modprobe.conf
<<EOF
64 install noexport_nodep-$BITNESS echo noexport_nodep-$BITNESS
65 install export_nodep-$BITNESS echo export_nodep-$BITNESS
66 install noexport_dep-$BITNESS echo noexport_dep-$BITNESS
67 install export_dep-$BITNESS echo export_dep-$BITNESS
68 install noexport_doubledep-$BITNESS echo noexport_doubledep-$BITNESS
71 [ "`modprobe --show-depends noexport_nodep-$BITNESS 2>>tests/tmp/stderr`" = "install echo noexport_nodep-$BITNESS" ]
72 [ "`modprobe --show-depends export_nodep-$BITNESS 2>>tests/tmp/stderr`" = "install echo export_nodep-$BITNESS" ]
73 [ "`modprobe --show-depends noexport_dep-$BITNESS 2>>tests/tmp/stderr`" = "install echo export_nodep-$BITNESS
74 install echo noexport_dep-$BITNESS" ]
75 [ "`modprobe --show-depends export_dep-$BITNESS 2>>tests/tmp/stderr`" = "install echo export_nodep-$BITNESS
76 install echo export_dep-$BITNESS" ]
77 [ "`modprobe --show-depends noexport_doubledep-$BITNESS 2>>tests/tmp/stderr`" = "install echo export_nodep-$BITNESS
78 install echo export_dep-$BITNESS
79 install echo noexport_doubledep-$BITNESS" ]
80 # Nothing in stderr...
81 [ `wc -c < tests/tmp/stderr` = 0 ]
83 # Module options printed.
84 cat > tests
/tmp
/etc
/modprobe.d
/modprobe.conf
<<EOF
85 options noexport_nodep-$BITNESS opt1
86 options export_nodep-$BITNESS opt2
87 options noexport_dep-$BITNESS opt3
88 options export_dep-$BITNESS opt4
89 options noexport_doubledep-$BITNESS opt5
92 [ "`modprobe --show-depends noexport_nodep-$BITNESS 2>>tests/tmp/stderr`" = "insmod /lib/modules/$MODTEST_UNAME/noexport_nodep-$BITNESS.ko opt1" ]
93 [ "`modprobe --show-depends export_nodep-$BITNESS 2>>tests/tmp/stderr`" = "insmod /lib/modules/$MODTEST_UNAME/export_nodep-$BITNESS.ko opt2" ]
94 [ "`modprobe --show-depends noexport_dep-$BITNESS 2>>tests/tmp/stderr`" = "insmod /lib/modules/$MODTEST_UNAME/export_nodep-$BITNESS.ko opt2
95 insmod /lib/modules/$MODTEST_UNAME/noexport_dep-$BITNESS.ko opt3" ]
96 [ "`modprobe --show-depends export_dep-$BITNESS 2>>tests/tmp/stderr`" = "insmod /lib/modules/$MODTEST_UNAME/export_nodep-$BITNESS.ko opt2
97 insmod /lib/modules/$MODTEST_UNAME/export_dep-$BITNESS.ko opt4" ]
98 [ "`modprobe --show-depends noexport_doubledep-$BITNESS 2>>tests/tmp/stderr`" = "insmod /lib/modules/$MODTEST_UNAME/export_nodep-$BITNESS.ko opt2
99 insmod /lib/modules/$MODTEST_UNAME/export_dep-$BITNESS.ko opt4
100 insmod /lib/modules/$MODTEST_UNAME/noexport_doubledep-$BITNESS.ko opt5" ]
101 # Nothing in stderr...
102 [ `wc -c < tests/tmp/stderr` = 0 ]
105 cat > tests
/tmp
/etc
/modprobe.d
/modprobe.conf
<<EOF
106 options noexport_nodep-$BITNESS opt1
107 alias foo noexport_nodep-$BITNESS
111 [ "`modprobe --show-depends foo`" = "insmod /lib/modules/$MODTEST_UNAME/noexport_nodep-$BITNESS.ko opt1 fooopt" ]
112 # Nothing in stderr...
113 [ `wc -c < tests/tmp/stderr` = 0 ]