Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/RobotFramework/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ignore = [
"missing-doc-suite",
"missing-doc-test-case",
"missing-doc-keyword",
"missing-doc-resource-file",

# Size
"too-long-test-case",
Expand Down
246 changes: 0 additions & 246 deletions tests/RobotFramework/tests/pkcs11/compatibility.robot

This file was deleted.

59 changes: 0 additions & 59 deletions tests/RobotFramework/tests/pkcs11/compatibility_16x.robot

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
*** Settings ***
Documentation Tests for the `tedge cert create-key-hsm` command.

Resource pkcs11_common.resource

Suite Setup Custom Setup
Suite Teardown Get Suite Logs

Test Tags adapter:docker theme:cryptoki
Resource ../pkcs11_common.resource


*** Variables ***
${KEY_URI} ${EMPTY}
${TOKEN_URI} pkcs11:token=create-key-token


*** Test Cases ***
Can create a private key on the PKCS11 token
*** Keywords ***
Create a private key on the PKCS11 token
Execute Command cmd=softhsm2-util --init-token --free --label create-key-token --pin=123456 --so-pin=123456

${output}= Execute Command
Expand Down Expand Up @@ -50,7 +45,7 @@ Can create a private key on the PKCS11 token
... p11tool_keytype=EC/ECDSA-SECP384R1
# ECDSA P521 not supported by rcgen

Shows connected initialized tokens when token argument is not provided
Show connected initialized tokens when token argument is not provided
# setup multiple tokens
Execute Command cmd=softhsm2-util --init-token --free --label create-key-token1 --pin=123456 --so-pin=123456
Execute Command cmd=softhsm2-util --init-token --free --label create-key-token2 --pin=123456 --so-pin=123456
Expand All @@ -67,7 +62,7 @@ Shows connected initialized tokens when token argument is not provided
Should Contain ${stderr} token=create-key-token1
Should Contain ${stderr} token=create-key-token2

Can set key ID using --id flag
Set key ID using --id flag
${output}= Execute Command
... cmd=tedge cert create-key-hsm --type ecdsa --label my-key --id 010203 "${TOKEN_URI}"
... strip=True
Expand All @@ -83,7 +78,7 @@ Can set key ID using --id flag
... exp_exit_code=!0
Should Contain ${output} Object with this id already exists on the token

Can provide PIN using --pin flag
Provide PIN using --pin flag
${output}= Execute Command
... cmd=tedge cert create-key-hsm --label my-key --pin 000000 "${TOKEN_URI}"
... strip=True
Expand All @@ -92,7 +87,7 @@ Can provide PIN using --pin flag
... exp_exit_code=!0
Should Contain ${output} The specified PIN is incorrect

Saves public key to file using --outfile-pubkey flag
Save public key to file using --outfile-pubkey flag
${output}= Execute Command
... cmd=tedge cert create-key-hsm --label my-key --outfile-pubkey pubkey.pem "${TOKEN_URI}"
... strip=True
Expand All @@ -101,8 +96,6 @@ Saves public key to file using --outfile-pubkey flag
${pubkey}= Execute Command cat pubkey.pem strip=True
Should Contain ${output} ${pubkey}


*** Keywords ***
Create private key
[Arguments] ${type} ${label} ${bits}=${EMPTY} ${curve}=${EMPTY} ${p11tool_keytype}=${EMPTY}
# create the private key on token and write CSR to device.csr_path
Expand All @@ -129,6 +122,7 @@ Create private key
Should Contain ${create_key_output} ${key_uri}

Custom Setup
[Arguments] ${tedge_p11_server_version}
${DEVICE_SN}= Setup register=${False}
Set Suite Variable ${DEVICE_SN}

Expand All @@ -140,3 +134,5 @@ Custom Setup
Execute Command tedge config set c8y.url "${domain}"
Execute Command tedge config set mqtt.bridge.built_in true
Execute Command tedge config set device.cryptoki.mode socket

Install tedge-p11-server ${tedge_p11_server_version}
Loading