Check cross-references in automated tests 92/7092/2
authorgcalvino <guillermo.calvinosanchez@altran.com>
Thu, 10 Jan 2019 12:03:30 +0000 (13:03 +0100)
committergcalvino <guillermo.calvinosanchez@altran.com>
Thu, 10 Jan 2019 14:04:42 +0000 (15:04 +0100)
Change-Id: I8493927687aaf3f40550e69b7a91773ea826cc62
Signed-off-by: gcalvino <guillermo.calvinosanchez@altran.com>
osm_nbi/tests/test.py

index ddb5e69..884c08c 100755 (executable)
@@ -1791,6 +1791,14 @@ class TestDescriptors:
                     "/vnfpkgm/v1/vnf_packages/{}/package_content".format(self.vnfd_id), headers_zip_yaml,
                     "@b" + vnfd_filename_path, 204, None, 0)
 
+        queries = ["mgmt-interface.cp=mgmt", "vdu.0.interface.0.external-connection-point-ref=mgmt",
+                   "vdu.0.interface.1.internal-connection-point-ref=internal",
+                   "internal-vld.0.internal-connection-point.0.id-ref=internal"]
+        for query in queries:
+            engine.test("Upload invalid VNFD ", "PUT",
+                        "/vnfpkgm/v1/vnf_packages/{}/package_content?{}".format(self.vnfd_id, query),
+                        headers_zip_yaml, "@b" + vnfd_filename_path, 422, r_header_yaml, "yaml")
+
         # test bug 605
         engine.test("Upload invalid VNFD ", "PUT", "/vnfpkgm/v1/vnf_packages/{}/package_content".format(self.vnfd_id),
                     headers_yaml, self.vnfd_prova, 422, r_header_yaml, "yaml")
@@ -1821,6 +1829,12 @@ class TestDescriptors:
                     "@b" + nsd_filename_path, 201, r_headers_yaml_location_nsd, "yaml")
         self.nsd_id = engine.last_id
 
+        queries = ["vld.0.vnfd-connection-point-ref.0.vnfd-id-ref=hf"]
+        for query in queries:
+            engine.test("Upload invalid NSD ", "PUT",
+                        "/nsd/v1/ns_descriptors/{}/nsd_content?{}".format(self.nsd_id, query),
+                        headers_zip_yaml, "@b" + nsd_filename_path, 422, r_header_yaml, "yaml")
+
         # get nsd descriptor
         engine.test("Get NSD descriptor", "GET", "/nsd/v1/ns_descriptors/{}".format(self.nsd_id), headers_yaml,
                     None, 200, r_header_yaml, "yaml")