File tree Expand file tree Collapse file tree 10 files changed +28
-40
lines changed
tests/RobotFramework/tests/pkcs11 Expand file tree Collapse file tree 10 files changed +28
-40
lines changed Original file line number Diff line number Diff line change 11*** Settings ***
22Resource pin_select.resource
3- Resource ../pkcs11_common.resource
4-
53Suite Setup tedge-p11-server Setup ${TEDGE_P11_SERVER_VERSION }
64
75
Original file line number Diff line number Diff line change 11*** Settings ***
22Resource pin_select.resource
3- Resource ../pkcs11_common.resource
4-
53Suite Setup tedge-p11-server Setup ${TEDGE_P11_SERVER_VERSION }
64
75
86*** Variables ***
9- ${TEDGE_P11_SERVER_VERSION } 1.6 .0
7+ ${TEDGE_P11_SERVER_VERSION } 1.7 .0
108
119
1210*** Test Cases ***
Original file line number Diff line number Diff line change @@ -12,10 +12,18 @@ Pass PIN in the request using pin-value
1212 Execute Command cmd=tedge config set device.key_uri "pkcs11:token=tedge;object=tedge?pin-value=incorrect"
1313 Tedge Reconnect Should Fail With The specified PIN is incorrect
1414
15- [Teardown] Execute Command tedge config set device.key_uri " ${key_uri } "
15+ [Teardown] Restore previous key_uri ${key_uri }
1616
1717Pass PIN in the request using device.key_pin
1818 Execute Command tedge config set device.key_pin incorrect
1919 Tedge Reconnect Should Fail With The specified PIN is incorrect
2020
2121 [Teardown] Execute Command tedge config unset device.key_pin
22+
23+ Restore previous key_uri
24+ [Arguments] ${key_uri }
25+ IF $key_uri
26+ Execute Command tedge config set device.key_uri "${key_uri } "
27+ ELSE
28+ Execute Command tedge config unset device.key_uri
29+ END
Original file line number Diff line number Diff line change @@ -151,12 +151,19 @@ tedge-p11-server Setup
151151 ${DEVICE_SN } = Setup register=${False }
152152 Set Suite Variable ${DEVICE_SN }
153153
154- # initialize the soft hsm
155- Execute Command sudo /usr/bin/tedge-init-hsm.sh --type softhsm2 --pin 123456
154+ # Allow the tedge user to access softhsm
155+ Execute Command sudo usermod -a -G softhsm tedge
156+ Transfer To Device ${CURDIR } /data/init_softhsm.sh /usr/bin/
157+ Execute Command sudo -u tedge /usr/bin/init_softhsm.sh --device-id "${DEVICE_SN } " --pin 123456
158+
159+ Execute Command tedge config set device.cryptoki.pin 123456
160+ Execute Command tedge config set device.cryptoki.module_path /usr/lib/softhsm/libsofthsm2.so
161+ Execute Command tedge config set mqtt.bridge.built_in true
162+ Execute Command tedge config set device.cryptoki.mode socket
163+
156164 # tests expect that the device.key_uri is initially unset
157165 Execute Command cmd=tedge config unset device.key_uri
158166
159- # configure tedge
160167 Set Cumulocity URLs
161168 ThinEdgeIO.Register Device With Cumulocity CA ${DEVICE_SN }
162169
Original file line number Diff line number Diff line change 11*** Settings ***
22Resource tedge_cert_download.resource
3- Resource ../pkcs11_common.resource
43
54Suite Setup tedge-p11-server Setup ${TEDGE_P11_SERVER_VERSION }
65
Original file line number Diff line number Diff line change 11*** Settings ***
22Resource tedge_cert_download.resource
3- Resource ../pkcs11_common.resource
4-
53Suite Setup tedge-p11-server Setup ${TEDGE_P11_SERVER_VERSION }
64
75
86*** Variables ***
9- ${TEDGE_P11_SERVER_VERSION } 1.6.0
7+ ${TEDGE_P11_SERVER_VERSION } 1.7.0
8+ ${PKCS11_USE_P11TOOL } ${True }
109
1110
1211*** Test Cases ***
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Documentation This test suite runs the tests with tedge-p11-server pinned
66Resource ../pkcs11_common.resource
77Resource tedge_cert_renew.resource
88
9- Suite Setup Custom Setup ${TEDGE_P11_SERVER_VERSION }
9+ Suite Setup tedge-p11-server Setup ${TEDGE_P11_SERVER_VERSION }
1010Suite Teardown Get Suite Logs
1111
1212Test Tags adapter:docker theme:cryptoki compatibility
Original file line number Diff line number Diff line change @@ -3,17 +3,17 @@ Documentation This test suite runs the tests with tedge-p11-server pinned
33... versions of thin-edge remain backwards compatible with tedge-p11-server's binary communication protocol. The
44... scope of this test is limited to tedge-p11-server's initial feature set and will generally not be expanded.
55
6- Resource ../pkcs11_common.resource
76Resource tedge_cert_renew.resource
87
9- Suite Setup Custom Setup ${TEDGE_P11_SERVER_VERSION }
8+ Suite Setup tedge-p11-server Setup ${TEDGE_P11_SERVER_VERSION }
109Suite Teardown Get Suite Logs
1110
1211Test Tags adapter:docker theme:cryptoki compatibility
1312
1413
1514*** Variables ***
1615${TEDGE_P11_SERVER_VERSION } 1.6.1
16+ ${PKCS11_USE_P11TOOL } ${True }
1717
1818
1919*** Test Cases ***
@@ -24,4 +24,6 @@ Renew certificate
2424 Use PKCS11 key to renew the public certificate error=PKCS #11 service failed: Failed to find a signing key
2525
2626Can renew the certificate using different keypair
27+ # In 1.6.1 there was a bug where the generated CSR signature was invalid (#3737), fixed in 1.7.0
28+ Install tedge-p11-server 1.7.0
2729 Renew the certificate using different keypair
Original file line number Diff line number Diff line change @@ -66,27 +66,3 @@ Renew the certificate using different keypair
6666 Execute Command tedge cert renew c8y
6767 ${stdout } = Tedge Reconnect Should Succeed
6868 Should Contain ${stdout } The new certificate is now the active certificate
69-
70- Custom Setup
71- [Arguments] ${tedge_p11_server_version }
72- ${DEVICE_SN } = Setup register=${False }
73- Set Suite Variable ${DEVICE_SN }
74-
75- # Allow the tedge user to access softhsm
76- Execute Command sudo usermod -a -G softhsm tedge
77- Transfer To Device ${CURDIR } /data/init_softhsm.sh /usr/bin/
78-
79- # initialize the soft hsm and create a certificate signing request
80- Execute Command tedge config set device.cryptoki.pin 123456
81- Execute Command tedge config set device.cryptoki.module_path /usr/lib/softhsm/libsofthsm2.so
82- Execute Command sudo -u tedge /usr/bin/init_softhsm.sh --device-id "${DEVICE_SN } " --pin 123456
83-
84- # configure tedge
85- Set Cumulocity URLs
86- Execute Command tedge config set mqtt.bridge.built_in true
87- Execute Command tedge config set device.cryptoki.mode socket
88-
89- ${csr_path } = Execute Command cmd=tedge config get device.csr_path strip=${True }
90- Register Device With Cumulocity CA ${DEVICE_SN } csr_path=${csr_path }
91-
92- Install tedge-p11-server ${tedge_p11_server_version }
Original file line number Diff line number Diff line change @@ -37,4 +37,5 @@ Can connect to C8y using an RSA key
3737 Connects to C8y using an RSA key
3838
3939Can connect to C8y supporting all TLS13 ECDSA signature algorithms
40+ Install tedge-p11-server 1.6.0
4041 Connects to C8y supporting all TLS13 ECDSA signature algorithms
You can’t perform that action at this time.
0 commit comments