X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Ftests.git;a=blobdiff_plain;f=robot-systest%2Ftestsuite%2Fsa_08-vnf_with_vnf_indicators_snmp.robot;fp=robot-systest%2Ftestsuite%2Fsa_08-vnf_with_vnf_indicators_snmp.robot;h=7ba0818adff2bcd696ec0d4dbf1f3289f574cd85;hp=ea8873c0d113864d1ad3647a4f0c3d9d1fcdeb9f;hb=7a9e031926d2fa7ed5041485b3d41b0c1e85d2a9;hpb=23ff8f980f66ef57fb4d254336a018e3a697a187 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 ea8873c..7ba0818 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 @@ -1,3 +1,4 @@ +*** Comments *** # 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 @@ -10,6 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + *** Settings *** Documentation [SA-08] VNF with VNF-based indicators through SNMP. @@ -17,13 +19,13 @@ Library OperatingSystem Library String Library Collections -Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/prometheus_lib.robot +Resource ../lib/vnfd_lib.resource +Resource ../lib/nsd_lib.resource +Resource ../lib/ns_lib.resource +Resource ../lib/ssh_lib.resource +Resource ../lib/prometheus_lib.resource -Force Tags sa_08 cluster_k8s daily regression +Test 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 @@ -31,85 +33,76 @@ Suite Teardown Run Keyword And Ignore Error Suite Cleanup *** Variables *** # NS instantiation parameters -${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } +${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } # NS and VNF descriptor package folder and ids -${vnfd_pkg} snmp_ee_vnf -${vnfd_name} snmp_ee-vnf -${nsd_pkg} snmp_ee_ns -${nsd_name} snmp_ee-ns +${VNFD_PKG} snmp_ee_vnf +${VNFD_NAME} snmp_ee-vnf +${NSD_PKG} snmp_ee_ns +${NSD_NAME} snmp_ee-ns # NS instance name -${ns_name} sa_08-vnf_with_vnf_indicators_snmp_test +${NS_NAME} sa_08-vnf_with_vnf_indicators_snmp_test # Prometheus polling interval and retries -${prometheus_poll_retries} 10 times -${prometheus_poll_timeout} 1 minute +${PROMETHEUS_POLL_RETRIES} 10 times +${PROMETHEUS_POLL_TIMEOUT} 1 minute # Prometheus metrics to retrieve -${metric_1_name} ifInOctets -${metric_1_filter} ifIndex=1 -${metric_2_name} ifMtu -${metric_2_filter} ifIndex=2 +${METRIC_1_NAME} ifInOctets +${METRIC_1_FILTER} ifIndex=1 +${METRIC_2_NAME} ifMtu +${METRIC_2_FILTER} ifIndex=2 *** Test Cases *** Create VNF Descriptor - - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' - + [Documentation] Upload VNF package for the testsuite. + Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}' Create NS Descriptor - - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' - + [Documentation] Upload NS package for the testsuite. + Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}' Instantiate Network Service - - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${EMPTY} - Set Suite Variable ${ns_id} ${id} - + [Documentation] Instantiate the NS for the testsuite. + ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${EMPTY} + Set Suite Variable ${NS_ID} ${id} Get VNF SNMP Metrics - - 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_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} ${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} ${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}' - + [Documentation] Check that SNMP metrics from the VNF are stored in Prometheus. + 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_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} ${PROMETHEUS_USER} ${PROMETHEUS_PASSWORD} ${METRIC_1_NAME} ${METRIC_1_FILTER} + 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} ${PROMETHEUS_USER} ${PROMETHEUS_PASSWORD} ${METRIC_2_NAME} ${METRIC_2_FILTER} + IF ${metric_2_value} <= 0 Fail msg=The metric '${METRIC_2_NAME}' value is '${metric_2_value}' Delete NS Instance + [Documentation] Delete NS instance. [Tags] cleanup - - Delete NS ${ns_name} - + Delete NS ${NS_NAME} Delete NS Descriptor + [Documentation] Delete NS package from OSM. [Tags] cleanup - - Delete NSD ${nsd_name} - + Delete NSD ${NSD_NAME} Delete VNF Descriptor + [Documentation] Delete VNF package from OSM. [Tags] cleanup - - Delete VNFD ${vnfd_name} + Delete VNFD ${VNFD_NAME} *** 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 NS ${ns_name} - Run Keyword If Any Tests Failed Delete NSD ${nsd_name} - Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} + Run Keyword If Any Tests Failed Delete NS ${NS_NAME} + Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME} + Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME}