From a351dd2cde5da66a2a04b084e41d2e3210ca5945 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Tue, 27 Jun 2023 12:07:08 +0200 Subject: [PATCH] Remove get_osm_info from common_helpers.py and add it to rest_lib Change-Id: Ibacebaeca1306f3815cef3fff8554563b656cd6f Signed-off-by: garciadeblas --- robot-systest/lib/rest_lib.robot | 12 ++++-------- robot-systest/lib/vim_lib.robot | 1 + robot-systest/resources/common_helpers.py | 7 ------- .../sol003_01-vnf_lifecycle_management.py | 16 ---------------- 4 files changed, 5 insertions(+), 31 deletions(-) delete mode 100644 robot-systest/resources/sol003_01-vnf_lifecycle_management.py diff --git a/robot-systest/lib/rest_lib.robot b/robot-systest/lib/rest_lib.robot index 7541a52..ced8a21 100644 --- a/robot-systest/lib/rest_lib.robot +++ b/robot-systest/lib/rest_lib.robot @@ -19,13 +19,16 @@ Library yaml Library JSONLibrary Library String Library OperatingSystem + Resource %{ROBOT_DEVOPS_FOLDER}/lib/vim_lib.robot -Variables %{ROBOT_DEVOPS_FOLDER}/resources/sol003_01-vnf_lifecycle_management.py *** Variables *** @{success_status_code_list} 200 201 202 204 ${auth_token_uri} /osm/admin/v1/tokens ${HOST} ${EMPTY} +${osm_user} %{OSM_USER=admin} +${osm_password} %{OSM_PASSWORD=admin} +${osm_project} %{OSM_PROJECT=admin} *** Keywords *** Get Auth Token @@ -81,13 +84,6 @@ Get ID Set Suite Variable ${value} ${id[0]} [Return] ${value} -Update Json Value - [Arguments] ${JsonInput} ${key} - ${json_path}= Read Directory - ${json_obj}= Load JSON From File ${json_path}/${JsonInput} - ${updated_json_obj}= JSONLibrary.Update Value To Json ${json_obj} $..${key} ${created_vim_account_id} - Set Suite Variable ${updated_json_obj} - Get Api Request [Arguments] ${uri} [Documentation] Keyword to Get API Request diff --git a/robot-systest/lib/vim_lib.robot b/robot-systest/lib/vim_lib.robot index c1eaf91..2c96802 100644 --- a/robot-systest/lib/vim_lib.robot +++ b/robot-systest/lib/vim_lib.robot @@ -17,6 +17,7 @@ Library String Library Collections Library OperatingSystem +# Gerardo Resource %{ROBOT_DEVOPS_FOLDER}/lib/prometheus_lib.robot diff --git a/robot-systest/resources/common_helpers.py b/robot-systest/resources/common_helpers.py index 3753555..87a3d34 100644 --- a/robot-systest/resources/common_helpers.py +++ b/robot-systest/resources/common_helpers.py @@ -22,10 +22,3 @@ def get_prometheus_info(): prometheus_user = os.environ.get("PROMETHEUS_USER", "") prometheus_password = os.environ.get("PROMETHEUS_PASSWORD", "") return prometheus_host, prometheus_port, prometheus_user, prometheus_password - - -def get_osm_info(): - osm_user = os.environ.get("OSM_USER", "admin") - osm_password = os.environ.get("OSM_PASSWORD", "admin") - osm_project = os.environ.get("OSM_PROJECT", "admin") - return osm_user, osm_password, osm_project diff --git a/robot-systest/resources/sol003_01-vnf_lifecycle_management.py b/robot-systest/resources/sol003_01-vnf_lifecycle_management.py deleted file mode 100644 index a411cd2..0000000 --- a/robot-systest/resources/sol003_01-vnf_lifecycle_management.py +++ /dev/null @@ -1,16 +0,0 @@ -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from common_helpers import get_osm_info - - -(osm_user, osm_password, osm_project) = get_osm_info() -- 2.25.1