Skip to content

Commit cedc27e

Browse files
authored
Merge pull request #3852 from reubenmiller/test-refactor-system-tests
test: refactor system tests in preparation for mqtt service support
2 parents dab6cca + fcc2bb7 commit cedc27e

File tree

5 files changed

+35
-12
lines changed

5 files changed

+35
-12
lines changed

tests/RobotFramework/requirements/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
paho-mqtt~=1.6.1
22
python-dotenv~=1.0.0
33
robotframework~=7.0.0
4-
robotframework-c8y @ git+https://github.com/thin-edge/robotframework-c8y.git@0.47.0
4+
robotframework-c8y @ git+https://github.com/thin-edge/robotframework-c8y.git@0.49.0
55
robotframework-aws @ git+https://github.com/thin-edge/[email protected]
66
robotframework-debuglibrary~=2.5.0
77
robotframework-jsonlibrary~=0.5

tests/RobotFramework/tests/cumulocity/firmware/firmware_operation_child_device.robot

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ Upload binary to Cumulocity
120120
Create c8y_Firmware operation
121121
${operation}= Cumulocity.Install Firmware firmware1 1.0 ${file_url}
122122
Set Suite Variable $operation
123-
Cumulocity.Operation Should Be DELIVERED ${operation}
123+
Set Device Context ${PARENT_SN}
124+
Should Have MQTT Messages c8y/devicecontrol/notifications message_contains=${operation.id}
124125

125126
Validate if file is not newly downloaded
126127
Set Device Context ${PARENT_SN}

tests/RobotFramework/tests/cumulocity/telemetry/thin-edge_device_telemetry.robot

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ Measurement units can be cleared
109109
... type=t6
110110
... value=temperature
111111
... series=temperature
112-
... reverse=${True}
113-
... after=1970-01-01
112+
... sort_newest=${True}
114113
Should Be Equal ${measurements[0]["temperature"]["temperature"]["unit"]} °C
115114
# Execute Command sleep 1
116115
Execute Command tedge mqtt pub -r te/device/main///m/t6/meta ''
@@ -122,8 +121,7 @@ Measurement units can be cleared
122121
... type=t6
123122
... value=temperature
124123
... series=temperature
125-
... after=1970-01-01
126-
... reverse=${True}
124+
... sort_newest=${True}
127125
Log ${measurements}
128126
Should Not Contain ${measurements[0]["temperature"]["temperature"]} unit
129127

tests/RobotFramework/tests/customizing/data_path_config.robot

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ Create c8y_Firmware operation
5959
[Arguments] ${firmware_url}
6060
${operation}= Cumulocity.Install Firmware firmware1 1.0 ${firmware_url}
6161
Set Suite Variable $operation
62-
Cumulocity.Operation Should Be DELIVERED ${operation}
62+
Set Device Context ${PARENT_SN}
63+
Should Have MQTT Messages c8y/devicecontrol/notifications message_contains=${operation.id}
6364

6465
Validate tedge firmware update request sent
6566
[Arguments] ${date_from}

tests/RobotFramework/tests/pkcs11/private_key_storage.robot

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,24 +206,47 @@ tedge cert create-key-hsm should ask where to create keypair if multiple tokens
206206

207207
# unset key_uri so there there's no hint where to generate the keypair
208208
Execute Command cmd=tedge config unset device.key_uri
209-
${stderr}= Execute Command cmd=tedge cert create-key-hsm --type ecdsa --label my-key strip=True stdout=False stderr=True exp_exit_code=1
209+
${stderr}= Execute Command
210+
... cmd=tedge cert create-key-hsm --type ecdsa --label my-key
211+
... strip=True
212+
... stdout=False
213+
... stderr=True
214+
... exp_exit_code=1
210215
Should Contain ${stderr} No token URL was provided for this operation; the available tokens are:
211216
Should Contain ${stderr} token=create-key-token1
212217
Should Contain ${stderr} token=create-key-token2
213218

214219
tedge cert create-key-hsm can set chosen id and returns error if object with this id already exists
215-
${output}= Execute Command cmd=tedge cert create-key-hsm --type ecdsa --label my-key --id 010203 "pkcs11:token=tedge" strip=True stdout=False stderr=True
220+
${output}= Execute Command
221+
... cmd=tedge cert create-key-hsm --type ecdsa --label my-key --id 010203 "pkcs11:token=tedge"
222+
... strip=True
223+
... stdout=False
224+
... stderr=True
216225
Should Contain ${output} id=%01%02%03
217226

218-
${output}= Execute Command cmd=tedge cert create-key-hsm --type ecdsa --label my-key --id 010203 "pkcs11:token=tedge" strip=True stdout=False stderr=True exp_exit_code=!0
227+
${output}= Execute Command
228+
... cmd=tedge cert create-key-hsm --type ecdsa --label my-key --id 010203 "pkcs11:token=tedge"
229+
... strip=True
230+
... stdout=False
231+
... stderr=True
232+
... exp_exit_code=!0
219233
Should Contain ${output} Object with this id already exists on the token
220234

221235
tedge cert create-key-hsm can set pin per request
222-
${output}= Execute Command cmd=tedge cert create-key-hsm --label my-key --pin 000000 "pkcs11:token=tedge" strip=True stdout=False stderr=True exp_exit_code=!0
236+
${output}= Execute Command
237+
... cmd=tedge cert create-key-hsm --label my-key --pin 000000 "pkcs11:token=tedge"
238+
... strip=True
239+
... stdout=False
240+
... stderr=True
241+
... exp_exit_code=!0
223242
Should Contain ${output} The specified PIN is incorrect
224243

225244
tedge cert create-key-hsm can save public key to file
226-
${output}= Execute Command cmd=tedge cert create-key-hsm --label my-key --outfile-pubkey pubkey.pem "pkcs11:token=tedge" strip=True stdout=False stderr=True
245+
${output}= Execute Command
246+
... cmd=tedge cert create-key-hsm --label my-key --outfile-pubkey pubkey.pem "pkcs11:token=tedge"
247+
... strip=True
248+
... stdout=False
249+
... stderr=True
227250
${pubkey}= Execute Command cat pubkey.pem strip=True
228251
Should Contain ${output} ${pubkey}
229252

0 commit comments

Comments
 (0)