3 mkdir
-p tests
/tmp
/proc
5 # We allow this in case proc is not mounted.
6 [ "`rmmod foo_bar`" = "DELETE_MODULE: foo_bar EXCL NONBLOCK " ]
8 # We don't allow any other errors. Doesn't work if we're root.
9 if [ `id -u` -ne 0 ]; then
10 touch tests
/tmp
/proc
/modules
11 chmod 000 tests
/tmp
/proc
/modules
13 [ "`rmmod foo_bar 2>&1`" = "FATAL: can't open /proc/modules: Permission denied" ]
16 [ "`rmmod -f foo_bar`" = "DELETE_MODULE: foo_bar EXCL TRUNC NONBLOCK " ]