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

« back to all changes in this revision

Viewing changes to .pc/0014-Conditionalize-tests-based-on-kernel-version.patch/tests/keyctl/invalidate/valid/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/sh
 
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
# create a keyring and attach it to the session keyring
 
13
marker "ADD KEYRING"
 
14
create_keyring wibble @s
 
15
expect_keyid keyringid
 
16
 
 
17
# check that we have an empty keyring
 
18
marker "LIST KEYRING"
 
19
list_keyring $keyringid
 
20
expect_keyring_rlist rlist empty
 
21
 
 
22
# stick a key in the keyring
 
23
marker "ADD KEY"
 
24
create_key user lizard gizzard $keyringid
 
25
expect_keyid keyid
 
26
 
 
27
# check that we can list it
 
28
marker "LIST KEYRING 2"
 
29
list_keyring $keyringid
 
30
expect_keyring_rlist rlist $keyid
 
31
 
 
32
# invalidate the key
 
33
marker "INVALIDATE KEY"
 
34
invalidate_key $keyid
 
35
 
 
36
# check that it's now empty again
 
37
marker "LIST KEYRING 3"
 
38
list_keyring $keyringid
 
39
expect_keyring_rlist rlist empty
 
40
 
 
41
# stick another key in the keyring
 
42
marker "ADD KEY"
 
43
create_key user lizard2 gizzard $keyringid
 
44
expect_keyid keyid
 
45
 
 
46
# check that we can list it
 
47
marker "LIST KEYRING 4"
 
48
list_keyring $keyringid
 
49
expect_keyring_rlist rlist $keyid
 
50
 
 
51
# invalidate the keyring
 
52
marker "INVALIDATE KEYRING"
 
53
invalidate_key $keyringid
 
54
 
 
55
# need to wait for the gc
 
56
sleep 1
 
57
 
 
58
# check that the keyring no longer exists
 
59
marker "CHECK KEYRING"
 
60
list_keyring --fail $keyringid
 
61
expect_error ENOKEY
 
62
 
 
63
# check that the key got gc'd also
 
64
marker "CHECK KEY"
 
65
describe_key --fail $keyid
 
66
expect_error ENOKEY
 
67
 
 
68
echo "++++ FINISHED TEST: $result" >>$OUTPUTFILE
 
69
 
 
70
# --- then report the results in the database ---
 
71
toolbox_report_result $TEST $result