From: Guillermo Calvino Date: Mon, 21 Nov 2022 17:13:58 +0000 (+0100) Subject: Fix Bug 2197 - Prometheus cannot be authenticated in Robot tests X-Git-Tag: release-v14.0-start~42 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=063677c719bd33d8674903ed5b7f11e7368da23a;p=osm%2Ftests.git Fix Bug 2197 - Prometheus cannot be authenticated in Robot tests Change-Id: I1c610968fea5f13711d6d6d8bed5ddc7422a6d3f Signed-off-by: Guillermo Calvino --- diff --git a/robot-systest/lib/prometheus_lib.robot b/robot-systest/lib/prometheus_lib.robot index c76b560..5fdda49 100644 --- a/robot-systest/lib/prometheus_lib.robot +++ b/robot-systest/lib/prometheus_lib.robot @@ -29,17 +29,17 @@ Get Metric ... The filter parameters are given to this function in key=value format (one argument per key/value pair). ... Fails if the metric is not found or has multiple values. ... Examples of execution: - ... \${metric}= Get Metric \${prometheus_ip} \${prometheus_port} \${metric} - ... \${metric}= Get Metric \${prometheus_ip} \${prometheus_port} \${metric} \${param1}=\${value1} \${param2}=\${value2} + ... \${metric}= Get Metric \${prometheus_ip} \${prometheus_port} ${prometheus_password} \${metric} + ... \${metric}= Get Metric \${prometheus_ip} \${prometheus_port} ${prometheus_password} \${metric} \${param1}=\${value1} \${param2}=\${value2} - [Arguments] ${prometheus_ip} ${prometheus_port} ${metric} @{filter_parameters} + [Arguments] ${prometheus_ip} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${metric} @{filter_parameters} ${filter}= Set Variable ${EMPTY} FOR ${param} IN @{filter_parameters} ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in filter parameters ${filter}= Catenate SEPARATOR= ${filter} ${param_name}="${param_value}", END - ${resp}= Execute Prometheus Instant Query ${prometheus_host} ${prometheus_port} query=${metric}{${filter}} + ${resp}= Execute Prometheus Instant Query ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} query=${metric}{${filter}} ${result_list}= Convert To List ${resp["data"]["result"]} ${results}= Get Length ${result_list} Should Not Be Equal As Numbers 0 ${results} msg=Metric ${metric} not found values=false @@ -52,9 +52,9 @@ Execute Prometheus Instant Query ... Return an inline json with the result of the query. ... The requested URL is the next: http://\${prometheus_ip}:\${prometheus_port}/api/v1/query?\${querystring} - [Arguments] ${prometheus_ip} ${prometheus_port} ${querystring} - - Create Session prometheus http://${prometheus_ip}:${prometheus_port} timeout=${timeout} max_retries=${max_retries} + [Arguments] ${prometheus_ip} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${querystring} + ${auth}= IF '${prometheus_password}'!='${EMPTY}' Create List ${prometheus_user} ${prometheus_password} ELSE Set Variable None + Create Session prometheus http://${prometheus_ip}:${prometheus_port} timeout=${timeout} max_retries=${max_retries} verify=false auth=${auth} ${resp}= GET On Session prometheus /api/v1/query?${querystring} timeout=${timeout} Status Should Be 200 ${resp} [Return] ${resp.json()} diff --git a/robot-systest/lib/sdnc_lib.robot b/robot-systest/lib/sdnc_lib.robot index 0b4508b..1089b7c 100644 --- a/robot-systest/lib/sdnc_lib.robot +++ b/robot-systest/lib/sdnc_lib.robot @@ -80,9 +80,9 @@ Check for SDNC Check for SDNC Status - [Arguments] ${sdnc_id} ${prometheus_host} ${prometheus_port} + [Arguments] ${sdnc_id} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} - Wait Until Keyword Succeeds ${sdnc_status_max_wait_time} ${sdnc_status_pol_time} Check If SDNC Is Available ${sdnc_id} ${prometheus_host} ${prometheus_port} + Wait Until Keyword Succeeds ${sdnc_status_max_wait_time} ${sdnc_status_pol_time} Check If SDNC Is Available ${sdnc_id} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} Get SDNC ID @@ -95,7 +95,7 @@ Get SDNC ID Check If SDNC Is Available - [Arguments] ${sdnc_id} ${prometheus_host} ${prometheus_port} + [Arguments] ${sdnc_id} ${prometheus_host} ${prometheus_port} ${prometheus_password} ${prometheus_user} ${prometheus_password} - ${metric}= Get Metric ${prometheus_host} ${prometheus_port} osm_sdnc_status sdnc_id=${sdnc_id} + ${metric}= Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_password} ${prometheus_user} ${prometheus_password} osm_sdnc_status sdnc_id=${sdnc_id} Should Be Equal As Integers ${metric} 1 msg=SDNC '${sdnc_id}' is not active values=false diff --git a/robot-systest/lib/vim_lib.robot b/robot-systest/lib/vim_lib.robot index 8fd7e51..bfaae36 100644 --- a/robot-systest/lib/vim_lib.robot +++ b/robot-systest/lib/vim_lib.robot @@ -73,17 +73,17 @@ Check for VIM Target Check for VIM Target Metric - [Arguments] ${vim_name} ${prometheus_host} ${prometheus_port} + [Arguments] ${vim_name} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${vim_account_id}= Get VIM Target ID ${vim_name} - Wait Until Keyword Succeeds ${vim_status_max_wait_time} ${vim_status_pol_time} Check If VIM Target Has Metric ${vim_account_id} ${prometheus_host} ${prometheus_port} + Wait Until Keyword Succeeds ${vim_status_max_wait_time} ${vim_status_pol_time} Check If VIM Target Has Metric ${vim_account_id} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} Check for VIM Target Status - [Arguments] ${vim_name} ${prometheus_host} ${prometheus_port} + [Arguments] ${vim_name} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${vim_account_id}= Get VIM Target ID ${vim_name} - Wait Until Keyword Succeeds ${vim_status_max_wait_time} ${vim_status_pol_time} Check If VIM Target Is Available ${vim_account_id} ${prometheus_host} ${prometheus_port} + Wait Until Keyword Succeeds ${vim_status_max_wait_time} ${vim_status_pol_time} Check If VIM Target Is Available ${vim_account_id} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} Get VIM Target ID @@ -110,14 +110,14 @@ Check If VIM Target Is Enabled Check If VIM Target Is Available - [Arguments] ${vim_account_id} ${prometheus_host} ${prometheus_port} + [Arguments] ${vim_account_id} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} - ${metric}= Get Metric ${prometheus_host} ${prometheus_port} osm_vim_status vim_account_id=${vim_account_id} + ${metric}= Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} osm_vim_status vim_account_id=${vim_account_id} Should Be Equal As Integers ${metric} 1 msg=VIM Target '${vim_account_id}' is not active values=false Check If VIM Target Has Metric - [Arguments] ${vim_account_id} ${prometheus_host} ${prometheus_port} + [Arguments] ${vim_account_id} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} - ${metric}= Get Metric ${prometheus_host} ${prometheus_port} osm_vim_status vim_account_id=${vim_account_id} + ${metric}= Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} osm_vim_status vim_account_id=${vim_account_id} Should Be True ${metric} <2 msg=VIM Target '${vim_account_id}' has no metric diff --git a/robot-systest/resources/basic_01-crud_operations_on_vim_targets_data.py b/robot-systest/resources/basic_01-crud_operations_on_vim_targets_data.py index de9e696..c56d51a 100644 --- a/robot-systest/resources/basic_01-crud_operations_on_vim_targets_data.py +++ b/robot-systest/resources/basic_01-crud_operations_on_vim_targets_data.py @@ -17,7 +17,12 @@ from common_helpers import get_prometheus_info # Prometheus host and port -(prometheus_host, prometheus_port) = get_prometheus_info() +( + prometheus_host, + prometheus_port, + prometheus_user, + prometheus_password, +) = get_prometheus_info() # VIM configuration cloud_type = os.environ.get("CLOUD_TYPE", "openstack") @@ -27,7 +32,11 @@ if cloud_type == "openstack": vim_name_prefix = "basic01" # Get credentias from Openstack Clouds file os_cloud = os.environ.get("OS_CLOUD") - clouds_file_paths = ["./clouds.yaml", str(Path.home()) + "/.config/openstack/clouds.yaml", "/etc/openstack/clouds.yaml"] + clouds_file_paths = [ + "./clouds.yaml", + str(Path.home()) + "/.config/openstack/clouds.yaml", + "/etc/openstack/clouds.yaml", + ] for path in clouds_file_paths: clouds_file_path = Path(path) if clouds_file_path.exists(): @@ -49,12 +58,22 @@ if cloud_type == "openstack": raise Exception("Auth url not found in Openstack cloud '" + os_cloud + "'") vim_auth_url = cloud["auth"]["auth_url"] if not "project_name" in cloud["auth"]: - raise Exception("Project name not found in Openstack cloud '" + os_cloud + "'") + raise Exception( + "Project name not found in Openstack cloud '" + os_cloud + "'" + ) vim_tenant = cloud["auth"]["project_name"] - vim_user_domain_name = cloud["auth"]["user_domain_name"] if "user_domain_name" in cloud["auth"] else None - vim_project_domain_name = cloud["auth"]["project_domain_name"] if "project_domain_name" in cloud["auth"] else None + vim_user_domain_name = ( + cloud["auth"]["user_domain_name"] + if "user_domain_name" in cloud["auth"] + else None + ) + vim_project_domain_name = ( + cloud["auth"]["project_domain_name"] + if "project_domain_name" in cloud["auth"] + else None + ) vim_insecure = True if "verify" in cloud and not cloud["verify"] else None - + # Extra config vim_config_dict = {} vim_config_dict["vim_network_name"] = os.environ.get("VIM_MGMT_NET") @@ -64,7 +83,11 @@ if cloud_type == "openstack": vim_config_dict["user_domain_name"] = vim_user_domain_name if vim_insecure: vim_config_dict["insecure"] = True - vim_config = "'{}'".format(yaml.safe_dump(vim_config_dict, default_flow_style=True, width=10000).rstrip('\r\n')) + vim_config = "'{}'".format( + yaml.safe_dump(vim_config_dict, default_flow_style=True, width=10000).rstrip( + "\r\n" + ) + ) elif cloud_type == "azure": # Azure VIM @@ -87,7 +110,11 @@ elif cloud_type == "azure": vim_config_dict["vnet_name"] = os.environ.get("VNET_NAME") if "AZURE_FLAVORS_PATTERN" in os.environ: vim_config_dict["flavors_pattern"] = os.environ.get("AZURE_FLAVORS_PATTERN") - vim_config = "'{}'".format(yaml.safe_dump(vim_config_dict, default_flow_style=True, width=10000).rstrip('\r\n')) + vim_config = "'{}'".format( + yaml.safe_dump(vim_config_dict, default_flow_style=True, width=10000).rstrip( + "\r\n" + ) + ) else: raise Exception("VIM type not supported: '" + cloud_type + "'") diff --git a/robot-systest/resources/basic_08-disable_port_security_network_level_data.py b/robot-systest/resources/basic_08-disable_port_security_network_level_data.py index f4ee5f3..62cb9c3 100644 --- a/robot-systest/resources/basic_08-disable_port_security_network_level_data.py +++ b/robot-systest/resources/basic_08-disable_port_security_network_level_data.py @@ -18,7 +18,12 @@ from common_helpers import get_prometheus_info # Prometheus host and port -(prometheus_host, prometheus_port) = get_prometheus_info() +( + prometheus_host, + prometheus_port, + prometheus_user, + prometheus_password, +) = get_prometheus_info() # VIM Configuration vim_account_type = "openstack" @@ -26,7 +31,11 @@ vim_name = "basic_08_vim_test" # Get credentials from Openstack clouds file os_cloud = os.environ.get("OS_CLOUD") -clouds_file_paths = ["./clouds.yaml", str(Path.home()) + "/.config/openstack/clouds.yaml", "/etc/openstack/clouds.yaml"] +clouds_file_paths = [ + "./clouds.yaml", + str(Path.home()) + "/.config/openstack/clouds.yaml", + "/etc/openstack/clouds.yaml", +] for path in clouds_file_paths: clouds_file_path = Path(path) if clouds_file_path.exists(): @@ -50,8 +59,16 @@ with clouds_file_path.open() as clouds_file: if not "project_name" in cloud["auth"]: raise Exception("Project name not found in Openstack cloud '" + os_cloud + "'") vim_tenant = cloud["auth"]["project_name"] - vim_user_domain_name = cloud["auth"]["user_domain_name"] if "user_domain_name" in cloud["auth"] else None - vim_project_domain_name = cloud["auth"]["project_domain_name"] if "project_domain_name" in cloud["auth"] else None + vim_user_domain_name = ( + cloud["auth"]["user_domain_name"] + if "user_domain_name" in cloud["auth"] + else None + ) + vim_project_domain_name = ( + cloud["auth"]["project_domain_name"] + if "project_domain_name" in cloud["auth"] + else None + ) vim_insecure = True if "verify" in cloud and not cloud["verify"] else None # Extra VIM config @@ -65,18 +82,20 @@ if vim_insecure: vim_config_dict["insecure"] = True vim_config_dict["disable_network_port_security"] = True vim_config_dict["management_network_name"] = os.environ.get("VIM_MGMT_NET") -vim_config = "'{}'".format(yaml.safe_dump(vim_config_dict, default_flow_style=True, width=10000).rstrip('\r\n')) +vim_config = "'{}'".format( + yaml.safe_dump(vim_config_dict, default_flow_style=True, width=10000).rstrip("\r\n") +) # Get ${HOME} from local machine home = str(Path.home()) # NS and VNF descriptor package folder -vnfd_pkg = 'hackfest_multivdu_vnf' -nsd_pkg = 'hackfest_multivdu_ns' +vnfd_pkg = "hackfest_multivdu_vnf" +nsd_pkg = "hackfest_multivdu_ns" # NS and VNF descriptor id -vnfd_name = 'hackfest_multivdu-vnf' -nsd_name = 'hackfest_multivdu-ns' +vnfd_name = "hackfest_multivdu-vnf" +nsd_name = "hackfest_multivdu-ns" # NS instance name -ns_name = 'basic_08_disable_port_security_network_level_test' +ns_name = "basic_08_disable_port_security_network_level_test" # SSH keys to be used -publickey = home + '/.ssh/id_rsa.pub' -privatekey = home + '/.ssh/id_rsa' +publickey = home + "/.ssh/id_rsa.pub" +privatekey = home + "/.ssh/id_rsa" diff --git a/robot-systest/resources/common_helpers.py b/robot-systest/resources/common_helpers.py index 8ffaffe..87a3d34 100644 --- a/robot-systest/resources/common_helpers.py +++ b/robot-systest/resources/common_helpers.py @@ -13,10 +13,12 @@ import os def get_prometheus_info(): - if os.environ.get('PROMETHEUS_HOSTNAME', False): - prometheus_host = os.environ.get('PROMETHEUS_HOSTNAME') - prometheus_port = os.environ.get('PROMETHEUS_PORT', 9090) + if os.environ.get("PROMETHEUS_HOSTNAME", False): + prometheus_host = os.environ.get("PROMETHEUS_HOSTNAME") + prometheus_port = os.environ.get("PROMETHEUS_PORT", 9090) else: - prometheus_host = os.environ.get('OSM_HOSTNAME') - prometheus_port = os.environ.get('PROMETHEUS_PORT', 9091) - return prometheus_host, prometheus_port + prometheus_host = os.environ.get("OSM_HOSTNAME") + prometheus_port = os.environ.get("PROMETHEUS_PORT", 9091) + prometheus_user = os.environ.get("PROMETHEUS_USER", "") + prometheus_password = os.environ.get("PROMETHEUS_PASSWORD", "") + return prometheus_host, prometheus_port, prometheus_user, prometheus_password diff --git a/robot-systest/resources/epa_03-crud_operations_on_sdnc_data.py b/robot-systest/resources/epa_03-crud_operations_on_sdnc_data.py index 029cb2b..3267dd2 100644 --- a/robot-systest/resources/epa_03-crud_operations_on_sdnc_data.py +++ b/robot-systest/resources/epa_03-crud_operations_on_sdnc_data.py @@ -19,7 +19,12 @@ from common_helpers import get_prometheus_info # Prometheus host and port -(prometheus_host, prometheus_port) = get_prometheus_info() +( + prometheus_host, + prometheus_port, + prometheus_user, + prometheus_password, +) = get_prometheus_info() # SDNC Configuration diff --git a/robot-systest/resources/sa_01-vnf_with_vim_metrics_data.py b/robot-systest/resources/sa_01-vnf_with_vim_metrics_data.py index 6d63b55..27f448f 100644 --- a/robot-systest/resources/sa_01-vnf_with_vim_metrics_data.py +++ b/robot-systest/resources/sa_01-vnf_with_vim_metrics_data.py @@ -16,4 +16,9 @@ from common_helpers import get_prometheus_info # Prometheus host and port -(prometheus_host, prometheus_port) = get_prometheus_info() +( + prometheus_host, + prometheus_port, + prometheus_user, + prometheus_password, +) = get_prometheus_info() diff --git a/robot-systest/resources/sa_02-vnf_with_vim_metrics_and_autoscaling_data.py b/robot-systest/resources/sa_02-vnf_with_vim_metrics_and_autoscaling_data.py index 6d63b55..27f448f 100644 --- a/robot-systest/resources/sa_02-vnf_with_vim_metrics_and_autoscaling_data.py +++ b/robot-systest/resources/sa_02-vnf_with_vim_metrics_and_autoscaling_data.py @@ -16,4 +16,9 @@ from common_helpers import get_prometheus_info # Prometheus host and port -(prometheus_host, prometheus_port) = get_prometheus_info() +( + prometheus_host, + prometheus_port, + prometheus_user, + prometheus_password, +) = get_prometheus_info() diff --git a/robot-systest/resources/sa_07-alarms_from_sa-related_vnfs_data.py b/robot-systest/resources/sa_07-alarms_from_sa-related_vnfs_data.py index 6d63b55..27f448f 100644 --- a/robot-systest/resources/sa_07-alarms_from_sa-related_vnfs_data.py +++ b/robot-systest/resources/sa_07-alarms_from_sa-related_vnfs_data.py @@ -16,4 +16,9 @@ from common_helpers import get_prometheus_info # Prometheus host and port -(prometheus_host, prometheus_port) = get_prometheus_info() +( + prometheus_host, + prometheus_port, + prometheus_user, + prometheus_password, +) = get_prometheus_info() diff --git a/robot-systest/resources/sa_08-vnf_with_vnf_indicators_snmp_data.py b/robot-systest/resources/sa_08-vnf_with_vnf_indicators_snmp_data.py index 6d63b55..27f448f 100644 --- a/robot-systest/resources/sa_08-vnf_with_vnf_indicators_snmp_data.py +++ b/robot-systest/resources/sa_08-vnf_with_vnf_indicators_snmp_data.py @@ -16,4 +16,9 @@ from common_helpers import get_prometheus_info # Prometheus host and port -(prometheus_host, prometheus_port) = get_prometheus_info() +( + prometheus_host, + prometheus_port, + prometheus_user, + prometheus_password, +) = get_prometheus_info() diff --git a/robot-systest/testsuite/basic_01-crud_operations_on_vim_targets.robot b/robot-systest/testsuite/basic_01-crud_operations_on_vim_targets.robot index 9445a97..eb35010 100644 --- a/robot-systest/testsuite/basic_01-crud_operations_on_vim_targets.robot +++ b/robot-systest/testsuite/basic_01-crud_operations_on_vim_targets.robot @@ -33,7 +33,7 @@ Create VIM Target Basic ${created_vim_account_id}= Create VIM Target ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} Set Suite Variable ${created_vim_account_id} Check VIM Target Operational State ${vim_name} - Check for VIM Target Metric ${vim_name} ${prometheus_host} ${prometheus_port} + ${stdout}= Check for VIM Target Metric ${vim_name} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} Delete VIM Target By Name @@ -57,7 +57,7 @@ Create VIM Target With Extra Config ${created_vim_account_id}= Create VIM Target ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} config=${vim_config} Set Suite Variable ${created_vim_account_id} Check VIM Target Operational State ${vim_name} - Check for VIM Target Status ${vim_name} ${prometheus_host} ${prometheus_port} + Check for VIM Target Status ${vim_name} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} Delete VIM Target By ID diff --git a/robot-systest/testsuite/basic_08-disable_port_security_network_level.robot b/robot-systest/testsuite/basic_08-disable_port_security_network_level.robot index 41228ea..25164f5 100644 --- a/robot-systest/testsuite/basic_08-disable_port_security_network_level.robot +++ b/robot-systest/testsuite/basic_08-disable_port_security_network_level.robot @@ -38,7 +38,7 @@ ${port_disabled_msg} port_security_enabled: false Create VIM With Port Security Disabled ${created_vim_account_id}= Create VIM Target ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} config=${vim_config} - Check for VIM Target Status ${vim_name} ${prometheus_host} ${prometheus_port} + Check for VIM Target Status ${vim_name} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} Create VNF Descriptor diff --git a/robot-systest/testsuite/epa_03-crud_operations_on_sdnc.robot b/robot-systest/testsuite/epa_03-crud_operations_on_sdnc.robot index e507fa7..982a8de 100644 --- a/robot-systest/testsuite/epa_03-crud_operations_on_sdnc.robot +++ b/robot-systest/testsuite/epa_03-crud_operations_on_sdnc.robot @@ -37,7 +37,7 @@ Create Basic SDNC Check SDNC Status Is Healthy - Check for SDNC Status ${sdnc_id} ${prometheus_host} ${prometheus_port} + Check for SDNC Status ${sdnc_id} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} Delete Basic SDNC diff --git a/robot-systest/testsuite/sa_01-vnf_with_vim_metrics.robot b/robot-systest/testsuite/sa_01-vnf_with_vim_metrics.robot index df04d4e..b9b69ad 100644 --- a/robot-systest/testsuite/sa_01-vnf_with_vim_metrics.robot +++ b/robot-systest/testsuite/sa_01-vnf_with_vim_metrics.robot @@ -81,9 +81,9 @@ Get VNF VIM-based Metrics Variable Should Exist ${prometheus_port} msg=Prometheus port is not available Variable Should Exist ${metric_1_name} msg=Prometheus first metric name is not available Variable Should Exist ${metric_2_name} msg=Prometheus second metric name is not available - ${metric_1_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${metric_1_name} + ${metric_1_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${metric_1_name} Run Keyword If ${metric_1_value} <= 0 Fail msg=The metric '${metric_1_name}' value is '${metric_1_value}' - ${metric_2_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${metric_2_name} + ${metric_2_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${metric_2_name} Run Keyword If ${metric_2_value} <= 0 Fail msg=The metric '${metric_2_name}' value is '${metric_2_value}' diff --git a/robot-systest/testsuite/sa_02-vnf_with_vim_metrics_and_autoscaling.robot b/robot-systest/testsuite/sa_02-vnf_with_vim_metrics_and_autoscaling.robot index 74b56dd..76b3229 100644 --- a/robot-systest/testsuite/sa_02-vnf_with_vim_metrics_and_autoscaling.robot +++ b/robot-systest/testsuite/sa_02-vnf_with_vim_metrics_and_autoscaling.robot @@ -113,7 +113,7 @@ Get VNF VIM-based Metric Before Auto-scaling Variable Should Exist ${prometheus_host} msg=Prometheus address is not available Variable Should Exist ${prometheus_port} msg=Prometheus port is not available Variable Should Exist ${metric_name} msg=Prometheus metric name is not available - ${metric_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${metric_name} + ${metric_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${metric_name} Run Keyword If ${metric_value} <= 0 Fail msg=The metric '${metric_name}' value is '${metric_value}' Run Keyword If ${metric_value} >= ${metric_threshold} Fail msg=The metric '${metric_name}' value is higher than '${metric_threshold}' before scaling @@ -173,7 +173,7 @@ Check VIM-based Metric Exceeds Threshold Variable Should Exist ${prometheus_host} msg=Prometheus address is not available Variable Should Exist ${prometheus_port} msg=Prometheus port is not available Variable Should Exist ${metric_name} msg=Prometheus metric name is not available - ${metric_value}= Get Metric ${prometheus_host} ${prometheus_port} ${metric_name} + ${metric_value}= Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${metric_name} Run Keyword If ${metric_value} <= ${metric_threshold} Fail msg=The metric '${metric_name}' value is '${metric_value}' which is lower than '${metric_threshold}' diff --git a/robot-systest/testsuite/sa_07-alarms_from_sa-related_vnfs.robot b/robot-systest/testsuite/sa_07-alarms_from_sa-related_vnfs.robot index 465c300..4055dfd 100644 --- a/robot-systest/testsuite/sa_07-alarms_from_sa-related_vnfs.robot +++ b/robot-systest/testsuite/sa_07-alarms_from_sa-related_vnfs.robot @@ -137,7 +137,7 @@ Get Alarm Metric Variable Should Exist ${prometheus_host} msg=Prometheus address is not available Variable Should Exist ${prometheus_port} msg=Prometheus port is not available Variable Should Exist ${metric_name} msg=Prometheus metric name is not available - ${metric_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${metric_name} + ${metric_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${metric_name} Run Keyword If ${metric_value} <= 0 Fail msg=The metric '${metric_name}' value is '${metric_value}' diff --git a/robot-systest/testsuite/sa_08-vnf_with_vnf_indicators_snmp.robot b/robot-systest/testsuite/sa_08-vnf_with_vnf_indicators_snmp.robot index 5fde6ba..a937bcd 100644 --- a/robot-systest/testsuite/sa_08-vnf_with_vnf_indicators_snmp.robot +++ b/robot-systest/testsuite/sa_08-vnf_with_vnf_indicators_snmp.robot @@ -77,9 +77,9 @@ Get VNF SNMP Metrics Variable Should Exist ${prometheus_port} msg=Prometheus port is not available Variable Should Exist ${metric_1_name} msg=Prometheus first metric name is not available Variable Should Exist ${metric_2_name} msg=Prometheus second metric name is not available - ${metric_1_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${metric_1_name} ${metric_1_filter} + ${metric_1_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${metric_1_name} ${metric_1_filter} Run Keyword If ${metric_1_value} <= 0 Fail msg=The metric '${metric_1_name}' value is '${metric_1_value}' - ${metric_2_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${metric_2_name} ${metric_2_filter} + ${metric_2_value}= Wait Until Keyword Succeeds ${prometheus_poll_retries} ${prometheus_poll_timeout} Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${metric_2_name} ${metric_2_filter} Run Keyword If ${metric_2_value} <= 0 Fail msg=The metric '${metric_2_name}' value is '${metric_2_value}'