aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2014-03-04 17:55:39 +0000
committerDavid Howells <dhowells@redhat.com>2014-03-06 15:13:07 +0000
commit969d6d7b8843e5b940de7eb66e752ff5621c2bc4 (patch)
treef6b7e7840883475f4e706b6d64dc936e372cd0f2
parentc826acbcf4406fe1f07578f54bc4e9a7ab547afd (diff)
downloadkeyutils-969d6d7b8843e5b940de7eb66e752ff5621c2bc4.tar.gz
TEST: keyctl show only takes an argument from 1.5.4 onwards
keyctl show only takes an argument from 1.5.4 onwards, so it cannot be tested for prior to that. Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r--tests/keyctl/show/valid/runtest.sh38
1 files changed, 20 insertions, 18 deletions
diff --git a/tests/keyctl/show/valid/runtest.sh b/tests/keyctl/show/valid/runtest.sh
index 9fad8a4..efc4683 100644
--- a/tests/keyctl/show/valid/runtest.sh
+++ b/tests/keyctl/show/valid/runtest.sh
@@ -54,24 +54,26 @@ then
fi
# check that shows of specified keyrings also work
-declare -i j
-j=$nr_keyrings
-for i in $keyrings
-do
- marker "CHECK SHOW OTHERS $j"
- echo --- $i >>$OUTPUTFILE
- if ! keyctl show $i >>$OUTPUTFILE
- then
- failed
- fi
- k=`keyctl show $i | wc -l`
- if [ $(($j + 1)) != $k ]
- then
- failed
- fi
- j=$(($j - 1))
-done
-
+if keyutils_at_or_later_than 1.5.4
+then
+ declare -i j
+ j=$nr_keyrings
+ for i in $keyrings
+ do
+ marker "CHECK SHOW OTHERS $j"
+ echo --- $i >>$OUTPUTFILE
+ if ! keyctl show $i >>$OUTPUTFILE
+ then
+ failed
+ fi
+ k=`keyctl show $i | wc -l`
+ if [ $(($j + 1)) != $k ]
+ then
+ failed
+ fi
+ j=$(($j - 1))
+ done
+fi
echo "++++ FINISHED TEST: $result" >>$OUTPUTFILE
# --- then report the results in the database ---