Fix basic01 and vim_lib: success if any metric is registered in Prometheus 80/9780/2
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 2 Oct 2020 15:40:25 +0000 (15:40 +0000)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 6 Oct 2020 08:37:03 +0000 (08:37 +0000)
Change-Id: Ia27baf1e87f706777f8fd0e6665b91b9a695d1c7
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
robot-systest/lib/vim_lib.robot
robot-systest/testsuite/basic_01-crud_operations_on_vim_targets.robot

index a54448a..a156a9e 100644 (file)
@@ -70,6 +70,13 @@ Check for VIM Target
     Should Not Be Equal As Strings  ${stdout}  ${vim_name}
 
 
     Should Not Be Equal As Strings  ${stdout}  ${vim_name}
 
 
+Check for VIM Target Metric
+    [Arguments]  ${vim_name}  ${prometheus_host}  ${prometheus_port}
+
+    ${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}
+
+
 Check for VIM Target Status
     [Arguments]  ${vim_name}  ${prometheus_host}  ${prometheus_port}
 
 Check for VIM Target Status
     [Arguments]  ${vim_name}  ${prometheus_host}  ${prometheus_port}
 
@@ -91,3 +98,10 @@ Check If VIM Target Is Available
 
     ${metric}=  Get Metric  ${prometheus_host}  ${prometheus_port}  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
 
     ${metric}=  Get Metric  ${prometheus_host}  ${prometheus_port}  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}
+
+    ${metric}=  Get Metric  ${prometheus_host}  ${prometheus_port}  osm_vim_status  vim_account_id=${vim_account_id}
+    Should Be True   ${metric} <2   msg=VIM Target '${vim_account_id}' has no metric
index d848bd8..a05359d 100644 (file)
@@ -30,7 +30,7 @@ Create VIM Target Basic
     Set Suite Variable  ${vim_name}
     ${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}
     Set Suite Variable  ${vim_name}
     ${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 for VIM Target Status  ${vim_name}  ${prometheus_host}  ${prometheus_port}
+    Check for VIM Target Metric  ${vim_name}  ${prometheus_host}  ${prometheus_port}
 
 
 Delete VIM Target By Name
 
 
 Delete VIM Target By Name