From 03e5abef605e576e7807a5275e4e4f112334b0bc Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Mon, 11 Jun 2018 10:35:10 -0400 Subject: [PATCH] tests: Skip CUSE tests if not compiled with CUSE interface Check for a '#define WITH_CUSE 1' line in config.h to determine whether the swtpm was compiled with the CUSE interface and skip the tests with the CUSE interface if no such line can be found. Signed-off-by: Stefan Berger --- tests/test_cuse | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_cuse b/tests/test_cuse index 1b9daa48..5258274c 100644 --- a/tests/test_cuse +++ b/tests/test_cuse @@ -11,6 +11,12 @@ if [ "$(id -u)" -ne 0 ]; then exit 77 fi +if [ -z "$(grep -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 modprobe cuse if [ $? -ne 0 ]; then