aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2014-03-05 12:27:48 +0000
committerDavid Howells <dhowells@redhat.com>2014-03-06 15:13:07 +0000
commite0279b30c433d29f04a33841b35b04152f8f8e85 (patch)
treefbef3078c8e1240c9a588cb7404d92dc32b07a03
parent134fe06e34d480c5e6611407124fa4759437a88a (diff)
downloadkeyutils-e0279b30c433d29f04a33841b35b04152f8f8e85.tar.gz
TEST: Conditionalise usage and testing of key invalidation
Key invalidation only came in with 3.5-rc1. Don't use it if the running kernel doesn't support it. Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r--tests/keyctl/invalidate/bad-args/runtest.sh6
-rw-r--r--tests/keyctl/invalidate/noargs/runtest.sh6
-rw-r--r--tests/keyctl/invalidate/valid/runtest.sh6
-rw-r--r--tests/prepare.inc.sh9
4 files changed, 27 insertions, 0 deletions
diff --git a/tests/keyctl/invalidate/bad-args/runtest.sh b/tests/keyctl/invalidate/bad-args/runtest.sh
index e4afa29..2d9ab11 100644
--- a/tests/keyctl/invalidate/bad-args/runtest.sh
+++ b/tests/keyctl/invalidate/bad-args/runtest.sh
@@ -6,6 +6,12 @@
# ---- do the actual testing ----
+if [ $have_key_invalidate = 0 ]
+then
+ toolbox_skip_test $TEST "SKIPPING DUE TO LACK OF KEY INVALIDATION"
+ exit 0
+fi
+
result=PASS
echo "++++ BEGINNING TEST" >$OUTPUTFILE
diff --git a/tests/keyctl/invalidate/noargs/runtest.sh b/tests/keyctl/invalidate/noargs/runtest.sh
index 0c76ac3..25b19ba 100644
--- a/tests/keyctl/invalidate/noargs/runtest.sh
+++ b/tests/keyctl/invalidate/noargs/runtest.sh
@@ -6,6 +6,12 @@
# ---- do the actual testing ----
+if [ $have_key_invalidate = 0 ]
+then
+ toolbox_skip_test $TEST "SKIPPING DUE TO LACK OF KEY INVALIDATION"
+ exit 0
+fi
+
result=PASS
echo "++++ BEGINNING TEST" >$OUTPUTFILE
diff --git a/tests/keyctl/invalidate/valid/runtest.sh b/tests/keyctl/invalidate/valid/runtest.sh
index b64b7fe..46262fd 100644
--- a/tests/keyctl/invalidate/valid/runtest.sh
+++ b/tests/keyctl/invalidate/valid/runtest.sh
@@ -6,6 +6,12 @@
# ---- do the actual testing ----
+if [ $have_key_invalidate = 0 ]
+then
+ toolbox_skip_test $TEST "SKIPPING DUE TO LACK OF KEY INVALIDATION"
+ exit 0
+fi
+
result=PASS
echo "++++ BEGINNING TEST" >$OUTPUTFILE
diff --git a/tests/prepare.inc.sh b/tests/prepare.inc.sh
index 850d4d0..28ed2f0 100644
--- a/tests/prepare.inc.sh
+++ b/tests/prepare.inc.sh
@@ -70,6 +70,15 @@ then
fi
#
+# Work out whether key invalidation is supported by the kernel
+#
+have_key_invalidate=0
+if keyutils_at_or_later_than 3.5-rc1 && kernel_at_or_later_than 3.5-rc1
+then
+ have_key_invalidate=1
+fi
+
+#
# Work out whether the big_key type is supported by the kernel
#
have_big_key_type=0