*** Variables ***
${timeout} 30
${max_retries} 1
+${prometheus_host} %{PROMETHEUS_HOSTNAME}
+${prometheus_port} 9090
+${prometheus_user} %{PROMETHEUS_USER}
+${prometheus_password} %{PROMETHEUS_PASSWORD}
*** Keywords ***
+Set Testsuite Prometheus Variables
+ [Documentation] Set Testsuite Prometheus Variables to be used in subsequent test cases
+
+ ${prometheus_port} Set Variable If '${prometheus_host}'=='${EMPTY}' 9091
+ Log ${prometheus_port}
+ ${prometheus_host} Set Variable If '${prometheus_host}'=='${EMPTY}' %{OSM_HOSTNAME}
+ Log ${prometheus_host}
+ Log ${prometheus_user}
+ Log ${prometheus_password}
+ Set Suite Variable ${prometheus_host}
+ Set Suite Variable ${prometheus_port}
+ Set Suite Variable ${prometheus_user}
+ Set Suite Variable ${prometheus_password}
+
+
Get Metric
[Documentation] Get the instant value of a metric from Prometheus using multiple filter parameters.
... The filter parameters are given to this function in key=value format (one argument per key/value pair).
import os
from pathlib import Path
import yaml
-from common_helpers import get_prometheus_info
-# Prometheus host and port
-(
- prometheus_host,
- prometheus_port,
- prometheus_user,
- prometheus_password,
-) = get_prometheus_info()
-
# VIM configuration
cloud_type = os.environ.get("CLOUD_TYPE", "openstack")
if cloud_type == "openstack":
from pathlib import Path
import yaml
-from common_helpers import get_prometheus_info
-
-
-# Prometheus host and port
-(
- prometheus_host,
- prometheus_port,
- prometheus_user,
- prometheus_password,
-) = get_prometheus_info()
# VIM Configuration
vim_account_type = "openstack"
+++ /dev/null
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-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)
- else:
- 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
import os
-from common_helpers import get_prometheus_info
-
-
-# Prometheus host and port
-(
- prometheus_host,
- prometheus_port,
- prometheus_user,
- prometheus_password,
-) = get_prometheus_info()
-
# SDNC Configuration
sdnc_name = "epa_03"
+++ /dev/null
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from common_helpers import get_prometheus_info
-
-
-# Prometheus host and port
-(
- prometheus_host,
- prometheus_port,
- prometheus_user,
- prometheus_password,
-) = get_prometheus_info()
+++ /dev/null
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from common_helpers import get_prometheus_info
-
-
-# Prometheus host and port
-(
- prometheus_host,
- prometheus_port,
- prometheus_user,
- prometheus_password,
-) = get_prometheus_info()
+++ /dev/null
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from common_helpers import get_prometheus_info
-
-
-# Prometheus host and port
-(
- prometheus_host,
- prometheus_port,
- prometheus_user,
- prometheus_password,
-) = get_prometheus_info()
+++ /dev/null
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from common_helpers import get_prometheus_info
-
-
-# Prometheus host and port
-(
- prometheus_host,
- prometheus_port,
- prometheus_user,
- prometheus_password,
-) = get_prometheus_info()
... All tests will be performed over an Openstack VIM, and the credentials will be loaded from clouds.yaml file.
Resource %{ROBOT_DEVOPS_FOLDER}/lib/vim_lib.robot
+Resource %{ROBOT_DEVOPS_FOLDER}/lib/prometheus_lib.robot
Variables %{ROBOT_DEVOPS_FOLDER}/resources/basic_01-crud_operations_on_vim_targets_data.py
Force Tags basic_01 cluster_main daily regression
+Suite Setup Run Keyword And Ignore Error Suite Preparation
+
*** Test Cases ***
Create VIM Target Basic
Should Be Equal As Strings ${vim_account_id} ${created_vim_account_id}
Delete VIM Target ${vim_account_id}
+
+*** Keywords ***
+Suite Preparation
+ [Documentation] Test Suite Preparation: Setting Prometheus Testsuite Variables
+
+ Set Testsuite Prometheus Variables
Force Tags basic_08 cluster_main daily regression
+Suite Setup Run Keyword And Ignore Error Suite Preparation
Suite Teardown Run Keyword And Ignore Error Suite Cleanup
*** Keywords ***
+Suite Preparation
+ [Documentation] Test Suite Preparation: Setting Prometheus Testsuite Variables
+
+ Set Testsuite Prometheus Variables
+
+
Suite Cleanup
[Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
Force Tags epa_03 cluster_epa daily regression
+Suite Setup Run Keyword And Ignore Error Suite Preparation
Suite Teardown Run Keyword And Ignore Error Delete Basic SDNC
[Tags] cleanup
Delete SDNC ${sdnc_name}
+
+
+*** Keywords ***
+Suite Preparation
+ [Documentation] Test Suite Preparation: Setting Prometheus Testsuite Variables
+
+ Set Testsuite Prometheus Variables
Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot
Resource %{ROBOT_DEVOPS_FOLDER}/lib/prometheus_lib.robot
-Variables %{ROBOT_DEVOPS_FOLDER}/resources/sa_01-vnf_with_vim_metrics_data.py
-
Force Tags sa_01 cluster_sa daily regression
+Suite Setup Run Keyword And Ignore Error Suite Preparation
Suite Teardown Run Keyword And Ignore Error Suite Cleanup
*** Keywords ***
+Suite Preparation
+ [Documentation] Test Suite Preparation: Setting Prometheus Testsuite Variables
+
+ Set Testsuite Prometheus Variables
+
+
Suite Cleanup
[Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}
-
-
Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot
Resource %{ROBOT_DEVOPS_FOLDER}/lib/prometheus_lib.robot
-Variables %{ROBOT_DEVOPS_FOLDER}/resources/sa_02-vnf_with_vim_metrics_and_autoscaling_data.py
-
Force Tags sa_02 cluster_sa daily regression sanity azure
+Suite Setup Run Keyword And Ignore Error Suite Preparation
Suite Teardown Run Keyword And Ignore Error Suite Cleanup
*** Keywords ***
+Suite Preparation
+ [Documentation] Test Suite Preparation: Setting Prometheus Testsuite Variables
+
+ Set Testsuite Prometheus Variables
+
+
Suite Cleanup
[Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
${metric_filter}= Set Variable ns_id=${ns_id}
${metric_value}= Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} ${metric_name} ${metric_filter}
Run Keyword If ${metric_value} <= ${metric_threshold} Fail msg=The metric '${metric_name}' value is '${metric_value}' which is lower than '${metric_threshold}'
-
Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot
Resource %{ROBOT_DEVOPS_FOLDER}/lib/prometheus_lib.robot
-Variables %{ROBOT_DEVOPS_FOLDER}/resources/sa_07-alarms_from_sa-related_vnfs_data.py
-
Force Tags sa_07 cluster_sa daily regression
+Suite Setup Run Keyword And Ignore Error Suite Preparation
Suite Teardown Run Keyword And Ignore Error Suite Cleanup
*** Keywords ***
+Suite Preparation
+ [Documentation] Test Suite Preparation: Setting Prometheus Testsuite Variables
+
+ Set Testsuite Prometheus Variables
+
+
Suite Cleanup
[Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot
Resource %{ROBOT_DEVOPS_FOLDER}/lib/prometheus_lib.robot
-Variables %{ROBOT_DEVOPS_FOLDER}/resources/sa_08-vnf_with_vnf_indicators_snmp_data.py
-
Force Tags sa_08 cluster_k8s daily regression
+Suite Setup Run Keyword And Ignore Error Suite Preparation
Suite Teardown Run Keyword And Ignore Error Suite Cleanup
*** Keywords ***
+Suite Preparation
+ [Documentation] Test Suite Preparation: Setting Prometheus Testsuite Variables
+
+ Set Testsuite Prometheus Variables
+
+
Suite Cleanup
[Documentation] Test Suite Cleanup: Deleting descriptors and NS instance