diff --git a/TAF/testScenarios/functionalTest/API/core-metadata/device/GET-Positive.robot b/TAF/testScenarios/functionalTest/API/core-metadata/device/GET-Positive.robot index 2133bea0..e0353d52 100644 --- a/TAF/testScenarios/functionalTest/API/core-metadata/device/GET-Positive.robot +++ b/TAF/testScenarios/functionalTest/API/core-metadata/device/GET-Positive.robot @@ -27,7 +27,7 @@ DeviceGET002 - Query all devices with offset And Set Test Variable ${offset} 2 When Query All Devices With offset=${offset} Then Should Return Status Code "200" And devices - And And totalCount Is Greater Than Zero And ${content}[devices] Count Should Match totalCount-offset + And totalCount Is Greater Than Zero And ${content}[devices] Count Should Match totalCount-offset And Should Return Content-Type "application/json" And Response Time Should Be Less Than "${default_response_time_threshold}"ms [Teardown] Delete Multiple Devices Sample And Profiles Sample diff --git a/TAF/testScenarios/functionalTest/API/support-cron-scheduler/info/GET.robot b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/info/GET.robot new file mode 100644 index 00000000..8c6500ae --- /dev/null +++ b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/info/GET.robot @@ -0,0 +1,30 @@ +*** Settings *** +Resource TAF/testCaseModules/keywords/common/commonKeywords.robot +Suite Setup Run Keywords Setup Suite +... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token +Suite Teardown Run Teardown Keywords +Force Tags Skipped + +*** Variables *** +${SUITE} Support Cron Scheduler Info GET Test Cases +${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/support-cron-scheduler-info.log + +*** Test Cases *** +InfoGET001 - Query ping + When Query Ping + Then Should Return Status Code "200" And timestamp + And apiVersion Should be ${API_VERSION} + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + +InfoGET002 - Query version + When Query Version + Then Should Return Status Code "200" And version + And apiVersion Should be ${API_VERSION} + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + +InfoGET003 - Query config + When Query Config + Then Should Return Status Code "200" And config + And apiVersion Should be ${API_VERSION} + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + diff --git a/TAF/testScenarios/functionalTest/API/support-cron-scheduler/job/DELETE.robot b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/job/DELETE.robot new file mode 100644 index 00000000..7315ba1e --- /dev/null +++ b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/job/DELETE.robot @@ -0,0 +1,27 @@ +*** Settings *** +Resource TAF/testCaseModules/keywords/common/commonKeywords.robot +Suite Setup Run Keywords Setup Suite +... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token +Suite Teardown Run Teardown Keywords +Force Tags Skipped + +*** Variables *** +${SUITE} Support Cron Scheduler Job Delete Test Cases +${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/support-cron-scheduler-delete.log + +*** Test Cases *** +CronSchedJobDELETE001 - Delete job + # Jobs contain combination with definition type CRON/INTERVAL and actions type REST/EDGEXMESSAGEBUS/DEVICECONTROL + Given Create Multiple Jobs + When Delete Job By Name + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And Job Has Been Deleted + [Teardown] Delete Jobs + +ErrCronSchedJobDELETE001 - Delete job with invalid name + When Delete Job By Invalid Name + Then Should Return Status Code "404" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms diff --git a/TAF/testScenarios/functionalTest/API/support-cron-scheduler/job/GET.robot b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/job/GET.robot new file mode 100644 index 00000000..23a81f13 --- /dev/null +++ b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/job/GET.robot @@ -0,0 +1,62 @@ +*** Settings *** +Resource TAF/testCaseModules/keywords/common/commonKeywords.robot +Suite Setup Run Keywords Setup Suite +... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token +Suite Teardown Run Teardown Keywords +Force Tags Skipped + +*** Variables *** +${SUITE} Support Cron Scheduler Job Get Positive Test Cases +${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/support-cron-scheduler-get-positive.log + +*** Test Cases *** +CronSchedJobGET001 - Query all jobs + Given Create Multiple Jobs + When Query All Jobs + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And scheduleJobs Count Should Match totalCount + [Teardown] Delete Jobs + +CronSchedJobGET002 - Query all jobs by labels + Given Create Multiple Jobs With Labels + When Query All Jobs By Labels + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And scheduleJobs Count Should Be Correct + [Teardown] Delete Jobs + +CronSchedJobGET003 - Query all jobs by offset + Given Create Multiple Jobs + When Query All Jobs By Offset + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And scheduleJobs Count Should Match totalCount-offset + [Teardown] Delete Jobs + +CronSchedJobGET004 - Query all jobs by limit + Given Create Multiple Jobs + When Query All Jobs By Limit + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And scheduleJobs Count Should Match Limit + [Teardown] Delete Jobs + +CronSchedJobGET005 - Query job by name + Given Create Multiple Jobs + When Query Job By Name + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And Job Should Be Found + [Teardown] Delete Jobs + +ErrCronSchedJobGET001 - Query job by name with non-existent job + When Query Job By Name With Non-existent Job + Then Should Return Status Code "404" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms diff --git a/TAF/testScenarios/functionalTest/API/support-cron-scheduler/job/PATCH.robot b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/job/PATCH.robot new file mode 100644 index 00000000..0cca1b71 --- /dev/null +++ b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/job/PATCH.robot @@ -0,0 +1,78 @@ +*** Settings *** +Resource TAF/testCaseModules/keywords/common/commonKeywords.robot +Suite Setup Run Keywords Setup Suite +... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token +Suite Teardown Run Teardown Keywords +Force Tags Skipped + +*** Variables *** +${SUITE} Support Cron Scheduler Job PATCH Test Cases +${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/support-cron-scheduler-patch.log + +*** Test Cases *** +CronSchedJobPATCH001 - Update jobs + # Update different field on each job + Given Create Multiple Jobs + When Update Jobs + Then Should Return Status Code "207" + And Should Return Content-Type "application/json" + And Item Index All Should Contain Status Code "201" And id + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And Jobs Should Be Updated + [Teardown] Delete Jobs + +ErrCronSchedJobPATCH001 - Update job with empty definition type + Given Create Multiple Jobs + When Update Jobs With Empty Definition Type + Then Should Return Status Code "400" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + [Teardown] Delete Jobs + +ErrCronSchedJobPATCH002 - Update job with empty definition scheduledef + Given Create Multiple Jobs + When Update Jobs With Empty Definition ScheduleDef + Then Should Return Status Code "400" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + [Teardown] Delete Jobs + +ErrCronSchedJobPATCH003 - Update job with invalid definition type + Given Create Multiple Jobs + When Update Jobs With Invalid Definition Type + Then Should Return Status Code "400" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + [Teardown] Delete Jobs + +ErrCronSchedJobPATCH004 - Update job with empty actions type + Given Create Multiple Jobs + When Update Jobs With Empty Actions Type + Then Should Return Status Code "400" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + [Teardown] Delete Jobs + +ErrCronSchedJobPATCH005 - Update job with invalid actions type + Given Create Multiple Jobs + When Update Jobs With Invalid Actions Type + Then Should Return Status Code "400" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + [Teardown] Delete Jobs + +ErrCronSchedJobPATCH006 - Update job with invalid admin state + Given Create Multiple Jobs + When Update Jobs With Invalid AdminState + Then Should Return Status Code "400" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + [Teardown] Delete Jobs + +ErrCronSchedJobPATCH007 - Update job with startTimestamp > endTimestamp + Given Create Multiple Jobs + When Update Jobs With Incorrect Definition Timestamp + Then Should Return Status Code "400" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + [Teardown] Delete Jobs diff --git a/TAF/testScenarios/functionalTest/API/support-cron-scheduler/job/POST-trigger.robot b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/job/POST-trigger.robot new file mode 100644 index 00000000..9aef129f --- /dev/null +++ b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/job/POST-trigger.robot @@ -0,0 +1,34 @@ +*** Settings *** +Resource TAF/testCaseModules/keywords/common/commonKeywords.robot +Suite Setup Run Keywords Setup Suite +... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token +Suite Teardown Run Teardown Keywords +Force Tags Skipped + +*** Variables *** +${SUITE} Support Cron Scheduler Job POST Trigger Test Cases +${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/support-cron-scheduler-post-trigger.log + +*** Test Cases *** +CronSchedJobTriggerPOST001 - Trigger job by manual + Given Create Multiple Jobs + When Trigger Job By Manual + Then Should Return Status Code "202" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And Job Has Been Triggered + [Teardown] Delete Jobs + +ErrCronSchedJobTriggerPOST001 - Trigger job by manual with non-existent job + When Trigger Job By Manual With Non-existent Job + Then Should Return Status Code "404" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + +ErrCronSchedJobTriggerPOST002 - Trigger job by manual with the startTimestamp is not arrived yet + Given Create Multiple Jobs + When Trigger Job Which startTimestamp Is Not Arrived + Then Should Return Status Code "500" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + [Teardown] Delete Jobs diff --git a/TAF/testScenarios/functionalTest/API/support-cron-scheduler/job/POST.robot b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/job/POST.robot new file mode 100644 index 00000000..5e6bdfde --- /dev/null +++ b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/job/POST.robot @@ -0,0 +1,68 @@ +*** Settings *** +Resource TAF/testCaseModules/keywords/common/commonKeywords.robot +Suite Setup Run Keywords Setup Suite +... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token +Suite Teardown Run Teardown Keywords +Force Tags Skipped + +*** Variables *** +${SUITE} Support Cron Scheduler Job POST Test Cases +${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/support-cron-scheduler-post.log + +*** Test Cases *** +CronSchedJobPOST001 - Create multiple jobs + # Jobs contain combination with definition type CRON/INTERVAL and actions type REST/EDGEXMESSAGEBUS/DEVICECONTROL + When Create Multiple Jobs + Then Should Return Status Code "207" + And Should Return Content-Type "application/json" + And Item Index All Should Contain Status Code "201" And id + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + [Teardown] Delete Jobs + +ErrCronSchedJobPOST001 - Create job with empty name + When Create Jobs With Empty Name + Then Should Return Status Code "400" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + +ErrCronSchedJobPOST002 - Create job with empty definition type + When Create Jobs With Empty Definition Type + Then Should Return Status Code "400" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + +ErrCronSchedJobPOST003 - Create job with empty definition scheduledef + When Create Jobs With Empty Definition ScheduleDef + Then Should Return Status Code "400" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + +ErrCronSchedJobPOST004 - Create job with invalid definition type + When Create Jobs With Invalid Definition Type + Then Should Return Status Code "400" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + +ErrCronSchedJobPOST005 - Create job with empty actions type + When Create Jobs With Empty Actions Type + Then Should Return Status Code "400" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + +ErrCronSchedJobPOST006 - Create job with invalid actions type + When Create Jobs With Invalid Actions Type + Then Should Return Status Code "400" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + +ErrCronSchedJobPOST007 - Create job with invalid admin state + When Create Jobs With Invalid AdminState + Then Should Return Status Code "400" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + +ErrCronSchedJobPOST008 - Create job with startTimestamp > endTimestamp + When Create Jobs With Incorrect Definition Timestamp + Then Should Return Status Code "400" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms diff --git a/TAF/testScenarios/functionalTest/API/support-cron-scheduler/scheduleactionrecord/GET-all.robot b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/scheduleactionrecord/GET-all.robot new file mode 100644 index 00000000..524bd151 --- /dev/null +++ b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/scheduleactionrecord/GET-all.robot @@ -0,0 +1,77 @@ +*** Settings *** +Resource TAF/testCaseModules/keywords/common/commonKeywords.robot +Suite Setup Run Keywords Setup Suite +... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token +Suite Teardown Run Teardown Keywords +Force Tags Skipped + +*** Variables *** +${SUITE} Support Cron Scheduler Action Record Get All Test Cases +${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/support-cron-scheduler-action-record-get-all.log + +*** Test Cases *** +CronSchedActionGET001 - Query all schedule action record + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query All Schedule Action Record + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And ActionRecord Count Should Match totalCount + And Job Name Should Be Matched With Created Jobs + [Teardown] Delete Jobs + +CronSchedActionGET002 - Query all schedule action record with start + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query All Schedule Action Record With Start + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And Only Created Of ActionRecord Greater Start Should Be Found + And Job Name Should Be Matched With Created Jobs + [Teardown] Delete Jobs + +CronSchedActionGET003 - Query all schedule action record with end + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query All Schedule Action Record With End + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And Only Created Of ActionRecord Less Than End Should Be Found + And Job Name Should Be Matched With Created Jobs + [Teardown] Delete Jobs + +CronSchedActionGET004 - Query all schedule action record with start/end + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query All Schedule Action Record With Start/End + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And Only Created Of ActionRecord Between Start/End Should Be Found + And Job Name Should Be Matched With Created Jobs + [Teardown] Delete Jobs + +CronSchedActionGET005 - Query all schedule action record with offset + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query All Schedule Action Record With offset + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And ActionRecord Count Should Match totalCount-offset + And Job Name Should Be Matched With Created Jobs + [Teardown] Delete Jobs + +CronSchedActionGET006 - Query all schedule action record by start with limit + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query All Schedule Action Record With Limit + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And ActionRecord Count Should Match Limit + And Job Name Should Be Matched With Created Jobs + [Teardown] Delete Jobs diff --git a/TAF/testScenarios/functionalTest/API/support-cron-scheduler/scheduleactionrecord/GET-latest.robot b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/scheduleactionrecord/GET-latest.robot new file mode 100644 index 00000000..e04c6fc7 --- /dev/null +++ b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/scheduleactionrecord/GET-latest.robot @@ -0,0 +1,28 @@ +*** Settings *** +Resource TAF/testCaseModules/keywords/common/commonKeywords.robot +Suite Setup Run Keywords Setup Suite +... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token +Suite Teardown Run Teardown Keywords +Force Tags Skipped + +*** Variables *** +${SUITE} Support Cron Scheduler Action Record Get Latest Test Cases +${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/support-cron-scheduler-action-record-get-latest.log + +*** Test Cases *** +CronSchedActionLatestGET001 - Query latest schedule action record of job + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query Latest Schedule Action Record By Job Name + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Should Be 1 And Only The Latest ActionRecord Of Job Should Be Found + And Job Name Should Be The Same With Queried + [Teardown] Delete Jobs + +CronSchedActionLatestGET002 - Query latest schedule action record with non-existent job + When Query Latest Schedule Action Record With Non-existent Job + Then Should Return Status Code "404" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms diff --git a/TAF/testScenarios/functionalTest/API/support-cron-scheduler/scheduleactionrecord/GET-name-status.robot b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/scheduleactionrecord/GET-name-status.robot new file mode 100644 index 00000000..f8356c12 --- /dev/null +++ b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/scheduleactionrecord/GET-name-status.robot @@ -0,0 +1,77 @@ +*** Settings *** +Resource TAF/testCaseModules/keywords/common/commonKeywords.robot +Suite Setup Run Keywords Setup Suite +... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token +Suite Teardown Run Teardown Keywords +Force Tags Skipped + +*** Variables *** +${SUITE} Support Cron Scheduler Action Record Get By Name And Status Test Cases +${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/support-cron-scheduler-action-record-get-name-status.log + +*** Test Cases *** +CronSchedActionAllGET001 - Query schedule action record by name and status + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query Schedule Action Record By Name And Status + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And ActionRecord Count Should Match totalCount + And Job Name and Status Both Should Be The Same With Queried + [Teardown] Delete Jobs + +CronSchedActionAllGET002 - Query schedule action record by name and status with start + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query Schedule Action Record By Name And Status With Start + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And Only Created Of ActionRecord Greater Start Should Be Found + And Job Name and Status Both Should Be The Same With Queried + [Teardown] Delete Jobs + +CronSchedActionAllGET003 - Query schedule action record by name and status with end + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query Schedule Action Record By Name And Status With End + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And Only Created Of ActionRecord Less Than End Should Be Found + And Job Name and Status Both Should Be The Same With Queried + [Teardown] Delete Jobs + +CronSchedActionAllGET004 - Query schedule action record by name and status with start/end + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query Schedule Action Record By Name And Status With Start/End + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And Only Created Of ActionRecord Between Start/End Should Be Found + And Job Name and Status Both Should Be The Same With Queried + [Teardown] Delete Jobs + +CronSchedActionAllGET005 - Query schedule action record by name and status with offset + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query Schedule Action Record By Name And Status With offset + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And ActionRecord Count Should Match totalCount-offset + And Job Name and Status Both Should Be The Same With Queried + [Teardown] Delete Jobs + +CronSchedActionAllGET006 - Query schedule action record by name and status with limit + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query Schedule Action Record By Name And Status With Limit + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And ActionRecord Count Should Match Limit + And Job Name and Status Both Should Be The Same With Queried + [Teardown] Delete Jobs diff --git a/TAF/testScenarios/functionalTest/API/support-cron-scheduler/scheduleactionrecord/GET-name.robot b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/scheduleactionrecord/GET-name.robot new file mode 100644 index 00000000..e6adfb34 --- /dev/null +++ b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/scheduleactionrecord/GET-name.robot @@ -0,0 +1,77 @@ +*** Settings *** +Resource TAF/testCaseModules/keywords/common/commonKeywords.robot +Suite Setup Run Keywords Setup Suite +... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token +Suite Teardown Run Teardown Keywords +Force Tags Skipped + +*** Variables *** +${SUITE} Support Cron Scheduler Action Record Get By Nqme Test Cases +${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/support-cron-scheduler-action-record-get-name.log + +*** Test Cases *** +CronSchedActionNameGET001 - Query schedule action record by name + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query Schedule Action Record By Job Name + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And ActionRecord Count Should Match totalCount + And Job Name Should Be The Same With Queried + [Teardown] Delete Jobs + +CronSchedActionNameGET002 - Query schedule action record by name with start + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query Schedule Action Record By Job Name With Start + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And Only Created Of ActionRecord Greater Start Should Be Found + And Job Name Should Be The Same With Queried + [Teardown] Delete Jobs + +CronSchedActionNameGET003 - Query schedule action record by name with end + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query Schedule Action Record By Job Name With End + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And Only Created Of ActionRecord Less Than End Should Be Found + And Job Name Should Be The Same With Queried + [Teardown] Delete Jobs + +CronSchedActionNameGET004 - Query schedule action record by name with start/end + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query Schedule Action Record By Job Name With Start/End + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And Only Created Of ActionRecord Between Start/End Should Be Found + And Job Name Should Be The Same With Queried + [Teardown] Delete Jobs + +CronSchedActionNameGET005 - Query schedule action record by name with offset + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query Schedule Action Record By Job Name With Offset + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And ActionRecord Count Should Match totalCount-offset + And Job Name Should Be The Same With Queried + [Teardown] Delete Jobs + +CronSchedActionNameGET006 - Query schedule action record by name with limit + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query Schedule Action Record By Job Name With Limit + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And ActionRecord Count Should Match Limit + And Job Name Should Be The Same With Queried + [Teardown] Delete Jobs diff --git a/TAF/testScenarios/functionalTest/API/support-cron-scheduler/scheduleactionrecord/GET-status.robot b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/scheduleactionrecord/GET-status.robot new file mode 100644 index 00000000..505f10bd --- /dev/null +++ b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/scheduleactionrecord/GET-status.robot @@ -0,0 +1,77 @@ +*** Settings *** +Resource TAF/testCaseModules/keywords/common/commonKeywords.robot +Suite Setup Run Keywords Setup Suite +... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token +Suite Teardown Run Teardown Keywords +Force Tags Skipped + +*** Variables *** +${SUITE} Support Cron Scheduler Action Record Get By Status Test Cases +${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/support-cron-scheduler-action-record-get-status.log + +*** Test Cases *** +CronSchedActionStatusGET001 - Query schedule action record by status + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query Schedule Action Record By Status + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And ActionRecord Count Should Match totalCount + And Status Should Be The Same With Queried + [Teardown] Delete Jobs + +CronSchedActionStatusGET002 - Query schedule action record by status with start + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query Schedule Action Record By Status With Start + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And Only Created Of ActionRecord Greater Start Should Be Found + And Status Should Be The Same With Queried + [Teardown] Delete Jobs + +CronSchedActionStatusGET003 - Query schedule action record by status with end + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query Schedule Action Record By Status With End + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And Only Created Of ActionRecord Less Than End Should Be Found + And Status Should Be The Same With Queried + [Teardown] Delete Jobs + +CronSchedActionStatusGET004 - Query schedule action record by status with start/end + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query Schedule Action Record By Status With Start/End + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And Only Created Of ActionRecord Between Start/End Should Be Found + And Status Should Be The Same With Queried + [Teardown] Delete Jobs + +CronSchedActionStatusGET005 - Query schedule action record by status with offset + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query Schedule Action Record By Status With offset + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And ActionRecord Count Should Match totalCount-offset + And Status Should Be The Same With Queried + [Teardown] Delete Jobs + +CronSchedActionStatusGET006 - Query schedule action record by status with limit + Given Create Multiple Jobs + And Wait For Running Schedule Job + When Query Schedule Action Record By Status With Limit + Then Should Return Status Code "200" + And Should Return Content-Type "application/json" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + And totalCount Is Greater Than Zero And ActionRecord Count Should Match Limit + And Status Should Be The Same With Queried + [Teardown] Delete Jobs diff --git a/TAF/testScenarios/functionalTest/API/support-cron-scheduler/secrets/POST.robot b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/secrets/POST.robot new file mode 100644 index 00000000..39701b9e --- /dev/null +++ b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/secrets/POST.robot @@ -0,0 +1,34 @@ +*** Settings *** +Resource TAF/testCaseModules/keywords/common/commonKeywords.robot +Suite Setup Run Keywords Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token + ... AND Setup Suite +Suite Teardown Run Teardown Keywords +Force Tags Skipped + +*** Variables *** +${SUITE} Support-Cron-Scheduler Secrets POST Testcases +${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/support-cron-scheduler-secrets.log + +*** Test Cases *** +SecretsPOST001 - Stores secrets to the secret client with Path + When Store Secret Data With Path + Then Should Return Status Code "201" + And Run Keyword If $SECURITY_SERVICE_NEEDED == 'true' Service ${SERVICE_NAME} Secrets Should be Stored + ... ELSE Secrets Should be Stored To Registry Service ${SERVICE_NAME} + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + +ErrSecretsPOST001 - Stores secrets to the secret client fails (empty path) + When Store Secret Data With Empty Path + Then Should Return Status Code "400" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + +ErrSecretsPOST002 - Stores secrets to the secret client fails (missing key) + When Store Secret Data With Missing Key + Then Should Return Status Code "400" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + +ErrSecretsPOST003 - Stores secrets to the secret client fails (missing value) + When Store Secret Data With Missing Value + Then Should Return Status Code "400" + And Response Time Should Be Less Than "${default_response_time_threshold}"ms + diff --git a/TAF/testScenarios/integrationTest/UC_app_service_configurable/external_mqtt_trigger.robot b/TAF/testScenarios/integrationTest/UC_app_service_configurable/external_mqtt_trigger.robot index c5070d54..49f592ef 100644 --- a/TAF/testScenarios/integrationTest/UC_app_service_configurable/external_mqtt_trigger.robot +++ b/TAF/testScenarios/integrationTest/UC_app_service_configurable/external_mqtt_trigger.robot @@ -19,8 +19,8 @@ ExternalTrigger001 - Test external mqtt trigger works And Subscribe MQTT Broker Topics ${mqtt_export_topic} With ${EX_BROKER_PORT} # Subscribe export mqtt broker When Run process python ${WORK_DIR}/TAF/utils/src/setup/mqtt-publisher.py ${mqtt_trigger_topic} "${publish_msg}" ${EX_BROKER_PORT} false ... shell=True timeout=10s - Then Message Is Recevied By ${mqtt_trigger_topic} Topic - And Message Is Recevied By ${mqtt_export_topic} Topic + Then Message Is Received By ${mqtt_trigger_topic} Topic + And Message Is Received By ${mqtt_export_topic} Topic [Teardown] Terminate All Processes kill=True @@ -30,7 +30,7 @@ Subscribe MQTT Broker Topics ${topic} With ${Port} ... shell=True stdout=${WORK_DIR}/TAF/testArtifacts/logs/${topic}.log Sleep 1s # Waiting for subscriber is ready -Message Is Recevied By ${topic} Topic +Message Is Received By ${topic} Topic Wait Until Keyword Succeeds 6x 1 sec File Should Not Be Empty ${WORK_DIR}/TAF/testArtifacts/logs/${topic}.log ${subscribe_msg} Grep File ${WORK_DIR}/TAF/testArtifacts/logs/${topic}.log ${publish_msg} Should Not Be Empty ${subscribe_msg} diff --git a/TAF/testScenarios/integrationTest/UC_end_to_end/export_data_to_backend.robot b/TAF/testScenarios/integrationTest/UC_end_to_end/export_data_to_backend.robot index 2d8ba6c9..b4aac970 100644 --- a/TAF/testScenarios/integrationTest/UC_end_to_end/export_data_to_backend.robot +++ b/TAF/testScenarios/integrationTest/UC_end_to_end/export_data_to_backend.robot @@ -36,7 +36,7 @@ Export002 - Export events/readings to MQTT Server And Set Test Variable ${device_name} mqtt-export-device And Create Device For device-virtual With Name ${device_name} When Get device data by device ${device_name} and command ${PREFIX}_GenerateDeviceValue_INT16_RW - Then Device data has recevied by mqtt subscriber + Then Device data has Received by mqtt subscriber [Teardown] Run keywords Delete device by name ${device_name} ... AND Delete all events by age @@ -79,7 +79,7 @@ Get device data by device ${device_name} and command ${command} Should return status code "200" sleep 500ms -Device data has recevied by mqtt subscriber +Device data has Received by mqtt subscriber ${mqtt_broker_received}= grep file ${WORK_DIR}/TAF/testArtifacts/logs/mqtt-subscriber.log origin run keyword if "${device_name}" not in """${mqtt_broker_received}""" ... fail No export log found on mqtt subscriber diff --git a/TAF/testScenarios/integrationTest/UC_kuiper/export_by_kuiper_rules.robot b/TAF/testScenarios/integrationTest/UC_kuiper/export_by_kuiper_rules.robot index d50cd0f6..e8cd54f6 100644 --- a/TAF/testScenarios/integrationTest/UC_kuiper/export_by_kuiper_rules.robot +++ b/TAF/testScenarios/integrationTest/UC_kuiper/export_by_kuiper_rules.robot @@ -28,7 +28,7 @@ Kuiper001 - Add a new rule and export to MQTT Given Create A Rule mqtt-rule With ${rule_sql} And MQTT Sink And Create Device For device-virtual With Name ${device_name} When Execute Get Command ${command} To Trigger ${device_name} - Then Device data with keyword "${resource}" has recevied by mqtt subscriber + Then Device data with keyword "${resource}" has received by mqtt subscriber [Teardown] Run Keywords Delete device by name ${device_name} ... AND Delete Rules mqtt-rule ... AND Terminate Process ${handle_mqtt} kill=True @@ -118,7 +118,7 @@ Delete Stream ... expected_status=any run keyword if ${resp.status_code}!=200 log to console ${resp.content} -Device data with keyword "${keyword}" has recevied by mqtt subscriber +Device data with keyword "${keyword}" has received by mqtt subscriber Dump Last 100 lines Log And Service Config app-rules-engine http://localhost:59701 ${mqtt_broker_received}= grep file ${WORK_DIR}/TAF/testArtifacts/logs/${subscriber_file} ${keyword} run keyword if """${mqtt_broker_received}""" == '${EMPTY}' diff --git a/TAF/testScenarios/integrationTest/UC_mqtt_message_bus/core_data_config.robot b/TAF/testScenarios/integrationTest/UC_mqtt_message_bus/core_data_config.robot index 5953d3ff..023677b9 100644 --- a/TAF/testScenarios/integrationTest/UC_mqtt_message_bus/core_data_config.robot +++ b/TAF/testScenarios/integrationTest/UC_mqtt_message_bus/core_data_config.robot @@ -22,7 +22,7 @@ CoreConfig001 - Set core-data MessageBus.BaseTopicPrefix not match device-virtua And Create Device For device-virtual With Name ${device_name} When Get device data by device ${device_name} and command ${PREFIX}_GenerateDeviceValue_UINT8_RW with ds-pushevent=true Then Should Return Status Code "200" And event - And Event Has Been Recevied By MQTT Subscriber + And Event Has Been Received By MQTT Subscriber And Event Is Not Pushed To Core Data [Teardown] Run keywords Delete device by name ${device_name} ... AND Delete all events by age @@ -56,7 +56,7 @@ Ping Data Service Query Ping Should return status code "200" -Event Has Been Recevied By MQTT Subscriber +Event Has Been Received By MQTT Subscriber ${received_event} Get file ${WORK_DIR}/TAF/testArtifacts/logs/${subscriber_file} Should Contain ${received_event} ${device_name} No Event is not received by mqtt subscriber Should Contain ${received_event} correlationID No CorrelationID Found in Event diff --git a/TAF/testScenarios/integrationTest/UC_mqtt_message_bus/device_virtual_config.robot b/TAF/testScenarios/integrationTest/UC_mqtt_message_bus/device_virtual_config.robot index 44cc1869..aa90f0bd 100644 --- a/TAF/testScenarios/integrationTest/UC_mqtt_message_bus/device_virtual_config.robot +++ b/TAF/testScenarios/integrationTest/UC_mqtt_message_bus/device_virtual_config.robot @@ -20,7 +20,7 @@ Config001 - Set MessageBus.Protocol to MQTT # Set protocol on deployment And Create Device For device-virtual With Name ${device_name} When Retrive device data by device ${device_name} and command ${PREFIX}_GenerateDeviceValue_UINT8_RW Then Should Return Status Code "200" And event - And Event Has Been Recevied By MQTT Subscriber + And Event Has Been Received By MQTT Subscriber And Event Has Been Pushed To Core Data [Teardown] Run keywords Delete device by name ${device_name} ... AND Delete all events by age @@ -35,7 +35,7 @@ Config002 - Modify MessageBus.BaseTopicPrefix and receive data from the topic co When Retrive device data by device ${device_name} and command ${PREFIX}_GenerateDeviceValue_INT8_RW Then Should Return Status Code "200" And event And Event Has Been Pushed To Core Data - And Event Has Been Recevied By MQTT Subscriber + And Event Has Been Received By MQTT Subscriber [Teardown] Run keywords Delete device by name ${device_name} ... AND Delete all events by age ... AND Terminate Process ${handle_mqtt} kill=True @@ -80,7 +80,7 @@ Retrive device data by device ${device_name} and command ${command} Set Test Variable ${log_timestamp} ${timestamp} sleep 500ms -Event Has Been Recevied By MQTT Subscriber +Event Has Been Received By MQTT Subscriber ${logs} Run Process ${WORK_DIR}/TAF/utils/scripts/${DEPLOY_TYPE}/query-docker-logs.sh device-virtual ${log_timestamp} ... shell=True stderr=STDOUT output_encoding=UTF-8 timeout=10s ${correlation_line} Get Lines Containing String ${logs.stdout}.encode() Correlation-ID diff --git a/TAF/testScenarios/integrationTest/UC_data_clean_up/clean_up_events_and_readings.robot b/TAF/testScenarios/integrationTest/UC_scheduler/clean_up_events_and_readings.robot similarity index 94% rename from TAF/testScenarios/integrationTest/UC_data_clean_up/clean_up_events_and_readings.robot rename to TAF/testScenarios/integrationTest/UC_scheduler/clean_up_events_and_readings.robot index 1fa4779b..11364dd9 100644 --- a/TAF/testScenarios/integrationTest/UC_data_clean_up/clean_up_events_and_readings.robot +++ b/TAF/testScenarios/integrationTest/UC_scheduler/clean_up_events_and_readings.robot @@ -20,7 +20,7 @@ Scheduler001-Set scheduler for each 30s to clean up events And Create interval action with interval delete events for core-data And Create events by get device command When sleep 30s - Then Query device events after exeucting deletion, and no event found + Then Query device events after executing deletion, and no event found [Teardown] run keywords Delete intervalAction by name ${intervalAction_name} ... AND Delete interval by name ${interval_name} ... AND Delete device by name ${device_name} @@ -31,7 +31,7 @@ Scheduler002-Set scheduler for each 60s to clean up events And Create interval action with interval delete events for core-data And Create events by get device command When sleep 60s - Then Query device events after exeucting deletion, and no event found + Then Query device events after executing deletion, and no event found [Teardown] run keywords Delete intervalAction by name ${intervalAction_name} ... AND Delete interval by name ${interval_name} ... AND Delete device by name ${device_name} @@ -67,7 +67,7 @@ Create events by get device command ${events_length}= GET LENGTH ${content}[events] run keyword if ${events_length} == 0 fail Events didn't create before clean up -Query device events after exeucting deletion, and no event found +Query device events after executing deletion, and no event found Query all events should be equal as integers ${response} 200 ${events_length}= GET LENGTH ${content}[events] diff --git a/TAF/testScenarios/integrationTest/UC_scheduler/cron_scheduler.robot b/TAF/testScenarios/integrationTest/UC_scheduler/cron_scheduler.robot new file mode 100644 index 00000000..14e54465 --- /dev/null +++ b/TAF/testScenarios/integrationTest/UC_scheduler/cron_scheduler.robot @@ -0,0 +1,37 @@ +*** Settings *** +Resource TAF/testCaseModules/keywords/common/commonKeywords.robot +Suite Setup Run keywords Setup Suite +... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token +Suite Teardown Run Teardown Keywords +Force Tags Skipped + +*** Variables *** +${SUITE} Trigger Cron Scheduler + +*** Test Cases *** +CronScheduler001 - Create schedule job with INTERVAL definition and REST action to clean up events and readings + Given Create A Job With INTERVAL definition To Trigger CleanUp Events And Readings + And Create Device + And Create Events And Readings By Get Device Command + When Wait For Running Schedule Job + And Query All Events + Then No Events Should Be Found + [Teardown] run keywords Delete Device By Name + ... AND Delete Jobs + +CronScheduler002 - Create schedule job with INTERVAL definition and DEVICECONTROL action to set device command + Given Create A Job With INTERVAL definition To Set Device Command + And Create Device + When Wait For Running Schedule Job + And Get Device Command + Then Device Command Value Should Be The Same With Set Command + [Teardown] run keywords Delete Device By Name + ... AND Delete Jobs + +CronScheduler003 - Create schedule job with CRON definition to send message to app-service + # Set Topic to external-request which is received by app-external-mqtt-trigger service + # Subscribe Topic "edgex-export" which is exported from app-external-mqtt-trigger + Given Subscribe MQTT Broker Topic "edgex-export" + And Create A Job With CRON definition To Send Message To app-service + When Wait For Running Schedule Job + And Message Is Received FROM edgex-export Topic