3 mkdir
-p tests
/tmp
/proc
6 echo 'foo 100 0' > tests
/tmp
/proc
/modules
7 echo 'bar 100 0' >> tests
/tmp
/proc
/modules
9 [ "`rmmod foo bar`" = "DELETE_MODULE: foo EXCL NONBLOCK
10 DELETE_MODULE: bar EXCL NONBLOCK " ]
12 [ "`rmmod -f foo bar`" = "DELETE_MODULE: foo EXCL TRUNC NONBLOCK
13 DELETE_MODULE: bar EXCL TRUNC NONBLOCK " ]
15 [ "`rmmod -w foo bar`" = "DELETE_MODULE: foo EXCL
16 DELETE_MODULE: bar EXCL " ]
18 # First examine stdout (mixing them gives unpredictable results)
19 [ "`rmmod foo bar baz 2>/dev/null`" = "DELETE_MODULE: foo EXCL NONBLOCK
20 DELETE_MODULE: bar EXCL NONBLOCK " ]
21 [ "`rmmod baz foo bar 2>/dev/null`" = "DELETE_MODULE: foo EXCL NONBLOCK
22 DELETE_MODULE: bar EXCL NONBLOCK " ]
25 [ "`rmmod foo bar baz 2>&1 >/dev/null`" = "ERROR: Module baz does not exist in /proc/modules" ]
26 [ "`rmmod baz foo bar 2>&1 >/dev/null`" = "ERROR: Module baz does not exist in /proc/modules" ]