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

« back to all changes in this revision

Viewing changes to .pc/0016-Enable-skipping-of-MAXDESCLEN-tests.patch/tests/keyctl/search/bad-args/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
# check that an empty key type fails correctly
 
13
marker "CHECK EMPTY KEY TYPE"
 
14
search_for_key --fail @s "" wibble
 
15
expect_error EINVAL
 
16
search_for_key --fail @s "" wibble @p
 
17
expect_error EINVAL
 
18
 
 
19
# check that an unsupported key type fails correctly
 
20
marker "CHECK UNSUPPORTED KEY TYPE"
 
21
search_for_key --fail @s lizardsgizzards wibble
 
22
expect_error ENOKEY
 
23
search_for_key --fail @s lizardsgizzards wibble @p
 
24
expect_error ENOKEY
 
25
 
 
26
# check that an invalid key type fails correctly
 
27
marker "CHECK INVALID KEY TYPE"
 
28
search_for_key --fail @s .user wibble
 
29
expect_error EPERM
 
30
search_for_key --fail @s .user wibble @p
 
31
expect_error EPERM
 
32
 
 
33
# check that an overlong key type fails correctly
 
34
marker "CHECK OVERLONG KEY TYPE"
 
35
search_for_key --fail @s $maxtype wibble
 
36
expect_error ENOKEY
 
37
search_for_key --fail @s a$maxtype wibble @p
 
38
expect_error EINVAL
 
39
 
 
40
# check that an max length key description works correctly (4095 inc NUL)
 
41
marker "CHECK MAXLEN DESC"
 
42
search_for_key --fail @s user $maxdesc
 
43
expect_error ENOKEY
 
44
 
 
45
search_for_key --fail @s user $maxdesc @p
 
46
expect_error ENOKEY
 
47
 
 
48
# check that an overlong key description fails correctly (>4095 inc NUL)
 
49
marker "CHECK OVERLONG DESC"
 
50
search_for_key --fail @s user a$maxdesc
 
51
expect_error EINVAL
 
52
 
 
53
search_for_key --fail @s user a$maxdesc @p
 
54
expect_error EINVAL
 
55
 
 
56
# check that a bad key ID fails correctly
 
57
marker "CHECK BAD KEY ID"
 
58
search_for_key --fail @s user wibble -2000
 
59
expect_error EINVAL
 
60
 
 
61
# create a non-keyring key
 
62
marker "CREATE KEY"
 
63
create_key user a a @s
 
64
expect_keyid keyid
 
65
 
 
66
# search the non-keyring key
 
67
marker "SEARCH KEY"
 
68
search_for_key --fail $keyid user a
 
69
expect_error ENOTDIR
 
70
search_for_key --fail $keyid user a @p
 
71
expect_error ENOTDIR
 
72
 
 
73
# dispose of the key
 
74
marker "UNLINK KEY"
 
75
unlink_key $keyid @s
 
76
 
 
77
echo "++++ FINISHED TEST: $result" >>$OUTPUTFILE
 
78
 
 
79
# --- then report the results in the database ---
 
80
toolbox_report_result $TEST $result