X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=robot-systest%2Flib%2Fprometheus_lib.robot;h=0f4f07c0a8ff14bf5754b2091bff1f84eee8f8f7;hb=23ff8f980f66ef57fb4d254336a018e3a697a187;hp=33208f3d2ed92ae891205adf440a13e3bf4a5768;hpb=2d4de332830e2f6deb4705fcc85d140c92e27c2c;p=osm%2Ftests.git diff --git a/robot-systest/lib/prometheus_lib.robot b/robot-systest/lib/prometheus_lib.robot index 33208f3..0f4f07c 100644 --- a/robot-systest/lib/prometheus_lib.robot +++ b/robot-systest/lib/prometheus_lib.robot @@ -15,32 +15,32 @@ Documentation Library to obtain metrics from Prometheus. Library String Library Collections +Library OperatingSystem Library RequestsLibrary *** Variables *** ${timeout} 30 ${max_retries} 1 -${prometheus_host} %{PROMETHEUS_HOSTNAME} -${prometheus_port} 9090 -${prometheus_user} %{PROMETHEUS_USER} -${prometheus_password} %{PROMETHEUS_PASSWORD} +${prometheus_host} %{PROMETHEUS_HOSTNAME=UNKNOWN} +${prometheus_port} %{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 + IF '${prometheus_host}' == 'UNKNOWN' + ${local_prometheus_host}= Get Environment Variable OSM_HOSTNAME + Set Suite Variable ${prometheus_host} ${local_prometheus_host} + Set Suite Variable ${prometheus_port} 9091 + END 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