diff options
author | Malarvizhi <malarvizhi.44@wipro.com> | 2021-07-29 04:15:41 +0000 |
---|---|---|
committer | Malarvizhi <malarvizhi.44@wipro.com> | 2021-07-29 04:15:41 +0000 |
commit | 245abc2d72a119260933deac8c4332f04dcb95bf (patch) | |
tree | 3d11bb5072e2d747c8565bc1e240d366b73a51fd | |
parent | 3923a98d737cf3359657052492f48985d045635e (diff) |
Coverage Area to TA list mapping - OOF-CPS Integration
Issue-ID: OPTFRA-971
Signed-off-by: Malarvizhi Paramasivam <malarvizhi.44@wipro.com>
Change-Id: I672aeca56fbe248dee38a9be6fb6deb6988bc254
3 files changed, 9 insertions, 8 deletions
diff --git a/conductor/conductor/data/plugins/inventory_provider/candidates/slice_profiles_candidate.py b/conductor/conductor/data/plugins/inventory_provider/candidates/slice_profiles_candidate.py index a8f0b47..68e767e 100644 --- a/conductor/conductor/data/plugins/inventory_provider/candidates/slice_profiles_candidate.py +++ b/conductor/conductor/data/plugins/inventory_provider/candidates/slice_profiles_candidate.py @@ -43,7 +43,8 @@ ATTRIBUTE_AGGREGATION = { "ue_mobility_level": copy_first, "activity_factor": copy_first, "survival_time": copy_first, - "max_number_of_conns": copy_first + "max_number_of_conns": copy_first, + "coverage_area_ta_list": copy_first } @@ -87,12 +88,9 @@ def get_slice_requirements(subnet_requirements): slice_profile_tuples = {} for key in slice_requirements_keys: - if key == "coverage_area_ta_list": - pass - else: - attributes = [] - for slice_profile in subnet_requirements.values(): - attributes.append(slice_profile.get(key)) - slice_profile_tuples[key] = attributes + attributes = [] + for slice_profile in subnet_requirements.values(): + attributes.append(slice_profile.get(key)) + slice_profile_tuples[key] = attributes return {attr: ATTRIBUTE_AGGREGATION[attr](values) for attr, values in slice_profile_tuples.items()} diff --git a/conductor/conductor/tests/unit/data/plugins/inventory_provider/test_candidates.py b/conductor/conductor/tests/unit/data/plugins/inventory_provider/test_candidates.py index ded58ad..acf24c4 100644 --- a/conductor/conductor/tests/unit/data/plugins/inventory_provider/test_candidates.py +++ b/conductor/conductor/tests/unit/data/plugins/inventory_provider/test_candidates.py @@ -39,6 +39,7 @@ class TestCandidates(unittest.TestCase): "core_reliability": 99.99, "cost": 1.0, "coverage_area": "City: Chennai", + "coverage_area_ta_list": "City: Chennai", "inventory_provider": "generator", "inventory_type": "slice_profiles", "latency": 25, diff --git a/conductor/conductor/tests/unit/data/plugins/inventory_provider/test_generator.py b/conductor/conductor/tests/unit/data/plugins/inventory_provider/test_generator.py index 6978940..20218ab 100644 --- a/conductor/conductor/tests/unit/data/plugins/inventory_provider/test_generator.py +++ b/conductor/conductor/tests/unit/data/plugins/inventory_provider/test_generator.py @@ -38,6 +38,8 @@ class TestGenerator(unittest.TestCase): candidates_file = './conductor/tests/unit/data/plugins/inventory_provider/generated_candidates.json' expected_candidates = json.loads(open(candidates_file).read()) + for candidate in expected_candidates: + candidate['coverage_area_ta_list'] = [234,123,421] coverage_area_file='./conductor/tests/unit/data/plugins/inventory_provider/coverage_area.json' coverage_area_json = json.loads(open(coverage_area_file).read()) generator = Generator() |