swtpm/tests/test_cuse
Stefan Berger c2b54e6ab5 tests: Fix shellcheck issue SC2148 by adding a shell directive
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2023-01-30 18:25:45 -05:00

28 lines
623 B
Plaintext

# shellcheck shell=bash
# 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 ! grep -q -E '#[[:blank:]]*define[[:blank:]]+WITH_CUSE[[:blank:]]+1[[:blank:]]*$' \
"${PWD}/../config.h"; then
echo "Skipping test: swtpm was not compiled with CUSE interface"
exit 77
fi
if [ ! -c /dev/cuse ]; then
if ! modprobe cuse; then
echo "Skipping test using CUSE module: module not availabe"
exit 77
fi
fi