X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_lcm%2Ftests%2Ftest_ns.py;h=28b8fbe25d45f3f1e58ce2f5818e31cff4dd513d;hb=4369058fc74040102bc7d5d41cd92b579e9027dc;hp=c0dda158734f636a1c9cce650c45c40829a0036b;hpb=656b6ddc53d7b6640a7b4fad1a7b80241dce9e70;p=osm%2FLCM.git diff --git a/osm_lcm/tests/test_ns.py b/osm_lcm/tests/test_ns.py index c0dda15..28b8fbe 100644 --- a/osm_lcm/tests/test_ns.py +++ b/osm_lcm/tests/test_ns.py @@ -342,6 +342,25 @@ class TestMyNS(asynctest.TestCase): self.assertEqual(return_value, expected_value) # print("scale_result: {}".format(self.db.get_one("nslcmops", {"_id": nslcmop_id}).get("detailed-status"))) + async def test_vca_status_refresh(self): + nsr_id = descriptors.test_ids["TEST-A"]["ns"] + nslcmop_id = descriptors.test_ids["TEST-A"]["instantiate"] + await self.my_ns.vca_status_refresh(nsr_id, nslcmop_id) + expected_value = dict() + return_value = dict() + vnf_descriptors = self.db.get_list("vnfds") + for i, _ in enumerate(vnf_descriptors): + for j, value in enumerate(vnf_descriptors[i]["df"]): + if "lcm-operations-configuration" in vnf_descriptors[i]["df"][j]: + if "day1-2" in value["lcm-operations-configuration"]["operate-vnf-op-config"]: + for k, v in enumerate(value["lcm-operations-configuration"]["operate-vnf-op-config"]["day1-2"]): + if "juju" in v["execution-environment-list"][k]: + expected_value = self.db.get_list("nsrs")[i]["vcaStatus"] + await self.my_ns._on_update_n2vc_db("nsrs", {"_id": nsr_id}, + "_admin.deployed.VCA.0", {}) + return_value = self.db.get_list("nsrs")[i]["vcaStatus"] + self.assertEqual(return_value, expected_value) + # Test _retry_or_skip_suboperation() # Expected result: # - if a suboperation's 'operationState' is marked as 'COMPLETED', SUBOPERATION_STATUS_SKIP is expected