From dbada22a91407ded3f66e93a7f4b165147ec7db1 Mon Sep 17 00:00:00 2001 From: Mike Marchetti Date: Tue, 14 Aug 2018 12:13:48 -0400 Subject: [PATCH] systest fixes to suport sol005 Change-Id: I13fb63491b2ca341313c958b8460b96f62625a0c Signed-off-by: Mike Marchetti --- systest/Makefile | 2 +- systest/lib/osm/fixtures.py | 3 +++ systest/lib/osm/osm.py | 6 +++--- systest/testcases/vim/test_vim.py | 22 +++++++++------------- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/systest/Makefile b/systest/Makefile index 40492aa2..6321901f 100644 --- a/systest/Makefile +++ b/systest/Makefile @@ -129,7 +129,7 @@ report_dir: _run_test: report_dir -$(Q)py.test \ - --osmhost $(OSM_HOSTNAME) \ + --osmhost $(OSM_HOSTNAME) --sol005 \ $(OPTION_RO_HOSTNAME) \ $(OPTION_OS_AUTH_URL) \ $(OPTION_OS_USERNAME) \ diff --git a/systest/lib/osm/fixtures.py b/systest/lib/osm/fixtures.py index 2c66ac59..889de153 100644 --- a/systest/lib/osm/fixtures.py +++ b/systest/lib/osm/fixtures.py @@ -20,6 +20,7 @@ import json def osm_add_options(parser): parser.addoption("--osmhost", default="", help="osm hostname") + parse.addoption("--sol005",action="store_true", help="enable sol005 API") parser.addoption("--osm_ro_host", default="", help="osm ro_host") parser.addoption("--osm-descriptor-packages", default="", help="location of descriptor packages") parser.addoption("--osm-vnfd-descriptor-packages", default="", help="vnfd packages to test") @@ -41,6 +42,7 @@ def osm(request): def osm(request): from lib.osm import osm osmhost=request.config.getoption("--osmhost") + sol005=request.config.getoption("--sol005") osm_ro_host=request.config.getoption("--osm_ro_host") descriptors_dir=request.config.getoption("--osm-descriptor-packages") vnfd_descriptors_list=request.config.getoption("--osm-vnfd-descriptor-packages").split(',') @@ -48,6 +50,7 @@ def osm(request): ns_name_prefix=request.config.getoption("--osm-ns-name-prefix") return osm.Osm(osmhost, ro_host=osm_ro_host, + sol005=sol005 descriptors_dir=descriptors_dir, vnfd_descriptors_list=vnfd_descriptors_list, nsd_descriptors_list=nsd_descriptors_list, diff --git a/systest/lib/osm/osm.py b/systest/lib/osm/osm.py index f67cf57e..35b6144b 100644 --- a/systest/lib/osm/osm.py +++ b/systest/lib/osm/osm.py @@ -15,11 +15,11 @@ # under the License. -from osmclient.client import client +from osmclient import client class Osm(): - def __init__(self,osmhost,ro_host=None,descriptors_dir=None,vnfd_descriptors_list=None,nsd_descriptors_list=None,ns_name_prefix=None): - self._OsmApi=client.Client(host=osmhost,ro_host=ro_host) + def __init__(self,osmhost,sol005=None,ro_host=None,descriptors_dir=None,vnfd_descriptors_list=None,nsd_descriptors_list=None,ns_name_prefix=None): + self._OsmApi=client.Client(host=osmhost,sol005=sol005,ro_host=ro_host) self._descriptors_dir = descriptors_dir self.vnfd_descriptors_list = vnfd_descriptors_list self.nsd_descriptors_list = nsd_descriptors_list diff --git a/systest/testcases/vim/test_vim.py b/systest/testcases/vim/test_vim.py index 51938011..a80ae708 100644 --- a/systest/testcases/vim/test_vim.py +++ b/systest/testcases/vim/test_vim.py @@ -51,11 +51,10 @@ class TestClass(object): resp=osm.get_api().vim.get(vim_name) assert resp['name'] == vim_name - assert resp['type'] == 'openstack' + assert resp['vim_type'] == 'openstack' assert resp['vim_url'] == os_access['vim-url'] - assert resp['vim_url_admin'] == os_access['vim-url'] - assert resp['vim_tenants'][0]['user'] == os_access['vim-username'] - assert resp['vim_tenants'][0]['vim_tenant_name'] == os_access['vim-tenant-name'] + assert resp['vim_user'] == os_access['vim-username'] + assert resp['vim_tenant_name'] == os_access['vim-tenant-name'] assert not osm.get_api().vim.delete(vim_name) @pytest.mark.vmware @@ -73,12 +72,10 @@ class TestClass(object): resp=osm.get_api().vim.get(vim_name) assert resp['name'] == vim_name - assert resp['type'] == 'vmware' + assert resp['vim_type'] == 'vmware' assert resp['vim_url'] == os_access['vim-url'] - assert resp['vim_url_admin'] == os_access['vim-url'] - assert resp['vim_tenants'][0]['user'] == os_access['vim-username'] - assert resp['vim_tenants'][0]['vim_tenant_name'] == os_access['vim-tenant-name'] - + assert resp['vim_user'] == os_access['vim-username'] + assert resp['vim_tenant_name'] == os_access['vim-tenant-name'] assert not osm.get_api().vim.delete(vim_name) #@pytest.mark.smoke @@ -96,11 +93,10 @@ class TestClass(object): assert not osm.get_api().vim.create(vim['name'],os_access) resp=osm.get_api().vim.get(vim['name']) assert resp['name'] == vim['name'] - assert resp['type'] == vim['vim-type'] + assert resp['vim_type'] == vim['vim-type'] assert resp['vim_url'] == os_access['vim-url'] - assert resp['vim_url_admin'] == os_access['vim-url'] - assert resp['vim_tenants'][0]['user'] == os_access['vim-username'] - assert resp['vim_tenants'][0]['vim_tenant_name'] == os_access['vim-tenant-name'] + assert resp['vim_user'] == os_access['vim-username'] + assert resp['vim_tenant_name'] == os_access['vim-tenant-name'] for vim in osm.get_api().vim.list(False): osm.get_api().vim.delete(vim['name']) -- 2.25.1