feature8029 do not validate vim_account type 61/8161/3
authortierno <alfonso.tiernosepulveda@telefonica.com>
Wed, 13 Nov 2019 15:57:51 +0000 (15:57 +0000)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Fri, 22 Nov 2019 12:08:54 +0000 (12:08 +0000)
feature8030 do not validate wim_account type

Change-Id: I0d975b80481dd7562c631155444e3461dcc1dd94
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
osm_nbi/tests/test_admin_topics.py
osm_nbi/validation.py

index 739b68c..5597979 100755 (executable)
@@ -631,16 +631,17 @@ class Test_CommonVimWimSdn(TestCase):
                                "Wrong operation status enter time")
             self.assertEqual(operation["detailed-status"], "", "Wrong operation detailed status info")
             self.assertIsNone(operation["operationParams"], "Wrong operation parameters")
-        with self.subTest(i=2):
-            rollback = []
-            test_type = "bad_type"
-            with self.assertRaises(EngineException, msg="Accepted wrong CIM type") as e:
-                self.topic.new(rollback, self.fake_session,
-                               {"name": self.test_name, "wim_url": test_url, "wim_type": test_type})
-            self.assertEqual(len(rollback), 0, "Wrong rollback length")
-            self.assertEqual(e.exception.http_code, HTTPStatus.UNPROCESSABLE_ENTITY, "Wrong HTTP status code")
-            self.assertIn("format error at '{}' '{}".format("wim_type", "'{}' is not one of {}").format(test_type, ""),
-                          norm(str(e.exception)), "Wrong exception text")
+        # This test is disabled. From Feature 8030 we admit all WIM/SDN types
+        # with self.subTest(i=2):
+        #     rollback = []
+        #     test_type = "bad_type"
+        #     with self.assertRaises(EngineException, msg="Accepted wrong CIM type") as e:
+        #         self.topic.new(rollback, self.fake_session,
+        #                        {"name": self.test_name, "wim_url": test_url, "wim_type": test_type})
+        #     self.assertEqual(len(rollback), 0, "Wrong rollback length")
+        #     self.assertEqual(e.exception.http_code, HTTPStatus.UNPROCESSABLE_ENTITY, "Wrong HTTP status code")
+        #     self.assertIn("format error at '{}' '{}".format("wim_type", "'{}' is not one of {}").format(test_type,""),
+        #                   norm(str(e.exception)), "Wrong exception text")
 
     def test_conflict_on_new(self):
         with self.subTest(i=1):
index f4823f6..fe574e3 100644 (file)
@@ -363,7 +363,7 @@ ns_scale = {   # TODO for the moment it is only VDU-scaling
 
 schema_version = {"type": "string", "enum": ["1.0"]}
 schema_type = {"type": "string"}
-vim_type = {"enum": ["openstack", "openvim", "vmware", "opennebula", "aws", "azure", "fos"]}
+vim_type = shortname_schema  # {"enum": ["openstack", "openvim", "vmware", "opennebula", "aws", "azure", "fos"]}
 
 vim_account_edit_schema = {
     "title": "vim_account edit input schema",
@@ -410,7 +410,7 @@ vim_account_new_schema = {
     "additionalProperties": False
 }
 
-wim_type = {"enum": ["tapi", "onos", "odl", "dynpac", "fake"]}
+wim_type = shortname_schema  # {"enum": ["tapi", "onos", "odl", "dynpac", "fake"]}
 
 wim_account_edit_schema = {
     "title": "wim_account edit input schema",