diff options
author | 2020-06-22 18:51:43 +0100 | |
---|---|---|
committer | 2020-07-06 09:07:37 +0100 | |
commit | 0464347539f931847ab578ff935994aef0102352 (patch) | |
tree | 601971765ec6b363b6755984e437c02bea3c83ec /components/pm-subscription-handler/tests | |
parent | b80449b81a2deb3b6e2510a655de02f9375ef636 (diff) |
[PMSH] Add enable_tls boolean flag to config1.1.0
Signed-off-by: efiacor <fiachra.corcoran@est.tech>
Change-Id: I19f71b690f743980eaa149c9b2c76fecb98a0120
Issue-ID: DCAEGEN2-2146
Diffstat (limited to 'components/pm-subscription-handler/tests')
9 files changed, 25 insertions, 89 deletions
diff --git a/components/pm-subscription-handler/tests/data/cbs_data_1.json b/components/pm-subscription-handler/tests/data/cbs_data_1.json index 8dc225dc..75253c88 100644 --- a/components/pm-subscription-handler/tests/data/cbs_data_1.json +++ b/components/pm-subscription-handler/tests/data/cbs_data_1.json @@ -64,13 +64,15 @@ "operational_policy_name": "pmsh-operational-policy", "aaf_password":"demo123456!", "aaf_identity":"dcae@dcae.onap.org", - "cert_path":"/opt/app/pm-mapper/etc/certs/cert.pem", - "key_path":"/opt/app/pm-mapper/etc/certs/key.pem", + "cert_path":"/opt/app/pmsh/etc/certs/cert.pem", + "key_path":"/opt/app/pmsh/etc/certs/key.pem", + "ca_cert_path":"/opt/app/pmsh/etc/certs/cacert.pem", + "enable_tls":"true", "streams_subscribes":{ "aai_subscriber":{ "type":"message_router", "dmaap_info":{ - "topic_url":"https://node:30226/events/AAI_EVENT", + "topic_url":"https://message-router:3905/events/AAI_EVENT", "client_role":"org.onap.dcae.aaiSub", "location":"san-francisco", "client_id":"1575976809466" @@ -79,7 +81,7 @@ "policy_pm_subscriber":{ "type":"message_router", "dmaap_info":{ - "topic_url":"https://node:30226/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS", + "topic_url":"https://message-router:3905/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS", "client_role":"org.onap.dcae.pmSubscriber", "location":"san-francisco", "client_id":"1575876809456" @@ -90,7 +92,7 @@ "policy_pm_publisher":{ "type":"message_router", "dmaap_info":{ - "topic_url":"https://node:30226/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS", + "topic_url":"https://message-router:3905/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS", "client_role":"org.onap.dcae.pmPublisher", "location":"san-francisco", "client_id":"1475976809466" @@ -99,7 +101,7 @@ "other_publisher":{ "type":"message_router", "dmaap_info":{ - "topic_url":"https://node:30226/events/org.onap.dmaap.mr.SOME_OTHER_TOPIC", + "topic_url":"https://message-router:3905/events/org.onap.dmaap.mr.SOME_OTHER_TOPIC", "client_role":"org.onap.dcae.pmControlPub", "location":"san-francisco", "client_id":"1875976809466" diff --git a/components/pm-subscription-handler/tests/data/cbs_data_2.json b/components/pm-subscription-handler/tests/data/cbs_data_2.json deleted file mode 100755 index c223ddea..00000000 --- a/components/pm-subscription-handler/tests/data/cbs_data_2.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "config":{}, - "policy": { - "subscription": { - "subscriptionName": "someExtraPM-AllKista-gNB-R2B", - "administrativeState": "UNLOCKED", - "fileBasedGP": 15, - "fileLocation": "c:\/\/PM", - "nfFilter": { - "swVersions": [ - "A21", - "B" - ], - "nfNames": [ - "ABC", - "DEF", - "foo.*" - ] - }, - "measurementGroups": [ - { - "measurementGroup": { - "measurementTypes": [ - { - "measurementType": "countera" - }, - { - "measurementType": "counterb" - } - ], - "managedObjectDNsBasic": [ - { - "DN": "dna" - }, - { - "DN": "dnb" - } - ] - } - }, - { - "measurementGroup": { - "measurementTypes": [ - { - "measurementType": "counterc" - }, - { - "measurementType": "counterd" - } - ], - "managedObjectDNsBasic": [ - { - "DN": "dnc" - }, - { - "DN": "dnd" - } - ] - } - } - ] - } -} - - - -}
\ No newline at end of file diff --git a/components/pm-subscription-handler/tests/data/mr_aai_events.json b/components/pm-subscription-handler/tests/data/mr_aai_events.json index 202d1339..156a8e8d 100755 --- a/components/pm-subscription-handler/tests/data/mr_aai_events.json +++ b/components/pm-subscription-handler/tests/data/mr_aai_events.json @@ -2,5 +2,8 @@ "mr_response": [
"{\"cambria.partition\":\"AAI\",\"event-header\":{\"severity\":\"NORMAL\",\"entity-type\":\"pnf\",\"top-entity-type\":\"pnf\",\"entity-link\":\"/aai/v16/network/pnfs/pnf/pnf_newly_discovered\",\"event-type\":\"AAI-EVENT\",\"domain\":\"dev\",\"action\":\"UPDATE\",\"sequence-number\":\"0\",\"id\":\"db09e090-196e-4f84-9645-e449b1cd3640\",\"source-name\":\"dcae-curl\",\"version\":\"v16\",\"timestamp\":\"20200203-15:14:08:807\"},\"entity\":{\"ipaddress-v4-oam\":\"10.10.10.37\",\"nf-role\":\"gNB\",\"equip-type\":\"val8\",\"relationship-list\":{\"relationship\":[{\"related-to\":\"service-instance\",\"relationship-data\":[{\"relationship-value\":\"Demonstration\",\"relationship-key\":\"customer.global-customer-id\"},{\"relationship-value\":\"vCPE\",\"relationship-key\":\"service-subscription.service-type\"},{\"relationship-value\":\"2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-key\":\"service-instance.service-instance-id\"}],\"related-link\":\"/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-label\":\"org.onap.relationships.inventory.ComposedOf\",\"related-to-property\":[{\"property-key\":\"service-instance.service-instance-name\",\"property-value\":\"Svc6_1\"}]}]},\"equip-vendor\":\"Ericsson\",\"serial-number\":\"6061ZW3\",\"ipaddress-v6-oam\":\"2001:0db8:0:0:0:0:1428:57ab\",\"equip-model\":\"val6\",\"in-maint\":false,\"resource-version\":\"1578668956804\",\"sw-version\":\"val7\",\"pnf-id\":\"eabcfaf7-b7f3-45fb-94e7-e6112fb3e8b8\",\"pnf-name\":\"pnf_newly_discovered\",\"orchestration-status\":\"Active\"}}",
"{\"cambria.partition\":\"AAI\",\"event-header\":{\"severity\":\"NORMAL\",\"entity-type\":\"pnf\",\"top-entity-type\":\"pnf\",\"entity-link\":\"/aai/v16/network/pnfs/pnf/pnf_newly_discovered\",\"event-type\":\"AAI-EVENT\",\"domain\":\"dev\",\"action\":\"UPDATE\",\"sequence-number\":\"0\",\"id\":\"db09e090-196e-4f84-9645-e449b1cd3640\",\"source-name\":\"dcae-curl\",\"version\":\"v16\",\"timestamp\":\"20200203-15:14:08:807\"},\"entity\":{\"orchestration-status\":\"Active\",\"ipaddress-v4-oam\":\"10.10.10.37\",\"nf-role\":\"gNB\",\"equip-type\":\"val8\",\"relationship-list\":{\"relationship\":[{\"related-to\":\"service-instance\",\"relationship-data\":[{\"relationship-value\":\"Demonstration\",\"relationship-key\":\"customer.global-customer-id\"},{\"relationship-value\":\"vCPE\",\"relationship-key\":\"service-subscription.service-type\"},{\"relationship-value\":\"2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-key\":\"service-instance.service-instance-id\"}],\"related-link\":\"/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-label\":\"org.onap.relationships.inventory.ComposedOf\",\"related-to-property\":[{\"property-key\":\"service-instance.service-instance-name\",\"property-value\":\"Svc6_1\"}]}]},\"equip-vendor\":\"Ericsson\",\"serial-number\":\"6061ZW3\",\"ipaddress-v6-oam\":\"2001:0db8:0:0:0:0:1428:57ab\",\"equip-model\":\"val6\",\"in-maint\":false,\"resource-version\":\"1578668956804\",\"sw-version\":\"val7\",\"pnf-id\":\"eabcfaf7-b7f3-45fb-94e7-e6112fb3e8b8\",\"pnf-name\":\"pnf_already_active\",\"orchestration-status\":\"Active\"}}",
- "{\"cambria.partition\":\"AAI\",\"event-header\":{\"severity\":\"NORMAL\",\"entity-type\":\"pnf\",\"top-entity-type\":\"pnf\",\"entity-link\":\"/aai/v16/network/pnfs/pnf/pnf_newly_discovered\",\"event-type\":\"AAI-EVENT\",\"domain\":\"dev\",\"action\":\"DELETE\",\"sequence-number\":\"0\",\"id\":\"db09e090-196e-4f84-9645-e449b1cd3640\",\"source-name\":\"dcae-curl\",\"version\":\"v16\",\"timestamp\":\"20200203-15:14:08:807\"},\"entity\":{\"ipaddress-v4-oam\":\"10.10.10.37\",\"nf-role\":\"gNB\",\"equip-type\":\"val8\",\"relationship-list\":{\"relationship\":[{\"related-to\":\"service-instance\",\"relationship-data\":[{\"relationship-value\":\"Demonstration\",\"relationship-key\":\"customer.global-customer-id\"},{\"relationship-value\":\"vCPE\",\"relationship-key\":\"service-subscription.service-type\"},{\"relationship-value\":\"2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-key\":\"service-instance.service-instance-id\"}],\"related-link\":\"/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-label\":\"org.onap.relationships.inventory.ComposedOf\",\"related-to-property\":[{\"property-key\":\"service-instance.service-instance-name\",\"property-value\":\"Svc6_1\"}]}]},\"equip-vendor\":\"Ericsson\",\"serial-number\":\"6061ZW3\",\"ipaddress-v6-oam\":\"2001:0db8:0:0:0:0:1428:57ab\",\"equip-model\":\"val6\",\"in-maint\":false,\"resource-version\":\"1578668956804\",\"sw-version\":\"val7\",\"pnf-id\":\"eabcfaf7-b7f3-45fb-94e7-e6112fb3e8b8\",\"pnf-name\":\"pnf_to_be_deleted\",\"orchestration-status\":\"Active\"}}"]
+ "{\"cambria.partition\":\"AAI\",\"event-header\":{\"severity\":\"NORMAL\",\"entity-type\":\"pnf\",\"top-entity-type\":\"pnf\",\"entity-link\":\"/aai/v16/network/pnfs/pnf/pnf_newly_discovered\",\"event-type\":\"AAI-EVENT\",\"domain\":\"dev\",\"action\":\"DELETE\",\"sequence-number\":\"0\",\"id\":\"db09e090-196e-4f84-9645-e449b1cd3640\",\"source-name\":\"dcae-curl\",\"version\":\"v16\",\"timestamp\":\"20200203-15:14:08:807\"},\"entity\":{\"ipaddress-v4-oam\":\"10.10.10.37\",\"nf-role\":\"gNB\",\"equip-type\":\"val8\",\"relationship-list\":{\"relationship\":[{\"related-to\":\"service-instance\",\"relationship-data\":[{\"relationship-value\":\"Demonstration\",\"relationship-key\":\"customer.global-customer-id\"},{\"relationship-value\":\"vCPE\",\"relationship-key\":\"service-subscription.service-type\"},{\"relationship-value\":\"2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-key\":\"service-instance.service-instance-id\"}],\"related-link\":\"/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-label\":\"org.onap.relationships.inventory.ComposedOf\",\"related-to-property\":[{\"property-key\":\"service-instance.service-instance-name\",\"property-value\":\"Svc6_1\"}]}]},\"equip-vendor\":\"Ericsson\",\"serial-number\":\"6061ZW3\",\"ipaddress-v6-oam\":\"2001:0db8:0:0:0:0:1428:57ab\",\"equip-model\":\"val6\",\"in-maint\":false,\"resource-version\":\"1578668956804\",\"sw-version\":\"val7\",\"pnf-id\":\"eabcfaf7-b7f3-45fb-94e7-e6112fb3e8b8\",\"pnf-name\":\"pnf_to_be_deleted\",\"orchestration-status\":\"Active\"}}",
+ "{\"cambria.partition\":\"AAI\",\"event-header\":{\"severity\":\"NORMAL\",\"entity-type\":\"model-ver\",\"top-entity-type\":\"model\",\"entity-link\":\"/aai/v19/service-design-and-creation/models/model/60cd7bbf-0a6b-43ce-a5af-07cbf168ecdc/model-vers/model-ver/5485c7ac-825f-414d-aba4-e24147107d0b\",\"event-type\":\"AAI-EVENT\",\"domain\":\"dev\",\"action\":\"UPDATE\",\"sequence-number\":\"0\",\"id\":\"e16cb0f9-3617-4a14-9c81-f7ee4cdf9df7\",\"source-name\":\"UNKNOWN\",\"version\":\"v19\",\"timestamp\":\"20200701-12:06:12:135\"},\"entity\":{\"model-type\":\"service\",\"model-vers\":{\"model-ver\":[{\"model-version-id\":\"5485c7ac-825f-414d-aba4-e24147107d0b\",\"resource-version\":\"1593605171956\",\"model-description\":\"catalog service description\",\"model-name\":\"Demo_pNF_WCcM9Z2VNE3eGfLIKulP\",\"model-elements\":{\"model-element\":[{\"relationship-list\":{\"relationship\":[{\"related-to\":\"model-ver\",\"relationship-data\":[{\"relationship-value\":\"82194af1-3c2c-485a-8f44-420e22a9eaa4\",\"relationship-key\":\"model.model-invariant-id\"},{\"relationship-value\":\"46b92144-923a-4d20-b85a-3cbd847668a9\",\"relationship-key\":\"model-ver.model-version-id\"}],\"related-link\":\"/aai/v19/service-design-and-creation/models/model/82194af1-3c2c-485a-8f44-420e22a9eaa4/model-vers/model-ver/46b92144-923a-4d20-b85a-3cbd847668a9\",\"relationship-label\":\"org.onap.relationships.inventory.IsA\",\"related-to-property\":[{\"property-key\":\"model-ver.model-name\",\"property-value\":\"service-instance\"}]}]},\"resource-version\":\"1593605012006\",\"model-elements\":{\"model-element\":[{\"relationship-list\":{\"relationship\":[{\"related-to\":\"model-ver\",\"relationship-data\":[{\"relationship-value\":\"c8fb1064-f38a-4a13-90a6-ec60289879ac\",\"relationship-key\":\"model.model-invariant-id\"},{\"relationship-value\":\"94c051c3-4484-425e-a107-6914816321a6\",\"relationship-key\":\"model-ver.model-version-id\"}],\"related-link\":\"/aai/v19/service-design-and-creation/models/model/c8fb1064-f38a-4a13-90a6-ec60289879ac/model-vers/model-ver/94c051c3-4484-425e-a107-6914816321a6\",\"relationship-label\":\"org.onap.relationships.inventory.IsA\",\"related-to-property\":[{\"property-key\":\"model-ver.model-name\",\"property-value\":\"pNF 77be3d89-b735\"}]}]},\"resource-version\":\"1593605012006\",\"new-data-del-flag\":\"T\",\"cardinality\":\"unbounded\",\"model-element-uuid\":\"44712769-981d-4970-9ea5-4c99b86f838e\"}]},\"new-data-del-flag\":\"T\",\"cardinality\":\"unbounded\",\"model-element-uuid\":\"4a601305-9e09-4152-98ad-b8c466d57813\"}]},\"model-version\":\"1.0\",\"distribution-status\":\"DISTRIBUTION_COMPLETE_OK\"}]},\"model-invariant-id\":\"60cd7bbf-0a6b-43ce-a5af-07cbf168ecdc\"}}",
+ "{\"cambria.partition\":\"AAI\",\"event-header\":{\"severity\":\"NORMAL\",\"entity-type\":\"customer\",\"top-entity-type\":\"customer\",\"entity-link\":\"/aai/v19/business/customers/customer/ETE_Customer_5638d7b4-a02d-4cc4-801e-77ee837d2855\",\"event-type\":\"AAI-EVENT\",\"domain\":\"dev\",\"action\":\"CREATE\",\"sequence-number\":\"0\",\"id\":\"ef390383-3d08-4268-a013-d11c14efd716\",\"source-name\":\"robot-ete\",\"version\":\"v19\",\"timestamp\":\"20200701-12:06:50:388\"},\"entity\":{\"global-customer-id\":\"ETE_Customer_5638d7b4-a02d-4cc4-801e-77ee837d2855\",\"subscriber-type\":\"INFRA\",\"resource-version\":\"1593605210258\",\"subscriber-name\":\"ETE_Customer_5638d7b4-a02d-4cc4-801e-77ee837d2855\",\"service-subscriptions\":{\"service-subscription\":[{\"relationship-list\":{\"relationship\":[{\"related-to\":\"tenant\",\"relationship-data\":[{\"relationship-value\":\"CloudOwner\",\"relationship-key\":\"cloud-region.cloud-owner\"},{\"relationship-value\":\"RegionForPNF\",\"relationship-key\":\"cloud-region.cloud-region-id\"},{\"relationship-value\":\"dummy_tenant_id_for_pnf\",\"relationship-key\":\"tenant.tenant-id\"}],\"related-link\":\"/aai/v19/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionForPNF/tenants/tenant/dummy_tenant_id_for_pnf\",\"relationship-label\":\"org.onap.relationships.inventory.Uses\",\"related-to-property\":[{\"property-key\":\"tenant.tenant-name\",\"property-value\":\"dummy_tenant_for_pnf\"}]}]},\"resource-version\":\"1593605210258\",\"service-type\":\"pNF\"}]}}}"
+ ]
}
diff --git a/components/pm-subscription-handler/tests/log_config.yaml b/components/pm-subscription-handler/tests/log_config.yaml index 56620708..1c3abd8b 100755 --- a/components/pm-subscription-handler/tests/log_config.yaml +++ b/components/pm-subscription-handler/tests/log_config.yaml @@ -4,7 +4,7 @@ disable_existing_loggers: true loggers: onap_logger: - level: INFO + level: DEBUG handlers: [stdout_handler] propagate: false handlers: diff --git a/components/pm-subscription-handler/tests/test_aai_service.py b/components/pm-subscription-handler/tests/test_aai_service.py index 9f370096..4b7be153 100644 --- a/components/pm-subscription-handler/tests/test_aai_service.py +++ b/components/pm-subscription-handler/tests/test_aai_service.py @@ -37,7 +37,6 @@ class AaiClientTestCase(TestCase): def setUp(self, mock_get_db_url, mock_update_config, mock_get_pmsh_config): mock_get_db_url.return_value = 'sqlite://' self.env = EnvironmentVarGuard() - self.env.set('AAI_SERVICE_HOST', '1.2.3.4') self.env.set('AAI_SERVICE_PORT', '8443') self.env.set('LOGGER_CONFIG', os.path.join(os.path.dirname(__file__), 'log_config.yaml')) with open(os.path.join(os.path.dirname(__file__), 'data/cbs_data_1.json'), 'r') as data: @@ -67,14 +66,14 @@ class AaiClientTestCase(TestCase): @responses.activate def test_aai_client_get_all_aai_xnf_data_not_found(self): responses.add(responses.PUT, - 'https://1.2.3.4:8443/aai/v16/query?format=simple&nodesOnly=true', + 'https://1.2.3.4:8443/aai/v19/query?format=simple&nodesOnly=true', json={'error': 'not found'}, status=404) self.assertIsNone(aai_client._get_all_aai_nf_data(self.app_conf)) @responses.activate def test_aai_client_get_all_aai_xnf_data_success(self): responses.add(responses.PUT, - 'https://1.2.3.4:8443/aai/v16/query?format=simple&nodesOnly=true', + 'https://aai:8443/aai/v19/query?format=simple&nodesOnly=true', json={'dummy_data': 'blah_blah'}, status=200) self.assertIsNotNone(aai_client._get_all_aai_nf_data(self.app_conf)) @@ -84,4 +83,4 @@ class AaiClientTestCase(TestCase): aai_client._get_aai_service_url() def test_aai_client_get_aai_service_url_success(self): - self.assertEqual('https://1.2.3.4:8443', aai_client._get_aai_service_url()) + self.assertEqual('https://aai:8443', aai_client._get_aai_service_url()) diff --git a/components/pm-subscription-handler/tests/test_controller.py b/components/pm-subscription-handler/tests/test_controller.py index 57230429..d324a07d 100755 --- a/components/pm-subscription-handler/tests/test_controller.py +++ b/components/pm-subscription-handler/tests/test_controller.py @@ -42,7 +42,6 @@ class ControllerTestCase(unittest.TestCase): mock_session.return_value.status_code = 200 mock_session.return_value.text = self.aai_response_data self.env = EnvironmentVarGuard() - self.env.set('AAI_SERVICE_HOST', '1.2.3.4') self.env.set('AAI_SERVICE_PORT', '8443') self.env.set('LOGGER_CONFIG', os.path.join(os.path.dirname(__file__), 'log_config.yaml')) with open(os.path.join(os.path.dirname(__file__), 'data/cbs_data_1.json'), 'r') as data: diff --git a/components/pm-subscription-handler/tests/test_pmsh_utils.py b/components/pm-subscription-handler/tests/test_pmsh_utils.py index 1ea27a7c..6e5585f5 100644 --- a/components/pm-subscription-handler/tests/test_pmsh_utils.py +++ b/components/pm-subscription-handler/tests/test_pmsh_utils.py @@ -78,8 +78,8 @@ class PmshUtilsTestCase(TestCase): def test_utils_get_cert_data(self, mock_get_pmsh_config): mock_get_pmsh_config.return_value = self.cbs_data self.app_conf = AppConfig() - self.assertTrue(self.app_conf.cert_params, ('/opt/app/pm-mapper/etc/certs/cert.pem', - '/opt/app/pm-mapper/etc/certs/key.pem')) + self.assertEqual(self.app_conf.cert_params, ('/opt/app/pmsh/etc/certs/cert.pem', + '/opt/app/pmsh/etc/certs/key.pem')) @patch('mod.pmsh_utils.AppConfig._get_pmsh_config') @patch.object(Session, 'post') @@ -98,7 +98,7 @@ class PmshUtilsTestCase(TestCase): mock_get_pmsh_config.return_value = self.cbs_data self.app_conf = AppConfig() responses.add(responses.POST, - 'https://node:30226/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS', + 'https://message-router:3905/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS', json={'error': 'Client Error'}, status=400) mr_policy_pub = self.app_conf.get_mr_pub('policy_pm_publisher') with self.assertRaises(Exception): @@ -121,7 +121,7 @@ class PmshUtilsTestCase(TestCase): self.app_conf = AppConfig() policy_mr_sub = self.app_conf.get_mr_sub('policy_pm_subscriber') responses.add(responses.GET, - 'https://node:30226/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/' + 'https://message-router:3905/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/' 'dcae_pmsh_cg/1?timeout=1000', json={"dummy_val": "43c4ee19-6b8d-4279-a80f-c507850aae47"}, status=200) mr_topic_data = policy_mr_sub.get_from_topic(1) @@ -134,7 +134,7 @@ class PmshUtilsTestCase(TestCase): self.app_conf = AppConfig() policy_mr_sub = self.app_conf.get_mr_sub('policy_pm_subscriber') responses.add(responses.GET, - 'https://node:30226/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/' + 'https://message-router:3905/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/' 'dcae_pmsh_cg/1?timeout=1000', json={"dummy_val": "43c4ee19-6b8d-4279-a80f-c507850aae47"}, status=400) with self.assertRaises(Exception): @@ -163,7 +163,7 @@ class PmshUtilsTestCase(TestCase): self.app_conf.refresh_config() mock_logger.assert_called_with('AppConfig data has been refreshed') - @patch('mod.logger.debug') + @patch('mod.logger.error') @patch('mod.pmsh_utils.get_all') def test_refresh_config_fail(self, mock_cbs_client_get_all, mock_logger): mock_cbs_client_get_all.return_value = self.cbs_data @@ -171,4 +171,4 @@ class PmshUtilsTestCase(TestCase): mock_cbs_client_get_all.side_effect = Exception with self.assertRaises(RetryError): self.app_conf.refresh_config() - mock_logger.assert_called_with('Failed to refresh AppConfig data') + mock_logger.assert_called_with('Failed to get config from CBS: ', exc_info=True) diff --git a/components/pm-subscription-handler/tests/test_subscription.py b/components/pm-subscription-handler/tests/test_subscription.py index 1543afe8..74593a42 100755 --- a/components/pm-subscription-handler/tests/test_subscription.py +++ b/components/pm-subscription-handler/tests/test_subscription.py @@ -46,7 +46,6 @@ class SubscriptionTest(TestCase): mock_session.return_value.status_code = 200 mock_session.return_value.text = self.aai_response_data self.env = EnvironmentVarGuard() - self.env.set('AAI_SERVICE_HOST', '1.2.3.4') self.env.set('AAI_SERVICE_PORT', '8443') self.env.set('LOGGER_CONFIG', os.path.join(os.path.dirname(__file__), 'log_config.yaml')) with open(os.path.join(os.path.dirname(__file__), 'data/cbs_data_1.json'), 'r') as data: diff --git a/components/pm-subscription-handler/tests/test_subscription_handler.py b/components/pm-subscription-handler/tests/test_subscription_handler.py index a277da66..65a7c2c0 100644 --- a/components/pm-subscription-handler/tests/test_subscription_handler.py +++ b/components/pm-subscription-handler/tests/test_subscription_handler.py @@ -95,4 +95,5 @@ class SubscriptionHandlerTest(TestCase): self.mock_app, self.app_conf, self.mock_aai_event_thread) sub_handler.execute() - mock_logger.assert_called_with('Error occurred during the activation/deactivation process ') + mock_logger.assert_called_with('Error occurred during the activation/deactivation process ', + exc_info=True) |