From: Marcin Przybysz Date: Thu, 12 Mar 2020 07:18:56 +0000 (+0000) Subject: Merge "VID: Fix newVNFChange by being more graceful before clicking" X-Git-Tag: 6.0.0-ONAP~48 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=fa637364128e153662b0200765bc36fa5aef2c95;hp=ce7e0704a1df1e17623b556fcb03ac77d7570ed4;p=integration%2Fcsit.git Merge "VID: Fix newVNFChange by being more graceful before clicking" --- diff --git a/plans/aaf/certservice/docker-compose.yml b/plans/aaf/certservice/docker-compose.yml index 384158ab..ae7ee878 100644 --- a/plans/aaf/certservice/docker-compose.yml +++ b/plans/aaf/certservice/docker-compose.yml @@ -11,12 +11,11 @@ services: volumes: - $SCRIPTS_PATH:/opt/primekey/scripts command: bash -c " - ./scripts/ejbca-configuration.sh & /opt/primekey/bin/start.sh " healthcheck: test: ["CMD-SHELL", "curl -kI https://localhost:8443/ejbca/publicweb/healthcheck/ejbcahealth"] - interval: 10s + interval: 20s timeout: 3s retries: 9 networks: diff --git a/plans/aaf/certservice/scripts/ejbca-configuration.sh b/plans/aaf/certservice/scripts/ejbca-configuration.sh index 7ec1fa3a..77f5c555 100755 --- a/plans/aaf/certservice/scripts/ejbca-configuration.sh +++ b/plans/aaf/certservice/scripts/ejbca-configuration.sh @@ -1,9 +1,5 @@ #!/bin/bash -waitForEjbcaStartUp() { - sleep $1 -} - configureEjbca() { ejbca.sh config cmp addalias --alias cmpRA ejbca.sh config cmp updatealias --alias cmpRA --key operationmode --value ra @@ -20,5 +16,4 @@ configureEjbca() { ejbca.sh ca getcacert --caname ManagementCA -f /dev/stdout > cacert.pem } -waitForEjbcaStartUp 45 configureEjbca diff --git a/plans/aaf/certservice/setup.sh b/plans/aaf/certservice/setup.sh index dde516ae..995b31d3 100644 --- a/plans/aaf/certservice/setup.sh +++ b/plans/aaf/certservice/setup.sh @@ -27,6 +27,18 @@ SCRIPTS_DIRECTORY="scripts" JENKINS_SCRIPTS_PATH="$CURRENT_WORKDIR_PATH/$PROJECT_DIRECTORY/$SCRIPTS_DIRECTORY" LOCAL_SCRIPTS_PATH="$CURRENT_WORKDIR_PATH/$SCRIPTS_DIRECTORY" +# ------------------------------------ +#Prepare enviroment for client +#install docker sdk +echo "Uninstall docker-py and reinstall docker." +pip uninstall -y docker-py +pip uninstall -y docker +pip install -U docker==2.7.0 + +#export container name +export ClientContainerName=CertServiceClient +# ------------------------------------ + if test -d "$JENKINS_SCRIPTS_PATH"; then SCRIPTS_PATH=$JENKINS_SCRIPTS_PATH else test -f "$LOCAL_SCRIPTS_PATH"; @@ -53,9 +65,23 @@ export SCRIPTS_PATH=${SCRIPTS_PATH} docker-compose up -d -AAFCERT_IP=`get-instance-ip.sh aafcert` -export AAFCERT_IP=${AAFCERT_IP} - +AAFCERT_IP='none' # Wait container ready -sleep 15 +for i in {1..9} +do + AAFCERT_IP=`get-instance-ip.sh aafcert` + RESP_CODE=$(curl -I -s -o /dev/null -w "%{http_code}" http://${AAFCERT_IP}:8080/actuator/health) + if [[ "$RESP_CODE" == '200' ]]; then + echo 'AAF Cert Service is ready' + export AAFCERT_IP=${AAFCERT_IP} + docker exec aafcert-ejbca /opt/primekey/scripts/ejbca-configuration.sh + break + fi + echo 'Waiting for AAF Cert Service to start up...' + sleep 30s +done +if [[ $AAFCERT_IP == 'none' ] || [ $AAFCERT_IP == '' ]]; then + echo "AAF Cert Service is not ready!" + exit 1 # Return error code +fi diff --git a/plans/aaf/certservice/teardown.sh b/plans/aaf/certservice/teardown.sh index 3f10eaeb..0a9e0734 100644 --- a/plans/aaf/certservice/teardown.sh +++ b/plans/aaf/certservice/teardown.sh @@ -15,5 +15,8 @@ # limitations under the License. # +docker-compose down + kill-instance.sh aafcert -kill-instance.sh aafcert-ejbca \ No newline at end of file +kill-instance.sh aafcert-ejbca +kill-instance.sh ${ClientContainerName} \ No newline at end of file diff --git a/tests/aaf/certservice/assets/invalid_client_docker.env b/tests/aaf/certservice/assets/invalid_client_docker.env new file mode 100644 index 00000000..7fbc666e --- /dev/null +++ b/tests/aaf/certservice/assets/invalid_client_docker.env @@ -0,0 +1,12 @@ +#Client envs +REQUEST_TIMEOUT=5000 +OUTPUT_PATH=/var/log +CA_NAME=Invalid +#Csr config envs +COMMON_NAME=onap.org +ORGANIZATION=Linux-Foundation +ORGANIZATION_UNIT=ONAP +LOCATION=San-Francisco +STATE=California +COUNTRY=US +SANS=example.com:example1.com:example3.com \ No newline at end of file diff --git a/tests/aaf/certservice/assets/valid_client_docker.env b/tests/aaf/certservice/assets/valid_client_docker.env new file mode 100644 index 00000000..7a219761 --- /dev/null +++ b/tests/aaf/certservice/assets/valid_client_docker.env @@ -0,0 +1,12 @@ +#Client envs +REQUEST_TIMEOUT=30000 +OUTPUT_PATH=/var/log +CA_NAME=RA +#Csr config envs +COMMON_NAME=onap.org +ORGANIZATION=Linux-Foundation +ORGANIZATION_UNIT=ONAP +LOCATION=San-Francisco +STATE=California +COUNTRY=US +SANS=example.com:sample.com \ No newline at end of file diff --git a/tests/aaf/certservice/cert-service-test.robot b/tests/aaf/certservice/cert-service-test.robot index ad358263..36c15226 100644 --- a/tests/aaf/certservice/cert-service-test.robot +++ b/tests/aaf/certservice/cert-service-test.robot @@ -18,6 +18,11 @@ Reload Configuration [Documentation] Configuration was changed Send Get Request And Validate Response /reload 200 +Check if application is ready + [Tags] AAF-CERT-SERVICE + [Documentation] Send request to /ready endpoint and expect 200 + Send Get Request And Validate Response /ready 200 + Generate Certificate In RA Mode For CA Name [Tags] AAF-CERT-SERVICE [Documentation] Send request to ${CERT_SERVICE_ENDPOINT}/${RA_CA_NAME} endpoint and expect 200 @@ -42,3 +47,14 @@ Report Bad Request Error When PK Is Not Valid [Tags] AAF-CERT-SERVICE [Documentation] Send request to ${CERT_SERVICE_ENDPOINT}/${CLIENT_CA_NAME} endpoint and expect 400 Send Get Request with Header And Expect Error ${CERT_SERVICE_ENDPOINT}/${CLIENT_CA_NAME} ${VALID_CLIENT_CSR_FILE} ${INVALID_PK_FILE} 400 + +Cert Service Client successful create keystore and trust store + [Tags] AAF-CERT-SERVICE + [Documentation] Run with correct env and expected exit code 0 + Run Cert Service Client Container And Validate Exit Code ${VALID_ENV_FILE} 0 + +Creation of keystore and trustore unsuccesful, incorrect client configuration + [Tags] AAF-CERT-SERVICE + [Documentation] Run with invalid CaName env and expected exit code 5 + Run Cert Service Client Container And Validate Exit Code ${INVALID_ENV_FILE} 5 + diff --git a/tests/aaf/certservice/libraries/CertClientManager.py b/tests/aaf/certservice/libraries/CertClientManager.py new file mode 100644 index 00000000..30501c8b --- /dev/null +++ b/tests/aaf/certservice/libraries/CertClientManager.py @@ -0,0 +1,27 @@ +import docker + + +class CertClientManager: + + def run_client_container(self, client_image, container_name, path_to_env, request_url, network): + client = docker.from_env() + environment = self.read_list_env_from_file(path_to_env) + environment.append("REQUEST_URL=" + request_url) + container = client.containers.run(image=client_image, name=container_name, detach=True, environment=environment, + network=network) + exitcode = container.wait() + return exitcode + + def remove_client_container(self, container_name): + client = docker.from_env() + container = client.containers.get(container_name) + container.remove() + + def read_list_env_from_file(self, path): + f = open(path, "r") + r_list = [] + for line in f: + line = line.strip() + if line[0] != "#": + r_list.append(line) + return r_list diff --git a/tests/aaf/certservice/resources/cert-service-keywords.robot b/tests/aaf/certservice/resources/cert-service-keywords.robot index 5f25f0b0..a8315e7f 100644 --- a/tests/aaf/certservice/resources/cert-service-keywords.robot +++ b/tests/aaf/certservice/resources/cert-service-keywords.robot @@ -3,6 +3,7 @@ Library RequestsLibrary Library HttpLibrary.HTTP Library Collections +Library ../libraries/CertClientManager.py Resource ../../../common.robot Resource ./cert-service-properties.robot @@ -81,3 +82,10 @@ Send Post Request And Validate Response [Arguments] ${path} ${resp_code} ${resp}= Post Request ${http_session} ${path} Should Be Equal As Strings ${resp.status_code} ${resp_code} + +Run Cert Service Client Container And Validate Exit Code + [Documentation] Run Cert Service Client Container And Validate Exit Code + [Arguments] ${env_file} ${expected_code} + ${exitcode}= Run Client Container ${DOCKER_CLIENT_IMAGE} ${CLIENT_CONTAINER_NAME} ${env_file} ${CERT_ADDRESS} ${CERT_SERVICE_NETWORK} + Remove Client Container ${CLIENT_CONTAINER_NAME} + Should Be Equal As Strings ${exitcode} ${expected_code} diff --git a/tests/aaf/certservice/resources/cert-service-properties.robot b/tests/aaf/certservice/resources/cert-service-properties.robot index 5cf97819..ea5352e9 100644 --- a/tests/aaf/certservice/resources/cert-service-properties.robot +++ b/tests/aaf/certservice/resources/cert-service-properties.robot @@ -10,3 +10,13 @@ ${VALID_RA_CSR_FILE} %{WORKSPACE}/tests/aaf/certservice/asse ${VALID_RA_PK_FILE} %{WORKSPACE}/tests/aaf/certservice/assets/valid_ra.pk ${INVALID_CSR_FILE} %{WORKSPACE}/tests/aaf/certservice/assets/invalid.csr ${INVALID_PK_FILE} %{WORKSPACE}/tests/aaf/certservice/assets/invalid.key + + +${CERT_ADDRESS} ${AAFCERT_URL}/v1/certificate/ +${VALID_ENV_FILE} %{WORKSPACE}/tests/aaf/certservice/assets/valid_client_docker.env +${INVALID_ENV_FILE} %{WORKSPACE}/tests/aaf/certservice/assets/invalid_client_docker.env +${DOCKER_CLIENT_IMAGE} nexus3.onap.org:10001/onap/org.onap.aaf.certservice.aaf-certservice-client:latest +${CLIENT_CONTAINER_NAME} %{ClientContainerName} +${CERT_SERVICE_NETWORK} certservice_certservice + + diff --git a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_all_fields.json b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_all_fields.json index 3ad1fec0..d275850a 100644 --- a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_all_fields.json +++ b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_all_fields.json @@ -1,30 +1 @@ -{ - "event": { - "commonEventHeader": { - "version": "4.0.1", - "eventName": "StateChange_cpe_authentication", - "domain": "stateChange", - "eventId": "ab305d54-85b4-a31b-7db2fb6b9e546015", - "eventType": "applicationNf", - "sourceId": "", - "sourceName": "NVendor-Equip_Model-SN1234", - "reportingEntityId": "", - "reportingEntityName": "thirdparty-sdnc-idfromesrrequest", - "priority": "Normal", - "startEpochMicrosec": 1.413378172e+15, - "lastEpochMicrosec": 1.413378172e+15, - "sequence": 0, - "vesEventListenerVersion": "7.1" - }, - "stateChangeFields": { - "stateChangeFieldsVersion": 1, - "oldState": "outOfService", - "newState": "inService", - "stateInterface": "", - "additionalFields": { - "macAddress": "01:02:03:04:05:06", - "swVersion": "1.2.3" - } - } - } -} +["{\"event\":{\"commonEventHeader\":{\"version\":\"4.0.1\",\"eventName\":\"StateChange_cpe_authentication\",\"domain\":\"stateChange\",\"eventId\": \"ab305d54-85b4-a31b-7db2fb6b9e546015\",\"eventType\":\"applicationNf\",\"sourceId\":\"\",\"sourceName\":\"NVendor-Equip_Model-SN1234\",\"reportingEntityId\":\"\",\"reportingEntityName\":\"thirdparty-sdnc-idfromesrrequest\",\"priority\":\"Normal\",\"startEpochMicrosec\":1.413378172e+15,\"lastEpochMicrosec\":1.413378172e+15,\"sequence\":0,\"vesEventListenerVersion\":\"7.1\"},\"stateChangeFields\":{\"stateChangeFieldsVersion\":1,\"oldState\":\"outOfService\",\"newState\":\"inService\",\"stateInterface\":\"\",\"additionalFields\":{\"macAddress\":\"01:02:03:04:05:06\",\"swVersion\":\"1.2.3\"}}}}"] \ No newline at end of file diff --git a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_missing_new_old_state.json b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_missing_new_old_state.json index 2c14d468..da1313a8 100644 --- a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_missing_new_old_state.json +++ b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_missing_new_old_state.json @@ -1,29 +1 @@ -{ - "event": { - "commonEventHeader": { - "version": "4.0.1", - "eventName": "StateChange_cpe_authentication", - "domain": "stateChange", - "eventId": "ab305d54-85b4-a31b-7db2fb6b9e546015", - "eventType": "applicationNf", - "sourceId": "", - "sourceName": "NVendor-Equip_Model-SN1234", - "reportingEntityId": "", - "reportingEntityName": "thirdparty-sdnc-idfromesrrequest", - "priority": "Normal", - "startEpochMicrosec": 1.413378172e+15, - "lastEpochMicrosec": 1.413378172e+15, - "sequence": 0, - "vesEventListenerVersion": "7.1" - }, - "stateChangeFields": { - "stateChangeFieldsVersion": 1, - "oldState": "", - "newState": "", - "stateInterface": "", - "additionalFields": { - "macAddress": "01:02:03:04:05:06" - } - } - } -} \ No newline at end of file +["{\"event\":{\"commonEventHeader\":{\"version\":\"4.0.1\",\"eventName\":\"StateChange_cpe_authentication\",\"domain\":\"stateChange\",\"eventId\": \"ab305d54-85b4-a31b-7db2fb6b9e546015\",\"eventType\":\"applicationNf\",\"sourceId\":\"\",\"sourceName\":\"NVendor-Equip_Model-SN1234\",\"reportingEntityId\":\"\",\"reportingEntityName\":\"thirdparty-sdnc-idfromesrrequest\",\"priority\":\"Normal\",\"startEpochMicrosec\":1.413378172e+15,\"lastEpochMicrosec\":1.413378172e+15,\"sequence\":0,\"vesEventListenerVersion\":\"7.1\"},\"stateChangeFields\":{\"stateChangeFieldsVersion\":1,\"oldState\":\"\",\"newState\":\"\",\"stateInterface\":\"\",\"additionalFields\":{\"macAddress\":\"01:02:03:04:05:06\",\"swVersion\":\"1.2.3\"}}}}"] \ No newline at end of file diff --git a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_missing_rgmac.json b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_missing_rgmac.json index 21d97259..817107db 100644 --- a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_missing_rgmac.json +++ b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_missing_rgmac.json @@ -1,30 +1 @@ -{ - "event": { - "commonEventHeader": { - "version": "4.0.1", - "eventName": "StateChange_cpe_authentication", - "domain": "stateChange", - "eventId": "ab305d54-85b4-a31b-7db2fb6b9e546015", - "eventType": "applicationNf", - "sourceId": "", - "sourceName": "NVendor-Equip_Model-SN1234", - "reportingEntityId": "", - "reportingEntityName": "thirdparty-sdnc-idfromesrrequest", - "priority": "Normal", - "startEpochMicrosec": 1.413378172e+15, - "lastEpochMicrosec": 1.413378172e+15, - "sequence": 0, - "vesEventListenerVersion": "7.1" - }, - "stateChangeFields": { - "stateChangeFieldsVersion": 1, - "oldState": "outOfService", - "newState": "inService", - "stateInterface": "", - "additionalFields": { - "macAddress": "", - "swVersion": "1.2.3" - } - } - } -} +["{\"event\":{\"commonEventHeader\":{\"version\":\"4.0.1\",\"eventName\":\"StateChange_cpe_authentication\",\"domain\":\"stateChange\",\"eventId\": \"ab305d54-85b4-a31b-7db2fb6b9e546015\",\"eventType\":\"applicationNf\",\"sourceId\":\"\",\"sourceName\":\"NVendor-Equip_Model-SN1234\",\"reportingEntityId\":\"\",\"reportingEntityName\":\"thirdparty-sdnc-idfromesrrequest\",\"priority\":\"Normal\",\"startEpochMicrosec\":1.413378172e+15,\"lastEpochMicrosec\":1.413378172e+15,\"sequence\":0,\"vesEventListenerVersion\":\"7.1\"},\"stateChangeFields\":{\"stateChangeFieldsVersion\":1,\"oldState\":\"outOfService\",\"newState\":\"inService\",\"stateInterface\":\"\",\"additionalFields\":{\"macAddress\":\"\",\"swVersion\":\"1.2.3\"}}}}"] \ No newline at end of file diff --git a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_missing_sourceName.json b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_missing_sourceName.json index 538a56c6..e1a6fe32 100644 --- a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_missing_sourceName.json +++ b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_missing_sourceName.json @@ -1,30 +1 @@ -{ - "event": { - "commonEventHeader": { - "version": "4.0.1", - "eventName": "StateChange_cpe_authentication", - "domain": "stateChange", - "eventId": "ab305d54-85b4-a31b-7db2fb6b9e546015", - "eventType": "applicationNf", - "sourceId": "", - "sourceName": "", - "reportingEntityId": "", - "reportingEntityName": "thirdparty-sdnc-idfromesrrequest", - "priority": "Normal", - "startEpochMicrosec": 1.413378172e+15, - "lastEpochMicrosec": 1.413378172e+15, - "sequence": 0, - "vesEventListenerVersion": "7.1" - }, - "stateChangeFields": { - "stateChangeFieldsVersion": 1, - "oldState": "outOfService", - "newState": "inService", - "stateInterface": "", - "additionalFields": { - "macAddress": "01:02:03:04:05:06", - "swVersion": "1.2.3" - } - } - } -} +["{\"event\":{\"commonEventHeader\":{\"version\":\"4.0.1\",\"eventName\":\"StateChange_cpe_authentication\",\"domain\":\"stateChange\",\"eventId\": \"ab305d54-85b4-a31b-7db2fb6b9e546015\",\"eventType\":\"applicationNf\",\"sourceId\":\"\",\"sourceName\":\"\",\"reportingEntityId\":\"\",\"reportingEntityName\":\"thirdparty-sdnc-idfromesrrequest\",\"priority\":\"Normal\",\"startEpochMicrosec\":1.413378172e+15,\"lastEpochMicrosec\":1.413378172e+15,\"sequence\":0,\"vesEventListenerVersion\":\"7.1\"},\"stateChangeFields\":{\"stateChangeFieldsVersion\":1,\"oldState\":\"outOfService\",\"newState\":\"inService\",\"stateInterface\":\"\",\"additionalFields\":{\"macAddress\":\"01:02:03:04:05:06\",\"swVersion\":\"1.2.3\"}}}}"] \ No newline at end of file diff --git a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_wrong_sourceName.json b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_wrong_sourceName.json index 39a9e4ae..ffe031e9 100644 --- a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_wrong_sourceName.json +++ b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_wrong_sourceName.json @@ -1,30 +1 @@ -{ - "event": { - "commonEventHeader": { - "version": "4.0.1", - "eventName": "StateChange_cpe_authentication", - "domain": "stateChange", - "eventId": "ab305d54-85b4-a31b-7db2fb6b9e546015", - "eventType": "applicationNf", - "sourceId": "", - "sourceName": "Wrong-PNF-Name", - "reportingEntityId": "", - "reportingEntityName": "thirdparty-sdnc-idfromesrrequest", - "priority": "Normal", - "startEpochMicrosec": 1.413378172e+15, - "lastEpochMicrosec": 1.413378172e+15, - "sequence": 0, - "vesEventListenerVersion": "7.1" - }, - "stateChangeFields": { - "stateChangeFieldsVersion": 1, - "oldState": "outOfService", - "newState": "inService", - "stateInterface": "", - "additionalFields": { - "macAddress": "01:02:03:04:05:06", - "swVersion": "1.2.3" - } - } - } -} +["{\"event\":{\"commonEventHeader\":{\"version\":\"4.0.1\",\"eventName\":\"StateChange_cpe_authentication\",\"domain\":\"stateChange\",\"eventId\": \"ab305d54-85b4-a31b-7db2fb6b9e546015\",\"eventType\":\"applicationNf\",\"sourceId\":\"\",\"sourceName\":\"Wrong-PNF-Name\",\"reportingEntityId\":\"\",\"reportingEntityName\":\"thirdparty-sdnc-idfromesrrequest\",\"priority\":\"Normal\",\"startEpochMicrosec\":1.413378172e+15,\"lastEpochMicrosec\":1.413378172e+15,\"sequence\":0,\"vesEventListenerVersion\":\"7.1\"},\"stateChangeFields\":{\"stateChangeFieldsVersion\":1,\"oldState\":\"outOfService\",\"newState\":\"inService\",\"stateInterface\":\"\",\"additionalFields\":{\"macAddress\":\"01:02:03:04:05:06\",\"swVersion\":\"1.2.3\"}}}}"] \ No newline at end of file diff --git a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_without_swversion.json b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_without_swversion.json index fcacf1ce..f50ed5c1 100644 --- a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_without_swversion.json +++ b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_without_swversion.json @@ -1,16 +1 @@ -{ - "event": { - "commonEventHeader": { - "sourceName":"NVendor-Equip_Model-SN1234" - }, - "stateChangeFields": { - "stateChangeFieldsVersion": 1, - "newState": "inService", - "oldState": "outOfService", - "stateInterface": "", - "additionalFields": { - "macAddress": "00:11:22:33:44:55" - } - } - } -} +["{\"event\":{\"commonEventHeader\":{\"version\":\"4.0.1\",\"eventName\":\"StateChange_cpe_authentication\",\"domain\":\"stateChange\",\"eventId\": \"ab305d54-85b4-a31b-7db2fb6b9e546015\",\"eventType\":\"applicationNf\",\"sourceId\":\"\",\"sourceName\":\"NVendor-Equip_Model-SN1234\",\"reportingEntityId\":\"\",\"reportingEntityName\":\"thirdparty-sdnc-idfromesrrequest\",\"priority\":\"Normal\",\"startEpochMicrosec\":1.413378172e+15,\"lastEpochMicrosec\":1.413378172e+15,\"sequence\":0,\"vesEventListenerVersion\":\"7.1\"},\"stateChangeFields\":{\"stateChangeFieldsVersion\":1,\"oldState\":\"outOfService\",\"newState\":\"inService\",\"stateInterface\":\"\",\"additionalFields\":{\"macAddress\":\"01:02:03:04:05:06\"}}}}"] diff --git a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_malformed_json_format.json b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_malformed_json_format.json new file mode 100644 index 00000000..fba0214d --- /dev/null +++ b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_malformed_json_format.json @@ -0,0 +1 @@ +["{\"event\":{\"commonEventHeader\":{\"version\":\"4.0.1\",\"eventName\":\"StateChange_cpe_authentication\",\"domain\":\"stateChange\",\"eventId\": \"ab305d54-85b4-a31b-7db2fb6b9e546015\",\"eventType\":\"applicationNf\",\"sourceId\":\"\",\"sourceName\":\"NVendor-Equip_Model-SN1234\",\"reportingEntityId\":\"\",\"reportingEntityName\":\"thirdparty-sdnc-idfromesrrequest\",\"priority\":\"Normal\",\"startEpochMicrosec\":1.413378172e+15,\"lastEpochMicrosec\":1.413378172e+15,\"sequence\":0,\"vesEventListenerVersion\":\"7.1\"},\"stateChangeFields\":{\"stateChangeFieldsVersion\":1,\"oldState\":\"outOfService\",\"newState\":\"inService\",\"stateInterface\":\"\",\"additionalFields\":{\"macAddress\":\"01:02:03:04:05:06\",\"swVersion\":\"1.2.3\",}}}}"] \ No newline at end of file diff --git a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_not_json_format.json b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_not_json_format.json deleted file mode 100644 index 7801ad69..00000000 --- a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_not_json_format.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "event": { - "commonEventHeader": { - "version": "4.0.1", - "eventName": "StateChange_cpe_authentication", - "domain": "stateChange", - "eventId": "ab305d54-85b4-a31b-7db2fb6b9e546015", - "eventType": "applicationNf", - "sourceId": "", - "sourceName": "NVendor-Equip_Model-SN1234pnf-11", - "reportingEntityId": "", - "reportingEntityName": "thirdparty-sdnc-idfromesrrequest", - "priority": "Normal", - "startEpochMicrosec": 1.413378172e+15, - "lastEpochMicrosec": 1.413378172e+15, - "sequence": 0, - "vesEventListenerVersion": "7.1" - }, - "stateChangeFields": { - "stateChangeFieldsVersion": 1, - "oldState": "outOfService", - "newState": "inService", - "stateInterface": "", - "additionalFields": { - "macAddress": "01:02:03:04:05:06", - "swVersion": "1.2.3", - } - } - } -} diff --git a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_policy_with_all_fields.json b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_policy_with_all_fields.json index 05b15fbf..ea3daee7 100644 --- a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_policy_with_all_fields.json +++ b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_policy_with_all_fields.json @@ -20,4 +20,4 @@ "requestID": "d76541f3-7f55-4c80-b0a0-ec5dee2a56cb", "from": "DCAE" } -] +] \ No newline at end of file diff --git a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_event_with_all_fields.json b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_event_with_all_fields.json index 6fe23199..c70a3680 100644 --- a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_event_with_all_fields.json +++ b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_event_with_all_fields.json @@ -1,16 +1 @@ -{ - "nf-role":"role", - "equip-type":"Equipment-Type-1", - "equip-vendor":"NVendor", - "equip-model":"Equip_Model", - "serial-number":"SN1234", - "sw-version":"SW-version-1", - "correlationId":"NVendor-Equip_Model-SN1234", - "additionalFields": { - "attachment-point": "olt1-1-1", - "cvlan": "1005", - "svlan": "100", - "remote-id": "some-remote-id" - } - } - \ No newline at end of file +["{\"nf-role\":\"role\",\"equip-type\":\"Equipment-Type-1\",\"equip-vendor\":\"NVendor\",\"equip-model\":\"Equip_Model\",\"serial-number\":\"SN1234\",\"sw-version\":\"SW-version-1\",\"correlationId\":\"NVendor-Equip_Model-SN1234\",\"additionalFields\":{\"attachment-point\":\"olt1-1-1\",\"cvlan\":\"1005\",\"svlan\":\"100\",\"remote-id\":\"some-remote-id\"}}"] \ No newline at end of file diff --git a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_event_with_missing_attachment.json b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_event_with_missing_attachment.json index 43d1b212..e5941d17 100644 --- a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_event_with_missing_attachment.json +++ b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_event_with_missing_attachment.json @@ -1,15 +1 @@ -{ - "nf-role":"role", - "equip-type":"Equipment-Type-1", - "equip-vendor":"NVendor", - "equip-model":"Equip_Model", - "serial-number":"SN1234", - "sw-version":"SW-version-1", - "correlationId":"NVendor-Equip_Model-SN1234", - "additionalFields": { - "attachment-point": "", - "cvlan": "1005", - "svlan": "100", - "remote-id": "some-remote-id" - } - } +["{\"nf-role\":\"role\",\"equip-type\":\"Equipment-Type-1\",\"equip-vendor\":\"NVendor\",\"equip-model\":\"Equip_Model\",\"serial-number\":\"SN1234\",\"sw-version\":\"SW-version-1\",\"correlationId\":\"NVendor-Equip_Model-SN1234\",\"additionalFields\":{\"attachment-point\":\"\",\"cvlan\":\"1005\",\"svlan\":\"100\",\"remote-id\":\"some-remote-id\"}}"] \ No newline at end of file diff --git a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_event_with_missing_correlation.json b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_event_with_missing_correlation.json index a1aaee30..da00b165 100644 --- a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_event_with_missing_correlation.json +++ b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_event_with_missing_correlation.json @@ -1,15 +1 @@ -{ - "nf-role":"role", - "equip-type":"Equipment-Type-1", - "equip-vendor":"Vendor", - "equip-model":"Equip_Model", - "serial-number":"SN1234", - "sw-version":"SW-version-1", - "correlationId":"", - "additionalFields": { - "attachment-point": "olt1-1-1", - "cvlan": "1005", - "svlan": "100", - "remote-id": "some-remote-id" - } - } +["{\"nf-role\":\"role\",\"equip-type\":\"Equipment-Type-1\",\"equip-vendor\":\"NVendor\",\"equip-model\":\"Equip_Model\",\"serial-number\":\"SN1234\",\"sw-version\":\"SW-version-1\",\"correlationId\":\"\",\"additionalFields\":{\"attachment-point\":\"olt1-1-1\",\"cvlan\":\"1005\",\"svlan\":\"100\",\"remote-id\":\"some-remote-id\"}}"] \ No newline at end of file diff --git a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_event_with_wrong_correlation.json b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_event_with_wrong_correlation.json index f1dca037..2981c9da 100644 --- a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_event_with_wrong_correlation.json +++ b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_event_with_wrong_correlation.json @@ -1,15 +1 @@ -{ - "nf-role":"role", - "equip-type":"Equipment-Type-1", - "equip-vendor":"NVendor", - "equip-model":"Equip_Model", - "serial-number":"SN1234", - "sw-version":"SW-version-1", - "correlationId":"Wrong-Correlation-Id", - "additionalFields": { - "attachment-point": "olt1-1-1", - "cvlan": "1005", - "svlan": "100", - "remote-id": "some-remote-id" - } - } +["{\"nf-role\":\"role\",\"equip-type\":\"Equipment-Type-1\",\"equip-vendor\":\"NVendor\",\"equip-model\":\"Equip_Model\",\"serial-number\":\"SN1234\",\"sw-version\":\"SW-version-1\",\"correlationId\":\"Wrong-Correlation-Id\",\"additionalFields\":{\"attachment-point\":\"olt1-1-1\",\"cvlan\":\"1005\",\"svlan\":\"100\",\"remote-id\":\"some-remote-id\"}}"] \ No newline at end of file diff --git a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_malformed_json_format.json b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_malformed_json_format.json new file mode 100644 index 00000000..efb5cffd --- /dev/null +++ b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_malformed_json_format.json @@ -0,0 +1 @@ +["{\"nf-role\":\"role\",\"equip-type\":\"Equipment-Type-1\",\"equip-vendor\":\"NVendor\",\"equip-model\":\"Equip_Model\",\"serial-number\":\"SN1234\",\"sw-version\":\"SW-version-1\",\"correlationId\":\"NVendor-Equip_Model-SN1234\",\"additionalFields\":{\"attachment-point\":\"olt1-1-1\",\"cvlan\":\"1005\",\"svlan\":\"100\",\"remote-id\":\"some-remote-id\",}}"] \ No newline at end of file diff --git a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_not_json_format.json b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_not_json_format.json deleted file mode 100644 index ab5b214a..00000000 --- a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_not_json_format.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "nf-role":"role", - "equip-type":"Equipment-Type-1", - "equip-vendor":"NVendor", - "equip-model":"Equip_Model", - "serial-number":"SN1234", - "sw-version":"SW-version-1", - "correlationId":"NVendor-Equip_Model-SN1234", - "additionalFields": { - "attachment-point": "olt1-1-1", - "cvlan": "1005", - "svlan": "100", - "remote-id": "some-remote-id", - } - } diff --git a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/bbs_tests.robot b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/bbs_tests.robot index a0db4b2f..c60ffe6d 100644 --- a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/bbs_tests.robot +++ b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/bbs_tests.robot @@ -14,16 +14,15 @@ ${AAI_SIMULATOR_SETUP_URL} http://${AAI_SIMULATOR_SETUP} ${AUTH_EVENT_WITH_ALL_VALID_REQUIRED_FIELDS} %{WORKSPACE}/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_all_fields.json ${AUTH_EVENT_WITH_WRONG_SOURCENAME} %{WORKSPACE}/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_wrong_sourceName.json ${AUTH_EVENT_WITHOUT_SWVERSION} %{WORKSPACE}/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_without_swversion.json -${AUTH_EVENT_WITH_MISSING_RGMAC} %{WORKSPACE}/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_missing_rgmac.json ${AUTH_EVENT_WITH_MISSING_STATE} %{WORKSPACE}/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_missing_new_old_state.json ${AUTH_EVENT_WITH_MISSING_SOURCENAME} %{WORKSPACE}/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_event_with_missing_sourceName.json -${AUTH_NOT_JSON_FORMAT} %{WORKSPACE}/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_not_json_format.json +${AUTH_MALFORMED_JSON_FORMAT} %{WORKSPACE}/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_malformed_json_format.json ${AUTH_POLICY} %{WORKSPACE}/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/auth_policy_with_all_fields.json ${UPDATE_EVENT_WITH_ALL_VALID_REQUIRED_FIELDS} %{WORKSPACE}/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_event_with_all_fields.json ${UPDATE_EVENT_WITH_WRONG_CORRELATION} %{WORKSPACE}/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_event_with_wrong_correlation.json ${UPDATE_EVENT_WITH_MISSING_ATTACHMENT} %{WORKSPACE}/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_event_with_missing_attachment.json ${UPDATE_EVENT_WITH_MISSING_CORRELATION} %{WORKSPACE}/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_event_with_missing_correlation.json -${UPDATE_NOT_JSON_FORMAT} %{WORKSPACE}/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_not_json_format.json +${UPDATE_MALFORMED_JSON_FORMAT} %{WORKSPACE}/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_malformed_json_format.json ${UPDATE_POLICY} %{WORKSPACE}/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/json_events/update_policy_with_all_fields.json ${AAI_PNFS} %{WORKSPACE}/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/aai_records/aai_pnfs.json ${AAI_SERVICES} %{WORKSPACE}/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/assets/aai_records/aai_services.json @@ -37,12 +36,6 @@ Valid DMaaP CPE_AUTHENTICATION event can trigger Policy ${AUTH_EVENT_WITH_ALL_VALID_REQUIRED_FIELDS} ${AUTH_EVENT_WITHOUT_SWVERSION} -Invalid DMaaP CPE_AUTHENTICATION event RG MAC cannot trigger Policy - [Documentation] BBS get invalid RG MAC CPE_AUTHENTICATION event from DMaaP with missing required fields - BBS does not trigger Policy - [Tags] BBS Invalid RG MAC CPE_AUTHENTICATION event - [Template] Invalid rgmac auth event processing - ${AUTH_EVENT_WITH_MISSING_RGMAC} - Invalid DMaaP CPE_AUTHENTICATION event cannot trigger Policy [Documentation] BBS get invalid CPE_AUTHENTICATION event from DMaaP with missing required fields - BBS does not trigger Policy [Tags] BBS Invalid CPE_AUTHENTICATION event @@ -58,23 +51,23 @@ Get valid CPE_AUTHENTICATION event from DMaaP and PNF record in AAI does not exi Set event in DMaaP ${data} Wait Until Keyword Succeeds 20x 2000ms Check BBS log Error while retrieving PNF: A&AI Request for (/aai/v14/network/pnfs/pnf/Wrong-PNF-Name?depth=all) -CPE_AUTHENTICATION Event in DMaaP is not JSON format - [Documentation] BBS CPE_AUTHENTICATION not JSON format event from DMaaP - BBS does not Trigger Policy +CPE_AUTHENTICATION Event in DMaaP has malformed JSON format + [Documentation] BBS CPE_AUTHENTICATION has malformed JSON format event from DMaaP - BBS does not Trigger Policy [Tags] BBS - ${data}= Get Data From File ${AUTH_NOT_JSON_FORMAT} + ${data}= Get Data From File ${AUTH_MALFORMED_JSON_FORMAT} Set event in DMaaP ${data} - Wait Until Keyword Succeeds 20x 2000ms Check BBS log DMaaP Consumption Exception: Not a JSON Array: + Wait Until Keyword Succeeds 20x 2000ms Check BBS log DMaaP Consumer error: com.google.gson.stream.MalformedJsonException -# Get valid CPE_AUTHENTICATION event from DMaaP and AAI is not responding -# [Documentation] BBS get valid CPE_AUTHENTICATION event from DMaaP with all required fields and AAI is not responding - BBS does not trigger Policy -# [Tags] BBS AAI Uses containers -# [Timeout] 180s -# ${data}= Get Data From File ${AUTH_EVENT_WITH_ALL_VALID_REQUIRED_FIELDS} -# Ensure Container Is Exited aai_simulator -# Set event in DMaaP ${data} -# Wait Until Keyword Succeeds 20x 2000ms Check BBS log Error while retrieving PNF: aai_simulator: Try again -# Ensure Container Is Running aai_simulator -# Set AAI Records + # Get valid CPE_AUTHENTICATION event from DMaaP and AAI is not responding + # [Documentation] BBS get valid CPE_AUTHENTICATION event from DMaaP with all required fields and AAI is not responding - BBS does not trigger Policy + # [Tags] BBS AAI Uses containers + # [Timeout] 180s + # ${data}= Get Data From File ${AUTH_EVENT_WITH_ALL_VALID_REQUIRED_FIELDS} + # Ensure Container Is Exited aai_simulator + # Set event in DMaaP ${data} + # Wait Until Keyword Succeeds 20x 2000ms Check BBS log Error while retrieving PNF: aai_simulator: Try again + # Ensure Container Is Running aai_simulator + # Set AAI Records Valid DMaaP PNF_UPDATE event can trigger Policy [Documentation] BBS get valid PNF_UPDATE event from DMaaP with required fields - BBS triggers Policy @@ -98,20 +91,20 @@ Get valid PNF_UPDATE event from DMaaP and PNF record in AAI does not exist Wait Until Keyword Succeeds 20x 2000ms Check BBS log Error while retrieving PNF: A&AI Request for (/aai/v14/network/pnfs/pnf/Wrong-Correlation-Id?depth=all) -PNF_UPDATE Event in DMaaP is not JSON format - [Documentation] BBS PNF_UPDATE not JSON format event from DMaaP - BBS does not Trigger Policy +PNF_UPDATE Event in DMaaP has malformed JSON format + [Documentation] BBS PNF_UPDATE has malformed JSON format event from DMaaP - BBS does not Trigger Policy [Tags] BBS - ${data}= Get Data From File ${UPDATE_NOT_JSON_FORMAT} + ${data}= Get Data From File ${UPDATE_MALFORMED_JSON_FORMAT} Set event in DMaaP ${data} - Wait Until Keyword Succeeds 20x 2000ms Check BBS log DMaaP Consumption Exception: Not a JSON Array: + Wait Until Keyword Succeeds 20x 2000ms Check BBS log DMaaP Consumer error: com.google.gson.stream.MalformedJsonException -# Get valid PNF_UPDATE event from DMaaP and AAI is not responding -# [Documentation] BBS get valid PNF_UPDATE event from DMaaP with all required fields and AAI is not responding - BBS does not trigger Policy -# [Tags] BBS AAI Uses containers -# [Timeout] 180s -# ${data}= Get Data From File ${UPDATE_EVENT_WITH_ALL_VALID_REQUIRED_FIELDS} -# Ensure Container Is Exited aai_simulator -# Set event in DMaaP ${data} -# Wait Until Keyword Succeeds 20x 2000ms Check BBS log Error while retrieving PNF: aai_simulator: Try again -# Ensure Container Is Running aai_simulator -# Set AAI Records + # Get valid PNF_UPDATE event from DMaaP and AAI is not responding + # [Documentation] BBS get valid PNF_UPDATE event from DMaaP with all required fields and AAI is not responding - BBS does not trigger Policy + # [Tags] BBS AAI Uses containers + # [Timeout] 180s + # ${data}= Get Data From File ${UPDATE_EVENT_WITH_ALL_VALID_REQUIRED_FIELDS} + # Ensure Container Is Exited aai_simulator + # Set event in DMaaP ${data} + # Wait Until Keyword Succeeds 20x 2000ms Check BBS log Error while retrieving PNF: aai_simulator: Try again + # Ensure Container Is Running aai_simulator + # Set AAI Records diff --git a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/resources/BbsLibrary.py b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/resources/BbsLibrary.py index 8dbdc5a3..c58e67e2 100644 --- a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/resources/BbsLibrary.py +++ b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/resources/BbsLibrary.py @@ -40,7 +40,8 @@ class BbsLibrary(object): Get the correlationId, oldState, newState, stateInterface, macAddress, swVersion elements from the invalid message and place the elements into a JSON object (string) as fields for comparision """ - json_to_python = json.loads(json_file) + eventString = json.loads(json_file)[0] + json_to_python = json.loads(eventString.replace("\\", "")) correlation_id = json_to_python.get("event").get("commonEventHeader").get("sourceName") oldState = json_to_python.get("event").get("stateChangeFields").get("oldState") newState = json_to_python.get("event").get("stateChangeFields").get("newState") @@ -73,7 +74,8 @@ class BbsLibrary(object): Get the correlationId, attachment-point, remote-id, cvlan, svlan, elements from the invalid message and place the elements into a JSON object (string) as fields for comparision """ - json_to_python = json.loads(json_file) + eventString = json.loads(json_file)[0] + json_to_python = json.loads(eventString.replace("\\", "")) correlation_id = json_to_python.get("correlationId") attachmentPoint = json_to_python.get("additionalFields").get("attachment-point") remoteId = json_to_python.get("additionalFields").get("remote-id") @@ -109,7 +111,7 @@ class BbsLibrary(object): python_dmaap_policy = "" try: - d_policy = python_dmaap_policy.get("policyName") + d_policy = python_dmaap_policy[0].get("policyName") except: d_policy = "" diff --git a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/resources/docker-compose.yml b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/resources/docker-compose.yml index f2102727..b24006d3 100644 --- a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/resources/docker-compose.yml +++ b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/resources/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: bbs: - image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.components.bbs-event-processor:1.0.0 + image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.components.bbs-event-processor:latest command: > --dmaap.dmaapConsumerConfiguration.dmaapHostName=dmaap_simulator --dmaap.dmaapConsumerConfiguration.dmaapPortNumber=2222 @@ -36,6 +36,10 @@ services: CONFIGS_APPLICATION_CPE-AUTHENTICATION_POLICYSCOPE: "cpe-auth_policy_scope" CONFIGS_APPLICATION_CPE-AUTHENTICATION_CLCONTROLNAME: "cpe-auth_cl" LOGGING_LEVEL_ORG_ONAP_BBS: TRACE + CONFIGS_SECURITY_TRUSTSTOREPATH: KeyStore.jks + CONFIGS_SECURITY_TRUSTSTOREPASSWORDPATH: KeyStorePass.txt + CONFIGS_SECURITY_KEYSTOREPATH: KeyStore.jks + CONFIGS_SECURITY_KEYSTOREPASSWORDPATH: KeyStorePass.txt container_name: bbs depends_on: - dmaap-bc