From f90e03c6a749ee25df3ac74355981861d59160d0 Mon Sep 17 00:00:00 2001 From: krishnaa96 Date: Tue, 20 Jul 2021 11:44:26 +0530 Subject: Add cps client to PCI app - Add CPS client - Add configuration to switch between CPS and config DB Issue-ID: OPTFRA-978 Signed-off-by: krishnaa96 Change-Id: Ibce259123864a16e5f9e3b8e53563151d8036a88 --- test/config/osdf_config.yaml | 9 +++++++++ test/configdb/test_configdb_calls.py | 2 +- .../simulators/configdb/response-payloads/getCellList-1000.json | 1 - .../simulators/configdb/response-payloads/getCellList-2000.json | 1 - .../configdb/response-payloads/getCellList-netw1000.json | 1 + .../configdb/response-payloads/getCellList-netw2000.json | 1 + test/functest/simulators/simulated-config/osdf_config.yaml | 2 ++ test/pci-optimization-tests/fixed_pci.json | 2 +- test/pci-optimization-tests/pci_anr_request.json | 2 +- test/pci-optimization-tests/request.json | 4 ++-- test/test_process_fixed_pci.py | 2 +- test/test_process_pci_anr_opt.py | 2 +- test/test_process_pci_opt.py | 2 +- 13 files changed, 21 insertions(+), 10 deletions(-) delete mode 100644 test/functest/simulators/configdb/response-payloads/getCellList-1000.json delete mode 100644 test/functest/simulators/configdb/response-payloads/getCellList-2000.json create mode 100644 test/functest/simulators/configdb/response-payloads/getCellList-netw1000.json create mode 100644 test/functest/simulators/configdb/response-payloads/getCellList-netw2000.json (limited to 'test') diff --git a/test/config/osdf_config.yaml b/test/config/osdf_config.yaml index 2b38ddd..05d7c6a 100755 --- a/test/config/osdf_config.yaml +++ b/test/config/osdf_config.yaml @@ -64,6 +64,15 @@ aaf_ca_certs: ssl_certs/aaf_root_ca.cer pciHMSUsername: "" # pcihandler username for call back. pciHMSPassword: "" # pcihandler password for call back. +configClientType: configdb + +# config db api +configDbUrl: http://127.0.0.1:5000/simulated/configdb +configDbUserName: osdf +configDbPassword: passwd +configDbGetCellListUrl: 'getCellList' +configDbGetNbrListUrl: 'getNbrList' + # Credentials for the OOF PCI Opt service osdfPCIOptUsername: PCI-OSDF-USER osdfPCIOptPassword: PCI-OSDF-PASSWD diff --git a/test/configdb/test_configdb_calls.py b/test/configdb/test_configdb_calls.py index a6f1c97..3393991 100644 --- a/test/configdb/test_configdb_calls.py +++ b/test/configdb/test_configdb_calls.py @@ -16,7 +16,7 @@ # ------------------------------------------------------------------------- # -from apps.pci.optimizers.configdb import request +from apps.pci.optimizers.config_request import request import osdf.config.loader as config_loader from osdf.utils.interfaces import json_from_file from osdf.utils.programming_utils import DotDict diff --git a/test/functest/simulators/configdb/response-payloads/getCellList-1000.json b/test/functest/simulators/configdb/response-payloads/getCellList-1000.json deleted file mode 100644 index df23f6e..0000000 --- a/test/functest/simulators/configdb/response-payloads/getCellList-1000.json +++ /dev/null @@ -1 +0,0 @@ -["cell0","cell1","cell2"] \ No newline at end of file diff --git a/test/functest/simulators/configdb/response-payloads/getCellList-2000.json b/test/functest/simulators/configdb/response-payloads/getCellList-2000.json deleted file mode 100644 index 77cf7db..0000000 --- a/test/functest/simulators/configdb/response-payloads/getCellList-2000.json +++ /dev/null @@ -1 +0,0 @@ -["cell20","cell21","cell22","cell23","cell24"] \ No newline at end of file diff --git a/test/functest/simulators/configdb/response-payloads/getCellList-netw1000.json b/test/functest/simulators/configdb/response-payloads/getCellList-netw1000.json new file mode 100644 index 0000000..df23f6e --- /dev/null +++ b/test/functest/simulators/configdb/response-payloads/getCellList-netw1000.json @@ -0,0 +1 @@ +["cell0","cell1","cell2"] \ No newline at end of file diff --git a/test/functest/simulators/configdb/response-payloads/getCellList-netw2000.json b/test/functest/simulators/configdb/response-payloads/getCellList-netw2000.json new file mode 100644 index 0000000..77cf7db --- /dev/null +++ b/test/functest/simulators/configdb/response-payloads/getCellList-netw2000.json @@ -0,0 +1 @@ +["cell20","cell21","cell22","cell23","cell24"] \ No newline at end of file diff --git a/test/functest/simulators/simulated-config/osdf_config.yaml b/test/functest/simulators/simulated-config/osdf_config.yaml index 2f03d99..eb02b33 100755 --- a/test/functest/simulators/simulated-config/osdf_config.yaml +++ b/test/functest/simulators/simulated-config/osdf_config.yaml @@ -60,6 +60,8 @@ aaf_sms_timeout: 30 secret_domain: osdf aaf_ca_certs: ssl_certs/aaf_root_ca.cer +configClientType: configdb + # config db api configDbUrl: http://127.0.0.1:5000/simulated/configdb configDbUserName: osdf diff --git a/test/pci-optimization-tests/fixed_pci.json b/test/pci-optimization-tests/fixed_pci.json index 8bd159e..0038d04 100644 --- a/test/pci-optimization-tests/fixed_pci.json +++ b/test/pci-optimization-tests/fixed_pci.json @@ -26,7 +26,7 @@ "cellInfo": { - "networkId": "2000", + "networkId": "netw2000", "cellIdList": [ diff --git a/test/pci-optimization-tests/pci_anr_request.json b/test/pci-optimization-tests/pci_anr_request.json index e8947b1..34e2409 100644 --- a/test/pci-optimization-tests/pci_anr_request.json +++ b/test/pci-optimization-tests/pci_anr_request.json @@ -12,7 +12,7 @@ "timeout": 600 }, "cellInfo": { - "networkId": "2000", + "networkId": "netw2000", "cellIdList": [ "cell20" ] diff --git a/test/pci-optimization-tests/request.json b/test/pci-optimization-tests/request.json index 517ee10..a8eb4f6 100644 --- a/test/pci-optimization-tests/request.json +++ b/test/pci-optimization-tests/request.json @@ -12,9 +12,9 @@ "timeout": 600 }, "cellInfo": { - "networkId": "1000", + "networkId": "netw1000", "cellIdList": [ "cell0" ] } -} \ No newline at end of file +} diff --git a/test/test_process_fixed_pci.py b/test/test_process_fixed_pci.py index da68289..3d805c5 100644 --- a/test/test_process_fixed_pci.py +++ b/test/test_process_fixed_pci.py @@ -31,7 +31,7 @@ class TestProcessPlacementOpt(unittest.TestCase): def setUp(self): mock_req_accept_message = Response("Accepted Request", content_type='application/json; charset=utf-8') - self.patcher_req = patch('apps.pci.optimizers.configdb.request', + self.patcher_req = patch('apps.pci.optimizers.config_request.request', return_value={"solutionInfo": {"placementInfo": "dummy"}}) self.patcher_req_accept = patch('osdf.operation.responses.osdf_response_for_request_accept', return_value=mock_req_accept_message) diff --git a/test/test_process_pci_anr_opt.py b/test/test_process_pci_anr_opt.py index b717d32..17c3e6d 100644 --- a/test/test_process_pci_anr_opt.py +++ b/test/test_process_pci_anr_opt.py @@ -32,7 +32,7 @@ class TestProcessPlacementOpt(unittest.TestCase): def setUp(self): mock_req_accept_message = Response("Accepted Request", content_type='application/json; charset=utf-8') - self.patcher_req = patch('apps.pci.optimizers.configdb.request', + self.patcher_req = patch('apps.pci.optimizers.config_request.request', return_value={"solutionInfo": {"placementInfo": "dummy"}}) self.patcher_req_accept = patch('osdf.operation.responses.osdf_response_for_request_accept', return_value=mock_req_accept_message) diff --git a/test/test_process_pci_opt.py b/test/test_process_pci_opt.py index ffbc718..d52599d 100644 --- a/test/test_process_pci_opt.py +++ b/test/test_process_pci_opt.py @@ -31,7 +31,7 @@ class TestProcessPlacementOpt(unittest.TestCase): def setUp(self): mock_req_accept_message = Response("Accepted Request", content_type='application/json; charset=utf-8') - self.patcher_req = patch('apps.pci.optimizers.configdb.request', + self.patcher_req = patch('apps.pci.optimizers.config_request.request', return_value={"solutionInfo": {"placementInfo": "dummy"}}) self.patcher_req_accept = patch('osdf.operation.responses.osdf_response_for_request_accept', return_value=mock_req_accept_message) -- cgit 1.2.3-korg