Skip to content

Commit

Permalink
Merge pull request #2575 from reubenmiller/test-refactor-service-status
Browse files Browse the repository at this point in the history
test: refactor service tests by removing unnecessary logic
  • Loading branch information
reubenmiller authored Jan 10, 2024
2 parents 89750d8 + 52e8ab7 commit 2149ba7
Showing 1 changed file with 1 addition and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Test if all c8y services are down
tedge-agent
c8y-firmware-plugin


Test if all c8y services are using configured service type
[Template] Check if a service using configured service type
tedge-mapper-c8y
Expand All @@ -47,8 +46,6 @@ Test if all c8y services using default service type when service type configured
c8y-firmware-plugin

Check health status of tedge-mapper-c8y service on broker stop start
Custom Test Setup

Device Should Exist ${DEVICE_SN}:device:main:service:tedge-mapper-c8y show_info=False
${SERVICE}= Cumulocity.Device Should Have Fragment Values status\=up
Should Be Equal ${SERVICE["name"]} tedge-mapper-c8y
Expand All @@ -69,11 +66,8 @@ Check health status of tedge-mapper-c8y service on broker stop start
Should Be Equal ${SERVICE["name"]} tedge-mapper-c8y
Should Be Equal ${SERVICE["status"]} up

Custom Test Teardown

Check health status of tedge-mapper-c8y service on broker restart
[Documentation] Test tedge-mapper-c8y on mqtt broker restart
Custom Test Setup
Device Should Exist ${DEVICE_SN}:device:main:service:tedge-mapper-c8y show_info=False
${SERVICE}= Cumulocity.Device Should Have Fragment Values status\=up timeout=${TIMEOUT}
Expand All @@ -89,8 +83,6 @@ Check health status of tedge-mapper-c8y service on broker restart
Should Be Equal ${SERVICE["name"]} tedge-mapper-c8y
Should Be Equal ${SERVICE["status"]} up

Custom Test Teardown

Check health status of child device service
[Documentation] Test service status of child device services
# Create the child device by sending the service status on te/device/<child-id>/service/<service-id
Expand Down Expand Up @@ -119,21 +111,8 @@ Custom Setup
Set Suite Variable $DEVICE_SN
Device Should Exist ${DEVICE_SN}

Custom Test Setup
ThinEdgeIO.Start Service mosquitto
ThinEdgeIO.Restart Service tedge-mapper-c8y
ThinEdgeIO.Service Should Be Running tedge-mapper-c8y
ThinEdgeIO.Restart Service tedge-agent
ThinEdgeIO.Service Should Be Running tedge-agent

Custom Test Teardown
ThinEdgeIO.Stop Service tedge-mapper-c8y
ThinEdgeIO.Service Should Be Stopped tedge-mapper-c8y

Check if a service is up
[Arguments] ${service_name}
Custom Test Setup
ThinEdgeIO.Start Service ${service_name}
ThinEdgeIO.Service Should Be Running ${service_name}

Device Should Exist ${DEVICE_SN}:device:main:service:${service_name} show_info=False
Expand All @@ -144,12 +123,10 @@ Check if a service is up
Should Be Equal ${SERVICE["status"]} up
Should Be Equal ${SERVICE["type"]} c8y_Service
ThinEdgeIO.Stop Service ${service_name}
Custom Test Teardown


Check if a service is down
[Arguments] ${service_name}
Custom Test Setup
[Teardown] ThinEdgeIO.Start Service ${service_name}
ThinEdgeIO.Start Service ${service_name}
Device Should Exist ${DEVICE_SN}:device:main:service:${service_name} show_info=False
ThinEdgeIO.Stop Service ${service_name}
Expand All @@ -163,12 +140,9 @@ Check if a service is down
Should Be Equal ${SERVICE["status"]} down
Should Be Equal ${SERVICE["type"]} c8y_Service

Custom Test Teardown

Check if a service using configured service type
[Arguments] ${service_name}
Execute Command tedge config set service.type thinedge
Custom Test Setup
ThinEdgeIO.Restart Service ${service_name}
Device Should Exist ${DEVICE_SN}:device:main:service:${service_name} show_info=False
${SERVICE}= Cumulocity.Device Should Have Fragment Values status\=up serviceType\=thinedge timeout=${TIMEOUT}
Expand All @@ -178,12 +152,9 @@ Check if a service using configured service type
Should Be Equal ${SERVICE["status"]} up
Should Be Equal ${SERVICE["type"]} c8y_Service

Custom Test Teardown

Check if a service using configured service type as empty
[Arguments] ${service_name}
Execute Command tedge config set service.type ""
Custom Test Setup
ThinEdgeIO.Restart Service ${service_name}
Device Should Exist ${DEVICE_SN}:device:main:service:${service_name} show_info=False
${SERVICE}= Cumulocity.Device Should Have Fragment Values status\=up serviceType\=service timeout=${TIMEOUT}
Expand All @@ -192,5 +163,3 @@ Check if a service using configured service type as empty
Should Be Equal ${SERVICE["serviceType"]} service
Should Be Equal ${SERVICE["status"]} up
Should Be Equal ${SERVICE["type"]} c8y_Service

Custom Test Teardown

1 comment on commit 2149ba7

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
378 0 3 378 100 53m57.723999999s

Please sign in to comment.