aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorefiacor <fiachra.corcoran@est.tech>2020-07-06 11:55:44 +0100
committerefiacor <fiachra.corcoran@est.tech>2020-07-08 13:18:02 +0100
commit49b46449f4f98d53fe61f77b09e8a39ae26cd2be (patch)
treebf18dcdaf0ebeb94ad3196aa76e0e1a12df92f78
parent5c5599007d24eac42ec5181079cbedf2678f81e9 (diff)
[PMSH] TLS support refactoring
Signed-off-by: efiacor <fiachra.corcoran@est.tech> Change-Id: I169a072bdbc7ad3fddd4d002a76b798fa5627e8f Issue-ID: DCAEGEN2-2146
-rw-r--r--plans/dcaegen2-services-pmsh/testsuite/assets/aai_sim/aai-initializer.json2
-rw-r--r--plans/dcaegen2-services-pmsh/testsuite/assets/aai_sim/aai_mockserver.properties5
-rw-r--r--plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json6
-rw-r--r--plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json15
-rw-r--r--plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml6
-rw-r--r--plans/dcaegen2-services-pmsh/testsuite/setup.sh2
-rw-r--r--plans/dcaegen2-services-pmsh/testsuite/teardown.sh2
-rw-r--r--tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json2
-rw-r--r--tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json10
-rw-r--r--tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json10
-rw-r--r--tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json10
-rw-r--r--tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-new.json10
-rw-r--r--tests/dcaegen2-services-pmsh/testcases/pmsh.robot10
13 files changed, 66 insertions, 24 deletions
diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/aai_sim/aai-initializer.json b/plans/dcaegen2-services-pmsh/testsuite/assets/aai_sim/aai-initializer.json
index 5406f99c..3b8c127e 100644
--- a/plans/dcaegen2-services-pmsh/testsuite/assets/aai_sim/aai-initializer.json
+++ b/plans/dcaegen2-services-pmsh/testsuite/assets/aai_sim/aai-initializer.json
@@ -1,7 +1,7 @@
[
{
"httpRequest": {
- "path": "/aai/v16/query.*"
+ "path": "/aai/v19/query.*"
},
"httpResponse": {
"statusCode": 200,
diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/aai_sim/aai_mockserver.properties b/plans/dcaegen2-services-pmsh/testsuite/assets/aai_sim/aai_mockserver.properties
index 9c592303..04b9cc4e 100644
--- a/plans/dcaegen2-services-pmsh/testsuite/assets/aai_sim/aai_mockserver.properties
+++ b/plans/dcaegen2-services-pmsh/testsuite/assets/aai_sim/aai_mockserver.properties
@@ -14,10 +14,13 @@ mockserver.deleteGeneratedKeyStoreOnExit=true
# certificate domain name (default "localhost")
mockserver.sslCertificateDomainName=localhost
# comma separated list of domain names for Subject Alternative Name domain names (default empty list)
-mockserver.sslSubjectAlternativeNameDomains=www.example.com,www.another.com
+mockserver.sslSubjectAlternativeNameDomains=aai,aai.onap
# comma separated list of ip addresses for Subject Alternative Name ips (default empty list)
mockserver.sslSubjectAlternativeNameIps=127.0.0.1
+mockserver.certificateAuthorityPrivateKey=/var/tmp/mock_server_key.pem
+mockserver.certificateAuthorityCertificate=/var/tmp/mock_server_cacert.pem
+
# CORS
# enable CORS for MockServer REST API
diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json b/plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json
index 1a1ba9eb..16d6893a 100644
--- a/plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json
+++ b/plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json
@@ -77,12 +77,14 @@
"control_loop_name": "pmsh-control-loop",
"operational_policy_name": "pmsh-operational-policy",
"cert_path": "/opt/app/pmsh/etc/certs/cert.pem",
+ "enable_tls": true,
+ "ca_cert_path": "/opt/app/pmsh/etc/certs/cacert.pem",
"streams_publishes": {
"policy_pm_publisher": {
"dmaap_info": {
"client_id": "1475976809466",
"client_role": "org.onap.dcae.pmPublisher",
- "topic_url": "https://mr-sim:3095/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS",
+ "topic_url": "https://mr-sim:3095/events/unauthenticated.DCAE_CL_OUTPUT",
"location": "san-francisco"
},
"type": "message_router"
@@ -101,7 +103,7 @@
"policy_pm_subscriber": {
"dmaap_info": {
"location": "san-francisco",
- "topic_url": "https://mr-sim:3095/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS",
+ "topic_url": "https://mr-sim:3095/events/unauthenticated.PMSH_CL_INPUT",
"client_role": "org.onap.dcae.pmSubscriber",
"client_id": "1575876809456"
},
diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json b/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json
index 2eac8406..6b12a831 100644
--- a/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json
+++ b/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json
@@ -1,7 +1,10 @@
[
{
"httpRequest": {
- "path": "/events/AAI_EVENT/dcae_pmsh_cg/AAI-EVENT"
+ "path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event",
+ "queryStringParameters" : {
+ "timeout" : [ "1000" ]
+ }
},
"httpResponse": {
"statusCode": 200,
@@ -15,7 +18,10 @@
},
{
"httpRequest": {
- "path": "/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS"
+ "path": "/events/unauthenticated.DCAE_CL_OUTPUT",
+ "queryStringParameters" : {
+ "timeout" : [ "1000" ]
+ }
},
"httpResponse": {
"statusCode": 200,
@@ -32,7 +38,10 @@
},
{
"httpRequest": {
- "path": "/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/dcae_pmsh_cg/policy_response_consumer"
+ "path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input",
+ "queryStringParameters" : {
+ "timeout" : [ "1000" ]
+ }
},
"httpResponse": {
"statusCode": 200,
diff --git a/plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml b/plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml
index ed991c38..6df60f1e 100644
--- a/plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml
+++ b/plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml
@@ -11,15 +11,18 @@ services:
networks:
pmsh-network:
- aai-sim:
+ aai:
container_name: aai-sim
image: mockserver/mockserver:mockserver-5.9.0
environment:
MOCKSERVER_PROPERTY_FILE: /config/mockserver.properties
MOCKSERVER_INITIALIZATION_JSON_PATH: /config/aai-initializer.json
+ LOG_LEVEL: "DEBUG"
volumes:
- ./assets/aai_sim/aai_mockserver.properties:/config/mockserver.properties
- ./assets/aai_sim/aai-initializer.json:/config/aai-initializer.json
+ - ./assets/ssl_certs/mock_server_cacert.pem:/var/tmp/mock_server_cacert.pem
+ - ./assets/ssl_certs/mock_server_key.pem:/var/tmp/mock_server_key.pem
networks:
pmsh-network:
@@ -68,7 +71,6 @@ services:
PMSH_PG_URL: db
PMSH_PG_USERNAME: $DB_USER
PMSH_PG_PASSWORD: $DB_PASSWORD
- AAI_SERVICE_HOST: aai-sim
AAI_SERVICE_PORT: 1080
DCAE_CA_CERTPATH: '/opt/app/pmsh/etc/certs/cacert.pem'
networks:
diff --git a/plans/dcaegen2-services-pmsh/testsuite/setup.sh b/plans/dcaegen2-services-pmsh/testsuite/setup.sh
index eb2196a0..4b939fd0 100644
--- a/plans/dcaegen2-services-pmsh/testsuite/setup.sh
+++ b/plans/dcaegen2-services-pmsh/testsuite/setup.sh
@@ -6,7 +6,7 @@ export DB_PASSWORD=pmsh
TEST_PLANS_DIR=$WORKSPACE/plans/dcaegen2-services-pmsh/testsuite
-docker-compose -f ${TEST_PLANS_DIR}/docker-compose.yml up -d db aai-sim cbs-sim mr-sim
+docker-compose -f ${TEST_PLANS_DIR}/docker-compose.yml up -d db aai cbs-sim mr-sim
# Slow machine running CSITs can affect db coming up in time for PMSH
echo "Waiting for postgres db to come up..."
diff --git a/plans/dcaegen2-services-pmsh/testsuite/teardown.sh b/plans/dcaegen2-services-pmsh/testsuite/teardown.sh
index c5bac315..a01dfda0 100644
--- a/plans/dcaegen2-services-pmsh/testsuite/teardown.sh
+++ b/plans/dcaegen2-services-pmsh/testsuite/teardown.sh
@@ -2,7 +2,7 @@
echo "Starting teardown script"
TEST_PLANS_DIR=$WORKSPACE/plans/dcaegen2-services-pmsh/testsuite
mkdir -p $WORKSPACE/archives
-docker exec pmsh /bin/sh -c "ls -l /var/log/ONAP/dcaegen2/services/pmsh/"
docker exec pmsh /bin/sh -c "cat /var/log/ONAP/dcaegen2/services/pmsh/*"
+docker cp pmsh:/var/log/ONAP/dcaegen2/services/pmsh/application.log $WORKSPACE/archives/
docker-compose -f $TEST_PLANS_DIR/docker-compose.yml logs --no-color > $WORKSPACE/archives/pmsh-docker-compose.log
docker-compose -f $TEST_PLANS_DIR/docker-compose.yml down -v
diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json b/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json
index 569e9383..b70b41d1 100644
--- a/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json
+++ b/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json
@@ -77,6 +77,8 @@
"control_loop_name": "pmsh-control-loop",
"operational_policy_name": "pmsh-operational-policy",
"cert_path": "/opt/app/pmsh/etc/certs/cert.pem",
+ "enable_tls": true,
+ "ca_cert_path": "/opt/app/pmsh/etc/certs/cacert.pem",
"streams_publishes": {
"policy_pm_publisher": {
"dmaap_info": {
diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json
index 9c9dc6e5..1a027f21 100644
--- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json
+++ b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json
@@ -1,7 +1,10 @@
[
{
"httpRequest": {
- "path": "/events/AAI_EVENT/dcae_pmsh_cg/AAI-EVENT"
+ "path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event",
+ "queryStringParameters" : {
+ "timeout" : [ "1000" ]
+ }
},
"httpResponse": {
"statusCode": 200,
@@ -21,7 +24,10 @@
},
{
"httpRequest": {
- "path": "/events/AAI_EVENT/dcae_pmsh_cg/AAI-EVENT"
+ "path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event",
+ "queryStringParameters" : {
+ "timeout" : [ "1000" ]
+ }
},
"httpResponse": {
"statusCode": 200,
diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json
index c0accc8c..e5c4dd84 100644
--- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json
+++ b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json
@@ -1,7 +1,10 @@
[
{
"httpRequest": {
- "path": "/events/AAI_EVENT/dcae_pmsh_cg/AAI-EVENT"
+ "path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event",
+ "queryStringParameters" : {
+ "timeout" : [ "1000" ]
+ }
},
"httpResponse": {
"statusCode": 200,
@@ -21,7 +24,10 @@
},
{
"httpRequest": {
- "path": "/events/AAI_EVENT/dcae_pmsh_cg/AAI-EVENT"
+ "path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event",
+ "queryStringParameters" : {
+ "timeout" : [ "1000" ]
+ }
},
"httpResponse": {
"statusCode": 200,
diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json
index cc14f3c9..eba4e4ee 100644
--- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json
+++ b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json
@@ -1,7 +1,10 @@
[
{
"httpRequest": {
- "path": "/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/dcae_pmsh_cg/policy_response_consumer"
+ "path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input",
+ "queryStringParameters" : {
+ "timeout" : [ "1000" ]
+ }
},
"httpResponse": {
"statusCode": 200,
@@ -21,7 +24,10 @@
},
{
"httpRequest": {
- "path": "/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/dcae_pmsh_cg/policy_response_consumer"
+ "path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input",
+ "queryStringParameters" : {
+ "timeout" : [ "1000" ]
+ }
},
"httpResponse": {
"statusCode": 200,
diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-new.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-new.json
index 79bfb44f..f73fee82 100644
--- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-new.json
+++ b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-new.json
@@ -1,7 +1,10 @@
[
{
"httpRequest": {
- "path": "/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/dcae_pmsh_cg/policy_response_consumer"
+ "path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input",
+ "queryStringParameters" : {
+ "timeout" : [ "1000" ]
+ }
},
"httpResponse": {
"statusCode": 200,
@@ -21,7 +24,10 @@
},
{
"httpRequest": {
- "path": "/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/dcae_pmsh_cg/policy_response_consumer"
+ "path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input",
+ "queryStringParameters" : {
+ "timeout" : [ "1000" ]
+ }
},
"httpResponse": {
"statusCode": 200,
diff --git a/tests/dcaegen2-services-pmsh/testcases/pmsh.robot b/tests/dcaegen2-services-pmsh/testcases/pmsh.robot
index 08ab197c..a2b8cad6 100644
--- a/tests/dcaegen2-services-pmsh/testcases/pmsh.robot
+++ b/tests/dcaegen2-services-pmsh/testcases/pmsh.robot
@@ -64,7 +64,7 @@ Verify Policy response on MR is handled
[Documentation] Verify policy response on MR is handled
[Timeout] 40 seconds
SimulatePolicyResponse ${MR_EXPECTATION_POLICY_RESPONSE_PNF_EXISTING}
- Sleep 7 seconds Ensure Policy response on MR is picked up
+ Sleep 15 seconds Ensure Policy response on MR is picked up
${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT}
Should Be Equal As Strings ${resp.json()[0]['network_functions'][0]['nf_sub_status']} CREATED
@@ -73,7 +73,7 @@ Verify AAI event on MR detailing new PNF being detected is handled
[Documentation] Verify PNF created AAI event on MR is handled
[Timeout] 30 seconds
SimulateNewPNF
- Sleep 12 seconds Ensure AAI event on MR is picked up
+ Sleep 15 seconds Ensure AAI event on MR is picked up
${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT}
Should Be Equal As Strings ${resp.json()[0]['network_functions'][1]['nf_name']} pnf_newly_discovered
Should Be Equal As Strings ${resp.json()[0]['network_functions'][1]['orchestration_status']} Active
@@ -105,7 +105,7 @@ SetAdministrativeStateToUnlocked
SimulateNewPNF
${data}= Get Data From File ${MR_EXPECTATION_AAI_PNF_CREATED}
- ${resp} = Put Request mr_sim_session /clear data={"path": "/events/AAI_EVENT/dcae_pmsh_cg/AAI-EVENT"}
+ ${resp} = Put Request mr_sim_session /clear data={"path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event"}
Should Be True ${resp.status_code} == 200
${resp} = Put Request mr_sim_session /expectation data=${data}
Should Be True ${resp.status_code} == 201
@@ -113,14 +113,14 @@ SimulateNewPNF
SimulatePolicyResponse
[Arguments] ${expected_contents}
${data}= Get Data From File ${expected_contents}
- ${resp} = Put Request mr_sim_session /clear data={"path": "/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/dcae_pmsh_cg/policy_response_consumer"}
+ ${resp} = Put Request mr_sim_session /clear data={"path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input"}
Should Be True ${resp.status_code} == 200
${resp} = Put Request mr_sim_session /expectation data=${data}
Should Be True ${resp.status_code} == 201
SimulateDeletedPNF
${data}= Get Data From File ${MR_EXPECTATION_AAI_PNF_REMOVED}
- ${resp} = Put Request mr_sim_session /clear data={"path": "/events/AAI_EVENT/dcae_pmsh_cg/AAI-EVENT"}
+ ${resp} = Put Request mr_sim_session /clear data={"path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event"}
Should Be True ${resp.status_code} == 200
${resp} = Put Request mr_sim_session /expectation data=${data}
Should Be True ${resp.status_code} == 201