~ubuntu-branches/ubuntu/quantal/keyutils/quantal

« back to all changes in this revision

Viewing changes to tests/keyctl/clear/bad-args/runtest.sh

  • Committer: Package Import Robot
  • Author(s): Daniel Baumann
  • Date: 2012-04-16 09:45:04 UTC
  • mfrom: (10.2.6 sid)
  • Revision ID: package-import@ubuntu.com-20120416094504-in50o9m1zbwvrmrs
Tags: 1.5.5-2
* Adding patch from Simon Ruderich <simon@ruderich.org> to fix FTBFS
  with hardening flags (Closes: #661393).
* Updating to standards version 3.9.3.
* Updating copyright file machine-readable format version 1.0.
* Tightening debhelper install files.

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 a bad key ID fails correctly
 
13
marker "CHECK CLEAR BAD KEY ID"
 
14
clear_keyring --fail 0
 
15
expect_error EINVAL
 
16
 
 
17
# create a non-keyring
 
18
marker "CREATE KEY"
 
19
create_key user lizard gizzard @s
 
20
expect_keyid keyid
 
21
 
 
22
# check that a non-keyring ID fails correctly
 
23
marker "CHECK CLEAR NON-KEYRING KEY"
 
24
clear_keyring --fail $keyid
 
25
expect_error ENOTDIR
 
26
 
 
27
# dispose of the key we were using
 
28
marker "UNLINK KEY"
 
29
unlink_key --wait $keyid @s
 
30
 
 
31
# check that a non-existent key ID fails correctly
 
32
marker "CHECK CLEAR NON-EXISTENT KEY ID"
 
33
clear_keyring --fail $keyid
 
34
expect_error ENOKEY
 
35
 
 
36
echo "++++ FINISHED TEST: $result" >>$OUTPUTFILE
 
37
 
 
38
# --- then report the results in the database ---
 
39
toolbox_report_result $TEST $result