3
. ../../../prepare.inc.sh
4
. ../../../toolbox.inc.sh
7
# ---- do the actual testing ----
10
echo "++++ BEGINNING TEST" >$OUTPUTFILE
12
# check that we can add a user key to the session keyring
14
pcreate_key stuff user wibble @s
17
# read back what we put in it
18
marker "PRINT PAYLOAD"
20
expect_payload payload "stuff"
22
# check that we can update a user key
23
marker "UPDATE USER KEY"
24
pcreate_key lizard user wibble @s
26
# check we get the same key ID back
29
if [ "x$keyid" != "x$keyid2" ]
34
# read back what we changed it to
35
marker "PRINT UPDATED PAYLOAD"
37
expect_payload payload "lizard"
39
# remove the key we added
43
# add keys with huge payloads
44
old_root_quota=`cat /proc/sys/kernel/keys/root_maxbytes`
45
if [ $old_root_quota -lt 65536 ]
47
marker "INCREASE QUOTA"
48
echo 65536 >/proc/sys/kernel/keys/root_maxbytes
51
marker "ADD LARGE USER KEY"
52
pcreate_key_by_size 32767 user large @s
55
expect_payload payload "f128f774ede3fe931e7c6745c4292f40"
57
marker "ADD SMALL BIG KEY"
58
pcreate_key_by_size 128 big_key small @s
61
expect_payload payload "f09f35a5637839458e462e6350ecbce4"
63
marker "ADD HUGE BIG KEY"
64
pcreate_key_by_size $((1024*1024-1)) big_key huge @s
67
expect_payload payload "e57598cd670284cf7d09e16ed9d4b2ac"
69
marker "CLEAR KEYRING"
72
if [ $old_root_quota -lt 65536 ]
75
echo $old_root_quota >/proc/sys/kernel/keys/root_maxbytes
79
echo "++++ FINISHED TEST: $result" >>$OUTPUTFILE
81
# --- then report the results in the database ---
82
toolbox_report_result $TEST $result