From cc65ad8c58e70dee0f9c547f4e46692ee27de509 Mon Sep 17 00:00:00 2001 From: Cherry Wang Date: Mon, 11 Nov 2024 13:49:42 +0800 Subject: [PATCH] fix: Add version number validation Signed-off-by: Cherry Wang --- TAF/config/global_variables.py | 3 +++ TAF/testCaseModules/keywords/common/commonKeywords.robot | 5 +++++ .../functionalTest/API/app-service/info/GET.robot | 1 + .../functionalTest/API/core-command/info/GET.robot | 1 + .../functionalTest/API/core-data/info/GET.robot | 1 + .../functionalTest/API/core-keeper/info/GET.robot | 1 + .../functionalTest/API/core-metadata/info/GET.robot | 1 + .../functionalTest/API/support-cron-scheduler/info/GET.robot | 1 + .../functionalTest/API/support-notifications/info/GET.robot | 1 + .../functionalTest/device-service/common/info/GET.robot | 1 + 10 files changed, 16 insertions(+) diff --git a/TAF/config/global_variables.py b/TAF/config/global_variables.py index 4cc476e2..2bd28f79 100644 --- a/TAF/config/global_variables.py +++ b/TAF/config/global_variables.py @@ -2,6 +2,9 @@ LOG_LEVEL = "INFO" +# Release Version +REL_MAJOR_VERSION = "4.0" + # API Version API_VERSION = "v3" diff --git a/TAF/testCaseModules/keywords/common/commonKeywords.robot b/TAF/testCaseModules/keywords/common/commonKeywords.robot index abb41078..817c2ead 100644 --- a/TAF/testCaseModules/keywords/common/commonKeywords.robot +++ b/TAF/testCaseModules/keywords/common/commonKeywords.robot @@ -117,6 +117,11 @@ apiVersion Should be ${API_VERSION} Should contain "apiVersion" Should be true '${content}[apiVersion]' == '${API_VERSION}' +Version Should Contain Release Version + ${full_version} Fetch From Left ${content}[version] - + ${version_num} Split String ${full_version} . + Should Be Equal As Strings ${REL_MAJOR_VERSION} ${version_num}[0].${version_num}[1] + totalCount Should be ${value} Should contain ${content} totalCount Should be true '${content}[totalCount]' == '${value}' diff --git a/TAF/testScenarios/functionalTest/API/app-service/info/GET.robot b/TAF/testScenarios/functionalTest/API/app-service/info/GET.robot index d27f723d..8ac53aa5 100644 --- a/TAF/testScenarios/functionalTest/API/app-service/info/GET.robot +++ b/TAF/testScenarios/functionalTest/API/app-service/info/GET.robot @@ -19,6 +19,7 @@ InfoGET001 - Query ping InfoGET002 - Query version When Query Version Then Should Return Status Code "200" And version + And Version Should Contain Release Version And Should Return SDK Version 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/core-command/info/GET.robot b/TAF/testScenarios/functionalTest/API/core-command/info/GET.robot index 7300ef10..2aeeb87d 100644 --- a/TAF/testScenarios/functionalTest/API/core-command/info/GET.robot +++ b/TAF/testScenarios/functionalTest/API/core-command/info/GET.robot @@ -21,6 +21,7 @@ InfoGET001 - Query ping InfoGET002 - Query version When Query Version Then Should Return Status Code "200" And version + And Version Should Contain Release Version 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/core-data/info/GET.robot b/TAF/testScenarios/functionalTest/API/core-data/info/GET.robot index 94cbd4fb..36ce4d29 100644 --- a/TAF/testScenarios/functionalTest/API/core-data/info/GET.robot +++ b/TAF/testScenarios/functionalTest/API/core-data/info/GET.robot @@ -20,6 +20,7 @@ InfoGET001 - Query ping InfoGET002 - Query version When Query Version Then Should Return Status Code "200" And version + And Version Should Contain Release Version 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/core-keeper/info/GET.robot b/TAF/testScenarios/functionalTest/API/core-keeper/info/GET.robot index 59ffc4a7..10e5e114 100644 --- a/TAF/testScenarios/functionalTest/API/core-keeper/info/GET.robot +++ b/TAF/testScenarios/functionalTest/API/core-keeper/info/GET.robot @@ -20,6 +20,7 @@ InfoGET001 - Query ping InfoGET002 - Query version When Query Version Then Should Return Status Code "200" And version + And Version Should Contain Release Version 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/core-metadata/info/GET.robot b/TAF/testScenarios/functionalTest/API/core-metadata/info/GET.robot index a853546a..16772c2d 100644 --- a/TAF/testScenarios/functionalTest/API/core-metadata/info/GET.robot +++ b/TAF/testScenarios/functionalTest/API/core-metadata/info/GET.robot @@ -20,6 +20,7 @@ InfoGET001 - Query ping InfoGET002 - Query version When Query Version Then Should Return Status Code "200" And version + And Version Should Contain Release Version 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/info/GET.robot b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/info/GET.robot index c26be015..85f1c9f0 100644 --- a/TAF/testScenarios/functionalTest/API/support-cron-scheduler/info/GET.robot +++ b/TAF/testScenarios/functionalTest/API/support-cron-scheduler/info/GET.robot @@ -20,6 +20,7 @@ InfoGET001 - Query ping InfoGET002 - Query version When Query Version Then Should Return Status Code "200" And version + And Version Should Contain Release Version 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-notifications/info/GET.robot b/TAF/testScenarios/functionalTest/API/support-notifications/info/GET.robot index 45080420..12413933 100644 --- a/TAF/testScenarios/functionalTest/API/support-notifications/info/GET.robot +++ b/TAF/testScenarios/functionalTest/API/support-notifications/info/GET.robot @@ -20,6 +20,7 @@ InfoGET001 - Query ping InfoGET002 - Query version When Query Version Then Should Return Status Code "200" And version + And Version Should Contain Release Version And apiVersion Should be ${API_VERSION} And Response Time Should Be Less Than "${default_response_time_threshold}"ms diff --git a/TAF/testScenarios/functionalTest/device-service/common/info/GET.robot b/TAF/testScenarios/functionalTest/device-service/common/info/GET.robot index f652dc58..3c202ff3 100644 --- a/TAF/testScenarios/functionalTest/device-service/common/info/GET.robot +++ b/TAF/testScenarios/functionalTest/device-service/common/info/GET.robot @@ -20,6 +20,7 @@ InfoGET001 - Query ping InfoGET002 - Query version When Query Version Then Should Return Status Code "200" And version + And Version Should Contain Release Version And apiVersion Should be ${API_VERSION} And Response Time Should Be Less Than "${default_response_time_threshold}"ms