aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2014-01-15 15:07:05 +0000
committerDavid Howells <dhowells@redhat.com>2014-01-15 15:07:05 +0000
commit7963a21a183ccc5658acff3a1bf05ec3b0688946 (patch)
tree30066dcc7f02ee5113707337b3751c12803650b6
parent097fd4c381b669b99687517c422396198e5b5121 (diff)
downloadkeyutils-7963a21a183ccc5658acff3a1bf05ec3b0688946.tar.gz
TEST: Make search/valid aware that the behaviour of the kernel changed
The kernel changed its behaviour with regard to the error code it returns when the first key a search found was revoked and no valid key was found. It used to return ENOKEY and now returns EKEYREVOKED. Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r--tests/keyctl/search/valid/runtest.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/keyctl/search/valid/runtest.sh b/tests/keyctl/search/valid/runtest.sh
index 2deafc0..746ffa2 100644
--- a/tests/keyctl/search/valid/runtest.sh
+++ b/tests/keyctl/search/valid/runtest.sh
@@ -161,7 +161,20 @@ expect_keyid found $keyid2
# revoking the key should make the key unavailable
revoke_key $keyid2
search_for_key --fail $keyringid user lizard
-expect_error EKEYREVOKED
+kver=`uname -r`
+case $kver in
+ *.el7*)
+ expect_error EKEYREVOKED
+ ;;
+ *)
+ if version_less_than `uname -r` 3.13
+ then
+ expect_error ENOKEY
+ else
+ expect_error EKEYREVOKED
+ fi
+ ;;
+esac
# remove the keyrings we added
marker "UNLINK KEYRING"