From: aguilard Date: Tue, 5 Oct 2021 15:01:54 +0000 (+0200) Subject: Updated SA02 test: CPU threshold read from VNF package X-Git-Tag: v10.1.1-rc1~9 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F50%2F11250%2F1;p=osm%2Ftests.git Updated SA02 test: CPU threshold read from VNF package Change-Id: Ia49b05458b14be6abe916d6a80812aa5c7643843 Signed-off-by: aguilard (cherry picked from commit 9c787e49096be55086ec0690b2307978f05c3b9c) --- 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 15a4477..1824990 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 @@ -21,9 +21,8 @@ from common_helpers import get_prometheus_info # Prometheus polling interval and retries prometheus_poll_retries = '15 times' prometheus_poll_timeout = '1 minute' -# Prometheus metric and threshold +# Prometheus metric metric_name = 'osm_cpu_utilization' -metric_threshold = 40 # Get ${HOME} from local machine home = str(Path.home()) # NS and VNF descriptor package folder @@ -33,7 +32,7 @@ nsd_pkg = 'hackfest_basic_metrics_ns' vnfd_name = 'hackfest_basic_metrics-vnf' nsd_name = 'hackfest_basic-ns-metrics' # NS instance name -ns_name = 'sa_02-vnf_with_vim_metrics_and_autoscaling_test' +ns_name = 'sa_02' # SSH keys to be used publickey = home + '/.ssh/id_rsa.pub' privatekey = home + '/.ssh/id_rsa' 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 77b87b2..e500cb7 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 @@ -39,6 +39,7 @@ ${vnf_member_index} 1 ${vnf_ip_addr} ${EMPTY} ${vnf_id} ${EMPTY} ${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } +${success_return_code} 0 *** Test Cases *** @@ -47,6 +48,15 @@ Create VNF Descriptor Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' +Get Scale-Out Threshold From VNF + + ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-show ${vnfd_name} --literal | yq '.df[0]."scaling-aspect"[0]."scaling-policy"[0]."scaling-criteria"[0]."scale-out-threshold"' | tr -d \\" + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + ${scaleout_threshold}= Convert To Number ${stdout} + Set Suite Variable ${metric_threshold} ${scaleout_threshold} + log ${metric_threshold} + + Create NS Descriptor Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}'