Remove common_helpers.py and update tests using it
[osm/tests.git] / robot-systest / lib / prometheus_lib.robot
index 5fdda49..33208f3 100644 (file)
@@ -21,9 +21,28 @@ Library   RequestsLibrary
 *** 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).