From 8d3c4e843f0c1dc206f2eb29877f3b12782fbbcb Mon Sep 17 00:00:00 2001 From: Cherry Wang Date: Fri, 12 Jul 2024 17:18:00 +0800 Subject: [PATCH] feat: Use keeper as registry service and set registry service to a selection Signed-off-by: Cherry Wang --- TAF/config/global_variables.py | 20 +++- .../keywords/app-service/AppServiceAPI.robot | 16 ++-- .../keywords/common/commonKeywords.robot | 82 ++++++++++++++--- .../keywords/common/metrics.robot | 21 +++-- .../core-metadata/coreMetadataAPI.robot | 8 +- TAF/testCaseModules/keywords/setup/edgex.py | 1 + .../keywords/setup/startup_checker.py | 8 +- .../API/app-service/info/GET.robot | 2 +- .../API/app-service/secrets/POST.robot | 2 +- .../app-service/trigger/POST-negative.robot | 13 ++- .../app-service/trigger/POST-positive.robot | 21 +++-- .../API/core-data/event/GET-negative.robot | 7 +- .../API/core-data/event/GET-positive.robot | 10 +- .../core-data/reading/GET-negative-II.robot | 1 + .../API/core-data/reading/GET-negative.robot | 2 + .../deviceprofile/DELETE-DeviceCommand.robot | 4 +- .../deviceprofile/DELETE-DeviceResource.robot | 4 +- .../deviceprofile/DELETE-Negative.robot | 4 +- .../POST-Negative-Deviceresource.robot | 4 +- .../POST-Negative-Uploadfile.robot | 4 +- .../deviceprofile/POST-Negative.robot | 4 +- .../POST-Positive-Deviceresource.robot | 4 +- .../deviceprofile/POST-Positive.robot | 8 +- .../PUT-Negative-UploadFile.robot | 8 +- .../deviceprofile/PUT-Negative.robot | 8 +- .../deviceprofile/PUT-Positive.robot | 8 +- .../notification/GET-Negative-II.robot | 1 + .../support-notifications/secrets/POST.robot | 2 +- .../transmission/GET-Negative-II.robot | 1 + .../transmission/GET-Positive-II.robot | 6 +- .../intervalaction/POST-Positive.robot | 30 +++--- .../device-service/common/secrets/POST.robot | 2 +- .../cors_configuration.robot | 16 ++-- .../UC_URI_for_files/URI_for_files.robot | 24 ++--- .../device_configuration.robot | 20 ++-- .../UC_device_service/usemessagebus.robot | 12 +-- .../UC_end_to_end/export_store_forward.robot | 28 +++--- .../app_services_metrics_mqtt.robot | 92 +++++++++++-------- .../app_services_metrics_redis.robot | 84 +++++++++-------- .../UC_metrics/core_data_metrics_mqtt.robot | 27 +++--- .../UC_metrics/core_data_metrics_redis.robot | 25 ++--- .../core_data_config.robot | 14 +-- .../device_virtual_config.robot | 30 +++--- .../UC_retention/core_data_retention.robot | 10 +- .../notifications_retention.robot | 10 +- .../scalabilityTest/modbus/modbus.robot | 2 +- .../docker/get-compose-file-perfermance.sh | 9 +- TAF/utils/scripts/docker/get-compose-file.sh | 33 +++++-- TAF/utils/scripts/docker/run-tests.sh | 16 ++-- TAF/utils/scripts/docker/sync-compose-file.sh | 7 +- docs/run-tests-on-local.md | 8 ++ 51 files changed, 463 insertions(+), 320 deletions(-) diff --git a/TAF/config/global_variables.py b/TAF/config/global_variables.py index 00cf47ab..e4d65646 100644 --- a/TAF/config/global_variables.py +++ b/TAF/config/global_variables.py @@ -2,9 +2,6 @@ LOG_LEVEL = "INFO" -# Base endpoint in the Consul path for all services -CONSUL_CONFIG_BASE_ENDPOINT = "/v1/kv/edgex/v3" - # API Version API_VERSION = "v3" @@ -20,25 +17,31 @@ SECURITY_SERVICE_NEEDED=os.getenv("SECURITY_SERVICE_NEEDED") DOCKER_HOST_IP=os.getenv("DOCKER_HOST_IP") ARCH=os.getenv("ARCH") +REGISTRY_SERVICE=os.getenv("REGISTRY_SERVICE") # Token related variables jwt_token = '' consul_token = '' # Service port +APP_SAMPLE_PORT=59700 APP_HTTP_EXPORT_PORT = 59704 APP_MQTT_EXPORT_PORT = 59703 -APP_FUNCTIOAL_TESTS_PORT = 59705 +APP_FUNCTIONAL_TESTS_PORT = 59705 APP_EXTERNAL_MQTT_TRIGGER_PORT = 59706 -REGISTRY_PORT = 8500 +CONSUL_PORT = 8500 EX_BROKER_PORT = 1884 BROKER_PORT = 1883 +# Registry Config Version +CONFIG_VERSION = "v3" + if SECURITY_SERVICE_NEEDED == 'true': URI_SCHEME = "https" CORE_DATA_PORT = "8443/core-data" CORE_METADATA_PORT = "8443/core-metadata" CORE_COMMAND_PORT = "8443/core-command" + CORE_KEEPER_PORT = "8443/core-keeper" SUPPORT_NOTIFICATIONS_PORT = "8443/support-notifications" SUPPORT_SCHEDULER_PORT = "8443/support-scheduler" RULESENGINE_PORT = "8443/rules-engine" @@ -48,11 +51,18 @@ CORE_DATA_PORT = 59880 CORE_METADATA_PORT = 59881 CORE_COMMAND_PORT = 59882 + CORE_KEEPER_PORT = 59890 SUPPORT_NOTIFICATIONS_PORT = 59860 SUPPORT_SCHEDULER_PORT = 59861 RULESENGINE_PORT = 59720 ONVIF_CAMERA_PORT = 59984 +if REGISTRY_SERVICE == 'Consul': + REGISTRY_PORT = CONSUL_PORT +else: + REGISTRY_PORT = CORE_KEEPER_PORT + + # External MQTT Auth EX_BROKER_USER = os.getenv("EX_BROKER_USER") EX_BROKER_PASSWD = os.getenv("EX_BROKER_PASSWD") diff --git a/TAF/testCaseModules/keywords/app-service/AppServiceAPI.robot b/TAF/testCaseModules/keywords/app-service/AppServiceAPI.robot index 205731cb..799e4069 100644 --- a/TAF/testCaseModules/keywords/app-service/AppServiceAPI.robot +++ b/TAF/testCaseModules/keywords/app-service/AppServiceAPI.robot @@ -22,20 +22,20 @@ Suite Teardown for App Service Run Teardown Keywords Set ${service} Functions ${functions} - ${path}= Set variable ${CONSUL_CONFIG_BASE_ENDPOINT}/${service}/Writable/Pipeline/ExecutionOrder - Update Service Configuration On Consul ${path} ${functions} + ${path}= Set variable /${service}/Writable/Pipeline/ExecutionOrder + Update Configuration On Registry Service ${path} ${functions} Set Transform Type ${type} - ${path}= Set variable ${CONSUL_CONFIG_BASE_ENDPOINT}/app-functional-tests/Writable/Pipeline/Functions/Transform/Parameters/Type - Update Service Configuration On Consul ${path} ${type} + ${path}= Set variable /app-functional-tests/Writable/Pipeline/Functions/Transform/Parameters/Type + Update Configuration On Registry Service ${path} ${type} Set Compress Algorithm ${algorithm} - ${path}= Set variable ${CONSUL_CONFIG_BASE_ENDPOINT}/app-functional-tests/Writable/Pipeline/Functions/Compress/Parameters/Algorithm - Update Service Configuration On Consul ${path} ${algorithm} + ${path}= Set variable /app-functional-tests/Writable/Pipeline/Functions/Compress/Parameters/Algorithm + Update Configuration On Registry Service ${path} ${algorithm} Set Encrypt Algorithm ${algorithm} - ${path}= Set variable ${CONSUL_CONFIG_BASE_ENDPOINT}/app-functional-tests/Writable/Pipeline/Functions/Encrypt/Parameters/Algorithm - Update Service Configuration On Consul ${path} ${algorithm} + ${path}= Set variable /app-functional-tests/Writable/Pipeline/Functions/Encrypt/Parameters/Algorithm + Update Configuration On Registry Service ${path} ${algorithm} Trigger Function Pipeline With ${data} ${trigger_data}= Run keyword if '${data}' != 'Invalid Data' set variable Valid Data diff --git a/TAF/testCaseModules/keywords/common/commonKeywords.robot b/TAF/testCaseModules/keywords/common/commonKeywords.robot index 75aaed13..43d0ff46 100644 --- a/TAF/testCaseModules/keywords/common/commonKeywords.robot +++ b/TAF/testCaseModules/keywords/common/commonKeywords.robot @@ -11,6 +11,8 @@ Library TAF/testCaseModules/keywords/setup/setup_teardown.py *** Variables *** ${default_response_time_threshold} 1200 +${CONSUL_CONFIG_BASE_ENDPOINT} /v1/kv/edgex/${CONFIG_VERSION} +${KEEPER_CONFIG_BASE_ENDPOINT} /api/${API_VERSION}/kvs/key/edgex/${CONFIG_VERSION} *** Keywords *** Setup Suite @@ -242,7 +244,7 @@ Update Service Configuration On Consul ${headers}= Create Dictionary X-Consul-Token=${consul_token} ${url} Set Variable http://${BASE_URL}:${REGISTRY_PORT} Create Session Consul url=${url} disable_warnings=true - ${resp}= PUT On Session Consul ${path} data=${value} headers=${headers} expected_status=200 + ${resp}= PUT On Session Consul ${CONSUL_CONFIG_BASE_ENDPOINT}/${path} data=${value} headers=${headers} expected_status=200 Sleep 1s # Waiting for the configuration updating Query Service Configuration On Consul @@ -251,9 +253,18 @@ Query Service Configuration On Consul ${headers}= Create Dictionary X-Consul-Token=${consul_token} ${url} Set Variable http://${BASE_URL}:${REGISTRY_PORT} Create Session Consul url=${url} disable_warnings=true - ${resp}= Get On Session Consul ${path} headers=${headers} expected_status=any + ${resp}= Get On Session Consul ${CONSUL_CONFIG_BASE_ENDPOINT}/${path} headers=${headers} expected_status=any Set Response to Test Variables ${resp} +Delete Service Configuration On Consul + [Arguments] ${path} + ${consul_token} Run Keyword If $SECURITY_SERVICE_NEEDED == 'true' Get Consul Token + ${headers}= Create Dictionary X-Consul-Token=${consul_token} + ${url} Set Variable http://${BASE_URL}:${REGISTRY_PORT} + Create Session Consul url=${url} disable_warnings=true + DELETE On Session Consul ${CONSUL_CONFIG_BASE_ENDPOINT}/${path} params=recurse=true headers=${headers} + ... expected_status=200 + Get Consul Token ${command} Set Variable cat /tmp/edgex/secrets/consul-acl-token/bootstrap_token.json ${result} Run Process ${WORK_DIR}/TAF/utils/scripts/${DEPLOY_TYPE}/execute-command-in-docker.sh core-consul "${command}" @@ -261,6 +272,48 @@ Get Consul Token ${token} Evaluate json.loads('''${result.stdout}''') json [Return] ${token}[SecretID] +Update Service Configuration On Keeper + [Arguments] ${path} ${value} + ${headers}= Create Dictionary Authorization=Bearer ${jwt_token} + ${url} Set Variable ${URI_SCHEME}://${BASE_URL}:${CORE_KEEPER_PORT} + Create Session Keeper url=${url} disable_warnings=true + ${body} Create Dictionary value=${value} + ${resp}= PUT On Session Keeper ${KEEPER_CONFIG_BASE_ENDPOINT}/${path} + ... json=${body} headers=${headers} expected_status=200 + Sleep 1s # Waiting for the configuration updating + +Query Service Configuration On Keeper + [Arguments] ${path} + ${headers}= Create Dictionary Authorization=Bearer ${jwt_token} + ${url} Set Variable ${URI_SCHEME}://${BASE_URL}:${CORE_KEEPER_PORT} + Create Session Keeper url=${url} disable_warnings=true + ${resp}= GET On Session Keeper ${KEEPER_CONFIG_BASE_ENDPOINT}/${path} + ... headers=${headers} expected_status=any + Set Response to Test Variables ${resp} + +Delete Service Configuration On Keeper + [Arguments] ${path} + ${headers}= Create Dictionary Authorization=Bearer ${jwt_token} + ${url} Set Variable ${URI_SCHEME}://${BASE_URL}:${CORE_KEEPER_PORT} + Create Session Keeper url=${url} disable_warnings=true + ${resp}= DELETE On Session Keeper ${KEEPER_CONFIG_BASE_ENDPOINT}/${path} + ... headers=${headers} expected_status=200 + +Update Configuration On Registry Service + [Arguments] ${path} ${value} + Run Keyword If "${REGISTRY_SERVICE}" == "Consul" Update Service Configuration On Consul ${path} ${value} + ... ELSE IF "${REGISTRY_SERVICE}" == "Keeper" Update Service Configuration On Keeper ${path} ${value} + +Query Configuration On Registry Service + [Arguments] ${path} + Run Keyword If "${REGISTRY_SERVICE}" == "Consul" Query Service Configuration On Consul ${path} + ... ELSE IF "${REGISTRY_SERVICE}" == "Keeper" Query Service Configuration On Keeper ${path} + +Delete Configuration On Registry Service + [Arguments] ${path} + Run Keyword If "${REGISTRY_SERVICE}" == "Consul" Delete Service Configuration On Consul ${path} + ... ELSE IF "${REGISTRY_SERVICE}" == "Keeper" Delete Service Configuration On Keeper ${path} + Run Redis Subscriber Progress And Output [Arguments] ${topic} ${keyword} ${expected_msg_count}=1 ${duration}=30 ${current_time} get current epoch time @@ -329,18 +382,21 @@ Service ${service} Secrets Should be Stored Set Response to Test Variables ${resp} Should Contain ${content}[data] ${secrets_key} ${secrets_value} -Secrets Should be Stored To Consul +Secrets Should be Stored To Registry Service [Arguments] ${service} - # Validate Secret Name - ${secrets_name_path} Set Variable ${CONSUL_CONFIG_BASE_ENDPOINT}/${service}/Writable/InsecureSecrets/${secrets_name}/SecretName - Query Service Configuration On Consul ${secrets_name_path} - ${secrets_name_consul_value} Evaluate base64.b64decode('${content}[0][Value]').decode('utf-8') modules=base64 - Should Be Equal ${secrets_name_consul_value} ${secrets_name} - # Validate Secret Data - ${secrets_data_path} Set Variable ${CONSUL_CONFIG_BASE_ENDPOINT}/${service}/Writable/InsecureSecrets/${secrets_name}/SecretData/${secrets_key} - Query Service Configuration On Consul ${secrets_data_path} - ${secrets_key_consul_value} Evaluate base64.b64decode('${content}[0][Value]').decode('utf-8') modules=base64 - Should Be Equal ${secrets_key_consul_value} ${secrets_value} + # Validate Secret Name and Secret Data + FOR ${value} IN name data + ${path} Run Keyword If "${value}" == "name" Set Variable SecretName + ... ELSE IF "${value}" == "data" Set Variable SecretData/${secrets_key} + ${secrets_path} Set Variable ${service}/Writable/InsecureSecrets/${secrets_name}/${path} + Query Configuration On Registry Service ${secrets_path} + ${name_base64_value} Run Keyword If "${REGISTRY_SERVICE}" == "Consul" Set Variable ${content}[0][Value] + ... ELSE IF "${REGISTRY_SERVICE}" == "Keeper" Set Variable ${content}[response][0][value] + ${stored_value} Evaluate base64.b64decode('${name_base64_value}').decode('utf-8') modules=base64 + ${set_value} Run Keyword If "${value}" == "name" Set Variable ${secrets_name} + ... ELSE IF "${value}" == "data" Set Variable ${secrets_value} + Should Be Equal ${stored_value} ${set_value} + END Should Return Status Code "${statusCode_0}" or "${statusCode_1}" Should Match Regexp "${response}" (${statusCode_0}|${statusCode_1}) diff --git a/TAF/testCaseModules/keywords/common/metrics.robot b/TAF/testCaseModules/keywords/common/metrics.robot index 5b6055b2..e9c2b9b0 100644 --- a/TAF/testCaseModules/keywords/common/metrics.robot +++ b/TAF/testCaseModules/keywords/common/metrics.robot @@ -6,18 +6,21 @@ Library String Resource TAF/testCaseModules/keywords/common/commonKeywords.robot Resource TAF/testCaseModules/keywords/app-service/AppServiceAPI.robot +*** Variables *** +${APP_SERVICE_NAME} app-sample + *** Keywords *** -Set Telemetry ${config}=${value} For ${service_name} On Consul - ${telemetry_path} Set Variable ${CONSUL_CONFIG_BASE_ENDPOINT}/${service_name}/Writable/Telemetry +Set Telemetry ${config}=${value} For ${service_name} On Registry Service + ${telemetry_path} Set Variable /${service_name}/Writable/Telemetry ${path} Set Variable ${telemetry_path}/${config} - Update Service Configuration On Consul ${path} ${value} + Update Configuration On Registry Service ${path} ${value} -Set Topics For app-samle PerTopicPipelines On Consul +Set Topics For ${APP_SERVICE_NAME} PerTopicPipelines On Registry Service ${perTopics} Create List float int8-16 - ${path} Set Variable ${CONSUL_CONFIG_BASE_ENDPOINT}/app-sample/Writable/Pipeline/PerTopicPipelines + ${path} Set Variable /${APP_SERVICE_NAME}/Writable/Pipeline/PerTopicPipelines FOR ${ITEM} IN @{perTopics} ${topics_path} Set Variable ${path}/${ITEM}/Topics - Update Service Configuration On Consul ${topics_path} edgex/events/device/+/+/${device_name}/# + Update Configuration On Registry Service ${topics_path} events/device/+/+/${device_name}/# END Metrics ${metrics_name} With ${field_name} Should Be Received @@ -37,7 +40,7 @@ Metrics ${metrics_name} With ${field_name} Should Be Received ... AND Exit For Loop END -Recieved Metrics ${metrics_name} For All Pipelines And ${field_name} Should Not Be 0 +Received Metrics ${metrics_name} For All Pipelines And ${field_name} Should Not Be 0 Wait Until Keyword Succeeds 10x 1s File Should Not Be Empty ${WORK_DIR}/TAF/testArtifacts/logs/${subscriber_file} @{pipeline_ids} Create List default-pipeline float-pipeline int8-16-pipeline @{message_ids} Create List @@ -101,5 +104,5 @@ Get First Lines [Return] ${list} Set PerTopicPipelines ${perTopicPipeline} ExecutionOrder ${functions} - ${path}= Set variable ${CONSUL_CONFIG_BASE_ENDPOINT}/app-sample/Writable/Pipeline/PerTopicPipelines/${perTopicPipeline}/ExecutionOrder - Update Service Configuration On Consul ${path} ${functions} + ${path}= Set variable /${APP_SERVICE_NAME}/Writable/Pipeline/PerTopicPipelines/${perTopicPipeline}/ExecutionOrder + Update Configuration On Registry Service ${path} ${functions} diff --git a/TAF/testCaseModules/keywords/core-metadata/coreMetadataAPI.robot b/TAF/testCaseModules/keywords/core-metadata/coreMetadataAPI.robot index 3b101fd0..229f93c0 100644 --- a/TAF/testCaseModules/keywords/core-metadata/coreMetadataAPI.robot +++ b/TAF/testCaseModules/keywords/core-metadata/coreMetadataAPI.robot @@ -18,7 +18,7 @@ ${deviceResourceUri} /api/${API_VERSION}/deviceresource ${deviceUri} /api/${API_VERSION}/device ${provisionWatcherUri} /api/${API_VERSION}/provisionwatcher ${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/coreMetadataAPI.log -${uomValidationPath} ${CONSUL_CONFIG_BASE_ENDPOINT}/core-metadata/Writable/UoM/Validation +${uomValidationPath} /core-metadata/Writable/UoM/Validation @{device_service_list} device-virtual device-modbus device-rest *** Keywords *** @@ -762,9 +762,9 @@ Create A Provision Watcher Sample With Associated Test-Device-Service And ${devi Generate Provision Watchers ${provisionwatcher} Create provision watcher ${provisionwatcher} -Set ProfileChange.${config}=${value} For Core-Metadata On Consul - ${path}= Set Variable ${CONSUL_CONFIG_BASE_ENDPOINT}/core-metadata/Writable/ProfileChange/${config} - Update Service Configuration On Consul ${path} ${value} +Set ProfileChange.${config}=${value} For Core-Metadata On Registry Service + ${path}= Set Variable /core-metadata/Writable/ProfileChange/${config} + Update Configuration On Registry Service ${path} ${value} ## UoM Query UoM diff --git a/TAF/testCaseModules/keywords/setup/edgex.py b/TAF/testCaseModules/keywords/setup/edgex.py index e7c87d6f..23479220 100644 --- a/TAF/testCaseModules/keywords/setup/edgex.py +++ b/TAF/testCaseModules/keywords/setup/edgex.py @@ -50,6 +50,7 @@ def restart_services(*args): SettingsInfo().constant.DEPLOY_TYPE) cmd = ["sh", script_path, *args] run_command(cmd) + checker.check_services_startup(list(args)) def remove_services(*args): diff --git a/TAF/testCaseModules/keywords/setup/startup_checker.py b/TAF/testCaseModules/keywords/setup/startup_checker.py index bb9c9d55..51ea495f 100644 --- a/TAF/testCaseModules/keywords/setup/startup_checker.py +++ b/TAF/testCaseModules/keywords/setup/startup_checker.py @@ -45,7 +45,13 @@ "pingUrl": "/api/{}/ping".format(SettingsInfo().constant.API_VERSION)}, "app-service-mqtt-export": {"composeName": "app-service-mqtt-export", "port": SettingsInfo().constant.APP_MQTT_EXPORT_PORT, - "pingUrl": "/api/{}/ping".format(SettingsInfo().constant.API_VERSION)} + "pingUrl": "/api/{}/ping".format(SettingsInfo().constant.API_VERSION)}, + "app-functional-tests": {"composeName": "app-functional-tests", + "port": SettingsInfo().constant.APP_FUNCTIONAL_TESTS_PORT, + "pingUrl": "/api/{}/ping".format(SettingsInfo().constant.API_VERSION)}, + "app-sample": {"composeName": "app-sample", + "port": SettingsInfo().constant.APP_SAMPLE_PORT, + "pingUrl": "/api/{}/ping".format(SettingsInfo().constant.API_VERSION)} } httpConnTimeout = 5 diff --git a/TAF/testScenarios/functionalTest/API/app-service/info/GET.robot b/TAF/testScenarios/functionalTest/API/app-service/info/GET.robot index b68b419c..d27f723d 100644 --- a/TAF/testScenarios/functionalTest/API/app-service/info/GET.robot +++ b/TAF/testScenarios/functionalTest/API/app-service/info/GET.robot @@ -7,7 +7,7 @@ Suite Teardown Suite Teardown for App Service *** Variables *** ${SUITE} App-Service GET Testcases ${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/app-service-get.log -${AppServiceUrl_functional} http://${BASE_URL}:${APP_FUNCTIOAL_TESTS_PORT} +${AppServiceUrl_functional} http://${BASE_URL}:${APP_FUNCTIONAL_TESTS_PORT} *** Test Cases *** InfoGET001 - Query ping diff --git a/TAF/testScenarios/functionalTest/API/app-service/secrets/POST.robot b/TAF/testScenarios/functionalTest/API/app-service/secrets/POST.robot index a9e53f84..7de8d8fe 100644 --- a/TAF/testScenarios/functionalTest/API/app-service/secrets/POST.robot +++ b/TAF/testScenarios/functionalTest/API/app-service/secrets/POST.robot @@ -13,7 +13,7 @@ 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 ${app_service_name} Secrets Should be Stored - ... ELSE Secrets Should be Stored To Consul ${app_service_name} + ... ELSE Secrets Should be Stored To Registry Service ${app_service_name} And Response Time Should Be Less Than "${default_response_time_threshold}"ms ErrSecretsPOST001 - Stores secrets to the secret client fails (empty path) diff --git a/TAF/testScenarios/functionalTest/API/app-service/trigger/POST-negative.robot b/TAF/testScenarios/functionalTest/API/app-service/trigger/POST-negative.robot index c3e9d3b0..c25f3f7d 100644 --- a/TAF/testScenarios/functionalTest/API/app-service/trigger/POST-negative.robot +++ b/TAF/testScenarios/functionalTest/API/app-service/trigger/POST-negative.robot @@ -7,18 +7,21 @@ Suite Teardown Suite Teardown for App Service *** Variables *** ${SUITE} App-Service Trigger POST Negative Testcases ${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/app-service-trigger-negative.log -${AppServiceUrl_functional} http://${BASE_URL}:${APP_FUNCTIOAL_TESTS_PORT} +${AppServiceUrl_functional} http://${BASE_URL}:${APP_FUNCTIONAL_TESTS_PORT} +${APP_SERVICE_NAME} app-functional-tests *** Test Cases *** ErrTriggerPOST001 - Trigger pipeline fails (Invalid Data) - Given Set app-functional-tests Functions FilterByDeviceName, Transform, SetResponseData + Given Set ${APP_SERVICE_NAME} Functions FilterByDeviceName, Transform, SetResponseData + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} When Trigger Function Pipeline With Invalid Data Then Should Return Status Code "400" And Response Time Should Be Less Than "${default_response_time_threshold}"ms ErrTriggerPOST002 - Trigger pipeline fails (Unprocessable Entity) - Given Set app-functional-tests Functions FilterByDeviceName, Transform, SetResponseData + Given Set ${APP_SERVICE_NAME} Functions FilterByDeviceName, Transform, SetResponseData And Update Target Type To raw + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} When Trigger Function Pipeline With Invalid Data Then Should Return Status Code "422" And Response Time Should Be Less Than "${default_response_time_threshold}"ms @@ -26,6 +29,6 @@ ErrTriggerPOST002 - Trigger pipeline fails (Unprocessable Entity) *** Keywords *** Update Target Type To ${value} - ${path}= Set variable ${CONSUL_CONFIG_BASE_ENDPOINT}/app-functional-tests/Writable/Pipeline/TargetType - Update Service Configuration On Consul ${path} ${value} + ${path}= Set variable /app-functional-tests/Writable/Pipeline/TargetType + Update Configuration On Registry Service ${path} ${value} diff --git a/TAF/testScenarios/functionalTest/API/app-service/trigger/POST-positive.robot b/TAF/testScenarios/functionalTest/API/app-service/trigger/POST-positive.robot index c1710b76..1107a098 100644 --- a/TAF/testScenarios/functionalTest/API/app-service/trigger/POST-positive.robot +++ b/TAF/testScenarios/functionalTest/API/app-service/trigger/POST-positive.robot @@ -8,11 +8,13 @@ Suite Teardown Suite Teardown for App Service *** Variables *** ${SUITE} App-Service Trigger POST Positive Testcases ${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/app-service-trigger-positive.log -${AppServiceUrl_functional} http://${BASE_URL}:${APP_FUNCTIOAL_TESTS_PORT} +${AppServiceUrl_functional} http://${BASE_URL}:${APP_FUNCTIONAL_TESTS_PORT} +${APP_SERVICE_NAME} app-functional-tests *** Test Cases *** TriggerPOST001 - Trigger pipeline (no match) - Given Set app-functional-tests Functions FilterByDeviceName, Transform, SetResponseData + Given Set ${APP_SERVICE_NAME} Functions FilterByDeviceName, Transform, SetResponseData + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} When Trigger Function Pipeline With No Matching DeviceName Then Should Return Status Code "200" And Body Should Match Empty @@ -20,8 +22,9 @@ TriggerPOST001 - Trigger pipeline (no match) TriggerPOST002 - Trigger pipeline (XML) [Tags] SmokeTest - Given Set app-functional-tests Functions FilterByDeviceName, Transform, SetResponseData + Given Set ${APP_SERVICE_NAME} Functions FilterByDeviceName, Transform, SetResponseData And Set Transform Type xml + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} When Trigger Function Pipeline With Matching DeviceName Then Should Return Status Code "200" And Should Return Content-Type "application/xml" @@ -29,8 +32,9 @@ TriggerPOST002 - Trigger pipeline (XML) And Response Time Should Be Less Than "${default_response_time_threshold}"ms TriggerPOST003 - Trigger pipeline (JSON) - Given Set app-functional-tests Functions FilterByDeviceName, Transform, SetResponseData + Given Set ${APP_SERVICE_NAME} Functions FilterByDeviceName, Transform, SetResponseData And Set Transform Type json + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} When Trigger Function Pipeline With Matching DeviceName Then Should Return Status Code "200" And Should Return Content-Type "application/json" @@ -38,18 +42,20 @@ TriggerPOST003 - Trigger pipeline (JSON) And Response Time Should Be Less Than "${default_response_time_threshold}"ms TriggerPOST004 - Trigger pipeline (JSON-GZIP) - Given Set app-functional-tests Functions FilterByDeviceName, Transform, Compress, SetResponseData + Given Set ${APP_SERVICE_NAME} Functions FilterByDeviceName, Transform, Compress, SetResponseData And Set Transform Type json And Set Compress Algorithm gzip + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} When Trigger Function Pipeline With Matching DeviceName Then Should Return Status Code "200" And Body Should Match JSON-GZIP String And Response Time Should Be Less Than "${default_response_time_threshold}"ms TriggerPOST005 - Trigger pipeline (JSON-ZLIB) - Given Set app-functional-tests Functions FilterByDeviceName, Transform, Compress, SetResponseData + Given Set ${APP_SERVICE_NAME} Functions FilterByDeviceName, Transform, Compress, SetResponseData And Set Transform Type json And Set Compress Algorithm zlib + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} When Trigger Function Pipeline With Matching DeviceName Then Should Return Status Code "200" And Should Return Content-Type "text/plain" @@ -59,8 +65,9 @@ TriggerPOST005 - Trigger pipeline (JSON-ZLIB) TriggerPOST006 - Trigger pipeline (AES26) [Setup] Skip If $SECURITY_SERVICE_NEEDED == 'false' Given Store Secret Data With AES256 Auth - And Set app-functional-tests Functions FilterByDeviceName, Encrypt, SetResponseData + And Set ${APP_SERVICE_NAME} Functions FilterByDeviceName, Encrypt, SetResponseData And Set Encrypt Algorithm aes256 + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} When Trigger Function Pipeline With Matching DeviceName Then Should Return Status Code "200" And Should Return Content-Type "text/plain" diff --git a/TAF/testScenarios/functionalTest/API/core-data/event/GET-negative.robot b/TAF/testScenarios/functionalTest/API/core-data/event/GET-negative.robot index 67f82dad..2e09a56a 100644 --- a/TAF/testScenarios/functionalTest/API/core-data/event/GET-negative.robot +++ b/TAF/testScenarios/functionalTest/API/core-data/event/GET-negative.robot @@ -40,6 +40,7 @@ ErrEventGET004 - Query events by start/end time fails (Invalid End) ErrEventGET005 - Query events by start/end time fails (Start>End) ${start_time}= Get current nanoseconds epoch time + Sleep 1ms ${end_time}= Get current nanoseconds epoch time When Run Keyword And Expect Error * Query Events By Start/End Time ${end_time} ${start_time} Then Should Return Status Code "400" @@ -47,8 +48,8 @@ ErrEventGET005 - Query events by start/end time fails (Start>End) And Response Time Should Be Less Than "${default_response_time_threshold}"ms ErrEventGET006 - Query event fails when persistData is false - ${path}= Set Variable ${CONSUL_CONFIG_BASE_ENDPOINT}/core-data/Writable/PersistData - Given Update Service Configuration On Consul ${path} false + ${path}= Set Variable /core-data/Writable/PersistData + Given Update Configuration On Registry Service ${path} false And Generate Event Sample Event Device-Test-001 Profile-Test-001 Command-Test-001 Simple Reading And Create Event With Service-Test-001 And Profile-Test-001 And Device-Test-001 And Command-Test-001 When Query Event By Event Id "${id}" @@ -56,4 +57,4 @@ ErrEventGET006 - Query event fails when persistData is false And Should Return Content-Type "application/json" And Response Time Should Be Less Than "${default_response_time_threshold}"ms [Teardown] Run Keywords Delete All Events By Age - ... AND Update Service Configuration On Consul ${path} true + ... AND Update Configuration On Registry Service ${path} true diff --git a/TAF/testScenarios/functionalTest/API/core-data/event/GET-positive.robot b/TAF/testScenarios/functionalTest/API/core-data/event/GET-positive.robot index 3b1d8bee..8728bc7d 100644 --- a/TAF/testScenarios/functionalTest/API/core-data/event/GET-positive.robot +++ b/TAF/testScenarios/functionalTest/API/core-data/event/GET-positive.robot @@ -21,7 +21,7 @@ EventGET001 - Query all events [Teardown] Delete All Events By Age EventGET002 - Query all events by limit = -1 and MaxResultCount= 5 - Given Set MaxResultCount=5 For Core-Data On Consul + Given Set MaxResultCount=5 For Core-Data On Registry Service And Create Multiple Events When Query All Events With limit=-1 Then Should Return Status Code "200" @@ -30,7 +30,7 @@ EventGET002 - Query all events by limit = -1 and MaxResultCount= 5 And Should Return Content-Type "application/json" And Response Time Should Be Less Than "${default_response_time_threshold}"ms [Teardown] Run Keywords Delete All Events By Age - ... AND Set MaxResultCount=50000 For Core-Data On Consul + ... AND Set MaxResultCount=50000 For Core-Data On Registry Service EventGET003 - Query event by ID [Tags] SmokeTest @@ -99,7 +99,7 @@ Events Should Be Created Between ${start} And ${end} Should Be True ${end} >= ${content}[events][${index}][origin] >=${start} END -Set MaxResultCount=${number} For Core-Data On Consul - ${path}= Set Variable ${CONSUL_CONFIG_BASE_ENDPOINT}/core-data/Service/MaxResultCount - Update Service Configuration On Consul ${path} ${number} +Set MaxResultCount=${number} For Core-Data On Registry Service + ${path}= Set Variable /core-data/Service/MaxResultCount + Update Configuration On Registry Service ${path} ${number} Restart Services core-data diff --git a/TAF/testScenarios/functionalTest/API/core-data/reading/GET-negative-II.robot b/TAF/testScenarios/functionalTest/API/core-data/reading/GET-negative-II.robot index 7a45cefd..9d40e934 100644 --- a/TAF/testScenarios/functionalTest/API/core-data/reading/GET-negative-II.robot +++ b/TAF/testScenarios/functionalTest/API/core-data/reading/GET-negative-II.robot @@ -27,6 +27,7 @@ ErrReadingGET014 - Query readings by device name and resource name between start ErrReadingGET015 - Query readings by device name and resource name between start/end time fails (Start>End) ${start_time}= Get current nanoseconds epoch time + Sleep 1ms ${end_time}= Get current nanoseconds epoch time When Query readings by device and resource between start/end time Test_Device Test_Resource ${end_time} ${start_time} Then Should Return Status Code "400" diff --git a/TAF/testScenarios/functionalTest/API/core-data/reading/GET-negative.robot b/TAF/testScenarios/functionalTest/API/core-data/reading/GET-negative.robot index 2448fc98..50d3c434 100644 --- a/TAF/testScenarios/functionalTest/API/core-data/reading/GET-negative.robot +++ b/TAF/testScenarios/functionalTest/API/core-data/reading/GET-negative.robot @@ -59,6 +59,7 @@ ErrReadingGET007 - Query readings by start/end time fails (Invalid End) ErrReadingGET008 - Query readings by start/end time fails (Start>End) ${start_time}= Get current nanoseconds epoch time + Sleep 1ms ${end_time}= Get current nanoseconds epoch time When Run Keyword And Expect Error * Query Readings By Start/End Time ${end_time} ${start_time} Then Should Return Status Code "400" @@ -81,6 +82,7 @@ ErrReadingGET010 - Query readings by rsource and start/end time fails (Invalid E ErrReadingGET011 - Query readings by rsource and start/end time fails (Start>End) ${start_time}= Get current nanoseconds epoch time + Sleep 1ms ${end_time}= Get current nanoseconds epoch time When Query Readings By Resource And Start/End Time Test_Resource ${end_time} ${start_time} Then Should Return Status Code "400" diff --git a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/DELETE-DeviceCommand.robot b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/DELETE-DeviceCommand.robot index 244c17d3..553b17ea 100644 --- a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/DELETE-DeviceCommand.robot +++ b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/DELETE-DeviceCommand.robot @@ -66,7 +66,7 @@ ErrProfileCommandDELETE003 - Delete deviceCommand which profile used by device ErrProfileCommandDELETE004 - Delete deviceCommand when StrictDeviceProfileChanges config is enabled # StrictDeviceProfileChanges config is true - Given Set ProfileChange.StrictDeviceProfileChanges=true For Core-Metadata On Consul + Given Set ProfileChange.StrictDeviceProfileChanges=true For Core-Metadata On Registry Service And Set Test Variable ${profile_name} Test-Profile-3 And Generate A Device Profile Sample ${profile_name} And Create device profile ${deviceProfile} @@ -75,7 +75,7 @@ ErrProfileCommandDELETE004 - Delete deviceCommand when StrictDeviceProfileChange And Should Return Content-Type "application/json" And Response Time Should Be Less Than "${default_response_time_threshold}"ms And Device Command ${command_name} In ${profile_name} Should Not Be Deleted - [Teardown] Run Keywords Set ProfileChange.StrictDeviceProfileChanges=false For Core-Metadata On Consul + [Teardown] Run Keywords Set ProfileChange.StrictDeviceProfileChanges=false For Core-Metadata On Registry Service ... AND Delete Device Profile By Name ${profile_name} *** Keywords *** diff --git a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/DELETE-DeviceResource.robot b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/DELETE-DeviceResource.robot index 6b61dec3..79829301 100644 --- a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/DELETE-DeviceResource.robot +++ b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/DELETE-DeviceResource.robot @@ -64,7 +64,7 @@ ErrProfileResourceDELETE004 - Delete deviceResource which used by deviceCommand ErrProfileResourceDELETE005 - Delete deviceResource when StrictDeviceProfileChanges config is enabled # StrictDeviceProfileChanges config is true - Given Set ProfileChange.StrictDeviceProfileChanges=true For Core-Metadata On Consul + Given Set ProfileChange.StrictDeviceProfileChanges=true For Core-Metadata On Registry Service And Set Test Variable ${profile_name} Test-Profile-4 And Generate A Device Profile Sample ${profile_name} And Create device profile ${deviceProfile} @@ -73,7 +73,7 @@ ErrProfileResourceDELETE005 - Delete deviceResource when StrictDeviceProfileChan And Should Return Content-Type "application/json" And Response Time Should Be Less Than "${default_response_time_threshold}"ms And Device Resource ${resource_name} In ${profile_name} Should Not Be Deleted - [Teardown] Run Keywords Set ProfileChange.StrictDeviceProfileChanges=false For Core-Metadata On Consul + [Teardown] Run Keywords Set ProfileChange.StrictDeviceProfileChanges=false For Core-Metadata On Registry Service ... AND Delete Device Profile By Name ${profile_name} ProfileResourceDELETE006 - Delete deviceResource by name which contains Chinese and space character diff --git a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/DELETE-Negative.robot b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/DELETE-Negative.robot index a8097a53..aafcf131 100644 --- a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/DELETE-Negative.robot +++ b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/DELETE-Negative.robot @@ -37,12 +37,12 @@ ErrProfileDELETE003 - Delete device profile by name that used by rovisionwatcher [Teardown] Delete Multiple Provision Watchers Sample, Profiles Sample And Services Sample ErrProfileDELETE004 - Delete device profile by name when StrictDeviceProfileDeletes is true - Given Set ProfileChange.StrictDeviceProfileDeletes=true For Core-Metadata On Consul + Given Set ProfileChange.StrictDeviceProfileDeletes=true For Core-Metadata On Registry Service And Generate A Device Profile Sample Test-Profile-2 And Create device profile ${deviceProfile} When Delete Device Profile By Name Test-Profile-2 Then Should Return Status Code "423" And Should Return Content-Type "application/json" And Response Time Should Be Less Than "${default_response_time_threshold}"ms - [Teardown] Run Keywords Set ProfileChange.StrictDeviceProfileDeletes=false For Core-Metadata On Consul + [Teardown] Run Keywords Set ProfileChange.StrictDeviceProfileDeletes=false For Core-Metadata On Registry Service ... AND Delete Device Profile By Name Test-Profile-2 diff --git a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/POST-Negative-Deviceresource.robot b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/POST-Negative-Deviceresource.robot index c2e54555..1460033e 100644 --- a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/POST-Negative-Deviceresource.robot +++ b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/POST-Negative-Deviceresource.robot @@ -95,14 +95,14 @@ ErrProfileResourcePOST008 - Add deviceResource with readWrite validation error ErrProfileResourcePOST009 - Add deviceResource with invalid units value Given Create A Device Profile And Generate Multiple Resources Entity - And Update Service Configuration On Consul ${uomValidationPath} true + And Update Configuration On Registry Service ${uomValidationPath} true When Create Device Resources Contain invalid Units Value Then Should Return Status Code "207" And Should Return Content-Type "application/json" And Item Index All Should Contain Status Code "400" And Response Time Should Be Less Than "${default_response_time_threshold}"ms And Resources Should Not Be Added in ${test_profile} - [Teardown] Run Keywords Update Service Configuration On Consul ${uomValidationPath} false + [Teardown] Run Keywords Update Configuration On Registry Service ${uomValidationPath} false ... AND Delete Device Profile By Name ${test_profile} *** Keywords *** diff --git a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/POST-Negative-Uploadfile.robot b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/POST-Negative-Uploadfile.robot index 889b3372..9562448f 100644 --- a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/POST-Negative-Uploadfile.robot +++ b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/POST-Negative-Uploadfile.robot @@ -83,9 +83,9 @@ ErrProfilePOSTUpload008 - Create device profile by upload file with deviceComman [Teardown] Delete Profile Files NEW-Test-Profile-2.yaml ErrProfilePOSTUpload009 - Create device profile by upload file with invalid units property - Given Update Service Configuration On Consul ${uomValidationPath} true + Given Update Configuration On Registry Service ${uomValidationPath} true When Modify Device Profile Test-Profile-4 With invalid Units Value 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] Update Service Configuration On Consul ${uomValidationPath} false + [Teardown] Update Configuration On Registry Service ${uomValidationPath} false diff --git a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/POST-Negative.robot b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/POST-Negative.robot index 13af52ea..189d7f66 100644 --- a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/POST-Negative.robot +++ b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/POST-Negative.robot @@ -88,10 +88,10 @@ ErrProfilePOST008 - Create device profile with deviceCommands deviceResources va And Response Time Should Be Less Than "${default_response_time_threshold}"ms ErrProfilePOST009 - Create device profile with invalid units value - Given Update Service Configuration On Consul ${uomValidationPath} true + Given Update Configuration On Registry Service ${uomValidationPath} true When Create A Profile Test-Profile-1 With invalid Units Value Then Should Return Status Code "207" And Should Return Content-Type "application/json" And Item Index All Should Contain Status Code "400" And Response Time Should Be Less Than "${default_response_time_threshold}"ms - [Teardown] Update Service Configuration On Consul ${uomValidationPath} false + [Teardown] Update Configuration On Registry Service ${uomValidationPath} false diff --git a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/POST-Positive-Deviceresource.robot b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/POST-Positive-Deviceresource.robot index 1356817f..72334617 100644 --- a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/POST-Positive-Deviceresource.robot +++ b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/POST-Positive-Deviceresource.robot @@ -36,14 +36,14 @@ ProfileResourcePOST002 - Add multiple Resources on multiple device profiles ProfileResourcePOST003 - Add multiple Resources on device profile with valid units property Given Create A Device Profile And Generate Multiple Resources Entity - And Update Service Configuration On Consul ${uomValidationPath} true + And Update Configuration On Registry Service ${uomValidationPath} true When Create Device Resources Contain valid Units Value Then Should Return Status Code "207" And Should Return Content-Type "application/json" And Item Index All Should Contain Status Code "201" And Response Time Should Be Less Than "${default_response_time_threshold}"ms And Resources Should Be Added in ${test_profile} - [Teardown] Run Keywords Update Service Configuration On Consul ${uomValidationPath} false + [Teardown] Run Keywords Update Configuration On Registry Service ${uomValidationPath} false ... AND Delete Device Profile By Name ${test_profile} ProfileResourcePOST004 - Add Resources with Chinese and space character in resource name diff --git a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/POST-Positive.robot b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/POST-Positive.robot index d6d09b27..0ca082f7 100644 --- a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/POST-Positive.robot +++ b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/POST-Positive.robot @@ -52,23 +52,23 @@ ProfilePOST004 - Create device profile by upload file without deviceResources an ... AND Delete Profile Files ${upload_profile} ProfilePOST005 - Create device profile with json body and contains valid unit value - Given Update Service Configuration On Consul ${uomValidationPath} true + Given Update Configuration On Registry Service ${uomValidationPath} true When Create A Profile Test-Profile-1 With valid Units Value 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] Run Keywords Update Service Configuration On Consul ${uomValidationPath} false + [Teardown] Run Keywords Update Configuration On Registry Service ${uomValidationPath} false ... AND Delete Device Profile By Name Test-Profile-1 ProfilePOST006 - Create device profile by upload file and the update file contains valid unit value - Given Update Service Configuration On Consul ${uomValidationPath} true + Given Update Configuration On Registry Service ${uomValidationPath} true When Modify Device Profile Test-Profile-1 With valid Units Value Then Should Return Status Code "201" And Should Return Content-Type "application/json" And Should Contain "id" And Response Time Should Be Less Than "${default_response_time_threshold}"ms - [Teardown] Run Keywords Update Service Configuration On Consul ${uomValidationPath} false + [Teardown] Run Keywords Update Configuration On Registry Service ${uomValidationPath} false ... AND Delete Device Profile By Name Test-Profile-1 ... AND Delete Profile Files NEW-Test-Profile-1.yaml diff --git a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/PUT-Negative-UploadFile.robot b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/PUT-Negative-UploadFile.robot index 9ca2a515..4d326e5f 100644 --- a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/PUT-Negative-UploadFile.robot +++ b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/PUT-Negative-UploadFile.robot @@ -96,27 +96,27 @@ ErrProfilePUTUpload007 - Update device profile by upload file with deivceCommand ... AND Delete Profile Files NEW-Test-Profile-2.yaml ErrProfilePUTUpload008 - Update device profile by upload file when StrictDeviceProfileChanges is true - Given Set ProfileChange.StrictDeviceProfileChanges=true For Core-Metadata On Consul + Given Set ProfileChange.StrictDeviceProfileChanges=true For Core-Metadata On Registry Service And Upload Device Profile Test-Profile-3.yaml And Generate New Test-Profile-3.yaml With "profile" Property "manufacturer" Value "Mfr_ABC" When Upload File NEW-Test-Profile-3.yaml To Update Device Profile Then Should Return Status Code "423" And Should Return Content-Type "application/json" And Response Time Should Be Less Than "${default_response_time_threshold}"ms - [Teardown] Run Keywords Set ProfileChange.StrictDeviceProfileChanges=false For Core-Metadata On Consul + [Teardown] Run Keywords Set ProfileChange.StrictDeviceProfileChanges=false For Core-Metadata On Registry Service ... AND Delete Device Profile By Name Test-Profile-3 ... AND Delete Profile Files NEW-Test-Profile-3.yaml ErrProfilePUTUpload009 - Update device profile by upload file and the update file contains invalid unit value Given Upload Device Profile Test-Profile-3.yaml - And Update Service Configuration On Consul ${uomValidationPath} true + And Update Configuration On Registry Service ${uomValidationPath} true And Update Units Value In Profile Test-Profile-3 To invalid When Upload File NEW-Test-Profile-3.yaml To Update Device Profile 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 And Resource Units Should Not Be Updated in Test-Profile-3 - [Teardown] Run Keywords Update Service Configuration On Consul ${uomValidationPath} false + [Teardown] Run Keywords Update Configuration On Registry Service ${uomValidationPath} false ... AND Delete Device Profile By Name Test-Profile-3 ... AND Delete Profile Files NEW-Test-Profile-3.yaml diff --git a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/PUT-Negative.robot b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/PUT-Negative.robot index a63e3dee..0f760001 100644 --- a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/PUT-Negative.robot +++ b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/PUT-Negative.robot @@ -98,7 +98,7 @@ ErrProfilePUT007 - Update device profile with deivceCommands deviceResource vali [Teardown] Delete Multiple Device Profiles By Names Test-Profile-1 Test-Profile-2 Test-Profile-3 ErrProfilePUT008 - Update device profile when StrictDeviceProfileChanges is true - Given Set ProfileChange.StrictDeviceProfileChanges=true For Core-Metadata On Consul + Given Set ProfileChange.StrictDeviceProfileChanges=true For Core-Metadata On Registry Service And Generate A Device Profile Sample Test-Profile-1 And Create Device Profile ${deviceProfile} And Set To Dictionary ${deviceProfile}[0][profile] manufacturer=Mfr_ABC @@ -106,13 +106,13 @@ ErrProfilePUT008 - Update device profile when StrictDeviceProfileChanges is true Then Should Return Status Code "423" And Should Return Content-Type "application/json" And Response Time Should Be Less Than "${default_response_time_threshold}"ms - [Teardown] Run Keywords Set ProfileChange.StrictDeviceProfileChanges=false For Core-Metadata On Consul + [Teardown] Run Keywords Set ProfileChange.StrictDeviceProfileChanges=false For Core-Metadata On Registry Service ... AND Delete Device Profile By Name Test-Profile-1 ErrProfilePUT009 - Update device profile with invalid units value Given Generate A Device Profile Sample Test-Profile-1 And Create Device Profile ${deviceProfile} - And Update Service Configuration On Consul ${uomValidationPath} true + And Update Configuration On Registry Service ${uomValidationPath} true And Set Profile Units Value To invalid When Update Device Profile ${deviceProfile} Then Should Return Status Code "207" @@ -120,7 +120,7 @@ ErrProfilePUT009 - Update device profile with invalid units value And Should Return Content-Type "application/json" And Response Time Should Be Less Than "${default_response_time_threshold}"ms And Resource Units Should Not Be Updated in Test-Profile-1 - [Teardown] Run Keywords Update Service Configuration On Consul ${uomValidationPath} false + [Teardown] Run Keywords Update Configuration On Registry Service ${uomValidationPath} false ... AND Delete Device Profile By Name Test-Profile-1 *** Keywords *** diff --git a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/PUT-Positive.robot b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/PUT-Positive.robot index 0485cfee..00c492d4 100644 --- a/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/PUT-Positive.robot +++ b/TAF/testScenarios/functionalTest/API/core-metadata/deviceprofile/PUT-Positive.robot @@ -54,7 +54,7 @@ ProfilePUT003 - Update device profiles by upload file ProfilePUT004 - Update a device profile with valid unit value Given Generate A Device Profile Sample Test-Profile-1 And Create Device Profile ${deviceProfile} - And Update Service Configuration On Consul ${uomValidationPath} true + And Update Configuration On Registry Service ${uomValidationPath} true And Set Profile Units Value To valid When Update Device Profile ${deviceProfile} Then Should Return Status Code "207" @@ -62,19 +62,19 @@ ProfilePUT004 - Update a device profile with valid unit value And Item Index 0 Should Contain Status Code "200" And Response Time Should Be Less Than "${default_response_time_threshold}"ms And Resource Units Should Be Updated in Test-Profile-1 - [Teardown] Run Keywords Update Service Configuration On Consul ${uomValidationPath} false + [Teardown] Run Keywords Update Configuration On Registry Service ${uomValidationPath} false ... AND Delete Device Profile By Name Test-Profile-1 ProfilePUT005 - Update device profiles by upload file and the update file contains valid unit value Given Upload Device Profile Test-Profile-2.yaml - And Update Service Configuration On Consul ${uomValidationPath} true + And Update Configuration On Registry Service ${uomValidationPath} true And Update Units Value In Profile Test-Profile-2 To valid When Upload File NEW-Test-Profile-2.yaml To Update Device Profile 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 Resource Units Should Be Updated in Test-Profile-2 - [Teardown] Run Keywords Update Service Configuration On Consul ${uomValidationPath} false + [Teardown] Run Keywords Update Configuration On Registry Service ${uomValidationPath} false ... AND Delete Device Profile By Name Test-Profile-2 ... AND Delete Profile Files NEW-Test-Profile-2.yaml diff --git a/TAF/testScenarios/functionalTest/API/support-notifications/notification/GET-Negative-II.robot b/TAF/testScenarios/functionalTest/API/support-notifications/notification/GET-Negative-II.robot index 09c63af5..ccbd1237 100644 --- a/TAF/testScenarios/functionalTest/API/support-notifications/notification/GET-Negative-II.robot +++ b/TAF/testScenarios/functionalTest/API/support-notifications/notification/GET-Negative-II.robot @@ -42,6 +42,7 @@ ErrNotificationGET013 - Query notifications by start/end time fails (Invalid End ErrNotificationGET014 - Query notifications by start/end time fails (Start>End) ${start}= Get current milliseconds epoch time + Sleep 1ms ${end}= Get current milliseconds epoch time When Run Keyword And Expect Error * Query Notifications By Start/End Time ${end} ${start} Then Should Return Status Code "400" diff --git a/TAF/testScenarios/functionalTest/API/support-notifications/secrets/POST.robot b/TAF/testScenarios/functionalTest/API/support-notifications/secrets/POST.robot index 69c9f876..986fd5d0 100644 --- a/TAF/testScenarios/functionalTest/API/support-notifications/secrets/POST.robot +++ b/TAF/testScenarios/functionalTest/API/support-notifications/secrets/POST.robot @@ -14,7 +14,7 @@ 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 support-notifications Secrets Should be Stored - ... ELSE Secrets Should be Stored To Consul support-notifications + ... ELSE Secrets Should be Stored To Registry Service support-notifications And Response Time Should Be Less Than "${default_response_time_threshold}"ms ErrSecretsPOST001 - Stores secrets to the secret client fails (empty path) diff --git a/TAF/testScenarios/functionalTest/API/support-notifications/transmission/GET-Negative-II.robot b/TAF/testScenarios/functionalTest/API/support-notifications/transmission/GET-Negative-II.robot index 71f7a2bc..03ba3f80 100644 --- a/TAF/testScenarios/functionalTest/API/support-notifications/transmission/GET-Negative-II.robot +++ b/TAF/testScenarios/functionalTest/API/support-notifications/transmission/GET-Negative-II.robot @@ -46,6 +46,7 @@ ErrTransmissionGET013 - Query transmissions by start/end time fails (Invalid End ErrTransmissionGET014 - Query transmissions by start/end time fails (Start>End) ${end} Get current milliseconds epoch time + Sleep 1ms ${start} Get current milliseconds epoch time When Query Transmissions By Start/End Time ${start} ${end} Then Should Return Status Code "400" diff --git a/TAF/testScenarios/functionalTest/API/support-notifications/transmission/GET-Positive-II.robot b/TAF/testScenarios/functionalTest/API/support-notifications/transmission/GET-Positive-II.robot index 54cc7ff1..6ec3c65e 100644 --- a/TAF/testScenarios/functionalTest/API/support-notifications/transmission/GET-Positive-II.robot +++ b/TAF/testScenarios/functionalTest/API/support-notifications/transmission/GET-Positive-II.robot @@ -107,9 +107,9 @@ Create A Subscriptions And Notifications sleep 3s # Waiting for the resend process to finish Set Writable configs: resendInterval=${resendInterval} and resendLimit=${resendLimit} - ${path}= Set variable ${CONSUL_CONFIG_BASE_ENDPOINT}/support-notifications/Writable - Update Service Configuration On Consul ${path}/ResendInterval ${resendInterval} - Update Service Configuration On Consul ${path}/ResendLimit ${resendLimit} + ${path}= Set variable /support-notifications/Writable + Update Configuration On Registry Service ${path}/ResendInterval ${resendInterval} + Update Configuration On Registry Service ${path}/ResendLimit ${resendLimit} Get Transmission Id Query All Transmissions diff --git a/TAF/testScenarios/functionalTest/API/support-scheduler/intervalaction/POST-Positive.robot b/TAF/testScenarios/functionalTest/API/support-scheduler/intervalaction/POST-Positive.robot index 5c13d2ad..19794f97 100644 --- a/TAF/testScenarios/functionalTest/API/support-scheduler/intervalaction/POST-Positive.robot +++ b/TAF/testScenarios/functionalTest/API/support-scheduler/intervalaction/POST-Positive.robot @@ -42,9 +42,9 @@ IntervalactionPOST003 - Create intervalaction with chinese name *** Keywords *** Set support-scheduler configs ScheduleIntervalTime=${millisecond} And LogLevel=${logLevel} - Set Test Variable ${consul_path} ${CONSUL_CONFIG_BASE_ENDPOINT}/support-scheduler - Update Service Configuration On Consul ${consul_path}/Writable/LogLevel ${logLevel} - Update Service Configuration On Consul ${consul_path}/ScheduleIntervalTime ${millisecond} + Set Test Variable ${path} /support-scheduler + Update Configuration On Registry Service ${path}/Writable/LogLevel ${logLevel} + Update Configuration On Registry Service ${path}/ScheduleIntervalTime ${millisecond} Create Pre-Created HalfSecond Interval And PingScheduler Intervalaction By Configs Set Test Variable ${interval_name} HalfSecond @@ -52,11 +52,13 @@ Create Pre-Created HalfSecond Interval And PingScheduler Intervalaction By Confi ${interval}= Create Dictionary Name=${interval_name} Interval=500ms Start=20200101T000000 ${intervalAction}= Create Dictionary Name=${intervalAction_name} Interval=${interval_name} Method=GET Port=59861 ... Host=edgex-support-scheduler Path=/api/${API_VERSION}/ping AdminState=UNLOCKED - FOR ${kv} IN &{interval} - Update Service Configuration On Consul ${consul_path}/Intervals/${interval_name}/${kv}[0] ${kv}[1] + Set Test Variable ${interval_dict} ${interval} + Set Test Variable ${intervalAction_dict} ${intervalAction} + FOR ${kv} IN &{interval_dict} + Update Configuration On Registry Service ${path}/Intervals/${interval_name}/${kv}[0] ${kv}[1] END - FOR ${kv} IN &{intervalAction} - Update Service Configuration On Consul ${consul_path}/IntervalActions/${intervalAction_name}/${kv}[0] ${kv}[1] + FOR ${kv} IN &{intervalAction_dict} + Update Configuration On Registry Service ${path}/IntervalActions/${intervalAction_name}/${kv}[0] ${kv}[1] END Restart Services support-scheduler Wait Until Keyword Succeeds 10x 1s Ping Scheduler Service @@ -64,14 +66,12 @@ Create Pre-Created HalfSecond Interval And PingScheduler Intervalaction By Confi Delete Pre-Created HalfSecond Interval And PingScheduler IntervalAction Delete intervalAction by name ${intervalAction_name} Delete interval by name ${interval_name} - ${consul_token} Run Keyword If $SECURITY_SERVICE_NEEDED == 'true' Get Consul Token - ${headers}= Create Dictionary X-Consul-Token=${consul_token} - ${url} Set Variable http://${BASE_URL}:${REGISTRY_PORT} - Create Session Consul url=${url} disable_warnings=true - DELETE On Session Consul ${consul_path}/IntervalActions/${intervalAction_name} params=recurse=true headers=${headers} - ... expected_status=200 - DELETE On Session Consul ${consul_path}/Intervals/${interval_name} params=recurse=true headers=${headers} - ... expected_status=200 + FOR ${kv} IN &{intervalAction_dict} + Delete Configuration On Registry Service ${path}/IntervalActions/${intervalAction_name}/${kv}[0] + END + FOR ${kv} IN &{interval_dict} + Delete Configuration On Registry Service ${path}/Intervals/${interval_name}/${kv}[0] + END Restart Services support-scheduler Pre-Created Interval And IntervalAction Should Be Created diff --git a/TAF/testScenarios/functionalTest/device-service/common/secrets/POST.robot b/TAF/testScenarios/functionalTest/device-service/common/secrets/POST.robot index 0dc567a4..70a433d5 100644 --- a/TAF/testScenarios/functionalTest/device-service/common/secrets/POST.robot +++ b/TAF/testScenarios/functionalTest/device-service/common/secrets/POST.robot @@ -14,7 +14,7 @@ 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 Consul ${SERVICE_NAME} + ... 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) diff --git a/TAF/testScenarios/integrationTest/UC_CORS_configuration/cors_configuration.robot b/TAF/testScenarios/integrationTest/UC_CORS_configuration/cors_configuration.robot index 45e93257..f271fcd1 100644 --- a/TAF/testScenarios/integrationTest/UC_CORS_configuration/cors_configuration.robot +++ b/TAF/testScenarios/integrationTest/UC_CORS_configuration/cors_configuration.robot @@ -34,7 +34,7 @@ CORS002-Enable CORS and receive an actual request And Header Should Contain ${expected_headers} CORS003-Enable CORS and receive a prefligt request with CORSAllowCredentials=false - [Setup] Run Keywords Set Service.CORSConfiguration.CORSAllowCredentials to false For core-metadata On Consul + [Setup] Run Keywords Set Service.CORSConfiguration.CORSAllowCredentials to false For core-metadata On Registry Service ... AND Restart Services core-metadata ${header_keys} Create List Access-Control-Request-Method Origin ${header_values} Create List GET http://localhost @@ -47,7 +47,7 @@ CORS003-Enable CORS and receive a prefligt request with CORSAllowCredentials=fal And Header Should Not Contain ${unexpected_headers} CORS004-Enable CORS and receive an actual request with CORSAllowCredentials=false - [Setup] Run Keywords Set Service.CORSConfiguration.CORSAllowCredentials to false For core-metadata On Consul + [Setup] Run Keywords Set Service.CORSConfiguration.CORSAllowCredentials to false For core-metadata On Registry Service ... AND Restart Services core-metadata ${header_keys} Create List Access-Control-Request-Method Origin ${header_values} Create List GET http://localhost @@ -66,9 +66,9 @@ CORS005-Not enable CORS And Header Should Not Contain ${unexpected_headers} *** Keywords *** -Set Service.CORSConfiguration.${config} to ${value} For ${service_name} On Consul - ${path}= Set Variable ${CONSUL_CONFIG_BASE_ENDPOINT}/${service_name}/Service/CORSConfiguration/${config} - Update Service Configuration On Consul ${path} ${value} +Set Service.CORSConfiguration.${config} to ${value} For ${service_name} On Registry Service + ${path}= Set Variable /${service_name}/Service/CORSConfiguration/${config} + Update Configuration On Registry Service ${path} ${value} Send ${method} Request With Headers [Arguments] ${header_keys} ${header_values} @@ -104,10 +104,10 @@ Header Should Not Contain END Enable CORS For Individual Service - Set Service.CORSConfiguration.EnableCORS to true For core-metadata On Consul - Set Service.CORSConfiguration.CORSAllowCredentials to true For core-metadata On Consul + Set Service.CORSConfiguration.EnableCORS to true For core-metadata On Registry Service + Set Service.CORSConfiguration.CORSAllowCredentials to true For core-metadata On Registry Service Restart Services core-metadata Disable CORS For Individual Service - Set Service.CORSConfiguration.EnableCORS to false For core-metadata On Consul + Set Service.CORSConfiguration.EnableCORS to false For core-metadata On Registry Service Restart Services core-metadata diff --git a/TAF/testScenarios/integrationTest/UC_URI_for_files/URI_for_files.robot b/TAF/testScenarios/integrationTest/UC_URI_for_files/URI_for_files.robot index a0c54790..f4f56721 100644 --- a/TAF/testScenarios/integrationTest/UC_URI_for_files/URI_for_files.robot +++ b/TAF/testScenarios/integrationTest/UC_URI_for_files/URI_for_files.robot @@ -13,14 +13,14 @@ ${SUITE} URI for files with username-passward in URI *** Test Cases *** URI001-Test UoM URI with username-passward in URI - Given Run Keyword If $SECURITY_SERVICE_NEEDED == 'true' Update core-metadata Configuration On Consul + Given Run Keyword If $SECURITY_SERVICE_NEEDED == 'true' Update core-metadata Configuration On Registry Service When Query UoM Then Should Contain ${content}[uom][units][weights][values] uritest URI002-Test configuration file, device profiles, devices and provision watchers with username-password in URI ${metadata_list} Create List profile device provisionWatcher ${name_list} Create List onvif-camera Camera001 Generic-Onvif-Provision-Watcher - Given Run Keyword If $SECURITY_SERVICE_NEEDED == 'true' Update device-onvif-camera Configuration On Consul + Given Run Keyword If $SECURITY_SERVICE_NEEDED == 'true' Update device-onvif-camera Configuration On Registry Service FOR ${metadata} ${name} IN ZIP ${metadata_list} ${name_list} When Run Keyword If '${metadata}' == 'profile' Query Device Profile By Name ${name} ... ELSE IF '${metadata}' == 'device' Query Device By Name ${name} @@ -31,13 +31,13 @@ URI002-Test configuration file, device profiles, devices and provision watchers URI003-Test Common configuration file with username-password in URI [Setup] Skip If $SECURITY_SERVICE_NEEDED == 'true' - ${path} Set Variable ${CONSUL_CONFIG_BASE_ENDPOINT}/core-command/Writable/LogLevel + ${path} Set Variable /core-command/Writable/LogLevel Given Set Test Variable ${url} ${coreCommandUrl} - FOR ${validate} IN config consul + FOR ${validate} IN config registry When Run Keyword If "${validate}" == "config" Query Config - ... ELSE IF "${validate}" == "consul" Query Service Configuration On Consul ${path} + ... ELSE IF "${validate}" == "registry" Query Configuration On Registry Service ${path} Then Run Keyword If "${validate}" == "config" Should Return Status Code "200" And config - ... ELSE IF "${validate}" == "consul" Should return status code "404" + ... ELSE IF "${validate}" == "registry" Should return status code "404" END *** Keywords *** @@ -54,20 +54,20 @@ Store Secret With HTTP Server To ${service} ${resp}= POST On Session Secrets api/${API_VERSION}/secret json=${secrets_data} headers=${headers} ... expected_status=201 -Update core-metadata Configuration On Consul - ${path} Set Variable ${CONSUL_CONFIG_BASE_ENDPOINT}/core-metadata/UoM/UoMFile +Update core-metadata Configuration On Registry Service + ${path} Set Variable /core-metadata/UoM/UoMFile ${value} Set Variable http://httpd-auth:80/files/uom.yaml?edgexSecretName=httpserver Store Secret With HTTP Server To core-metadata - Update Service Configuration On Consul ${path} ${value} + Update Configuration On Registry Service ${path} ${value} Restart Services core-metadata -Update device-onvif-camera Configuration On Consul +Update device-onvif-camera Configuration On Registry Service ${var_name_list} Create List ProfilesDir DevicesDir ProvisionWatchersDir ${file_list} Create List profile device provisionwatcher Store Secret With HTTP Server To device-onvif-camera FOR ${var_name} ${file} IN ZIP ${var_name_list} ${file_list} - ${path} Set Variable ${CONSUL_CONFIG_BASE_ENDPOINT}/device-onvif-camera/Device/${var_name} + ${path} Set Variable /device-onvif-camera/Device/${var_name} ${value} Set Variable http://httpd-auth:80/files/${file}.json?edgexSecretName=httpserver - Update Service Configuration On Consul ${path} ${value} + Update Configuration On Registry Service ${path} ${value} END Restart Services device-onvif-camera diff --git a/TAF/testScenarios/integrationTest/UC_device_service/device_configuration.robot b/TAF/testScenarios/integrationTest/UC_device_service/device_configuration.robot index 079f727e..60e05512 100644 --- a/TAF/testScenarios/integrationTest/UC_device_service/device_configuration.robot +++ b/TAF/testScenarios/integrationTest/UC_device_service/device_configuration.robot @@ -25,7 +25,7 @@ Config001 - Verify the return value when Data Transform is true and shift field Config002 - Verify the return value when Data Transform is false and shift field is set ${set_data} Create Dictionary ${PREFIX}_DeviceValue_UINT32_RW=4294901760 - Given Set Device DataTransform to false For ${SERVICE_NAME} On Consul + Given Set Device DataTransform to false For ${SERVICE_NAME} On Registry Service And Create Device For ${SERVICE_NAME} With Name Transform-Device-2 And Set specified device ${device_name} write command ${PREFIX}_GenerateDeviceValue_UINT32_RW with ${set_data} When Retrive device data by device ${device_name} and command ${PREFIX}_DeviceValue_UINT32_RW @@ -34,7 +34,7 @@ Config002 - Verify the return value when Data Transform is false and shift field And Response Time Should Be Less Than "${default_response_time_threshold}"ms And Should Be Equal As Integers 4294901760 ${content}[event][readings][0][value] [Teardown] Run Keywords Delete device by name ${device_name} - ... AND Set Device DataTransform to true For ${SERVICE_NAME} On Consul + ... AND Set Device DataTransform to true For ${SERVICE_NAME} On Registry Service Config003 - Verfiy reading contains units when ReadingUnits is true @@ -50,7 +50,7 @@ Config003 - Verfiy reading contains units when ReadingUnits is true Config004 - Verfiy reading contains units when ReadingUnits is false [Tags] backward-skip - Given Set Writable.Reading.ReadingUnits to false For ${SERVICE_NAME} On Consul + Given Set Writable.Reading.ReadingUnits to false For ${SERVICE_NAME} On Registry Service And Create Device For ${SERVICE_NAME} With Name ReadingUnits-False And Retrive Device Data By Device ${device_name} And Command ${PREFIX}_DeviceValue_INT8_R When Query Readings By Device Name ${device_name} @@ -58,19 +58,19 @@ Config004 - Verfiy reading contains units when ReadingUnits is false And Should Not Contain ${content}[readings][0] units And Should Return Content-Type "application/json" And Response Time Should Be Less Than "${default_response_time_threshold}"ms - [Teardown] Run Keywords Set Writable.Reading.ReadingUnits to true For ${SERVICE_NAME} On Consul + [Teardown] Run Keywords Set Writable.Reading.ReadingUnits to true For ${SERVICE_NAME} On Registry Service ... AND Delete Device By Name ${device_name} *** Keywords *** -Set Device ${config} to ${value} For ${service_name} On Consul - ${path}= Set Variable ${CONSUL_CONFIG_BASE_ENDPOINT}/${service_name}/Device/${config} - Update Service Configuration On Consul ${path} ${value} +Set Device ${config} to ${value} For ${service_name} On Registry Service + ${path}= Set Variable /${service_name}/Device/${config} + Update Configuration On Registry Service ${path} ${value} Restart Services device-virtual -Set Writable.Reading.ReadingUnits to ${value} For ${service_name} On Consul - ${path}= Set Variable ${CONSUL_CONFIG_BASE_ENDPOINT}/${service_name}/Writable/Reading/ReadingUnits - Update Service Configuration On Consul ${path} ${value} +Set Writable.Reading.ReadingUnits to ${value} For ${service_name} On Registry Service + ${path}= Set Variable /${service_name}/Writable/Reading/ReadingUnits + Update Configuration On Registry Service ${path} ${value} Retrive device data by device ${device_name} and command ${command} ${timestamp} Get current milliseconds epoch time diff --git a/TAF/testScenarios/integrationTest/UC_device_service/usemessagebus.robot b/TAF/testScenarios/integrationTest/UC_device_service/usemessagebus.robot index b3e9676c..e50e0fb7 100644 --- a/TAF/testScenarios/integrationTest/UC_device_service/usemessagebus.robot +++ b/TAF/testScenarios/integrationTest/UC_device_service/usemessagebus.robot @@ -13,7 +13,7 @@ ${SUITE} Device Service Test When MessageBus Set To True ${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/messagebus_true.log -# No nessecary to update consul, because default setting is MessageBus=true +# No nessecary to update registry service, because default setting is MessageBus=true *** Test Cases *** DeviceService001-Send get command with parameters ds-pushevent=false and ds-returnevent=false Set Test Variable ${device_name} messagebus-true-device-1 @@ -72,7 +72,7 @@ DeviceService005-Customize BaseTopicPrefix works correctly when using Redis mess ${params} Create Dictionary ds-pushevent=true ds-returnevent=true Given Run Redis Subscriber Progress And Output custom.events.device.* ${device_name} And Create Device For device-virtual With Name ${device_name} - And Set BaseTopicPrefix=custom For core-common-config-bootstrapper On Consul + And Set BaseTopicPrefix=custom For core-common-config-bootstrapper On Registry Service When Get device data by device ${device_name} and command ${PREFIX}_GenerateDeviceValue_INT8_RW with ${params} Then Should Return Status Code "200" And event And Event With Device ${device_name} Should Be Received by Redis Subscriber ${subscriber_file} @@ -80,12 +80,12 @@ DeviceService005-Customize BaseTopicPrefix works correctly when using Redis mess [Teardown] Run keywords Delete device by name ${device_name} ... AND Delete all events by age ... AND Terminate Process ${handle_redis} kill=True - ... AND Set BaseTopicPrefix=edgex For core-common-config-bootstrapper On Consul + ... AND Set BaseTopicPrefix=edgex For core-common-config-bootstrapper On Registry Service *** Keywords *** -Set ${config}=${value} For core-common-config-bootstrapper On Consul - ${path}= Set Variable ${CONSUL_CONFIG_BASE_ENDPOINT}/core-common-config-bootstrapper/all-services/MessageBus/${config} - Update Service Configuration On Consul ${path} ${value} +Set ${config}=${value} For core-common-config-bootstrapper On Registry Service + ${path}= Set Variable /core-common-config-bootstrapper/all-services/MessageBus/${config} + Update Configuration On Registry Service ${path} ${value} FOR ${service} IN device-virtual core-data Restart Services ${service} Run Keyword If '${service}' == 'device-virtual' Set Test Variable ${url} ${deviceServiceUrl} diff --git a/TAF/testScenarios/integrationTest/UC_end_to_end/export_store_forward.robot b/TAF/testScenarios/integrationTest/UC_end_to_end/export_store_forward.robot index 1e20c397..231718ad 100644 --- a/TAF/testScenarios/integrationTest/UC_end_to_end/export_store_forward.robot +++ b/TAF/testScenarios/integrationTest/UC_end_to_end/export_store_forward.robot @@ -4,9 +4,9 @@ Resource TAF/testCaseModules/keywords/common/commonKeywords.robot Resource TAF/testCaseModules/keywords/device-sdk/deviceServiceAPI.robot Suite Setup Run keywords Setup Suite ... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token -... AND Modify PersistOnError to true On Consul -Suite Teardown Run keywords Run Teardown Keywords -... AND Modify PersistOnError to false On Consul +... AND Modify PersistOnError to true On Registry Service +Suite Teardown Run keywords Modify PersistOnError to false On Registry Service +... AND Run Teardown Keywords Force Tags MessageBus=redis *** Variables *** @@ -18,7 +18,7 @@ ${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/export_store_and_fo StoreAndForward001 - Stored data is exported after connecting to http server ${configurations} Create Dictionary Enabled=true RetryInterval=3s MaxRetryCount=4 ${device_name} Set Variable store-device-1 - Given Set ${configurations} For app-http-export On Consul + Given Set ${configurations} For app-http-export On Registry Service And Create Device For device-virtual With Name ${device_name} ${timestamp} get current epoch time When Get device data by device ${device_name} and command ${PREFIX}_GenerateDeviceValue_UINT8_RW with ds-pushevent=true @@ -32,7 +32,7 @@ StoreAndForward001 - Stored data is exported after connecting to http server StoreAndForward002 - Stored data is cleared after the maximum configured retires ${configurations} Create Dictionary Enabled=true RetryInterval=3s MaxRetryCount=3 ${device_name} Set Variable store-device-2 - Given Set ${configurations} For app-http-export On Consul + Given Set ${configurations} For app-http-export On Registry Service And Create Device For device-virtual With Name ${device_name} ${timestamp} get current epoch time When Get device data by device ${device_name} and command ${PREFIX}_GenerateDeviceValue_INT16_RW with ds-pushevent=true @@ -45,7 +45,7 @@ StoreAndForward002 - Stored data is cleared after the maximum configured retires StoreAndForward003 - Exporting data didn't retry when Writeable.StoreAndForward.Enabled is false ${configurations} Create Dictionary Enabled=false RetryInterval=1s MaxRetryCount=3 ${device_name} Set Variable store-device-3 - Given Set ${configurations} For app-http-export On Consul + Given Set ${configurations} For app-http-export On Registry Service And Create Device For device-virtual With Name ${device_name} ${timestamp} get current epoch time When Get device data by device ${device_name} and command ${PREFIX}_GenerateDeviceValue_INT32_RW with ds-pushevent=true @@ -57,7 +57,7 @@ StoreAndForward003 - Exporting data didn't retry when Writeable.StoreAndForward. StoreAndForward004 - Retry loop interval is set by the Writeable.StoreAndForward.RetryInterval config setting ${configurations} Create Dictionary Enabled=true RetryInterval=2s MaxRetryCount=4 ${device_name} Set Variable store-device-4 - Given Set ${configurations} For app-http-export On Consul + Given Set ${configurations} For app-http-export On Registry Service And Create Device For device-virtual With Name ${device_name} ${timestamp} get current epoch time When Get device data by device ${device_name} and command ${PREFIX}_GenerateDeviceValue_INT8_RW with ds-pushevent=true @@ -70,7 +70,7 @@ StoreAndForward004 - Retry loop interval is set by the Writeable.StoreAndForward StoreAndForward005 - Export retries will resume after application service is restarted ${configurations} Create Dictionary Enabled=true RetryInterval=3s MaxRetryCount=4 ${device_name} Set Variable store-device-5 - Given Set ${configurations} For app-http-export On Consul + Given Set ${configurations} For app-http-export On Registry Service And Create Device For device-virtual With Name ${device_name} When Get device ${device_name} read command ${PREFIX}_GenerateDeviceValue_UINT16_RW with ds-pushevent=true And Restart app-http-export Service @@ -81,12 +81,12 @@ StoreAndForward005 - Export retries will resume after application service is res *** Keywords *** -Set ${configurations} For ${service_name} On Consul +Set ${configurations} For ${service_name} On Registry Service ${config_key} Get Dictionary Keys ${configurations} sort_keys=false ${config_value} Get Dictionary Values ${configurations} sort_keys=false FOR ${key} ${value} IN ZIP ${config_key} ${config_value} - ${path}= Set Variable ${CONSUL_CONFIG_BASE_ENDPOINT}/${service_name}/Writable/StoreAndForward/${key} - Update Service Configuration On Consul ${path} ${value} + ${path}= Set Variable /${service_name}/Writable/StoreAndForward/${key} + Update Configuration On Registry Service ${path} ${value} END Start HTTP Server And Received Exported Data Contains ${keyword} @@ -120,9 +120,9 @@ Found Remove Log In ${service_name} Logs From ${timestamp} ${retry_times} Get Line Count ${retry_lines} Should Be Equal As Integers ${retry_times} 1 -Modify PersistOnError to ${value} On Consul - ${path} Set Variable ${CONSUL_CONFIG_BASE_ENDPOINT}/app-http-export/Writable/Pipeline/Functions/HTTPExport/Parameters/PersistOnError - Update Service Configuration On Consul ${path} ${value} +Modify PersistOnError to ${value} On Registry Service + ${path} Set Variable /app-http-export/Writable/Pipeline/Functions/HTTPExport/Parameters/PersistOnError + Update Configuration On Registry Service ${path} ${value} Found Retry Log From ${timestamp} After Restarting ${service_name} # Show last 100 lines for debug diff --git a/TAF/testScenarios/integrationTest/UC_metrics/app_services_metrics_mqtt.robot b/TAF/testScenarios/integrationTest/UC_metrics/app_services_metrics_mqtt.robot index c560de1c..e89334fb 100644 --- a/TAF/testScenarios/integrationTest/UC_metrics/app_services_metrics_mqtt.robot +++ b/TAF/testScenarios/integrationTest/UC_metrics/app_services_metrics_mqtt.robot @@ -4,11 +4,13 @@ Resource TAF/testCaseModules/keywords/device-sdk/deviceServiceAPI.robot Resource TAF/testCaseModules/keywords/common/metrics.robot Suite Setup Run keywords Setup Suite ... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token -... AND Set Telemetry Interval=${interval}s For app-sample On Consul -... AND Update Service Configuration On Consul ${CONSUL_CONFIG_BASE_ENDPOINT}/app-sample/Writable/LogLevel DEBUG +... AND Set Telemetry Interval=${interval}s For ${APP_SERVICE_NAME} On Registry Service +... AND Update Configuration On Registry Service /${APP_SERVICE_NAME}/Writable/LogLevel DEBUG +... AND Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} Suite Teardown Run keywords Terminate All Processes ... AND Delete all events by age -... AND Set Telemetry Interval=30s For app-sample On Consul +... AND Set Telemetry Interval=30s For ${APP_SERVICE_NAME} On Registry Service +... AND Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} ... AND Run Teardown Keywords Force Tags backward-skip MessageBus=MQTT @@ -26,7 +28,7 @@ ${FLOAT32_CMD} ${PREFIX}_GenerateDeviceValue_FLOAT32_RW *** Test Cases *** APPServicesMetricsMQTT001-No Telemery Metrics isn't Published to MessageBus - Given Run MQTT Subscriber Progress And Output edgex/telemetry/app-sample/# payload + Given Run MQTT Subscriber Progress And Output edgex/telemetry/${APP_SERVICE_NAME}/# payload And Set Test Variable ${device_name} telemetry-metrics And Set All Telemetry Metrics To False And Create Device For device-virtual With Name ${device_name} @@ -39,10 +41,11 @@ APPServicesMetricsMQTT001-No Telemery Metrics isn't Published to MessageBus APPServicesMetricsMQTT002-Enable HttpExportSize And Verify Metrics is Publish to MessageBus ${handle_http} Start process python ${WORK_DIR}/TAF/utils/src/setup/httpd_server.py & shell=True # Start HTTP Server Sleep 1s # Waiting for Http Server startup - Given Run MQTT Subscriber Progress And Output edgex/telemetry/app-sample/HttpExportSize payload 2 + Given Run MQTT Subscriber Progress And Output edgex/telemetry/${APP_SERVICE_NAME}/HttpExportSize payload 2 And Set Test Variable ${device_name} http-export-size - And Set app-sample Functions HTTPExport - And Set Telemetry Metrics/HttpExportSize=true For app-sample On Consul + And Set ${APP_SERVICE_NAME} Functions HTTPExport + And Set Telemetry Metrics/HttpExportSize=true For ${APP_SERVICE_NAME} On Registry Service + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} And Create Device For device-virtual With Name ${device_name} When Get device data by device ${device_name} and command ${INT8_CMD} with ds-pushevent=true And Sleep ${interval} @@ -50,98 +53,111 @@ APPServicesMetricsMQTT002-Enable HttpExportSize And Verify Metrics is Publish to [Teardown] Run keywords Delete device by name ${device_name} ... AND Terminate Process ${handle_http} kill=True ... AND Terminate Process ${handle_mqtt} kill=True - ... AND Set Telemetry Metrics/HttpExportSize=false For app-sample On Consul - ... AND Set app-sample Functions FilterByProfileName, FilterByDeviceName, FilterByResourceName, TransformXml, SetResponseData + ... AND Set Telemetry Metrics/HttpExportSize=false For ${APP_SERVICE_NAME} On Registry Service + ... AND Set ${APP_SERVICE_NAME} Functions FilterByProfileName, FilterByDeviceName, FilterByResourceName, TransformXml, SetResponseData + ... AND Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} APPServicesMetricsMQTT003-Enable MqttExportSize And Verify Metrics is Publish to MessageBus - Given Run MQTT Subscriber Progress And Output edgex/telemetry/app-sample/MqttExportSize payload + Given Run MQTT Subscriber Progress And Output edgex/telemetry/${APP_SERVICE_NAME}/MqttExportSize payload And Set Test Variable ${device_name} mqtt-export-size - And Set app-sample Functions MQTTExport - And Set Telemetry Metrics/MqttExportSize=true For app-sample On Consul + And Set ${APP_SERVICE_NAME} Functions MQTTExport + And Set Telemetry Metrics/MqttExportSize=true For ${APP_SERVICE_NAME} On Registry Service + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} And Create Device For device-virtual With Name ${device_name} When Get device data by device ${device_name} and command ${INT8_CMD} with ds-pushevent=true And Sleep ${interval} Then Metrics MqttExportSize With histogram-count Should Be Received [Teardown] Run keywords Delete device by name ${device_name} ... AND Terminate Process ${handle_mqtt} kill=True - ... AND Set Telemetry Metrics/MqttExportSize=false For app-sample On Consul - ... AND Set app-sample Functions FilterByProfileName, FilterByDeviceName, FilterByResourceName, TransformXml, SetResponseData + ... AND Set Telemetry Metrics/MqttExportSize=false For ${APP_SERVICE_NAME} On Registry Service + ... AND Set ${APP_SERVICE_NAME} Functions FilterByProfileName, FilterByDeviceName, FilterByResourceName, TransformXml, SetResponseData + ... AND Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} APPServicesMetricsMQTT004-Enable MessagesReceived And Verify Metrics is Publish to MessageBus - Given Run MQTT Subscriber Progress And Output edgex/telemetry/app-sample/MessagesReceived payload + Given Run MQTT Subscriber Progress And Output edgex/telemetry/${APP_SERVICE_NAME}/MessagesReceived payload And Set Test Variable ${device_name} message-received - And Set Telemetry Metrics/MessagesReceived=true For app-sample On Consul + And Set Telemetry Metrics/MessagesReceived=true For ${APP_SERVICE_NAME} On Registry Service + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} And Create Device For device-virtual With Name ${device_name} When Get device data by device ${device_name} and command ${INT8_CMD} with ds-pushevent=true And Sleep ${interval} Then Metrics MessagesReceived With counter-count Should Be Received [Teardown] Run keywords Delete device by name ${device_name} ... AND Terminate Process ${handle_mqtt} kill=True - ... AND Set Telemetry Metrics/MessagesReceived=false For app-sample On Consul + ... AND Set Telemetry Metrics/MessagesReceived=false For ${APP_SERVICE_NAME} On Registry Service + ... AND Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} APPServicesMetricsMQTT005-Enable InvalidMessagesReceived And Verify Metrics is Publish to MessageBus ${publish_msg} Set Variable Invalid Message - Given Run MQTT Subscriber Progress And Output edgex/telemetry/app-sample/InvalidMessagesReceived payload 2 + Given Run MQTT Subscriber Progress And Output edgex/telemetry/${APP_SERVICE_NAME}/InvalidMessagesReceived payload 2 And Set Test Variable ${device_name} invalid-message-received And Create Device For device-virtual With Name ${device_name} - And Set Telemetry Metrics/InvalidMessagesReceived=true For app-sample On Consul + And Set Telemetry Metrics/InvalidMessagesReceived=true For ${APP_SERVICE_NAME} On Registry Service + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} When Run process python ${WORK_DIR}/TAF/utils/src/setup/mqtt-publisher.py edgex/events/${device_name} "${publish_msg}" ${BROKER_PORT} ${SECURITY_SERVICE_NEEDED} ... shell=True timeout=10s And Sleep ${interval_ex} Then Metrics InvalidMessagesReceived With counter-count Should Be Received [Teardown] Run keywords Terminate Process ${handle_mqtt} kill=True # Stop MQTT Subscribe Process - ... AND Set Telemetry Metrics/InvalidMessagesReceived=false For app-sample On Consul + ... AND Set Telemetry Metrics/InvalidMessagesReceived=false For ${APP_SERVICE_NAME} On Registry Service + ... AND Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} APPServicesMetricsMQTT006-Enable PipelineMessagesProcessed And Verify Metrics is Publish to MessageBus Given Set Test Variable ${device_name} pipeline-messages-processed - And Set Topics For app-samle PerTopicPipelines On Consul + And Set Topics For ${APP_SERVICE_NAME} PerTopicPipelines On Registry Service And Create Device For device-virtual With Name ${device_name} - And Run MQTT Subscriber Progress And Output edgex/telemetry/app-sample/PipelineMessagesProcessed payload 6 - And Set Telemetry Metrics/PipelineMessagesProcessed=true For app-sample On Consul + And Run MQTT Subscriber Progress And Output edgex/telemetry/${APP_SERVICE_NAME}/PipelineMessagesProcessed payload 6 + And Set Telemetry Metrics/PipelineMessagesProcessed=true For ${APP_SERVICE_NAME} On Registry Service + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} When Get Multiple Device Data With Commands ${COMMANDS} And Sleep ${interval_ex} - Then Recieved Metrics PipelineMessagesProcessed For All Pipelines And counter-count Should Not Be 0 + Then Received Metrics PipelineMessagesProcessed For All Pipelines And counter-count Should Not Be 0 [Teardown] Run keywords Delete device by name ${device_name} ... AND Terminate Process ${handle_mqtt} kill=True - ... AND Set Telemetry Metrics/PipelineMessagesProcessed=false For app-sample On Consul + ... AND Set Telemetry Metrics/PipelineMessagesProcessed=false For ${APP_SERVICE_NAME} On Registry Service + ... AND Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} APPServicesMetricsMQTT007-Enable PipelineMessageProcessingTime And Verify Metrics is Publish to MessageBus Given Set Test Variable ${device_name} pipeline-messages-processing-time - And Set Topics For app-samle PerTopicPipelines On Consul + And Set Topics For ${APP_SERVICE_NAME} PerTopicPipelines On Registry Service And Create Device For device-virtual With Name ${device_name} - And Run MQTT Subscriber Progress And Output edgex/telemetry/app-sample/PipelineMessageProcessingTime payload 6 - And Set Telemetry Metrics/PipelineMessageProcessingTime=true For app-sample On Consul + And Run MQTT Subscriber Progress And Output edgex/telemetry/${APP_SERVICE_NAME}/PipelineMessageProcessingTime payload 6 + And Set Telemetry Metrics/PipelineMessageProcessingTime=true For ${APP_SERVICE_NAME} On Registry Service + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} When Get Multiple Device Data With Commands ${COMMANDS} And Sleep ${interval_ex} - Then Recieved Metrics PipelineMessageProcessingTime For All Pipelines And timer-count Should Not Be 0 + Then Received Metrics PipelineMessageProcessingTime For All Pipelines And timer-count Should Not Be 0 [Teardown] Run keywords Delete device by name ${device_name} ... AND Terminate Process ${handle_mqtt} kill=True - ... AND Set Telemetry Metrics/PipelineMessageProcessingTime=false For app-sample On Consul + ... AND Set Telemetry Metrics/PipelineMessageProcessingTime=false For ${APP_SERVICE_NAME} On Registry Service + ... AND Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} APPServicesMetricsMQTT008-Enable PipelineProcessingErrors And Verify Metrics is Publish to MessageBus Given Set Test Variable ${device_name} pipeline-processing-errors - And Set app-sample Functions HTTPExport + And Set ${APP_SERVICE_NAME} Functions HTTPExport And Set PerTopicPipelines float ExecutionOrder HTTPExport And Set PerTopicPipelines int8-16 ExecutionOrder HTTPExport - And Set Topics For app-samle PerTopicPipelines On Consul + And Set Topics For ${APP_SERVICE_NAME} PerTopicPipelines On Registry Service And Create Device For device-virtual With Name ${device_name} - And Run MQTT Subscriber Progress And Output edgex/telemetry/app-sample/PipelineProcessingErrors payload 6 - And Set Telemetry Metrics/PipelineProcessingErrors=true For app-sample On Consul + And Run MQTT Subscriber Progress And Output edgex/telemetry/${APP_SERVICE_NAME}/PipelineProcessingErrors payload 6 + And Set Telemetry Metrics/PipelineProcessingErrors=true For ${APP_SERVICE_NAME} On Registry Service + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} When Get Multiple Device Data With Commands ${COMMANDS} And Sleep ${interval_ex} - Then Recieved Metrics PipelineProcessingErrors For All Pipelines And counter-count Should Not Be 0 + Then Received Metrics PipelineProcessingErrors For All Pipelines And counter-count Should Not Be 0 [Teardown] Run keywords Delete device by name ${device_name} ... AND Terminate Process ${handle_mqtt} kill=True - ... AND Set Telemetry Metrics/PipelineProcessingErrors=false For app-sample On Consul - ... AND Set app-sample Functions FilterByProfileName, FilterByDeviceName, FilterByResourceName, TransformXml, SetResponseData + ... AND Set Telemetry Metrics/PipelineProcessingErrors=false For ${APP_SERVICE_NAME} On Registry Service + ... AND Set ${APP_SERVICE_NAME} Functions FilterByProfileName, FilterByDeviceName, FilterByResourceName, TransformXml, SetResponseData ... AND Set PerTopicPipelines float ExecutionOrder TransformJson, SetResponseData ... AND Set PerTopicPipelines int8-16 ExecutionOrder TransformXml, Compress, SetResponseData + ... AND Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} *** Keywords *** Set All Telemetry Metrics To False ${range} Get Length ${APP_METRICS} FOR ${INDEX} IN RANGE ${range} - Set Telemetry Metrics/${APP_METRICS}[${INDEX}]=false For app-sample On Consul + Set Telemetry Metrics/${APP_METRICS}[${INDEX}]=false For ${APP_SERVICE_NAME} On Registry Service END Get Multiple Device Data With Commands ${commands} diff --git a/TAF/testScenarios/integrationTest/UC_metrics/app_services_metrics_redis.robot b/TAF/testScenarios/integrationTest/UC_metrics/app_services_metrics_redis.robot index fe2067b8..6f2d3532 100644 --- a/TAF/testScenarios/integrationTest/UC_metrics/app_services_metrics_redis.robot +++ b/TAF/testScenarios/integrationTest/UC_metrics/app_services_metrics_redis.robot @@ -4,11 +4,11 @@ Resource TAF/testCaseModules/keywords/device-sdk/deviceServiceAPI.robot Resource TAF/testCaseModules/keywords/common/metrics.robot Suite Setup Run keywords Setup Suite ... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token -... AND Set Telemetry Interval=${interval}s For app-sample On Consul -... AND Update Service Configuration On Consul ${CONSUL_CONFIG_BASE_ENDPOINT}/app-sample/Writable/LogLevel DEBUG +... AND Set Telemetry Interval=${interval}s For ${APP_SERVICE_NAME} On Registry Service +... AND Update Configuration On Registry Service /${APP_SERVICE_NAME}/Writable/LogLevel DEBUG Suite Teardown Run keywords Terminate All Processes ... AND Delete all events by age -... AND Set Telemetry Interval=30s For app-sample On Consul +... AND Set Telemetry Interval=30s For ${APP_SERVICE_NAME} On Registry Service ... AND Run Teardown Keywords Force Tags backward-skip MessageBus=redis @@ -26,7 +26,7 @@ ${FLOAT32_CMD} ${PREFIX}_GenerateDeviceValue_FLOAT32_RW *** Test Cases *** APPServicesMetricsRedis001-No Telemery Metrics isn't Published to MessageBus - Given Run Redis Subscriber Progress And Output edgex.telemetry.app-sample.# telemetry + Given Run Redis Subscriber Progress And Output edgex.telemetry.${APP_SERVICE_NAME}.# telemetry And Set Test Variable ${device_name} telemetry-metrics And Set All Telemetry Metrics To False And Create Device For device-virtual With Name ${device_name} @@ -39,10 +39,11 @@ APPServicesMetricsRedis001-No Telemery Metrics isn't Published to MessageBus APPServicesMetricsRedis002-Enable HttpExportSize And Verify Metrics is Publish to MessageBus ${handle_http} Start process python ${WORK_DIR}/TAF/utils/src/setup/httpd_server.py & shell=True # Start HTTP Server Sleep 1s # Waiting for Http Server startup - Given Run Redis Subscriber Progress And Output edgex.telemetry.app-sample.HttpExportSize telemetry + Given Run Redis Subscriber Progress And Output edgex.telemetry.${APP_SERVICE_NAME}.HttpExportSize telemetry And Set Test Variable ${device_name} http-export-size - And Set app-sample Functions HTTPExport - And Set Telemetry Metrics/HttpExportSize=true For app-sample On Consul + And Set ${APP_SERVICE_NAME} Functions HTTPExport + And Set Telemetry Metrics/HttpExportSize=true For ${APP_SERVICE_NAME} On Registry Service + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} And Create Device For device-virtual With Name ${device_name} When Get device data by device ${device_name} and command ${INT8_CMD} with ds-pushevent=true And Sleep ${interval} @@ -50,98 +51,105 @@ APPServicesMetricsRedis002-Enable HttpExportSize And Verify Metrics is Publish t [Teardown] Run keywords Delete device by name ${device_name} ... AND Terminate Process ${handle_http} kill=True ... AND Terminate Process ${handle_redis} kill=True - ... AND Set Telemetry Metrics/HttpExportSize=false For app-sample On Consul - ... AND Set app-sample Functions FilterByProfileName, FilterByDeviceName, FilterByResourceName, TransformXml, SetResponseData + ... AND Set Telemetry Metrics/HttpExportSize=false For ${APP_SERVICE_NAME} On Registry Service + ... AND Set ${APP_SERVICE_NAME} Functions FilterByProfileName, FilterByDeviceName, FilterByResourceName, TransformXml, SetResponseData APPServicesMetricsRedis003-Enable MqttExportSize And Verify Metrics is Publish to MessageBus - Given Run Redis Subscriber Progress And Output edgex.telemetry.app-sample.MqttExportSize telemetry + Given Run Redis Subscriber Progress And Output edgex.telemetry.${APP_SERVICE_NAME}.MqttExportSize telemetry And Set Test Variable ${device_name} mqtt-export-size - And Set app-sample Functions MQTTExport - And Set Telemetry Metrics/MqttExportSize=true For app-sample On Consul + And Set ${APP_SERVICE_NAME} Functions MQTTExport + And Set Telemetry Metrics/MqttExportSize=true For ${APP_SERVICE_NAME} On Registry Service + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} And Create Device For device-virtual With Name ${device_name} When Get device data by device ${device_name} and command ${INT8_CMD} with ds-pushevent=true And Sleep ${interval} Then Metrics MqttExportSize With histogram-count Should Be Received [Teardown] Run keywords Delete device by name ${device_name} ... AND Terminate Process ${handle_redis} kill=True - ... AND Set Telemetry Metrics/MqttExportSize=false For app-sample On Consul - ... AND Set app-sample Functions FilterByProfileName, FilterByDeviceName, FilterByResourceName, TransformXml, SetResponseData + ... AND Set Telemetry Metrics/MqttExportSize=false For ${APP_SERVICE_NAME} On Registry Service + ... AND Set ${APP_SERVICE_NAME} Functions FilterByProfileName, FilterByDeviceName, FilterByResourceName, TransformXml, SetResponseData APPServicesMetricsRedis004-Enable MessagesReceived And Verify Metrics is Publish to MessageBus - Given Run Redis Subscriber Progress And Output edgex.telemetry.app-sample.MessagesReceived telemetry + Given Run Redis Subscriber Progress And Output edgex.telemetry.${APP_SERVICE_NAME}.MessagesReceived telemetry And Set Test Variable ${device_name} message-received - And Set Telemetry Metrics/MessagesReceived=true For app-sample On Consul + And Set Telemetry Metrics/MessagesReceived=true For ${APP_SERVICE_NAME} On Registry Service + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} And Create Device For device-virtual With Name ${device_name} When Get device data by device ${device_name} and command ${INT8_CMD} with ds-pushevent=true And Sleep ${interval} Then Metrics MessagesReceived With counter-count Should Be Received [Teardown] Run keywords Delete device by name ${device_name} ... AND Terminate Process ${handle_redis} kill=True - ... AND Set Telemetry Metrics/MessagesReceived=false For app-sample On Consul + ... AND Set Telemetry Metrics/MessagesReceived=false For ${APP_SERVICE_NAME} On Registry Service APPServicesMetricsRedis005-Enable InvalidMessagesReceived And Verify Metrics is Publish to MessageBus ${publish_msg} Set Variable Invalid Message - Given Run Redis Subscriber Progress And Output edgex.telemetry.app-sample.InvalidMessagesReceived telemetry 2 + Given Run Redis Subscriber Progress And Output edgex.telemetry.${APP_SERVICE_NAME}.InvalidMessagesReceived telemetry 2 And Set Test Variable ${device_name} invalid-message-received And Create Device For device-virtual With Name ${device_name} - And Set Telemetry Metrics/InvalidMessagesReceived=true For app-sample On Consul + And Set Telemetry Metrics/InvalidMessagesReceived=true For ${APP_SERVICE_NAME} On Registry Service + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} When Run process python ${WORK_DIR}/TAF/utils/src/setup/redis-publisher.py edgex.events.${device_name} "${publish_msg}" ${SECURITY_SERVICE_NEEDED} ... shell=True timeout=10s And Sleep ${interval_ex} Then Metrics InvalidMessagesReceived With counter-count Should Be Received [Teardown] Run keywords Terminate Process ${handle_redis} kill=True - ... AND Set Telemetry Metrics/InvalidMessagesReceived=false For app-sample On Consul + ... AND Set Telemetry Metrics/InvalidMessagesReceived=false For ${APP_SERVICE_NAME} On Registry Service APPServicesMetricsRedis006-Enable PipelineMessagesProcessed And Verify Metrics is Publish to MessageBus - Given Run Redis Subscriber Progress And Output edgex.telemetry.app-sample.PipelineMessagesProcessed telemetry 9 + Given Run Redis Subscriber Progress And Output edgex.telemetry.${APP_SERVICE_NAME}.PipelineMessagesProcessed telemetry 9 And Set Test Variable ${device_name} pipeline-messages-processed - And Set Topics For app-samle PerTopicPipelines On Consul - And Set Telemetry Metrics/PipelineMessagesProcessed=true For app-sample On Consul + And Set Topics For ${APP_SERVICE_NAME} PerTopicPipelines On Registry Service + And Set Telemetry Metrics/PipelineMessagesProcessed=true For ${APP_SERVICE_NAME} On Registry Service + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} And Create Device For device-virtual With Name ${device_name} When Get Multiple Device Data With Commands ${COMMANDS} And Sleep ${interval_ex} - Then Recieved Metrics PipelineMessagesProcessed For All Pipelines And counter-count Should Not Be 0 + Then Received Metrics PipelineMessagesProcessed For All Pipelines And counter-count Should Not Be 0 [Teardown] Run keywords Delete device by name ${device_name} ... AND Terminate Process ${handle_redis} kill=True - ... AND Set Telemetry Metrics/PipelineMessagesProcessed=false For app-sample On Consul + ... AND Set Telemetry Metrics/PipelineMessagesProcessed=false For ${APP_SERVICE_NAME} On Registry Service APPServicesMetricsRedis007-Enable PipelineMessageProcessingTime And Verify Metrics is Publish to MessageBus - Given Run Redis Subscriber Progress And Output edgex.telemetry.app-sample.PipelineMessageProcessingTime telemetry 9 + Given Run Redis Subscriber Progress And Output edgex.telemetry.${APP_SERVICE_NAME}.PipelineMessageProcessingTime telemetry 9 And Set Test Variable ${device_name} pipeline-messages-processing-time - And Set Topics For app-samle PerTopicPipelines On Consul + And Set Topics For ${APP_SERVICE_NAME} PerTopicPipelines On Registry Service And Create Device For device-virtual With Name ${device_name} - And Set Telemetry Metrics/PipelineMessageProcessingTime=true For app-sample On Consul + And Set Telemetry Metrics/PipelineMessageProcessingTime=true For ${APP_SERVICE_NAME} On Registry Service + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} When Get Multiple Device Data With Commands ${COMMANDS} And Sleep ${interval_ex} - Then Recieved Metrics PipelineMessageProcessingTime For All Pipelines And timer-count Should Not Be 0 + Then Received Metrics PipelineMessageProcessingTime For All Pipelines And timer-count Should Not Be 0 [Teardown] Run keywords Delete device by name ${device_name} ... AND Terminate Process ${handle_redis} kill=True - ... AND Set Telemetry Metrics/PipelineMessageProcessingTime=false For app-sample On Consul + ... AND Set Telemetry Metrics/PipelineMessageProcessingTime=false For ${APP_SERVICE_NAME} On Registry Service APPServicesMetricsRedis008-Enable PipelineProcessingErrors And Verify Metrics is Publish to MessageBus - Given Run Redis Subscriber Progress And Output edgex.telemetry.app-sample.PipelineProcessingErrors telemetry 9 + Given Run Redis Subscriber Progress And Output edgex.telemetry.${APP_SERVICE_NAME}.PipelineProcessingErrors telemetry 9 And Set Test Variable ${device_name} pipeline-processing-errors - And Set app-sample Functions HTTPExport + And Set ${APP_SERVICE_NAME} Functions HTTPExport And Set PerTopicPipelines float ExecutionOrder HTTPExport And Set PerTopicPipelines int8-16 ExecutionOrder HTTPExport - And Set Topics For app-samle PerTopicPipelines On Consul - And Set Telemetry Metrics/PipelineProcessingErrors=true For app-sample On Consul + And Set Topics For ${APP_SERVICE_NAME} PerTopicPipelines On Registry Service + And Set Telemetry Metrics/PipelineProcessingErrors=true For ${APP_SERVICE_NAME} On Registry Service + And Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} And Create Device For device-virtual With Name ${device_name} When Get Multiple Device Data With Commands ${COMMANDS} And Sleep ${interval_ex} - Then Recieved Metrics PipelineProcessingErrors For All Pipelines And counter-count Should Not Be 0 + Then Received Metrics PipelineProcessingErrors For All Pipelines And counter-count Should Not Be 0 [Teardown] Run keywords Delete device by name ${device_name} ... AND Terminate Process ${handle_redis} kill=True - ... AND Set Telemetry Metrics/PipelineProcessingErrors=false For app-sample On Consul - ... AND Set app-sample Functions FilterByProfileName, FilterByDeviceName, FilterByResourceName, TransformXml, SetResponseData + ... AND Set Telemetry Metrics/PipelineProcessingErrors=false For ${APP_SERVICE_NAME} On Registry Service + ... AND Set ${APP_SERVICE_NAME} Functions FilterByProfileName, FilterByDeviceName, FilterByResourceName, TransformXml, SetResponseData ... AND Set PerTopicPipelines float ExecutionOrder TransformJson, SetResponseData ... AND Set PerTopicPipelines int8-16 ExecutionOrder TransformXml, Compress, SetResponseData + ... AND Run Keyword If "${REGISTRY_SERVICE}" == "Keeper" Restart Services ${APP_SERVICE_NAME} *** Keywords *** Set All Telemetry Metrics To False ${range} Get Length ${APP_METRICS} FOR ${INDEX} IN RANGE ${range} - Set Telemetry Metrics/${APP_METRICS}[${INDEX}]=false For app-sample On Consul + Set Telemetry Metrics/${APP_METRICS}[${INDEX}]=false For ${APP_SERVICE_NAME} On Registry Service END Get Multiple Device Data With Commands ${commands} diff --git a/TAF/testScenarios/integrationTest/UC_metrics/core_data_metrics_mqtt.robot b/TAF/testScenarios/integrationTest/UC_metrics/core_data_metrics_mqtt.robot index 1abd8480..abc5b9ee 100644 --- a/TAF/testScenarios/integrationTest/UC_metrics/core_data_metrics_mqtt.robot +++ b/TAF/testScenarios/integrationTest/UC_metrics/core_data_metrics_mqtt.robot @@ -6,36 +6,36 @@ Resource TAF/testCaseModules/keywords/device-sdk/deviceServiceAPI.robot Suite Setup Run keywords Setup Suite ... AND Set Suite Variable ${interval} 2 ... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token -... AND Set Telemetry Interval=${interval}s For core-data On Consul +... AND Set Telemetry Interval=${interval}s For ${TEST_SERVICE} On Registry Service Suite Teardown Run keywords Terminate All Processes ... AND Delete all events by age -... AND Set Telemetry Interval=30s For core-data On Consul +... AND Set Telemetry Interval=30s For ${TEST_SERVICE} On Registry Service ... AND Run Teardown Keywords Force Tags MessageBus=MQTT backward-skip *** Variables *** ${SUITE} Core Data Metrics Test - MQTT bus ${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/core_data_metrics_mqtt.log - +${TEST_SERVICE} core-data *** Test Cases *** DataMetricsMQTT001-Enable EventsPersisted And Verify Metrics is Publish to MessageBus - Given Run MQTT Subscriber Progress And Output edgex/telemetry/core-data/EventsPersisted payload + Given Run MQTT Subscriber Progress And Output edgex/telemetry/${TEST_SERVICE}/EventsPersisted payload 2 And Set Test Variable ${device_name} events-persisted-true - And Set Telemetry Metrics/EventsPersisted=true For core-data On Consul + And Set Telemetry Metrics/EventsPersisted=true For ${TEST_SERVICE} On Registry Service And Create Device For device-virtual With Name ${device_name} When Create multiple events And Sleep ${interval} Then Metrics EventsPersisted With counter-count Should Be Received [Teardown] Run keywords Delete device by name ${device_name} ... AND Terminate Process ${handle_mqtt} kill=True - ... AND Set Telemetry Metrics/EventsPersisted=false For core-data On Consul + ... AND Set Telemetry Metrics/EventsPersisted=false For ${TEST_SERVICE} On Registry Service DataMetricsMQTT002-Disable EventsPersisted And Verify Metrics isn't Publish to MessageBus - Given Run MQTT Subscriber Progress And Output edgex/telemetry/core-data/EventsPersisted payload + Given Run MQTT Subscriber Progress And Output edgex/telemetry/${TEST_SERVICE}/EventsPersisted payload 2 And Set Test Variable ${device_name} events-persisted-false - And Set Telemetry Metrics/EventsPersisted=false For core-data On Consul + And Set Telemetry Metrics/EventsPersisted=false For ${TEST_SERVICE} On Registry Service And Create Device For device-virtual With Name ${device_name} When Create multiple events And Sleep ${interval} @@ -44,25 +44,24 @@ DataMetricsMQTT002-Disable EventsPersisted And Verify Metrics isn't Publish to M ... AND Terminate Process ${handle_mqtt} kill=True DataMetricsMQTT003-Enable ReadingsPersisted And Verify Metrics is Publish to MessageBus - Given Run MQTT Subscriber Progress And Output edgex/telemetry/core-data/ReadingsPersisted payload + Given Run MQTT Subscriber Progress And Output edgex/telemetry/${TEST_SERVICE}/ReadingsPersisted payload 2 And Set Test Variable ${device_name} readings-persisted-true - And Set Telemetry Metrics/ReadingsPersisted=true For core-data On Consul + And Set Telemetry Metrics/ReadingsPersisted=true For ${TEST_SERVICE} On Registry Service And Create Device For device-virtual With Name ${device_name} When Create multiple events And Sleep ${interval} Then Metrics ReadingsPersisted With counter-count Should Be Received [Teardown] Run keywords Delete device by name ${device_name} ... AND Terminate Process ${handle_mqtt} kill=True - ... AND Set Telemetry Metrics/ReadingsPersisted=false For core-data On Consul + ... AND Set Telemetry Metrics/ReadingsPersisted=false For ${TEST_SERVICE} On Registry Service DataMetricsMQTT004-Disable ReadingsPersisted And Verify Metrics isn't Publish to MessageBus - Given Run MQTT Subscriber Progress And Output edgex/telemetry/core-data/ReadingsPersisted payload + Given Run MQTT Subscriber Progress And Output edgex/telemetry/${TEST_SERVICE}/ReadingsPersisted payload 2 And Set Test Variable ${device_name} readings-persisted-false - And Set Telemetry Metrics/ReadingsPersisted=false For core-data On Consul + And Set Telemetry Metrics/ReadingsPersisted=false For ${TEST_SERVICE} On Registry Service And Create Device For device-virtual With Name ${device_name} When Create multiple events And Sleep ${interval} Then No Metrics With Name ReadingsPersisted Received [Teardown] Run keywords Delete device by name ${device_name} ... AND Terminate Process ${handle_mqtt} kill=True - diff --git a/TAF/testScenarios/integrationTest/UC_metrics/core_data_metrics_redis.robot b/TAF/testScenarios/integrationTest/UC_metrics/core_data_metrics_redis.robot index 90756768..62bea560 100644 --- a/TAF/testScenarios/integrationTest/UC_metrics/core_data_metrics_redis.robot +++ b/TAF/testScenarios/integrationTest/UC_metrics/core_data_metrics_redis.robot @@ -6,35 +6,36 @@ Resource TAF/testCaseModules/keywords/device-sdk/deviceServiceAPI.robot Suite Setup Run keywords Setup Suite ... AND Set Suite Variable ${interval} 2 ... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token -... AND Set Telemetry Interval=${interval}s For core-data On Consul +... AND Set Telemetry Interval=${interval}s For ${TEST_SERVICE} On Registry Service Suite Teardown Run keywords Terminate All Processes ... AND Delete all events by age -... AND Set Telemetry Interval=30s For core-data On Consul +... AND Set Telemetry Interval=30s For ${TEST_SERVICE} On Registry Service ... AND Run Teardown Keywords Force Tags MessageBus=redis backward-skip *** Variables *** ${SUITE} Core Data Metrics Test - Redis Bus ${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/core_data_metrics_redis.log +${TEST_SERVICE} core-data *** Test Cases *** DataMetricsRedis001-Enable EventsPersisted And Verify Metrics is Publish to MessageBus - Given Run Redis Subscriber Progress And Output edgex.telemetry.core-data.EventsPersisted telemetry + Given Run Redis Subscriber Progress And Output edgex.telemetry.${TEST_SERVICE}.EventsPersisted telemetry And Set Test Variable ${device_name} events-persisted-true - And Set Telemetry Metrics/EventsPersisted=true For core-data On Consul + And Set Telemetry Metrics/EventsPersisted=true For ${TEST_SERVICE} On Registry Service And Create Device For device-virtual With Name ${device_name} When Create multiple events And Sleep ${interval} Then Metrics EventsPersisted With counter-count Should Be Received [Teardown] Run keywords Delete device by name ${device_name} ... AND Terminate Process ${handle_redis} kill=True - ... AND Set Telemetry Metrics/EventsPersisted=false For core-data On Consul + ... AND Set Telemetry Metrics/EventsPersisted=false For ${TEST_SERVICE} On Registry Service DataMetricsRedis002-Disable EventsPersisted And Verify Metrics isn't Publish to MessageBus - Given Run Redis Subscriber Progress And Output edgex.telemetry.core-data.EventsPersisted telemetry + Given Run Redis Subscriber Progress And Output edgex.telemetry.${TEST_SERVICE}.EventsPersisted telemetry And Set Test Variable ${device_name} events-persisted-false - And Set Telemetry Metrics/EventsPersisted=false For core-data On Consul + And Set Telemetry Metrics/EventsPersisted=false For ${TEST_SERVICE} On Registry Service And Create Device For device-virtual With Name ${device_name} When Create multiple events And Sleep ${interval} @@ -43,21 +44,21 @@ DataMetricsRedis002-Disable EventsPersisted And Verify Metrics isn't Publish to ... AND Terminate Process ${handle_redis} kill=True DataMetricsRedis003-Enable ReadingsPersisted And Verify Metrics is Publish to MessageBus - Given Run Redis Subscriber Progress And Output edgex.telemetry.core-data.ReadingsPersisted telemetry + Given Run Redis Subscriber Progress And Output edgex.telemetry.${TEST_SERVICE}.ReadingsPersisted telemetry And Set Test Variable ${device_name} readings-persisted-true - And Set Telemetry Metrics/ReadingsPersisted=true For core-data On Consul + And Set Telemetry Metrics/ReadingsPersisted=true For ${TEST_SERVICE} On Registry Service And Create Device For device-virtual With Name ${device_name} When Create multiple events And Sleep ${interval} Then Metrics ReadingsPersisted With counter-count Should Be Received [Teardown] Run keywords Delete device by name ${device_name} ... AND Terminate Process ${handle_redis} kill=True - ... AND Set Telemetry Metrics/ReadingsPersisted=false For core-data On Consul + ... AND Set Telemetry Metrics/ReadingsPersisted=false For ${TEST_SERVICE} On Registry Service DataMetricsRedis004-Disable ReadingsPersisted And Verify Metrics isn't Publish to MessageBus - Given Run Redis Subscriber Progress And Output edgex.telemetry.core-data.ReadingsPersisted telemetry + Given Run Redis Subscriber Progress And Output edgex.telemetry.${TEST_SERVICE}.ReadingsPersisted telemetry And Set Test Variable ${device_name} readings-persisted-false - And Set Telemetry Metrics/ReadingsPersisted=false For core-data On Consul + And Set Telemetry Metrics/ReadingsPersisted=false For ${TEST_SERVICE} On Registry Service And Create Device For device-virtual With Name ${device_name} When Create multiple events And Sleep ${interval} 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 5a54ac53..5953d3ff 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 @@ -12,13 +12,13 @@ Force Tags MessageBus=MQTT *** Variables *** ${SUITE} Core-Data-Configrations -${DATA_CONSOL_PATH} ${CONSUL_CONFIG_BASE_ENDPOINT}/core-data +${DATA_CONSOL_PATH} /core-data *** Test Cases *** CoreConfig001 - Set core-data MessageBus.BaseTopicPrefix not match device-virtual BaseTopicPrefix Given Run MQTT Subscriber Progress And Output edgex/events/device/# And Set Test Variable ${device_name} messagebus-mqtt-core-2 - And Set MessageBus BaseTopicPrefix=custom For core-data On Consul + And Set MessageBus BaseTopicPrefix=custom For core-data On Registry Service 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 @@ -26,13 +26,13 @@ CoreConfig001 - Set core-data MessageBus.BaseTopicPrefix not match device-virtua And Event Is Not Pushed To Core Data [Teardown] Run keywords Delete device by name ${device_name} ... AND Delete all events by age - ... AND Set MessageBus BaseTopicPrefix=edgex For core-data On Consul + ... AND Set MessageBus BaseTopicPrefix=edgex For core-data On Registry Service ... AND Terminate Process ${handle_mqtt} kill=True CoreConfig002 - Set core-data MessageBus.Optional.Qos (SUBSCRIBE) [Tags] backward-skip Given Set Test Variable ${device_name} messagebus-mqtt-core-4 - And Set MessageBus Optional/Qos=2 For core-data On Consul + And Set MessageBus Optional/Qos=2 For core-data On Registry Service 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 @@ -40,14 +40,14 @@ CoreConfig002 - Set core-data MessageBus.Optional.Qos (SUBSCRIBE) And Wait Until Keyword Succeeds 3x 2s Verify MQTT Broker Qos [Teardown] Run keywords Delete device by name ${device_name} ... AND Delete all events by age - ... AND Set MessageBus Optional/Qos=0 For core-data On Consul + ... AND Set MessageBus Optional/Qos=0 For core-data On Registry Service *** Keywords *** -Set MessageBus ${key}=${value} For core-data On Consul +Set MessageBus ${key}=${value} For core-data On Registry Service ${timestamp} get current epoch time Set Test Variable ${log_timestamp} ${timestamp} ${path}= Set Variable ${DATA_CONSOL_PATH}/MessageBus/${key} - Update Service Configuration On Consul ${path} ${value} + Update Configuration On Registry Service ${path} ${value} Restart Services core-data Wait Until Keyword Succeeds 10x 1s Ping Data Service 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 e298123a..44cc1869 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 @@ -16,7 +16,7 @@ ${SUITE} Configrations Config001 - Set MessageBus.Protocol to MQTT # Set protocol on deployment Given Run MQTT Subscriber Progress And Output edgex/events/device/# And Set Test Variable ${device_name} messageBus-mqtt - And Set Writable LogLevel To Debug For device-virtual On Consul + And Set Writable LogLevel To Debug For device-virtual On Registry Service 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 @@ -30,8 +30,8 @@ Config002 - Modify MessageBus.BaseTopicPrefix and receive data from the topic co Given Set Test Variable ${device_name} messagebus-true-device-5 And Run MQTT Subscriber Progress And Output custom/events/device/# And Create Device For device-virtual With Name ${device_name} - And Set MessageBus BaseTopicPrefix=custom For device-virtual On Consul - And Set MessageBus BaseTopicPrefix=custom For core-data On Consul + And Set MessageBus BaseTopicPrefix=custom For device-virtual On Registry Service + And Set MessageBus BaseTopicPrefix=custom For core-data On Registry Service 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 @@ -39,28 +39,28 @@ Config002 - Modify MessageBus.BaseTopicPrefix and receive data from the topic co [Teardown] Run keywords Delete device by name ${device_name} ... AND Delete all events by age ... AND Terminate Process ${handle_mqtt} kill=True - ... AND Set MessageBus BaseTopicPrefix=edgex For device-virtual On Consul - ... AND Set MessageBus BaseTopicPrefix=edgex For core-data On Consul + ... AND Set MessageBus BaseTopicPrefix=edgex For device-virtual On Registry Service + ... AND Set MessageBus BaseTopicPrefix=edgex For core-data On Registry Service Config003 - Set device-virtual MessageBus.Optional.Qos (PUBLISH) [Tags] backward-skip Given Set Test Variable ${device_name} messagebus-true-device-6 And Create Device For device-virtual With Name ${device_name} - And Set MessageBus Optional/Qos=2 For device-virtual On Consul - And Set MessageBus Optional/Qos=1 For core-data On Consul + And Set MessageBus Optional/Qos=2 For device-virtual On Registry Service + And Set MessageBus Optional/Qos=1 For core-data On Registry Service 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 Pushed To Core Data And Verify MQTT Broker Qos [Teardown] Run keywords Delete device by name ${device_name} ... AND Delete all events by age - ... AND Set MessageBus Optional/Qos=0 For device-virtual On Consul - ... AND Set MessageBus Optional/Qos=0 For core-data On Consul + ... AND Set MessageBus Optional/Qos=0 For device-virtual On Registry Service + ... AND Set MessageBus Optional/Qos=0 For core-data On Registry Service *** Keywords *** -Set MessageBus ${key}=${value} For ${service} On Consul - ${path}= Set Variable ${CONSUL_CONFIG_BASE_ENDPOINT}/${service}/MessageBus/${key} - Update Service Configuration On Consul ${path} ${value} +Set MessageBus ${key}=${value} For ${service} On Registry Service + ${path}= Set Variable /${service}/MessageBus/${key} + Update Configuration On Registry Service ${path} ${value} Restart Services ${service} Run Keyword If '${service}' == 'device-virtual' Set Test Variable ${url} ${deviceServiceUrl} ... ELSE IF '${service}' == 'core-data' Set Test Variable ${url} ${coreDataUrl} @@ -70,9 +70,9 @@ Set MessageBus ${key}=${value} For ${service} On Consul ... ELSE Sleep 5s END -Set Writable LogLevel To Debug For ${service_name} On Consul - ${path}= Set Variable ${CONSUL_CONFIG_BASE_ENDPOINT}/${service_name}/Writable/LogLevel - Update Service Configuration On Consul ${path} DEBUG +Set Writable LogLevel To Debug For ${service_name} On Registry Service + ${path}= Set Variable /${service_name}/Writable/LogLevel + Update Configuration On Registry Service ${path} DEBUG Retrive device data by device ${device_name} and command ${command} ${timestamp} get current epoch time diff --git a/TAF/testScenarios/integrationTest/UC_retention/core_data_retention.robot b/TAF/testScenarios/integrationTest/UC_retention/core_data_retention.robot index 1f2638e0..4b081ebc 100644 --- a/TAF/testScenarios/integrationTest/UC_retention/core_data_retention.robot +++ b/TAF/testScenarios/integrationTest/UC_retention/core_data_retention.robot @@ -5,16 +5,16 @@ Suite Setup Run keywords Setup Suite ... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token ... AND Delete all events by age ... AND Enable Core-Data Retention - ... AND Update Service Configuration On Consul ${DATA_CONSOL_PATH}/Writable/LogLevel DEBUG + ... AND Update Configuration On Registry Service ${DATA_CONSOL_PATH}/Writable/LogLevel DEBUG Suite Teardown Run Keywords Disable Core-Data Retention - ... AND Update Service Configuration On Consul ${DATA_CONSOL_PATH}/Writable/LogLevel INFO + ... AND Update Configuration On Registry Service ${DATA_CONSOL_PATH}/Writable/LogLevel INFO ... AND Run Teardown Keywords Force Tags MessageBus=redis *** Variables *** ${SUITE} core-data Retention ${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/core_data_retention.log -${DATA_CONSOL_PATH} ${CONSUL_CONFIG_BASE_ENDPOINT}/core-data +${DATA_CONSOL_PATH} /core-data ${maxCap} 5 ${minCap} 2 ${interval} 2s @@ -41,7 +41,7 @@ Enable Core-Data Retention ${values} Create List true 3s ${maxCap} ${minCap} FOR ${key} ${value} IN ZIP ${keys} ${values} ${path}= Set Variable ${DATA_CONSOL_PATH}/Retention/${key} - Update Service Configuration On Consul ${path} ${value} + Update Configuration On Registry Service ${path} ${value} END Restart Services core-data @@ -76,7 +76,7 @@ Stored Readings Are Belong To Stored Events Disable Core-Data Retention ${path}= Set Variable ${DATA_CONSOL_PATH}/Retention/Enabled - Update Service Configuration On Consul ${path} false + Update Configuration On Registry Service ${path} false Restart Services core-data Found Purge Log in ${service} diff --git a/TAF/testScenarios/integrationTest/UC_retention/notifications_retention.robot b/TAF/testScenarios/integrationTest/UC_retention/notifications_retention.robot index 61f1b652..f53628fe 100644 --- a/TAF/testScenarios/integrationTest/UC_retention/notifications_retention.robot +++ b/TAF/testScenarios/integrationTest/UC_retention/notifications_retention.robot @@ -8,16 +8,16 @@ Suite Setup Run keywords Setup Suite ... AND Run Keyword if $SECURITY_SERVICE_NEEDED == 'true' Get Token ... AND Cleanup All Notifications And Transmissions ... AND Enable Notifications Retention - ... AND Update Service Configuration On Consul ${CONSOL_PATH}/Writable/LogLevel DEBUG + ... AND Update Configuration On Registry Service ${CONSOL_PATH}/Writable/LogLevel DEBUG Suite Teardown Run Keywords Disable Notifications Retention - ... AND Update Service Configuration On Consul ${CONSOL_PATH}/Writable/LogLevel INFO + ... AND Update Configuration On Registry Service ${CONSOL_PATH}/Writable/LogLevel INFO ... AND Run Teardown Keywords Force Tags MessageBus=redis *** Variables *** ${SUITE} support-notifications Retention ${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/support-notifications_retention.log -${CONSOL_PATH} ${CONSUL_CONFIG_BASE_ENDPOINT}/support-notifications +${CONSOL_PATH} /support-notifications ${maxCap} 5 ${minCap} 2 ${interval} 3s @@ -48,7 +48,7 @@ Enable Notifications Retention ${values} Create List true 3s ${maxCap} ${minCap} FOR ${key} ${value} IN ZIP ${keys} ${values} ${path}= Set Variable ${CONSOL_PATH}/Retention/${key} - Update Service Configuration On Consul ${path} ${value} + Update Configuration On Registry Service ${path} ${value} END Restart Services support-notifications @@ -82,7 +82,7 @@ Stored Transmissions Are Belong To Stored Notifications Disable Notifications Retention ${path}= Set Variable ${CONSOL_PATH}/Retention/Enabled - Update Service Configuration On Consul ${path} false + Update Configuration On Registry Service ${path} false Restart Services support-notifications Create Subscriptions ${subscriptions_num} And Notifications ${notifications_num} diff --git a/TAF/testScenarios/scalabilityTest/modbus/modbus.robot b/TAF/testScenarios/scalabilityTest/modbus/modbus.robot index f29d087c..31da4b48 100644 --- a/TAF/testScenarios/scalabilityTest/modbus/modbus.robot +++ b/TAF/testScenarios/scalabilityTest/modbus/modbus.robot @@ -17,7 +17,7 @@ ${LOG_FILE_PATH} ${WORK_DIR}/TAF/testArtifacts/logs/modbus_scalability_test *** Test Cases *** Test Modbus scalability - Given Update Service Configuration On Consul ${CONSUL_CONFIG_BASE_ENDPOINT}/core-data/Writable/PersistData false + Given Update Configuration On Registry Service /core-data/Writable/PersistData false And Deploy services edgex-scalability-test-mqtt-export sleep 30 ${report_info} ${records} = When run scalability testing diff --git a/TAF/utils/scripts/docker/get-compose-file-perfermance.sh b/TAF/utils/scripts/docker/get-compose-file-perfermance.sh index 666e4e05..8faac469 100755 --- a/TAF/utils/scripts/docker/get-compose-file-perfermance.sh +++ b/TAF/utils/scripts/docker/get-compose-file-perfermance.sh @@ -10,11 +10,14 @@ USE_SHA1=${3:-main} # # security or no security [ "$USE_SECURITY" != '-security-' ] && USE_NO_SECURITY="-no-secty" +# # Consul or Keeper +[ "$REGISTRY_SERVICE" = "Keeper" ] && USE_KEEPER="-keeper" + # # first sync standard docker-compose file from edgex-compose repo -./sync-compose-file.sh "${USE_SHA1}" "${USE_NO_SECURITY}" "${USE_ARM64}" "-taf" "-perf" +./sync-compose-file.sh "${USE_SHA1}" "${USE_NO_SECURITY}" "${USE_ARM64}" "-taf" "${USE_KEEPER}" "-perf" # # docker-compose.yml file is used on Case 1-4 -cp docker-compose-taf-perf${USE_NO_SECURITY}${USE_ARM64}.yml docker-compose.yml +cp docker-compose-taf-perf${USE_NO_SECURITY}${USE_KEEPER}${USE_ARM64}.yml docker-compose.yml if [ "$USE_SECURITY" = '-security-' ]; then NGINX_ROUTE=",device-rest.http:\/\/edgex-device-rest:59986" @@ -29,6 +32,6 @@ done # # docker-compose-mqtt.yml file is used on Case 5 # # Then sync TAF performance specific docker-compose file from edgex-compose repo and replace the placeholders #./sync-compose-file.sh "${USE_SHA1}" "${USE_NO_SECURITY}" "${USE_ARM64}" "-taf" "-perf" -cp docker-compose-taf-perf${USE_NO_SECURITY}${USE_ARM64}.yml docker-compose-mqtt.yml +cp docker-compose-taf-perf${USE_NO_SECURITY}${USE_KEEPER}${USE_ARM64}.yml docker-compose-mqtt.yml sed -i 's/\MQTT_BROKER_ADDRESS_PLACE_HOLDER/tcp:\/\/${MQTT_BROKER_HOSTNAME}:1883/g' docker-compose-mqtt.yml sed -i 's/\LOGLEVEL: INFO/LOGLEVEL: DEBUG/g' docker-compose-mqtt.yml diff --git a/TAF/utils/scripts/docker/get-compose-file.sh b/TAF/utils/scripts/docker/get-compose-file.sh index 224aaebf..67963700 100755 --- a/TAF/utils/scripts/docker/get-compose-file.sh +++ b/TAF/utils/scripts/docker/get-compose-file.sh @@ -5,7 +5,8 @@ USE_ARCH=${1:--x86_64} USE_SECURITY=${2:--} USE_SHA1=${3:-main} TEST_STRATEGY=${4:-} -DELAYED_START=${5:-false} +REGISTRY_SERVICE=${5:-Consul} +DELAYED_START=${6:-false} . $(dirname "$0")/common-taf.env @@ -15,17 +16,29 @@ DELAYED_START=${5:-false} # # security or no security [ "$USE_SECURITY" != '-security-' ] && USE_NO_SECURITY="-no-secty" +# # Consul or Keeper +if [ "$REGISTRY_SERVICE" = "Keeper" ]; then + USE_KEEPER="-keeper" + REGISTRY_HOST=edgex-core-keeper + REGISTRY_PORT=59890 + REGISTRY_TYPE=keeper +else + REGISTRY_HOST=edgex-core-consul + REGISTRY_PORT=8500 + REGISTRY_TYPE=consul +fi + # # pre-release or other release mkdir -p tmp # generate single file docker-compose.yml for target configuration without # default device services, i.e. no device-virtual service -./sync-compose-file.sh "${USE_SHA1}" "${USE_NO_SECURITY}" "${USE_ARM64}" "-taf" -cp docker-compose-taf${USE_NO_SECURITY}${USE_ARM64}.yml docker-compose.yml +./sync-compose-file.sh "${USE_SHA1}" "${USE_NO_SECURITY}" "${USE_ARM64}" "-taf" "${USE_KEEPER}" +cp docker-compose-taf${USE_NO_SECURITY}${USE_KEEPER}${USE_ARM64}.yml docker-compose.yml if [ "${TEST_STRATEGY}" = "integration-test" ]; then # sync compose file for mqtt message bus - ./sync-compose-file.sh "${USE_SHA1}" "${USE_NO_SECURITY}" "${USE_ARM64}" "-taf" "" "-mqtt-bus" - cp docker-compose-taf${USE_NO_SECURITY}-mqtt-bus${USE_ARM64}.yml docker-compose-mqtt-bus.yml + ./sync-compose-file.sh "${USE_SHA1}" "${USE_NO_SECURITY}" "${USE_ARM64}" "-taf" "${USE_KEEPER}" "" "-mqtt-bus" + cp docker-compose-taf${USE_NO_SECURITY}-mqtt-bus${USE_KEEPER}${USE_ARM64}.yml docker-compose-mqtt-bus.yml # Set Compose files variable COMPOSE_FILE="docker-compose docker-compose-mqtt-bus" else @@ -89,7 +102,9 @@ for compose in ${COMPOSE_FILE}; do if [ "${compose}" = "docker-compose" ]; then sed -i '/\ \ \ \ environment:/a \ \ \ \ \ \ DATABASE_HOST: edgex-redis' tmp/core-command.yml sed -i '/\ \ \ \ environment:/a \ \ \ \ \ \ MESSAGEBUS_HOST: edgex-redis' tmp/core-command.yml - sed -i '/\ \ \ \ environment:/a \ \ \ \ \ \ REGISTRY_HOST: edgex-core-consul' tmp/core-command.yml + sed -i "/\ \ \ \ environment:/a \ \ \ \ \ \ REGISTRY_HOST: $REGISTRY_HOST" tmp/core-command.yml + sed -i "/\ \ \ \ environment:/a \ \ \ \ \ \ REGISTRY_PORT: $REGISTRY_PORT" tmp/core-command.yml + sed -i "/\ \ \ \ environment:/a \ \ \ \ \ \ REGISTRY_TYPE: $REGISTRY_TYPE" tmp/core-command.yml sed -i "/\ \ \ \ environment:/a \ \ \ \ \ \ EDGEX_COMMON_CONFIG: ${HTTP_SERVER_DIR}/common-config.yaml" tmp/core-command.yml sed -i '/\ \ \ \ environment:/a \ \ \ \ \ \ EDGEX_CONFIG_PROVIDER: none' tmp/core-command.yml fi @@ -101,7 +116,7 @@ for compose in ${COMPOSE_FILE}; do sed -n "/^\ \ mqtt-taf-broker:/,/^ [a-z].*:$/p" ${compose}.yml | sed '$d' > tmp/external-mqtt.yml sed -i "s/mosquitto-no-auth.conf/etc\/mosquitto\/mosquitto.conf/g" tmp/external-mqtt.yml sed -i '$a\ \ \ \ volumes:' tmp/external-mqtt.yml - sed -i '/\ \ \ \ volumes:/a \ \ \ \ - \/${WORK_DIR}\/TAF\/utils\/scripts\/docker\/mosquitto:\/etc\/mosquitto:z' tmp/external-mqtt.yml + sed -i '/\ \ \ \ volumes:/a \ \ \ \ \ \ - \/${WORK_DIR}\/TAF\/utils\/scripts\/docker\/mosquitto:\/etc\/mosquitto:z' tmp/external-mqtt.yml sed -i "/^\ \ mqtt-taf-broker:/,/^ [a-z].*:$/{//!d}; /^\ \ mqtt-taf-broker:/d" ${compose}.yml sed -i "/services:/ r tmp/external-mqtt.yml" ${compose}.yml @@ -111,7 +126,7 @@ for compose in ${COMPOSE_FILE}; do sed -i '/WRITABLE_PIPELINE_FUNCTIONS_MQTTEXPORT_PARAMETERS_BROKERADDRESS/a \ \ \ \ \ \ WRITABLE_PIPELINE_FUNCTIONS_MQTTEXPORT_PARAMETERS_AUTHMODE: usernamepassword' ${compose}.yml sed -i '/WRITABLE_PIPELINE_FUNCTIONS_MQTTEXPORT_PARAMETERS_BROKERADDRESS/a \ \ \ \ \ \ SECRETSTORE_SECRETSFILE: \/tmp\/secrets.json' ${compose}.yml sed -i '/WRITABLE_PIPELINE_FUNCTIONS_MQTTEXPORT_PARAMETERS_BROKERADDRESS/a \ \ \ \ \ \ SECRETSTORE_DISABLESCRUBSECRETSFILE: true' ${compose}.yml - sed -i '/\ \ \ \ volumes:/a \ \ \ \ - \/${WORK_DIR}\/TAF\/testData\/all-services\/secrets.json:\/tmp\/secrets.json' ${compose}.yml + sed -i '/\ \ \ \ volumes:/a \ \ \ \ \ \ - \/${WORK_DIR}\/TAF\/testData\/all-services\/secrets.json:\/tmp\/secrets.json' ${compose}.yml else sed -i '/WRITABLE_PIPELINE_FUNCTIONS_MQTTEXPORT_PARAMETERS_BROKERADDRESS/a \ \ \ \ \ \ WRITABLE_PIPELINE_FUNCTIONS_MQTTEXPORT_PARAMETERS_AUTHMODE: usernamepassword' ${compose}.yml sed -i '/WRITABLE_PIPELINE_FUNCTIONS_MQTTEXPORT_PARAMETERS_BROKERADDRESS/a \ \ \ \ \ \ WRITABLE_INSECURESECRETS_MQTT_SECRETDATA_USERNAME: ${EX_BROKER_USER}' ${compose}.yml @@ -200,7 +215,7 @@ for compose in ${COMPOSE_FILE}; do fi sed -i 's/\LOGLEVEL: INFO/LOGLEVEL: DEBUG/g' ${compose}.yml - sed -i '/METRICSMECHANISM/d' ${compose}.yml # remove METRICSMECHANISM env variable to allow change on Consul + sed -i '/METRICSMECHANISM/d' ${compose}.yml # remove METRICSMECHANISM env variable to allow change on Registry Service # Put HTTP Server On the top of compose file if [ "${TEST_STRATEGY}" = "integration-test" ] && [ "${compose}" = "docker-compose" ]; then diff --git a/TAF/utils/scripts/docker/run-tests.sh b/TAF/utils/scripts/docker/run-tests.sh index 717cd672..46750032 100755 --- a/TAF/utils/scripts/docker/run-tests.sh +++ b/TAF/utils/scripts/docker/run-tests.sh @@ -4,8 +4,8 @@ USE_ARCH=${1:-x86_64} SECURITY_SERVICE_NEEDED=${2:-false} TEST_STRATEGY=${3:-functional-test} # option: functional-test, integration-test TEST_SERVICE=${4:-api} -DEPLOY_SERVICES=${5:-} # no-deployment or empty - +REGISTRY_SERVICE=${5:-Consul} +DEPLOY_SERVICES=${6:-} # no-deployment or empty # # x86_64 or arm64 [ "$USE_ARCH" = "arm64" ] && USE_ARM64="-arm64" @@ -24,7 +24,7 @@ fi if [ "$DEPLOY_SERVICES" != "no-deployment" ]; then # Get compose file from edgex-compose - sh get-compose-file.sh ${USE_ARCH} ${USE_SECURITY} ${USE_SHA1} ${TEST_STRATEGY} + sh get-compose-file.sh ${USE_ARCH} ${USE_SECURITY} ${USE_SHA1} ${TEST_STRATEGY} ${REGISTRY_SERVICE} # Create backup report directory mkdir -p ${WORK_DIR}/TAF/testArtifacts/reports/cp-edgex @@ -50,7 +50,7 @@ case ${TEST_STRATEGY} in device-virtual) docker run --rm --network host --name taf-common -v ${WORK_DIR}:${WORK_DIR}:z -w ${WORK_DIR} \ --security-opt label:disable -e COMPOSE_IMAGE=${COMPOSE_IMAGE} -e ARCH=${ARCH} \ - -e SECURITY_SERVICE_NEEDED=${SECURITY_SERVICE_NEEDED} \ + -e SECURITY_SERVICE_NEEDED=${SECURITY_SERVICE_NEEDED} -e REGISTRY_SERVICE=${REGISTRY_SERVICE} \ -v /var/run/docker.sock:/var/run/docker.sock ${TAF_COMMON_IMAGE} \ --exclude Skipped -u functionalTest/device-service -p device-virtual cp ${WORK_DIR}/TAF/testArtifacts/reports/edgex/log.html ${WORK_DIR}/TAF/testArtifacts/reports/cp-edgex/virtual.html @@ -58,7 +58,7 @@ case ${TEST_STRATEGY} in device-modbus) docker run --rm --network host --name taf-common -v ${WORK_DIR}:${WORK_DIR}:z -w ${WORK_DIR} \ --security-opt label:disable -e COMPOSE_IMAGE=${COMPOSE_IMAGE} -e ARCH=${ARCH} \ - -e SECURITY_SERVICE_NEEDED=${SECURITY_SERVICE_NEEDED} \ + -e SECURITY_SERVICE_NEEDED=${SECURITY_SERVICE_NEEDED} -e REGISTRY_SERVICE=${REGISTRY_SERVICE} \ -v /var/run/docker.sock:/var/run/docker.sock ${TAF_COMMON_IMAGE} \ --exclude Skipped -u functionalTest/device-service -p device-modbus cp ${WORK_DIR}/TAF/testArtifacts/reports/edgex/log.html ${WORK_DIR}/TAF/testArtifacts/reports/cp-edgex/modbus.html @@ -66,7 +66,7 @@ case ${TEST_STRATEGY} in api) docker run --rm --network host -v ${WORK_DIR}:${WORK_DIR}:z -w ${WORK_DIR} \ --security-opt label:disable -e COMPOSE_IMAGE=${COMPOSE_IMAGE} -e ARCH=${ARCH} \ - -e SECURITY_SERVICE_NEEDED=${SECURITY_SERVICE_NEEDED} \ + -e SECURITY_SERVICE_NEEDED=${SECURITY_SERVICE_NEEDED} -e REGISTRY_SERVICE=${REGISTRY_SERVICE} \ --env-file ${WORK_DIR}/TAF/utils/scripts/docker/common-taf.env \ -v /var/run/docker.sock:/var/run/docker.sock ${TAF_COMMON_IMAGE} \ --exclude Skipped -u functionalTest/API -p default @@ -75,7 +75,7 @@ case ${TEST_STRATEGY} in *) docker run --rm --network host -v ${WORK_DIR}:${WORK_DIR}:z -w ${WORK_DIR} \ --security-opt label:disable -e COMPOSE_IMAGE=${COMPOSE_IMAGE} -e ARCH=${ARCH} \ - -e SECURITY_SERVICE_NEEDED=${SECURITY_SERVICE_NEEDED} \ + -e SECURITY_SERVICE_NEEDED=${SECURITY_SERVICE_NEEDED} -e REGISTRY_SERVICE=${REGISTRY_SERVICE} \ --env-file ${WORK_DIR}/TAF/utils/scripts/docker/common-taf.env \ -v /var/run/docker.sock:/var/run/docker.sock ${TAF_COMMON_IMAGE} \ --exclude Skipped -u functionalTest/API/${TEST_SERVICE} -p default @@ -89,7 +89,7 @@ case ${TEST_STRATEGY} in docker run --rm --network host -v ${WORK_DIR}:${WORK_DIR}:z -w ${WORK_DIR} \ --security-opt label:disable -e COMPOSE_IMAGE=${COMPOSE_IMAGE} -e ARCH=${ARCH} \ - -e SECURITY_SERVICE_NEEDED=${SECURITY_SERVICE_NEEDED} \ + -e SECURITY_SERVICE_NEEDED=${SECURITY_SERVICE_NEEDED} -e REGISTRY_SERVICE=${REGISTRY_SERVICE} \ --env-file ${WORK_DIR}/TAF/utils/scripts/docker/common-taf.env \ -v /tmp/edgex/secrets:/tmp/edgex/secrets:z \ -v /var/run/docker.sock:/var/run/docker.sock ${TAF_COMMON_IMAGE} \ diff --git a/TAF/utils/scripts/docker/sync-compose-file.sh b/TAF/utils/scripts/docker/sync-compose-file.sh index ea82345c..c0dd9498 100755 --- a/TAF/utils/scripts/docker/sync-compose-file.sh +++ b/TAF/utils/scripts/docker/sync-compose-file.sh @@ -9,13 +9,14 @@ USE_NO_SECURITY=$2 USE_ARM64=$3 TAF=$4 -TAF_PERF=$5 -TAF_MESSAGE_BUS=$6 +USE_KEEPER=$5 +TAF_PERF=$6 +TAF_MESSAGE_BUS=$7 # Handle TAF specific compose files [ "$TAF" = "-taf" ] && TAF_SUB_FOLDER="/taf" NIGHTLY_BUILD_URL="https://raw.githubusercontent.com/edgexfoundry/edgex-compose/${USE_SHA1}${TAF_SUB_FOLDER}" -COMPOSE_FILE="docker-compose${TAF}${TAF_PERF}${USE_NO_SECURITY}${TAF_MESSAGE_BUS}${USE_ARM64}.yml" +COMPOSE_FILE="docker-compose${TAF}${TAF_PERF}${USE_NO_SECURITY}${TAF_MESSAGE_BUS}${USE_KEEPER}${USE_ARM64}.yml" curl -o ${COMPOSE_FILE} "${NIGHTLY_BUILD_URL}/${COMPOSE_FILE}" diff --git a/docs/run-tests-on-local.md b/docs/run-tests-on-local.md index 403651e2..5487c7ed 100644 --- a/docs/run-tests-on-local.md +++ b/docs/run-tests-on-local.md @@ -19,11 +19,13 @@ export WORK_DIR=${HOME}/edgex-taf # Arguments for run-tests.sh ${ARCH}: x86_64 | arm64 ${SECURITY_SERVICE_NEEDED}: false | true +${REGISTRY_SERVICE}: Consul | Keeper ${TEST_STRATEGY}: functional-test | integration-test ${TEST_SERVICE}: all (default) | device-virtual | device-modbus | ${directory} under TAF/testScenarios/functionalTest/API | mqtt (integration-test) | redis (integration-test) ${DEPLOY_SERVICES}: no-deployment(If edgex services are deployed in place, use 'no-deployment' Otherwise, leave it empty.) cd ${WORK_DIR}/TAF/utils/scripts/docker +export REGISTRY_SERVICE=${REGISTRY_SERVICE} sh run-tests.sh ${ARCH} ${SECURITY_SERVICE_NEEDED} ${TEST_STRATEGY} ${TEST_SERVICE} ${DEPLOY_SERVICES} # If using x86_64, no need for secuity, adopt for functional-test, choose "api" for test_service and edgex service are deployed in place, it should be: @@ -90,6 +92,10 @@ Open the report file by browser: ${WORK_DIR}/TAF/testArtifacts/reports/cp-edgex/ ``` bash # ${ServiceDir}: Please use the directory name under TAF/testScenarios/functionalTest/API + # Before launching Service, please export the following variables. + export EDGEX_SECURITY_SECRET_STORE=false + export REGISTRY_SERVICE=${REGISTRY_SERVICE} + # Run Test Command python3 -m TUC --exclude Skipped -u functionalTest/API/${ServiceDir} -p default ``` @@ -100,6 +106,7 @@ Open the report file by browser: ${WORK_DIR}/TAF/testArtifacts/reports/cp-edgex/ # Before launching APP Service, please export the following variables. export EDGEX_SECURITY_SECRET_STORE=false + export REGISTRY_SERVICE=${REGISTRY_SERVICE} export SERVICE_PORT=59705 (For functional-tests) export SERVICE_PORT=59704 (For http-export) @@ -111,6 +118,7 @@ Open the report file by browser: ${WORK_DIR}/TAF/testArtifacts/reports/cp-edgex/ ``` bash # Before launching Device Service, please export the following variables. export EDGEX_SECURITY_SECRET_STORE=false + export REGISTRY_SERVICE=${REGISTRY_SERVICE} # Modify the ProfilesDir value on configuration.toml under ${HOME}/edgex-taf/TAF/config/${profile} ProfilesDir = ${HOME}/edgex-taf/TAF/config/${profile}