blob: 8762effb86730da8d1d13b33e4c5a36301a71ee6 [file] [log] [blame]
#! /bin/sh
mkdir -p tests/tmp/proc
# Old style
echo 'foo 100 0' > tests/tmp/proc/modules
echo 'bar 100 0' >> tests/tmp/proc/modules
[ "`rmmod foo bar`" = "DELETE_MODULE: foo EXCL NONBLOCK
DELETE_MODULE: bar EXCL NONBLOCK " ]
[ "`rmmod -f foo bar`" = "DELETE_MODULE: foo EXCL TRUNC NONBLOCK
DELETE_MODULE: bar EXCL TRUNC NONBLOCK " ]
[ "`rmmod -w foo bar`" = "DELETE_MODULE: foo EXCL
DELETE_MODULE: bar EXCL " ]
# First examine stdout (mixing them gives unpredictable results)
[ "`rmmod foo bar baz 2>/dev/null`" = "DELETE_MODULE: foo EXCL NONBLOCK
DELETE_MODULE: bar EXCL NONBLOCK " ]
[ "`rmmod baz foo bar 2>/dev/null`" = "DELETE_MODULE: foo EXCL NONBLOCK
DELETE_MODULE: bar EXCL NONBLOCK " ]
# Now examine stderr.
[ "`rmmod foo bar baz 2>&1 >/dev/null`" = "ERROR: Module baz does not exist in /proc/modules" ]
[ "`rmmod baz foo bar 2>&1 >/dev/null`" = "ERROR: Module baz does not exist in /proc/modules" ]