Skip to content

Commit d6cb317

Browse files
committed
add new keyword for pkcs11 tests
Signed-off-by: reubenmiller <reuben.d.miller@gmail.com>
1 parent 4d42aae commit d6cb317

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

tests/RobotFramework/tests/pkcs11/compatibility.robot

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Select Private key using tedge-p11-server URI
3434
... We set the URI on tedge-p11-server, which means that all connecting clients will use the selected key until
3535
... tedge-p11-server is restarted with a different URI.
3636
37-
Set tedge-p11-server Uri value=
37+
Unset tedge-p11-server Uri
3838
Tedge Reconnect Should Succeed
3939

4040
# expect failure if we try to use a token that doesn't exist
@@ -60,8 +60,7 @@ Select Private key using tedge-p11-server URI
6060
# but when URI has correct label, we expect valid key to be used again
6161
Set tedge-p11-server Uri value=pkcs11:token=tedge;object=tedge
6262
Tedge Reconnect Should Succeed
63-
64-
Set tedge-p11-server Uri value=
63+
[Teardown] Unset tedge-p11-server Uri
6564

6665
Select Private key using a request URI
6766
[Documentation] Like above, we select the key using a URI, but this time we include it in a request, which means
@@ -82,7 +81,7 @@ Select Private key using a request URI
8281

8382
Connects to C8y using an RSA key
8483
[Documentation] Test that we can connect to C8y using an RSA private keys of all sizes.
85-
[Setup] Set tedge-p11-server Uri value=${EMPTY}
84+
[Setup] Unset tedge-p11-server Uri
8685
[Template] Connect to C8y using new keypair
8786
type=rsa bits=4096
8887
type=rsa bits=3072
@@ -92,7 +91,7 @@ Connects to C8y using an RSA key
9291
Connects to C8y supporting all TLS13 ECDSA signature algorithms
9392
[Documentation] Check that we support all ECDSA sigschemes used in TLS1.3, i.e: ecdsa_secp256r1_sha256,
9493
... ecdsa_secp384r1_sha384, ecdsa_secp521r1_sha512.
95-
[Setup] Set tedge-p11-server Uri value=${EMPTY}
94+
[Setup] Unset tedge-p11-server Uri
9695
[Template] Connect to C8y using new keypair
9796
type=ecdsa curve=secp256r1
9897

@@ -191,4 +190,4 @@ Custom Setup
191190
${csr_path}= Execute Command cmd=tedge config get device.csr_path strip=${True}
192191
Register Device With Cumulocity CA ${DEVICE_SN} csr_path=${csr_path}
193192

194-
Set tedge-p11-server Uri value=
193+
Unset tedge-p11-server Uri

tests/RobotFramework/tests/pkcs11/pkcs11_common.resource

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ Set tedge-p11-server Uri
9191
Execute Command tedge config set device.cryptoki.uri '${value}'
9292
Restart Service tedge-p11-server
9393

94+
Unset tedge-p11-server Uri
95+
Execute Command tedge config unset device.cryptoki.uri
96+
Restart Service tedge-p11-server
97+
9498
Tedge Reconnect Should Succeed
9599
${stderr}= Execute Command tedge reconnect c8y stdout=false stderr=true
96100
RETURN ${stderr}

tests/RobotFramework/tests/pkcs11/private_key_storage.robot

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Select Private key using tedge-p11-server URI
2929
... We set the URI on tedge-p11-server, which means that all connecting clients will use the selected key until
3030
... tedge-p11-server is restarted with a different URI.
3131
32-
Set tedge-p11-server Uri value=
32+
Unset tedge-p11-server Uri
3333
Tedge Reconnect Should Succeed
3434

3535
# expect failure if we try to use a token that doesn't exist
@@ -55,8 +55,7 @@ Select Private key using tedge-p11-server URI
5555
# but when URI has correct label, we expect valid key to be used again
5656
Set tedge-p11-server Uri value=pkcs11:token=tedge;object=tedge
5757
Tedge Reconnect Should Succeed
58-
59-
Set tedge-p11-server Uri value=
58+
[Teardown] Unset tedge-p11-server Uri
6059

6160
Select Private key using a request URI
6261
[Documentation] Like above, we select the key using a URI, but this time we include it in a request, which means
@@ -77,7 +76,7 @@ Select Private key using a request URI
7776

7877
Connects to C8y using an RSA key
7978
[Documentation] Test that we can connect to C8y using an RSA private keys of all sizes.
80-
[Setup] Set tedge-p11-server Uri value=${EMPTY}
79+
[Setup] Unset tedge-p11-server Uri
8180
[Template] Connect to C8y using new keypair
8281
type=rsa bits=4096
8382
type=rsa bits=3072
@@ -87,7 +86,7 @@ Connects to C8y using an RSA key
8786
Connects to C8y supporting all TLS13 ECDSA signature algorithms
8887
[Documentation] Check that we support all ECDSA sigschemes used in TLS1.3, i.e: ecdsa_secp256r1_sha256,
8988
... ecdsa_secp384r1_sha384, ecdsa_secp521r1_sha512.
90-
[Setup] Set tedge-p11-server Uri value=${EMPTY}
89+
[Setup] Unset tedge-p11-server Uri
9190
[Template] Connect to C8y using new keypair
9291
type=ecdsa curve=secp256r1
9392
type=ecdsa curve=secp384r1
@@ -96,7 +95,7 @@ Connects to C8y supporting all TLS13 ECDSA signature algorithms
9695
Can use PKCS11 key to renew the public certificate
9796
[Documentation] Test that `tedge cert renew c8y` works with all supported keys. We do renew 2 times to see if we
9897
... can renew both a self-signed certificate and a certificate signed by C8y CA.
99-
[Setup] Set tedge-p11-server Uri value=${EMPTY}
98+
[Setup] Unset tedge-p11-server Uri
10099

101100
Test tedge cert renew type=ecdsa curve=secp256r1
102101
Test tedge cert renew type=ecdsa curve=secp384r1
@@ -255,4 +254,4 @@ Custom Setup
255254
${csr_path}= Execute Command cmd=tedge config get device.csr_path strip=${True}
256255
ThinEdgeIO.Register Device With Cumulocity CA ${DEVICE_SN} csr_path=${csr_path}
257256

258-
Set tedge-p11-server Uri value=
257+
Unset tedge-p11-server Uri

0 commit comments

Comments
 (0)