modprobe: remove flock() because it never worked anyway
[mit.git] / tests / test-rmmod / 05noproc.sh
blobe5ed2fe3b7b4a301971c232579d66fa47e38de2d
1 #! /bin/sh
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" ]
15 # But -f doesn't care
16 [ "`./rmmod -f foo_bar`" = "DELETE_MODULE: foo_bar EXCL TRUNC NONBLOCK " ]