summaryrefslogtreecommitdiff
path: root/keyutils-1.5.6/tests/keyctl/padd/useradd/runtest.sh
diff options
context:
space:
mode:
Diffstat (limited to 'keyutils-1.5.6/tests/keyctl/padd/useradd/runtest.sh')
-rw-r--r--keyutils-1.5.6/tests/keyctl/padd/useradd/runtest.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/keyutils-1.5.6/tests/keyctl/padd/useradd/runtest.sh b/keyutils-1.5.6/tests/keyctl/padd/useradd/runtest.sh
new file mode 100644
index 0000000..8eb0973
--- /dev/null
+++ b/keyutils-1.5.6/tests/keyctl/padd/useradd/runtest.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+. ../../../prepare.inc.sh
+. ../../../toolbox.inc.sh
+
+
+# ---- do the actual testing ----
+
+result=PASS
+echo "++++ BEGINNING TEST" >$OUTPUTFILE
+
+# check that we can add a user key to the session keyring
+marker "ADD USER KEY"
+pcreate_key stuff user wibble @s
+expect_keyid keyid
+
+# read back what we put in it
+marker "PRINT PAYLOAD"
+print_key $keyid
+expect_payload payload "stuff"
+
+# check that we can update a user key
+marker "UPDATE USER KEY"
+pcreate_key lizard user wibble @s
+
+# check we get the same key ID back
+expect_keyid keyid2
+
+if [ "x$keyid" != "x$keyid2" ]
+then
+ failed
+fi
+
+# read back what we changed it to
+marker "PRINT UPDATED PAYLOAD"
+print_key $keyid
+expect_payload payload "lizard"
+
+# remove the key we added
+marker "UNLINK KEY"
+unlink_key $keyid @s
+
+keyctl show
+
+echo "++++ FINISHED TEST: $result" >>$OUTPUTFILE
+
+# --- then report the results in the database ---
+toolbox_report_result $TEST $result