From c1625bd8163ca269ee1a6b25a1f569b97b529b17 Mon Sep 17 00:00:00 2001 From: Ruoyu Ying Date: Wed, 4 Dec 2019 00:48:46 +0800 Subject: [WIP]Migration to new policy api *Change retrieval payload send to policy *Change the configs inside common_config Issue-ID: OPTFRA-520 Change-Id: I27a63294cdec3def7d415ed2dcb96e3606d9e21f Signed-off-by: Ruoyu Ying --- test/conductor/test_conductor_calls.py | 4 ++-- test/conductor/test_conductor_translation.py | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'test/conductor') diff --git a/test/conductor/test_conductor_calls.py b/test/conductor/test_conductor_calls.py index 52e0367..d811e63 100644 --- a/test/conductor/test_conductor_calls.py +++ b/test/conductor/test_conductor_calls.py @@ -40,12 +40,12 @@ class TestConductorCalls(unittest.TestCase): def test_request(self): req_json = json_from_file("./test/placement-tests/request.json") - policies = pol.get_local_policies("test/policy-local-files/", self.lp) + policies = pol.get_local_policies("test/policy-local-files/new_policies/", self.lp) conductor.request(req_json, self.osdf_config, policies) def test_request_vfmod(self): req_json = json_from_file("./test/placement-tests/request_vfmod.json") - policies = pol.get_local_policies("test/policy-local-files/", self.lp) + policies = pol.get_local_policies("test/policy-local-files/new_policies/", self.lp) conductor.request(req_json, self.osdf_config, policies) diff --git a/test/conductor/test_conductor_translation.py b/test/conductor/test_conductor_translation.py index ad70157..cc9dc1c 100644 --- a/test/conductor/test_conductor_translation.py +++ b/test/conductor/test_conductor_translation.py @@ -28,7 +28,7 @@ class TestConductorTranslation(unittest.TestCase): self.main_dir = "" self.conductor_api_template = self.main_dir + "osdf/templates/conductor_interface.json" self.local_config_file = self.main_dir + "config/common_config.yaml" - policy_data_path = self.main_dir + "test/policy-local-files" + policy_data_path = self.main_dir + "test/policy-local-files/new_policies" valid_policies_list_file = policy_data_path + '/' + 'meta-valid-policies.txt' valid_policies_files = local_policies.get_policy_names_from_file(valid_policies_list_file) @@ -44,13 +44,15 @@ class TestConductorTranslation(unittest.TestCase): def test_gen_demands(self): # need to run this only on vnf policies - vnf_policies = [x for x in self.policies if x["content"]["policyType"] == "vnfPolicy"] + vnf_policies = [x for x in self.policies if x[list(x.keys())[0]]["type"] + == "onap.policies.optimization.VnfPolicy"] res = tr.gen_demands(self.request_json, vnf_policies) assert res is not None def test_gen_vfmod_demands(self): # need to run this only on vnf policies - vnf_policies = [x for x in self.policies if x["content"]["policyType"] == "vnfPolicy"] + vnf_policies = [x for x in self.policies if x[list(x.keys())[0]]["type"] + == "onap.policies.optimization.VnfPolicy"] res = tr.gen_demands(self.request_vfmod_json, vnf_policies) assert res is not None -- cgit 1.2.3-korg