summaryrefslogtreecommitdiffstats
path: root/robotframework-onap/ONAPLibrary/BaseAAIKeywords.py
diff options
context:
space:
mode:
authorDR695H <dr695h@att.com>2019-08-06 17:17:42 -0400
committerDR695H <dr695h@att.com>2019-08-06 17:17:42 -0400
commit9fef31d201bead81d118ad9d9db54d4a9292d0c0 (patch)
treec271fbaba6e55f8223d49e1648bc1857a46a592e /robotframework-onap/ONAPLibrary/BaseAAIKeywords.py
parent1f4b615239b75e2dfe0482555f01771aa8d4dc5a (diff)
fix few errors
fix aai lib not loading in no robot env, fix warnigs for https calls in requests, fix, add support for client certs Issue-ID: TEST-188 Change-Id: Ife00cca98efb412e8b24bba675526ae52413af74 Signed-off-by: DR695H <dr695h@att.com>
Diffstat (limited to 'robotframework-onap/ONAPLibrary/BaseAAIKeywords.py')
-rw-r--r--robotframework-onap/ONAPLibrary/BaseAAIKeywords.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/robotframework-onap/ONAPLibrary/BaseAAIKeywords.py b/robotframework-onap/ONAPLibrary/BaseAAIKeywords.py
index a512203..222c54b 100644
--- a/robotframework-onap/ONAPLibrary/BaseAAIKeywords.py
+++ b/robotframework-onap/ONAPLibrary/BaseAAIKeywords.py
@@ -18,7 +18,6 @@ from robot.libraries.BuiltIn import BuiltIn
import time
from ONAPLibrary.RequestsHelper import RequestsHelper
-from ONAPLibrary.HTTPKeywords import HTTPKeywords
from ONAPLibrary.VariableKeywords import VariableKeywords
@@ -30,36 +29,31 @@ class BaseAAIKeywords(object):
super(BaseAAIKeywords, self).__init__()
self.reqs = RequestsHelper()
self.builtin = BuiltIn()
- self.http = HTTPKeywords()
self.vars = VariableKeywords()
- aai_ip_addr = self.vars.get_globally_injected_parameters()['GLOBAL_INJECTED_AAI_IP_ADDR']
- aai_server_protocol = self.vars.get_global_parameters()['GLOBAL_AAI_SERVER_PROTOCOL']
- aai_server_port = self.vars.get_global_parameters()['GLOBAL_AAI_SERVER_PORT']
+ aai_ip_addr = self.vars.get_globally_injected_parameters().get('GLOBAL_INJECTED_AAI_IP_ADDR', '')
+ aai_server_protocol = self.vars.get_global_parameters().get('GLOBAL_AAI_SERVER_PROTOCOL', '')
+ aai_server_port = self.vars.get_global_parameters().get('GLOBAL_AAI_SERVER_PORT', '')
self.aai_endpoint = aai_server_protocol + '://' + aai_ip_addr + ':' + aai_server_port
@keyword
def run_get_request(self, endpoint, data_path, accept="application/json", auth=None):
"""Runs an AAI get request"""
- self.http.disable_warnings()
return self.reqs.get_request("aai", endpoint, data_path, sdc_user=None, accept=accept, auth=auth)
@keyword
def run_post_request(self, endpoint, data_path, data, accept="application/json", auth=None):
"""Runs an AAI post request"""
- self.http.disable_warnings()
return self.reqs.post_request("aai", endpoint, data_path, data, sdc_user=None, files=None,
accept=accept, auth=auth)
@keyword
def run_put_request(self, endpoint, data_path, data, accept="application/json", auth=None):
"""Runs an AAI post request"""
- self.http.disable_warnings()
return self.reqs.put_request("aai", endpoint, data_path, data, sdc_user=None, accept=accept, auth=auth)
@keyword
def run_delete_request(self, endpoint, data_path, resource_version, accept="application/json", auth=None):
"""Runs an AAI delete request"""
- self.http.disable_warnings()
return self.reqs.delete_request("aai", endpoint, data_path + '?resource-version=' + resource_version,
data=None, sdc_user=None, accept=accept, auth=auth)
@@ -67,6 +61,7 @@ class BaseAAIKeywords(object):
def wait_for_node_to_exist(self, search_node_type, key, uuid, auth=None):
logger.info('Waiting for AAI traversal to complete...')
for i in range(30):
+ logger.trace("running iteration " + str(i))
time.sleep(1)
result = self.find_node(search_node_type, key, uuid, auth=auth)
if result:
@@ -81,7 +76,6 @@ class BaseAAIKeywords(object):
def find_node(self, search_node_type, key, node_uuid, auth=None):
data_path = '/aai/v11/search/nodes-query?search-node-type={0}&filter={1}:EQUALS:{2}'.format(
search_node_type, key, node_uuid)
- self.http.disable_warnings()
resp = self.reqs.get_request("aai", self.aai_endpoint, data_path, accept="application/json", auth=auth)
response = resp.json()
return 'result-data' in response