Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for jwt request #1784

Merged
merged 2 commits into from
Mar 9, 2023
Merged

Conversation

gligorisaev
Copy link
Contributor

Proposed changes

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (general improvements like code refactoring that doesn't explicitly fix a bug or add any new functionality)
  • Documentation Update (if none of the other choices apply)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Paste Link to the issue


Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA (in all commits with git commit -s)
  • I ran cargo fmt as mentioned in CODING_GUIDELINES
  • I used cargo clippy as mentioned in CODING_GUIDELINES
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass %
145 0 5 145 100

Passed Tests

Name ⏱️ Duration Suite
Define Child device 1 ID 0.004 s C8Y Child Alarms Rpi
Normal case when the child device does not exist on c8y cloud 2.6870000000000003 s C8Y Child Alarms Rpi
Normal case when the child device already exists 1.311 s C8Y Child Alarms Rpi
Reconciliation when the new alarm message arrives, restart the mapper 2.6710000000000003 s C8Y Child Alarms Rpi
Reconciliation when the alarm that is cleared 7.246 s C8Y Child Alarms Rpi
Prerequisite Parent 23.468 s Child Conf Mgmt Plugin
Prerequisite Child 0.439 s Child Conf Mgmt Plugin
Child device bootstrapping 19.911 s Child Conf Mgmt Plugin
Snapshot from device 22.884 s Child Conf Mgmt Plugin
Child device config update 17.456 s Child Conf Mgmt Plugin
Configuration types should be detected on file change (without restarting service) 64.77 s Inotify Crate
Child devices support sending simple measurements 63.957 s Child Device Telemetry
Child devices support sending custom measurements 60.87 s Child Device Telemetry
Child devices support sending custom events 54.327 s Child Device Telemetry
Child devices support sending custom events overriding the type 47.842 s Child Device Telemetry
Child devices support sending custom alarms #1699 50.605 s Child Device Telemetry
Child devices support sending inventory data via c8y topic 27.837 s Child Device Telemetry
Main device support sending inventory data via c8y topic 27.364 s Child Device Telemetry
Successful firmware operation 81.388 s Firmware Operation
Install with empty firmware name 66.474 s Firmware Operation
Prerequisite Parent 25.189 s Firmware Operation Child Device
Prerequisite Child 9.022 s Firmware Operation Child Device
Child device firmware update 7.531 s Firmware Operation Child Device
Child device firmware update with cache 7.08 s Firmware Operation Child Device
Retrieve a JWT tokens 59.281 s Jwt Request
Supports restarting the device 99.807 s Restart Device
Update tedge version from previous using Cumulocity 109.879 s Tedge Self Update
Successful shell command with output 4.378 s Shell Operation
Check Successful shell command with literal double quotes output 4.176 s Shell Operation
Execute multiline shell command 3.96 s Shell Operation
Failed shell command 3.722 s Shell Operation
Software list should be populated during startup 64.216 s Software
Install software via Cumulocity 78.164 s Software
Software list should only show currently installed software and not candidates 55.286 s Software
Stop tedge-agent service 0.5 s Log Path Config
Customize the log path 0.159 s Log Path Config
Initialize tedge-agent 0.152 s Log Path Config
Check created folders 0.202 s Log Path Config
Remove created custom folders 0.138 s Log Path Config
Install latest via script (from current branch) 35.837 s Install Tedge
Install specific version via script (from current branch) 29.713 s Install Tedge
Install latest tedge via script (from main branch) 31.388 s Install Tedge
Support starting and stopping services 38.531 s Service-Control
Supports a reconnect 64.798 s Test-Commands
Supports disconnect then connect 58.371 s Test-Commands
Update unknown setting 38.368 s Test-Commands
Update known setting 24.926 s Test-Commands
Stop c8y-configuration-plugin 0.154 s Health C8Y-Configuration-Plugin
Update the service file 0.222 s Health C8Y-Configuration-Plugin
Reload systemd files 0.634 s Health C8Y-Configuration-Plugin
Start c8y-configuration-plugin 0.268 s Health C8Y-Configuration-Plugin
Start watchdog service 10.229 s Health C8Y-Configuration-Plugin
Check PID of c8y-configuration-plugin 0.268 s Health C8Y-Configuration-Plugin
Kill the PID 0.28 s Health C8Y-Configuration-Plugin
Recheck PID of c8y-configuration-plugin 0.334 s Health C8Y-Configuration-Plugin
Compare PID change 0.019 s Health C8Y-Configuration-Plugin
Stop watchdog service 0.329 s Health C8Y-Configuration-Plugin
Remove entry from service file 0.284 s Health C8Y-Configuration-Plugin
Stop c8y-log-plugin 0.162 s Health C8Y-Log-Plugin
Update the service file 0.155 s Health C8Y-Log-Plugin
Reload systemd files 0.551 s Health C8Y-Log-Plugin
Start c8y-log-plugin 0.202 s Health C8Y-Log-Plugin
Start watchdog service 10.198 s Health C8Y-Log-Plugin
Check PID of c8y-log-plugin 0.141 s Health C8Y-Log-Plugin
Kill the PID 0.246 s Health C8Y-Log-Plugin
Recheck PID of c8y-log-plugin 2.271 s Health C8Y-Log-Plugin
Compare PID change 0.001 s Health C8Y-Log-Plugin
Stop watchdog service 0.254 s Health C8Y-Log-Plugin
Remove entry from service file 0.318 s Health C8Y-Log-Plugin
Stop tedge-mapper 0.403 s Health Tedge Mapper C8Y
Update the service file 0.223 s Health Tedge Mapper C8Y
Reload systemd files 1.205 s Health Tedge Mapper C8Y
Start tedge-mapper 0.341 s Health Tedge Mapper C8Y
Start watchdog service 10.337 s Health Tedge Mapper C8Y
Check PID of tedge-mapper 0.194 s Health Tedge Mapper C8Y
Kill the PID 0.165 s Health Tedge Mapper C8Y
Recheck PID of tedge-mapper 0.235 s Health Tedge Mapper C8Y
Compare PID change 0.001 s Health Tedge Mapper C8Y
Stop watchdog service 0.168 s Health Tedge Mapper C8Y
Remove entry from service file 0.129 s Health Tedge Mapper C8Y
Stop tedge-agent 0.339 s Health Tedge-Agent
Update the service file 0.216 s Health Tedge-Agent
Reload systemd files 1.003 s Health Tedge-Agent
Start tedge-agent 0.239 s Health Tedge-Agent
Start watchdog service 10.381 s Health Tedge-Agent
Check PID of tedge-mapper 0.148 s Health Tedge-Agent
Kill the PID 0.156 s Health Tedge-Agent
Recheck PID of tedge-agent 2.233 s Health Tedge-Agent
Compare PID change 0.002 s Health Tedge-Agent
Stop watchdog service 0.162 s Health Tedge-Agent
Remove entry from service file 0.174 s Health Tedge-Agent
Stop tedge-mapper-az 0.469 s Health Tedge-Mapper-Az
Update the service file 0.479 s Health Tedge-Mapper-Az
Reload systemd files 1.5819999999999999 s Health Tedge-Mapper-Az
Start tedge-mapper-az 0.345 s Health Tedge-Mapper-Az
Start watchdog service 10.341 s Health Tedge-Mapper-Az
Check PID of tedge-mapper-az 0.162 s Health Tedge-Mapper-Az
Kill the PID 0.26 s Health Tedge-Mapper-Az
Recheck PID of tedge-agent 2.443 s Health Tedge-Mapper-Az
Compare PID change 0.001 s Health Tedge-Mapper-Az
Stop watchdog service 0.295 s Health Tedge-Mapper-Az
Remove entry from service file 0.311 s Health Tedge-Mapper-Az
Stop tedge-mapper-collectd 0.528 s Health Tedge-Mapper-Collectd
Update the service file 0.478 s Health Tedge-Mapper-Collectd
Reload systemd files 1.18 s Health Tedge-Mapper-Collectd
Start tedge-mapper-collectd 0.32 s Health Tedge-Mapper-Collectd
Start watchdog service 10.535 s Health Tedge-Mapper-Collectd
Check PID of tedge-mapper-collectd 0.124 s Health Tedge-Mapper-Collectd
Kill the PID 0.136 s Health Tedge-Mapper-Collectd
Recheck PID of tedge-mapper-collectd 0.229 s Health Tedge-Mapper-Collectd
Compare PID change 0.002 s Health Tedge-Mapper-Collectd
Stop watchdog service 0.195 s Health Tedge-Mapper-Collectd
Remove entry from service file 0.215 s Health Tedge-Mapper-Collectd
c8y-log-plugin health status 5.871 s MQTT health endpoints
c8y-configuration-plugin health status 5.93 s MQTT health endpoints
Wrong package name 0.135 s Improve Tedge Apt Plugin Error Messages
Wrong version 0.116 s Improve Tedge Apt Plugin Error Messages
Wrong type 0.385 s Improve Tedge Apt Plugin Error Messages
tedge_connect_test_positive 0.644 s Tedge Connect Test
tedge_connect_test_negative 0.853 s Tedge Connect Test
tedge_connect_test_sm_services 9.924 s Tedge Connect Test
tedge_disconnect_test_sm_services 1.6840000000000002 s Tedge Connect Test
Install thin-edge.io 25.765 s Call Tedge
call tedge -V 0.133 s Call Tedge
call tedge -h 0.107 s Call Tedge
call tedge -h -V 0.112 s Call Tedge
call tedge help 0.117 s Call Tedge
tedge config list 0.109 s Call Tedge Config List
tedge config list --all 0.095 s Call Tedge Config List
set/unset device.type 0.458 s Call Tedge Config List
set/unset device.key.path 0.464 s Call Tedge Config List
set/unset device.cert.path 0.606 s Call Tedge Config List
set/unset c8y.root.cert.path 0.914 s Call Tedge Config List
set/unset c8y.smartrest.templates 1.081 s Call Tedge Config List
set/unset az.root.cert.path 1.224 s Call Tedge Config List
set/unset az.mapper.timestamp 0.752 s Call Tedge Config List
set/unset mqtt.bind_address 0.759 s Call Tedge Config List
set/unset mqtt.port 0.799 s Call Tedge Config List
set/unset tmp.path 0.652 s Call Tedge Config List
set/unset logs.path 0.624 s Call Tedge Config List
set/unset run.path 0.797 s Call Tedge Config List
Get Put Delete 5.136 s Http File Transfer Api
Set keys should return value on stdout 0.249 s Tedge Config Get
Unset keys should not return anything on stdout and warnings on stderr 0.435 s Tedge Config Get
Invalid keys should not return anything on stdout and warnings on stderr 0.649 s Tedge Config Get

Copy link
Contributor

@reubenmiller reubenmiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gligorisaev The Get Unix Timestamp does not seem to be from the DateTime library. From memory I think we were talking about creating a new keyword to provide a "rounded down" unix timestamp in seconds.

I have just added this keyword Get Unix Timestamp to the robotframework-devicelibrary, so can you update this in your PR? This can be done via a regex in your IDE (but I can also help).

Replace pattern (with regex option turned on): robotframework-devicelibrary.git@.+
With new text: robotframework-devicelibrary.git@0.27.1

${DEVICE_SN}= Setup
Set Suite Variable $DEVICE_SN
Device Should Exist ${DEVICE_SN}
Stop Service tedge-mapper-c8y
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct me if I am wrong here, but first Default Setup runs then Custom Setup then the test.
Since you are stopping the tedge-mapper-c8y here before the test starts, how can you retrieve the jwt token? this mapper must be running right.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, Bridge creation is enough to retrieve the jwt token.

@gligorisaev gligorisaev temporarily deployed to Test Pull Request March 9, 2023 08:54 — with GitHub Actions Inactive
Signed-off-by: gligorisaev <gligorisaev@gmail.com>
@gligorisaev gligorisaev temporarily deployed to Test Pull Request March 9, 2023 10:26 — with GitHub Actions Inactive
Signed-off-by: gligorisaev <gligorisaev@gmail.com>
@gligorisaev gligorisaev temporarily deployed to Test Pull Request March 9, 2023 12:38 — with GitHub Actions Inactive
Copy link
Contributor

@reubenmiller reubenmiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@reubenmiller reubenmiller merged commit 38cdda5 into thin-edge:main Mar 9, 2023
albinsuresh pushed a commit to albinsuresh/thin-edge.io that referenced this pull request Mar 13, 2023
* add jwt test

---------

Signed-off-by: gligorisaev <gligorisaev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants