aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2014-03-12 17:27:07 +0000
committerDavid Howells <dhowells@redhat.com>2014-03-12 17:27:07 +0000
commit17703f161dd12fbebfb2e9ca51135293a9746fc7 (patch)
treea4e036dd6fd600273fc93ce28bf260217959c999
parent2c8f6c0b35aece330356717907a26bd45fb2e354 (diff)
downloadkeyutils-17703f161dd12fbebfb2e9ca51135293a9746fc7.tar.gz
TEST: Place exclusions for RHEL-5
Place exclusions for a couple of tests that fail under RHEL-5. https://bugzilla.redhat.com/show_bug.cgi?id=1075655 The problems are: (1) keyctl/show/valid fails because "keyctl show" doesn't handle nested keyrings with a depth of more than 2-3 correctly. (2) keyctl/show/valid fails because the output of "keyctl show" doesn't allow a big enough field for the key serial ID. (3) keyctl/padd/useradd fails because the "keyctl padd" & co. are limited to ~64KB of data rather than 1MB-1. (4) keyctl/padd/useradd fails because the "keyctl padd" & co. can't handle NUL chars in their input. Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r--tests/keyctl/padd/useradd/runtest.sh72
-rw-r--r--tests/keyctl/show/valid/runtest.sh38
2 files changed, 59 insertions, 51 deletions
diff --git a/tests/keyctl/padd/useradd/runtest.sh b/tests/keyctl/padd/useradd/runtest.sh
index f58bdc7..05fb984 100644
--- a/tests/keyctl/padd/useradd/runtest.sh
+++ b/tests/keyctl/padd/useradd/runtest.sh
@@ -40,43 +40,47 @@ expect_payload payload "lizard"
marker "UNLINK KEY"
unlink_key $keyid @s
-# add keys with huge payloads
-old_root_quota=`cat /proc/sys/kernel/keys/root_maxbytes`
-if [ $old_root_quota -lt 65536 ]
+if [ $OSDIST = RHEL ] && ! version_less_than $OSRELEASE 6.6 ||
+ keyutils_at_or_later_than 1.5.6
then
- marker "INCREASE QUOTA"
- echo 65536 >/proc/sys/kernel/keys/root_maxbytes
-fi
-
-marker "ADD LARGE USER KEY"
-pcreate_key_by_size 32767 user large @s
-expect_keyid keyid
-md5sum_key $keyid
-expect_payload payload "f128f774ede3fe931e7c6745c4292f40"
-
-if [ $have_big_key_type = 1 ]
-then
- marker "ADD SMALL BIG KEY"
- pcreate_key_by_size 128 big_key small @s
- expect_keyid keyid
- md5sum_key $keyid
- expect_payload payload "f09f35a5637839458e462e6350ecbce4"
-
- marker "ADD HUGE BIG KEY"
- pcreate_key_by_size $((1024*1024-1)) big_key huge @s
+ # add keys with huge payloads
+ old_root_quota=`cat /proc/sys/kernel/keys/root_maxbytes`
+ if [ $old_root_quota -lt 65536 ]
+ then
+ marker "INCREASE QUOTA"
+ echo 65536 >/proc/sys/kernel/keys/root_maxbytes
+ fi
+
+ marker "ADD LARGE USER KEY"
+ pcreate_key_by_size 32767 user large @s
expect_keyid keyid
md5sum_key $keyid
- expect_payload payload "e57598cd670284cf7d09e16ed9d4b2ac"
-fi
-
-marker "CLEAR KEYRING"
-clear_keyring @s
-
-if [ $old_root_quota -lt 65536 ]
-then
- marker "RESET QUOTA"
- echo $old_root_quota >/proc/sys/kernel/keys/root_maxbytes
- sleep 1
+ expect_payload payload "f128f774ede3fe931e7c6745c4292f40"
+
+ if [ $have_big_key_type = 1 ]
+ then
+ marker "ADD SMALL BIG KEY"
+ pcreate_key_by_size 128 big_key small @s
+ expect_keyid keyid
+ md5sum_key $keyid
+ expect_payload payload "f09f35a5637839458e462e6350ecbce4"
+
+ marker "ADD HUGE BIG KEY"
+ pcreate_key_by_size $((1024*1024-1)) big_key huge @s
+ expect_keyid keyid
+ md5sum_key $keyid
+ expect_payload payload "e57598cd670284cf7d09e16ed9d4b2ac"
+ fi
+
+ marker "CLEAR KEYRING"
+ clear_keyring @s
+
+ if [ $old_root_quota -lt 65536 ]
+ then
+ marker "RESET QUOTA"
+ echo $old_root_quota >/proc/sys/kernel/keys/root_maxbytes
+ sleep 1
+ fi
fi
echo "++++ FINISHED TEST: $result" >>$OUTPUTFILE
diff --git a/tests/keyctl/show/valid/runtest.sh b/tests/keyctl/show/valid/runtest.sh
index efc4683..cbdd85f 100644
--- a/tests/keyctl/show/valid/runtest.sh
+++ b/tests/keyctl/show/valid/runtest.sh
@@ -30,27 +30,31 @@ then
failed
fi
-# should be eight lines in the output (banner + session + 6 keyrings)
-marker "COUNT LINES"
-nlines=`keyctl show | wc -l`
-if [ "$nlines" -ne $(($nr_keyrings + 2)) ]
+if [ $OSDIST = RHEL ] && ! version_less_than $OSRELEASE 6.6 ||
+ keyutils_at_or_later_than 1.5.6
then
- failed
-fi
+ # should be eight lines in the output (banner + session + 6 keyrings)
+ marker "COUNT LINES"
+ nlines=`keyctl show | wc -l`
+ if [ "$nlines" -ne $(($nr_keyrings + 2)) ]
+ then
+ failed
+ fi
-# check the key ID list
-marker "CHECK KEY ID LIST"
-keyids=`keyctl show | tail -n +3 | cut -c1-11`
+ # check the key ID list
+ marker "CHECK KEY ID LIST"
+ keyids=`keyctl show | tail -n +3 | cut -c1-11`
-# we need to fix up the whitespace
-keyids=`echo $keyids`
-keyrings=`echo $keyrings`
+ # we need to fix up the whitespace
+ keyids=`echo $keyids`
+ keyrings=`echo $keyrings`
-echo "Compare '$keyids'" >>$OUTPUTFILE
-echo "And '$keyrings'" >>$OUTPUTFILE
-if [ "$keyids" != "$keyrings" ]
-then
- failed
+ echo "Compare '$keyids'" >>$OUTPUTFILE
+ echo "And '$keyrings'" >>$OUTPUTFILE
+ if [ "$keyids" != "$keyrings" ]
+ then
+ failed
+ fi
fi
# check that shows of specified keyrings also work