~ubuntu-branches/ubuntu/wily/keyutils/wily

« back to all changes in this revision

Viewing changes to .pc/0010-enable-skipping-tests-req-root.patch/tests/keyctl/padd/useradd/runtest.sh

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-10-16 11:45:19 UTC
  • mfrom: (1.1.7) (10.2.16 sid)
  • Revision ID: package-import@ubuntu.com-20141016114519-cqt8zwrg92c31m31
Tags: 1.5.9-5ubuntu1
Disable the tests, hanging on the distro buildd kernels (12.04 LTS).
Verified that the tests succeed with the 14.04 LTS kernels.
Addresses: LP: #1381973.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
. ../../../prepare.inc.sh
 
4
. ../../../toolbox.inc.sh
 
5
 
 
6
 
 
7
# ---- do the actual testing ----
 
8
 
 
9
result=PASS
 
10
echo "++++ BEGINNING TEST" >$OUTPUTFILE
 
11
 
 
12
# check that we can add a user key to the session keyring
 
13
marker "ADD USER KEY"
 
14
pcreate_key stuff user wibble @s
 
15
expect_keyid keyid
 
16
 
 
17
# read back what we put in it
 
18
marker "PRINT PAYLOAD"
 
19
print_key $keyid
 
20
expect_payload payload "stuff"
 
21
 
 
22
# check that we can update a user key
 
23
marker "UPDATE USER KEY"
 
24
pcreate_key lizard user wibble @s
 
25
 
 
26
# check we get the same key ID back
 
27
expect_keyid keyid2
 
28
 
 
29
if [ "x$keyid" != "x$keyid2" ]
 
30
then
 
31
    failed
 
32
fi
 
33
 
 
34
# read back what we changed it to
 
35
marker "PRINT UPDATED PAYLOAD"
 
36
print_key $keyid
 
37
expect_payload payload "lizard"
 
38
 
 
39
# remove the key we added
 
40
marker "UNLINK KEY"
 
41
unlink_key $keyid @s
 
42
 
 
43
# add keys with huge payloads
 
44
old_root_quota=`cat /proc/sys/kernel/keys/root_maxbytes`
 
45
if [ $old_root_quota -lt 65536 ]
 
46
then
 
47
    marker "INCREASE QUOTA"
 
48
    echo 65536 >/proc/sys/kernel/keys/root_maxbytes
 
49
fi
 
50
 
 
51
marker "ADD LARGE USER KEY"
 
52
pcreate_key_by_size 32767 user large @s
 
53
expect_keyid keyid
 
54
md5sum_key $keyid
 
55
expect_payload payload "f128f774ede3fe931e7c6745c4292f40"
 
56
 
 
57
marker "ADD SMALL BIG KEY"
 
58
pcreate_key_by_size 128 big_key small @s
 
59
expect_keyid keyid
 
60
md5sum_key $keyid
 
61
expect_payload payload "f09f35a5637839458e462e6350ecbce4"
 
62
 
 
63
marker "ADD HUGE BIG KEY"
 
64
pcreate_key_by_size $((1024*1024-1)) big_key huge @s
 
65
expect_keyid keyid
 
66
md5sum_key $keyid
 
67
expect_payload payload "e57598cd670284cf7d09e16ed9d4b2ac"
 
68
 
 
69
marker "CLEAR KEYRING"
 
70
clear_keyring @s
 
71
 
 
72
if [ $old_root_quota -lt 65536 ]
 
73
then
 
74
    marker "RESET QUOTA"
 
75
    echo $old_root_quota >/proc/sys/kernel/keys/root_maxbytes
 
76
    sleep 1
 
77
fi
 
78
 
 
79
echo "++++ FINISHED TEST: $result" >>$OUTPUTFILE
 
80
 
 
81
# --- then report the results in the database ---
 
82
toolbox_report_result $TEST $result