systest fixes to suport sol005 15/6415/1
authorMike Marchetti <mmarchetti@sandvine.com>
Tue, 14 Aug 2018 16:13:48 +0000 (12:13 -0400)
committerMike Marchetti <mmarchetti@sandvine.com>
Tue, 14 Aug 2018 16:14:04 +0000 (12:14 -0400)
Change-Id: I13fb63491b2ca341313c958b8460b96f62625a0c
Signed-off-by: Mike Marchetti <mmarchetti@sandvine.com>
systest/Makefile
systest/lib/osm/fixtures.py
systest/lib/osm/osm.py
systest/testcases/vim/test_vim.py

index 40492aa..6321901 100644 (file)
@@ -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) \
index 2c66ac5..889de15 100644 (file)
@@ -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,
index f67cf57..35b6144 100644 (file)
 #    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 
index 5193801..a80ae70 100644 (file)
@@ -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'])