-
Notifications
You must be signed in to change notification settings - Fork 0
/
000_basic_tests.feature
119 lines (110 loc) · 4.98 KB
/
000_basic_tests.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
Feature: Generate RSA key
Device should support key generation
Scenario: Smartcard should be visible by GnuPG
Given Run 'gpg --card-edit'
And set 'PROMPT' to 'gpg/card> '
When fail if will see '.*No such device' in 2 seconds
And wait for 'PROMPT'
And 'admin' -> '.*Admin commands are allowed.*'
# TODO check listed information
And ' ' -> 'PROMPT'
And send 'exit'
Then finish with success
Scenario: Factory reset should be possible
Given Run 'gpg --card-edit'
And set 'PROMPT' to 'gpg/card> '
When fail if will see '.*No such device' in 2 seconds
And wait for 'PROMPT'
And 'admin' -> '.*Admin commands are allowed.*'
And 'factory-reset' -> '.*Continue?.*'
And 'y' -> '.*Really.*'
And 'yes' -> 'PROMPT'
And ' ' -> 'PROMPT'
And send 'exit'
Then finish with success
Scenario: Generate ECC key Curve
Given Run 'gpg --card-edit'
And set 'PROMPT' to 'gpg/card> '
When fail if will see '.*No such device' in 2 seconds
And wait for 'PROMPT'
And 'admin' results in '.*Admin commands are allowed.*'
And send 'key-attr'
And (optional) on 'Replace existing keys' say 'y'
And (optional) on 'Please enter the PIN' say '123456'
And (optional) on 'Please enter the Admin PIN' say '12345678'
And (optional) on '^Admin PIN:' say '12345678'
And (optional) on 'PIN:' say '123456'
And on 'Changing card key attribute for: Signature key' say '2'
And on 'Please select which elliptic curve you want' say '1'
And on 'Changing card key attribute for: Encryption key' say '2'
And on 'Please select which elliptic curve you want' say '1'
And on 'Changing card key attribute for: Authentication key' say '2'
And on 'Please select which elliptic curve you want' say '1'
And send 'generate'
And on 'Make off-card backup of encryption key?.*' say 'N'
And (optional) on 'Key is valid for?' say '2'
And on 'Is this correct' say 'y'
And on 'Real name' say 'Test Suite ECC'
And on 'Email address' say 'test-suite-ECC@example.com'
And on 'Comment' say 'Key generation session ECC '
And on 'Change' say 'O'
And fail if will see 'gpg: key generation failed: Card error' in 5 seconds
And wait for 'PROMPT'
And send 'exit'
Then finish with success
Scenario: Generate RSA key 2k
Given Run 'gpg --card-edit'
And set 'PROMPT' to 'gpg/card> '
When fail if will see '.*No such device' in 2 seconds
And wait for 'PROMPT'
And 'admin' results in '.*Admin commands are allowed.*'
And send 'generate'
And fail if will see '.*No such device' in 2 seconds
And on 'Make off-card backup of encryption key?.*' say 'N'
And (optional) on 'Replace existing keys' say 'y'
And (optional) on 'Please enter the PIN' say '123456'
And (optional) on 'Please enter the Admin PIN' say '12345678'
And (optional) on '^Admin PIN:' say '12345678'
And (optional) on 'PIN:' say '123456'
And (optional) on 'Key is valid for?' say '2'
And (optional) on '.*Signature key.*' say '2048'
And (optional) on '.*Encryption key.*' say '2048'
And (optional) on '.*Authentication key.*' say '2048'
And on 'Is this correct' say 'y'
And on 'Real name' say 'Test Suite 2048'
And on 'Email address' say 'test-suite-2048@example.com'
And on 'Comment' say 'Key generation session RSA 2048'
And on 'Change' say 'O'
# And (optional) on 'Please enter the Admin PIN.*Admin PIN:' say '12345678'
And fail if will see 'gpg: key generation failed: Card error' in 60 seconds
And wait for 'PROMPT'
And send 'exit'
Then finish with success
Scenario: Generate RSA key 4k
Given Run 'gpg --card-edit'
And set 'PROMPT' to 'gpg/card> '
When fail if will see '.*No such device' in 2 seconds
And wait for 'PROMPT'
And 'admin' results in '.*Admin commands are allowed.*'
And send 'generate'
And fail if will see '.*No such device' in 2 seconds
And on 'Make off-card backup of encryption key?.*' say 'N'
And (optional) on 'Replace existing keys' say 'y'
And (optional) on 'Please enter the PIN' say '123456'
And (optional) on 'Please enter the Admin PIN' say '12345678'
And (optional) on '^Admin PIN:' say '12345678'
And (optional) on 'PIN:' say '123456'
And (optional) on 'Key is valid for?' say '2'
And (optional) on '.*Signature key.*' say '4096'
And (optional) on '.*Encryption key.*' say '4096'
And (optional) on '.*Authentication key.*' say '4096'
And on 'Is this correct' say 'y'
And on 'Real name' say 'Test Suite 4096'
And on 'Email address' say 'test-suite-4096@example.com'
And on 'Comment' say 'Key generation session RSA 4096'
And on 'Change' say 'O'
# And (optional) on 'Please enter the Admin PIN.*Admin PIN:' say '12345678'
And fail if will see 'gpg: key generation failed: Card error' in 600 seconds
And wait for 'PROMPT'
And send 'exit'
Then finish with success