swtpm/tests/test_cuse
Stefan Berger 415bf5563d tests: use uname -s to check for Linux
Use uname -s to check for Linux rather than uname -o, which doesn't
seem to be supported on OpenBSD.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-12 13:07:46 -04:00

21 lines
415 B
Plaintext

# For the license, see the LICENSE file in the root directory.
if ! [[ "$(uname -s)" =~ Linux ]]; then
echo "Need Linux to run test with CUSE interface."
exit 77
fi
if [ "$(id -u)" -ne 0 ]; then
echo "Need to be root to run test with CUSE interface."
exit 77
fi
if [ ! -c /dev/cuse ]; then
modprobe cuse
if [ $? -ne 0 ]; then
echo "Skipping test using CUSE module: module not availabe"
exit 77
fi
fi