Bug 806, System test exception handled!
[osm/devops.git] / systest / testcases / vnfs / test_vnfs.py
index 3eee94d..e7e1dce 100644 (file)
@@ -79,6 +79,10 @@ class TestClass(object):
         time.sleep(5)
 
     def vnf_test(self,osm, openstack, vim, vmware, vnfd_file_list, nsd_file_list, ns_scale=False):
+
+        # FIXME: need sleep after vim creation. Need a way to validate vim is ready to handle requests
+        time.sleep(20)
+
         for file in nsd_file_list:
             nsd_desc = osm.get_api().package.get_key_val_from_pkg(file)
 
@@ -86,16 +90,16 @@ class TestClass(object):
 
             assert osm.get_api().ns.create(nsd_desc['name'],ns_name,vim.vim_name)
 
-            if not utils.wait_for_value(lambda: osm.get_api().ns.get_field(ns_name,'operational-status'),result='init', wait_time=10):
+            if not utils.wait_for_value(lambda: osm.get_api().ns.get_field(ns_name,'operational-status'),result='init', wait_time=30):
                 nsr=osm.get_api().ns.get(ns_name)
                 pprint.pprint(nsr)
-                assert Fail, "operational-status != init"
+                assert True, "operational-status != init"
 
             # make sure ns is running
-            if not utils.wait_for_value(lambda: osm.get_api().ns.get_field(ns_name,'operational-status'),result='running',wait_time=30):
+            if not utils.wait_for_value(lambda: osm.get_api().ns.get_field(ns_name,'operational-status'),result='running',wait_time=240):
                 nsr=osm.get_api().ns.get(ns_name)
                 pprint.pprint(nsr)
-                assert Fail, "operational-status != running"
+                assert True, "operational-status != running"
 
             if ns_scale:
                 # for each descriptor, scale it
@@ -113,6 +117,12 @@ class TestClass(object):
 
             assert not osm.get_api().ns.delete(ns_name)
 
+            #wait for the ns to delete
+            try:
+                utils.wait_for_value( lambda: osm.get_api().ns.get(ns_name), result=False, wait_time=180)
+            except:
+                pass
+
             assert not osm.get_api().nsd.delete(nsd_desc['name'])
 
         for file in vnfd_file_list: