Skip to content

Commit 7d44718

Browse files
committed
test: tedge cert create-key
Signed-off-by: Marcel Guzik <marcel.guzik@cumulocity.com>
1 parent 83b1de7 commit 7d44718

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/RobotFramework/tests/pkcs11/private_key_storage.robot

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,26 @@ Connects to C8y supporting all TLS13 ECDSA signature algorithms
9999
type=ecdsa curve=secp384r1
100100
type=ecdsa curve=secp521r1
101101

102+
Creates a private key on the PKCS11 token
103+
Execute Command cmd=softhsm2-util --init-token --free --label create-key-token --pin=123456 --so-pin=123456
104+
105+
${output}= Execute Command
106+
... cmd=p11tool --login --set-pin=123456 --list-privkeys "pkcs11:token=create-key-token"
107+
... exp_exit_code=!0
108+
... strip=True
109+
... stdout=False
110+
... stderr=True
111+
Should Be Equal ${output} No matching objects found
112+
113+
Set tedge-p11-server Uri value=pkcs11:token=create-key-token
114+
Execute Command tedge cert create-key
115+
116+
${output}= Execute Command
117+
... cmd=p11tool --login --set-pin=123456 --list-privkeys "pkcs11:token=create-key-token"
118+
Should Contain ${output} Object 0:
119+
120+
[Teardown] Set tedge-p11-server Uri value=
121+
102122
Ignore tedge.toml if missing
103123
Execute Command rm -f ./tedge.toml
104124
${stderr}= Execute Command tedge-p11-server --config-dir . --module-path xx.so exp_exit_code=!0

0 commit comments

Comments
 (0)