diff options
32 files changed, 479 insertions, 63 deletions
diff --git a/plans/modeling-toscaparsers-genericparser/sanity-check/setup.sh b/plans/modeling-genericparser/sanity-check/setup.sh index 1ca35bef..721885db 100644 --- a/plans/modeling-toscaparsers-genericparser/sanity-check/setup.sh +++ b/plans/modeling-genericparser/sanity-check/setup.sh @@ -56,7 +56,7 @@ echo sleep 60 sleep 60 # start modeling-genericparser -docker run -d --name modeling-genericparser -v /var/lib/mysql -e MSB_ADDR=${DISCOVERY_IP}:10081 -e MYSQL_ADDR=${VFC_DB_IP}:3306 nexus3.onap.org:10001/onap/vfc/catalog +docker run -d --name modeling-genericparser -v /var/lib/mysql -e MSB_ADDR=${DISCOVERY_IP}:10081 -e MYSQL_ADDR=${VFC_DB_IP}:3306 nexus3.onap.org:10001/onap/modeling/genericparser GenericParser_IP=`get-instance-ip.sh modeling-genericparser` for i in {1..10}; do curl -sS -m 1 ${GenericParser_IP}:8806 && break diff --git a/plans/modeling-toscaparsers-genericparser/sanity-check/teardown.sh b/plans/modeling-genericparser/sanity-check/teardown.sh index 3982a1ef..3982a1ef 100644 --- a/plans/modeling-toscaparsers-genericparser/sanity-check/teardown.sh +++ b/plans/modeling-genericparser/sanity-check/teardown.sh diff --git a/plans/modeling-toscaparsers-genericparser/sanity-check/testplan.txt b/plans/modeling-genericparser/sanity-check/testplan.txt index 13456aed..25d2c5d7 100644 --- a/plans/modeling-toscaparsers-genericparser/sanity-check/testplan.txt +++ b/plans/modeling-genericparser/sanity-check/testplan.txt @@ -1,3 +1,3 @@ # Test suites are relative paths under [integration/csit.git]/tests/. # Place the suites in run order. -modeling-toscaparsers-genericparser/test.robot +modeling-genericparser/test.robot diff --git a/plans/multicloud-k8s/functionality1/setup.sh b/plans/multicloud-k8s/functionality1/setup.sh index 182fb8b7..eda24ba4 100755 --- a/plans/multicloud-k8s/functionality1/setup.sh +++ b/plans/multicloud-k8s/functionality1/setup.sh @@ -17,8 +17,22 @@ pushd ${SCRIPTS} ./run-instance.sh docker.io/mongo:4.0 multicloud-k8s-mongodb MONGO_IP=$(./get-instance-ip.sh multicloud-k8s-mongodb) +# setup multicloud-k8s configuration +CONFIG_FILE=$(pwd)/k8sconfig.json +cat << EOF > $CONFIG_FILE +{ + "database-address": "$MONGO_IP", + "database-type": "mongo", + "plugin-dir": "plugins", + "kube-config-dir": "kubeconfigs" +} +EOF + +cat $CONFIG_FILE + # start multicloud-k8s -./run-instance.sh nexus3.onap.org:10001/onap/multicloud/k8s:latest multicloud-k8s "-e PLUGINS_DIR=/opt/multicloud/k8s -e DATABASE_TYPE=mongo -e DATABASE_IP=$MONGO_IP" +docker run --name multicloud-k8s -v $CONFIG_FILE:/opt/multicloud/k8splugin/k8sconfig.json \ + -d nexus3.onap.org:10001/onap/multicloud/k8s:latest SERVICE_IP=$(./get-instance-ip.sh multicloud-k8s) SERVICE_PORT=8081 popd diff --git a/run-csit.sh b/run-csit.sh index 9b744dbd..93f4b7e2 100755 --- a/run-csit.sh +++ b/run-csit.sh @@ -98,7 +98,8 @@ pip install robotframework-selenium2library==1.8.0 robotframework-extendedseleni mkdir -p ${ROBOT_VENV}/src/onap rm -rf ${ROBOT_VENV}/src/onap/testsuite git clone https://gerrit.onap.org/r/testsuite/python-testing-utils.git ${ROBOT_VENV}/src/onap/testsuite/python-testing-utils -pip install --upgrade ${ROBOT_VENV}/src/onap/testsuite/python-testing-utils +git -C ${ROBOT_VENV}/src/onap/testsuite/python-testing-utils checkout master +pip install --upgrade ${ROBOT_VENV}/src/onap/testsuite/python-testing-utils/robotframework-onap pip freeze diff --git a/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot b/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot index a103c5cc..c211e7d6 100644 --- a/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot +++ b/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot @@ -11,7 +11,7 @@ Test Teardown Delete All Sessions *** Variables *** -${CLI_EXEC_CLI_CONFIG} { head -n 6 | tail -2;} < /tmp/pmmapper.log +${CLI_EXEC_CLI_CONFIG} { head -n 10 | tail -5;} < /tmp/pmmapper.log ${CLI_EXEC_CLI_SUBS} curl -k https://${DR_PROV_IP}:8443/internal/prov ${PMMAPPER_BASE_URL} http://${PMMAPPER_IP}:8081 ${DELIVERY_ENDPOINT} /delivery diff --git a/tests/dcaegen2/prh-testcases/assets/aai-missing-entry/incorrect-aai-entry.json b/tests/dcaegen2/prh-testcases/assets/aai-missing-entry/incorrect-aai-entry.json new file mode 100644 index 00000000..d0db0a11 --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/aai-missing-entry/incorrect-aai-entry.json @@ -0,0 +1,23 @@ +{ + "pnf-name": "wrong-record", + "pnf-name2": "example-pnf-name2-val-58071", + "pnf-name2-source": "example-pnf-name2-source-val-22408", + "pnf-id": "example-pnf-id-val-55834", + "equip-type": "example-equip-type-val-5497", + "equip-vendor": "example-equip-vendor-val-85730", + "equip-model": "example-equip-model-val-38526", + "management-option": "example-management-option-val-15776", + "ipaddress-v4-oam": "example-ipaddress-v4-oam-val-33556", + "sw-version": "example-sw-version-val-64239", + "in-maint": true, + "frame-id": "example-frame-id-val-76733", + "serial-number": "example-serial-number-val-79366", + "ipaddress-v4-loopback-0": "example-ipaddress-v4-loopback0-val-34781", + "ipaddress-v6-loopback-0": "example-ipaddress-v6-loopback0-val-29979", + "ipaddress-v4-aim": "example-ipaddress-v4-aim-val-53703", + "ipaddress-v6-aim": "example-ipaddress-v6-aim-val-93386", + "ipaddress-v6-oam": "example-ipaddress-v6-oam-val-92665", + "inv-status": "example-inv-status-val-8477", + "prov-status": "example-prov-status-val-68268", + "nf-role": "example-nf-role-val-68489" +} diff --git a/tests/dcaegen2/prh-testcases/assets/aai-missing-entry/ves-event.json b/tests/dcaegen2/prh-testcases/assets/aai-missing-entry/ves-event.json new file mode 100644 index 00000000..d8f3c90c --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/aai-missing-entry/ves-event.json @@ -0,0 +1,37 @@ +{ + "event": { + "commonEventHeader": { + "startEpochMicrosec": 1540212137393, + "sourceId": "val13", + "eventId": "registration_40212137", + "nfcNamingCode": "oam", + "internalHeaderFields": { + "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC" + }, + "eventType": "pnfRegistration", + "priority": "Normal", + "version": "4.0.1", + "reportingEntityName": "NOK6061ZW8", + "sequence": 0, + "domain": "pnfRegistration", + "lastEpochMicrosec": 1540212137393, + "eventName": "pnfRegistration_Nokia_5gDu", + "vesEventListenerVersion": "7.0.1", + "sourceName": "NOK6061ZW8", + "nfNamingCode": "gNB" + }, + "pnfRegistrationFields": { + "unitType": "val8", + "serialNumber": "6061ZW9", + "pnfRegistrationFieldsVersion": "2.0", + "manufactureDate": "1540212137393", + "modelNumber": "val6", + "lastServiceDate": "1540212137393", + "unitFamily": "BBU", + "vendorName": "Nokia", + "oamV4IpAddress": "val3", + "oamV6IpAddress": "val4", + "softwareVersion": "val7" + } + } +} diff --git a/tests/dcaegen2/prh-testcases/assets/aai-not-responding/ves-event.json b/tests/dcaegen2/prh-testcases/assets/aai-not-responding/ves-event.json new file mode 100644 index 00000000..d8f3c90c --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/aai-not-responding/ves-event.json @@ -0,0 +1,37 @@ +{ + "event": { + "commonEventHeader": { + "startEpochMicrosec": 1540212137393, + "sourceId": "val13", + "eventId": "registration_40212137", + "nfcNamingCode": "oam", + "internalHeaderFields": { + "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC" + }, + "eventType": "pnfRegistration", + "priority": "Normal", + "version": "4.0.1", + "reportingEntityName": "NOK6061ZW8", + "sequence": 0, + "domain": "pnfRegistration", + "lastEpochMicrosec": 1540212137393, + "eventName": "pnfRegistration_Nokia_5gDu", + "vesEventListenerVersion": "7.0.1", + "sourceName": "NOK6061ZW8", + "nfNamingCode": "gNB" + }, + "pnfRegistrationFields": { + "unitType": "val8", + "serialNumber": "6061ZW9", + "pnfRegistrationFieldsVersion": "2.0", + "manufactureDate": "1540212137393", + "modelNumber": "val6", + "lastServiceDate": "1540212137393", + "unitFamily": "BBU", + "vendorName": "Nokia", + "oamV4IpAddress": "val3", + "oamV6IpAddress": "val4", + "softwareVersion": "val7" + } + } +} diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-missing-field/invalid-ves-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-missing-field/invalid-ves-event.json new file mode 100644 index 00000000..52024d69 --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-missing-field/invalid-ves-event.json @@ -0,0 +1,16 @@ +{ + "event": { + "commonEventHeader": { + "sourceName": "" + }, + "pnfRegistrationFields": { + "oamV4IpAddress": "10.18.123.236", + "oamV6IpAddress": "2001:0db8:85a3:0000:0000:8a2a:0370:7334", + "serialNumber": "", + "vendorName": "", + "modelNumber": "", + "unitType": "", + "additionalFields": {} + } + } +} diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-not-array/invalid-ves-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-not-array/invalid-ves-event.json new file mode 100644 index 00000000..f6afb1d3 --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-not-array/invalid-ves-event.json @@ -0,0 +1,15 @@ +{ + "event": { + "commonEventHeader": { + "sourceName":"NOK6061ZW1" + }, + "pnfRegistrationFields": { + "oamV4IpAddress":"10.16.123.234", + "oamV6IpAddress":"2001:0db8:85a3:0000:0000:8a2e:0370:7334", + "serialNumber":"NOkkaaa123", + "vendorName":"equipVendor", + "modelNumber":"equipModel", + "unitType":"equipType", + } + } +} diff --git a/tests/dcaegen2/prh-testcases/assets/bbs_registration/aai-entry.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/aai-entry.json index 8787dc1b..8787dc1b 100644 --- a/tests/dcaegen2/prh-testcases/assets/bbs_registration/aai-entry.json +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/aai-entry.json diff --git a/tests/dcaegen2/prh-testcases/assets/bbs_registration/expected-logical-link.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/expected-logical-link.json index c48c841c..c48c841c 100644 --- a/tests/dcaegen2/prh-testcases/assets/bbs_registration/expected-logical-link.json +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/expected-logical-link.json diff --git a/tests/dcaegen2/prh-testcases/assets/bbs_registration/expected-pnf-ready-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/expected-pnf-ready-event.json index 9da0201c..9da0201c 100644 --- a/tests/dcaegen2/prh-testcases/assets/bbs_registration/expected-pnf-ready-event.json +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/expected-pnf-ready-event.json diff --git a/tests/dcaegen2/prh-testcases/assets/bbs_registration/ves-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/ves-event.json index c67d863e..c67d863e 100644 --- a/tests/dcaegen2/prh-testcases/assets/bbs_registration/ves-event.json +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/ves-event.json diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/aai-entry.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/aai-entry.json new file mode 100644 index 00000000..1378f58f --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/aai-entry.json @@ -0,0 +1,23 @@ +{ + "pnf-name": "NOK6061ZW8", + "pnf-name2": "example-pnf-name2-val-58071", + "pnf-name2-source": "example-pnf-name2-source-val-22408", + "pnf-id": "example-pnf-id-val-55834", + "equip-type": "example-equip-type-val-5497", + "equip-vendor": "example-equip-vendor-val-85730", + "equip-model": "example-equip-model-val-38526", + "management-option": "example-management-option-val-15776", + "ipaddress-v4-oam": "example-ipaddress-v4-oam-val-33556", + "sw-version": "example-sw-version-val-64239", + "in-maint": true, + "frame-id": "example-frame-id-val-76733", + "serial-number": "example-serial-number-val-79366", + "ipaddress-v4-loopback-0": "example-ipaddress-v4-loopback0-val-34781", + "ipaddress-v6-loopback-0": "example-ipaddress-v6-loopback0-val-29979", + "ipaddress-v4-aim": "example-ipaddress-v4-aim-val-53703", + "ipaddress-v6-aim": "example-ipaddress-v6-aim-val-93386", + "ipaddress-v6-oam": "example-ipaddress-v6-oam-val-92665", + "inv-status": "example-inv-status-val-8477", + "prov-status": "example-prov-status-val-68268", + "nf-role": "example-nf-role-val-68489" +}
\ No newline at end of file diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/expected-pnf-ready-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/expected-pnf-ready-event.json new file mode 100644 index 00000000..6c92285c --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/expected-pnf-ready-event.json @@ -0,0 +1,3 @@ +{ + "correlationId": "NOK6061ZW8" +} diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/ves-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/ves-event.json new file mode 100644 index 00000000..8fbfff32 --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/ves-event.json @@ -0,0 +1,39 @@ +{ + "event": { + "commonEventHeader": { + "startEpochMicrosec": 1540212137393, + "sourceId": "val13", + "eventId": "registration_40212137", + "nfcNamingCode": "oam", + "internalHeaderFields": { + "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC" + }, + "eventType": "pnfRegistration", + "priority": "Normal", + "version": "4.0.1", + "reportingEntityName": "NOK6061ZW8", + "sequence": 0, + "domain": "pnfRegistration", + "lastEpochMicrosec": 1540212137393, + "eventName": "pnfRegistration_Nokia_5gDu", + "vesEventListenerVersion": "7.0.1", + "sourceName": "NOK6061ZW8", + "nfNamingCode": "gNB" + }, + "pnfRegistrationFields": { + "unitType": "val8", + "serialNumber": "6061ZW9", + "pnfRegistrationFieldsVersion": "2.0", + "manufactureDate": "1540212137393", + "modelNumber": "val6", + "lastServiceDate": "1540212137393", + "unitFamily": "BBU", + "vendorName": "Nokia", + "oamV4IpAddress": "val3", + "oamV6IpAddress": "val4", + "softwareVersion": "val7", + "additionalFields": { + } + } + } +} diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/aai-entry.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/aai-entry.json new file mode 100644 index 00000000..1378f58f --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/aai-entry.json @@ -0,0 +1,23 @@ +{ + "pnf-name": "NOK6061ZW8", + "pnf-name2": "example-pnf-name2-val-58071", + "pnf-name2-source": "example-pnf-name2-source-val-22408", + "pnf-id": "example-pnf-id-val-55834", + "equip-type": "example-equip-type-val-5497", + "equip-vendor": "example-equip-vendor-val-85730", + "equip-model": "example-equip-model-val-38526", + "management-option": "example-management-option-val-15776", + "ipaddress-v4-oam": "example-ipaddress-v4-oam-val-33556", + "sw-version": "example-sw-version-val-64239", + "in-maint": true, + "frame-id": "example-frame-id-val-76733", + "serial-number": "example-serial-number-val-79366", + "ipaddress-v4-loopback-0": "example-ipaddress-v4-loopback0-val-34781", + "ipaddress-v6-loopback-0": "example-ipaddress-v6-loopback0-val-29979", + "ipaddress-v4-aim": "example-ipaddress-v4-aim-val-53703", + "ipaddress-v6-aim": "example-ipaddress-v6-aim-val-93386", + "ipaddress-v6-oam": "example-ipaddress-v6-oam-val-92665", + "inv-status": "example-inv-status-val-8477", + "prov-status": "example-prov-status-val-68268", + "nf-role": "example-nf-role-val-68489" +}
\ No newline at end of file diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/expected-pnf-ready-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/expected-pnf-ready-event.json new file mode 100644 index 00000000..75cb4a2e --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/expected-pnf-ready-event.json @@ -0,0 +1,6 @@ +{ + "additionalFields": { + "attachmentPoint": "" + }, + "correlationId": "NOK6061ZW8" +} diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/ves-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/ves-event.json new file mode 100644 index 00000000..d90869e3 --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/ves-event.json @@ -0,0 +1,40 @@ +{ + "event": { + "commonEventHeader": { + "startEpochMicrosec": 1540212137393, + "sourceId": "val13", + "eventId": "registration_40212137", + "nfcNamingCode": "oam", + "internalHeaderFields": { + "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC" + }, + "eventType": "pnfRegistration", + "priority": "Normal", + "version": "4.0.1", + "reportingEntityName": "NOK6061ZW8", + "sequence": 0, + "domain": "pnfRegistration", + "lastEpochMicrosec": 1540212137393, + "eventName": "pnfRegistration_Nokia_5gDu", + "vesEventListenerVersion": "7.0.1", + "sourceName": "NOK6061ZW8", + "nfNamingCode": "gNB" + }, + "pnfRegistrationFields": { + "unitType": "val8", + "serialNumber": "6061ZW9", + "pnfRegistrationFieldsVersion": "2.0", + "manufactureDate": "1540212137393", + "modelNumber": "val6", + "lastServiceDate": "1540212137393", + "unitFamily": "BBU", + "vendorName": "Nokia", + "oamV4IpAddress": "val3", + "oamV6IpAddress": "val4", + "softwareVersion": "val7", + "additionalFields": { + "attachmentPoint": "" + } + } + } +} diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/aai-entry.json b/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/aai-entry.json new file mode 100644 index 00000000..1378f58f --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/aai-entry.json @@ -0,0 +1,23 @@ +{ + "pnf-name": "NOK6061ZW8", + "pnf-name2": "example-pnf-name2-val-58071", + "pnf-name2-source": "example-pnf-name2-source-val-22408", + "pnf-id": "example-pnf-id-val-55834", + "equip-type": "example-equip-type-val-5497", + "equip-vendor": "example-equip-vendor-val-85730", + "equip-model": "example-equip-model-val-38526", + "management-option": "example-management-option-val-15776", + "ipaddress-v4-oam": "example-ipaddress-v4-oam-val-33556", + "sw-version": "example-sw-version-val-64239", + "in-maint": true, + "frame-id": "example-frame-id-val-76733", + "serial-number": "example-serial-number-val-79366", + "ipaddress-v4-loopback-0": "example-ipaddress-v4-loopback0-val-34781", + "ipaddress-v6-loopback-0": "example-ipaddress-v6-loopback0-val-29979", + "ipaddress-v4-aim": "example-ipaddress-v4-aim-val-53703", + "ipaddress-v6-aim": "example-ipaddress-v6-aim-val-93386", + "ipaddress-v6-oam": "example-ipaddress-v6-oam-val-92665", + "inv-status": "example-inv-status-val-8477", + "prov-status": "example-prov-status-val-68268", + "nf-role": "example-nf-role-val-68489" +}
\ No newline at end of file diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/expected-pnf-ready-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/expected-pnf-ready-event.json new file mode 100644 index 00000000..4ac7f6e3 --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/expected-pnf-ready-event.json @@ -0,0 +1,3 @@ +{ + "correlationId": "NOK6061ZW8" +}
\ No newline at end of file diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/ves-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/ves-event.json new file mode 100644 index 00000000..d8f3c90c --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/ves-event.json @@ -0,0 +1,37 @@ +{ + "event": { + "commonEventHeader": { + "startEpochMicrosec": 1540212137393, + "sourceId": "val13", + "eventId": "registration_40212137", + "nfcNamingCode": "oam", + "internalHeaderFields": { + "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC" + }, + "eventType": "pnfRegistration", + "priority": "Normal", + "version": "4.0.1", + "reportingEntityName": "NOK6061ZW8", + "sequence": 0, + "domain": "pnfRegistration", + "lastEpochMicrosec": 1540212137393, + "eventName": "pnfRegistration_Nokia_5gDu", + "vesEventListenerVersion": "7.0.1", + "sourceName": "NOK6061ZW8", + "nfNamingCode": "gNB" + }, + "pnfRegistrationFields": { + "unitType": "val8", + "serialNumber": "6061ZW9", + "pnfRegistrationFieldsVersion": "2.0", + "manufactureDate": "1540212137393", + "modelNumber": "val6", + "lastServiceDate": "1540212137393", + "unitFamily": "BBU", + "vendorName": "Nokia", + "oamV4IpAddress": "val3", + "oamV6IpAddress": "val4", + "softwareVersion": "val7" + } + } +} diff --git a/tests/dcaegen2/prh-testcases/bbs_tests.robot b/tests/dcaegen2/prh-testcases/bbs_tests.robot deleted file mode 100644 index e9bc999a..00000000 --- a/tests/dcaegen2/prh-testcases/bbs_tests.robot +++ /dev/null @@ -1,27 +0,0 @@ -*** Settings *** -Documentation Integration tests for PRH. -... PRH receive events from DMaaP and produce or not PNF_READY notification depends on required fields in received event. -Suite Setup Run keywords Create Headers AND Create sessions AND Ensure Container Is Running prh AND Ensure Container Is Exited ssl_prh -Suite Teardown Ensure Container Is Running ssl_prh -Test Teardown Reset Simulators - -#Suite Setup Run keywords Create headers AND Create sessions AND Ensure Container Is Running prh AND Ensure Container Is Exited ssl_prh -#Suite Teardown Run keywords Ensure Container Is Running ssl_prh AND Ensure Container Is Exited prh AND Reset Simulators -#Test Teardown Reset Simulators -Library resources/PrhLibrary.py -Resource resources/prh_library2.robot -Resource ../../common.robot - -*** Variables *** -${TEST_CASE_DIR} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets - -${DMAAP_SIMULATOR_SETUP_URL} http://${DMAAP_SIMULATOR_SETUP} -${AAI_SIMULATOR_SETUP_URL} http://${AAI_SIMULATOR_SETUP} -${CONSUL_SETUP_URL} http://${CONSUL_SETUP} - -*** Test Cases *** - -Correct VES event with additional fields - [Tags] PRH - [Template] VES event with additional fields - ${TEST_CASE_DIR}/bbs_registration
\ No newline at end of file diff --git a/tests/dcaegen2/prh-testcases/prh_tests2.robot b/tests/dcaegen2/prh-testcases/prh_tests2.robot new file mode 100644 index 00000000..7f0531b8 --- /dev/null +++ b/tests/dcaegen2/prh-testcases/prh_tests2.robot @@ -0,0 +1,53 @@ +*** Settings *** +Documentation Integration tests for PRH. +... PRH receive events from DMaaP and produce or not PNF_READY notification depends on required fields in received event. +Suite Setup Run keywords Create Headers AND Create sessions AND Ensure Container Is Running prh AND Ensure Container Is Exited ssl_prh +Suite Teardown Ensure Container Is Running ssl_prh +Test Teardown Reset Simulators + +Library resources/PrhLibrary.py +Resource resources/prh_library2.robot +Resource ../../common.robot + +*** Variables *** +${TEST_CASES_DIR} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets + +${DMAAP_SIMULATOR_SETUP_URL} http://${DMAAP_SIMULATOR_SETUP} +${AAI_SIMULATOR_SETUP_URL} http://${AAI_SIMULATOR_SETUP} +${CONSUL_SETUP_URL} http://${CONSUL_SETUP} + +*** Test Cases *** +Simple BBS case event + [Documentation] PRH get from DMaaP valid event with valid attachment point + [Tags] PRH Valid event Attachment point + [Template] Verify PNF ready sent and logical link created + ${TEST_CASES_DIR}/ves-event-with-attachment-point + +Simple registration event + [Documentation] PRH get from DMaaP valid event without valid attachment point + [Tags] PRH Valid event + [Template] Verify PNF ready sent + ${TEST_CASES_DIR}/ves-event-without-additional-fields + ${TEST_CASES_DIR}/ves-event-with-empty-additional-fields + ${TEST_CASES_DIR}/ves-event-with-empty-attachment-point + +Should not sent PNF ready when DMaaP event is invalid + [Documentation] PRH get from DMaaP event with missing required field + [Tags] PRH Invalid event + [Template] Verify event with missing required field is logged + ${TEST_CASES_DIR}/ves-event-missing-field + +Should not sent PNF ready when DMaaP event is not JSON array + [Documentation] Event from DMaaP is not JSON array + [Tags] PRH Invalid event + Verify incorrect JSON event is logged ${TEST_CASES_DIR}/ves-event-not-array + +Should not sent PNF ready when AAI record doesn't exist + [Documentation] PRH get from DMaaP valid event but given PNF doesn't exists in AAI + [Tags] PRH Missing AAI record + Verify missing AAI record is logged ${TEST_CASES_DIR}/aai-missing-entry + +Should not sent PNF ready when AAI is not responding + [Documentation] PRH get from DMaaP valid event but AAI is not responding + [Tags] PRH AAI not responding + Verify AAI not responding is logged ${TEST_CASES_DIR}/aai-not-responding diff --git a/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py b/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py index 597f8647..f6439be3 100644 --- a/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py +++ b/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py @@ -10,7 +10,8 @@ class PrhLibrary(object): pass @staticmethod - def check_for_log(search_for): + def find_log_entry(search_for): + print (type(search_for)) client = docker.from_env() container = client.containers.get('prh') print ("Check for log searches for pattern: ", search_for ) @@ -126,4 +127,4 @@ class PrhLibrary(object): @staticmethod def is_in_status(client, name, status): - return len(client.containers.list(all=True, filters={"name": "^/"+name+"$", "status": status})) == 1 + return len(client.containers.list(all=True, filters={"name": "^/"+name+"$", "status": status})) == 1
\ No newline at end of file diff --git a/tests/dcaegen2/prh-testcases/resources/prh_library.robot b/tests/dcaegen2/prh-testcases/resources/prh_library.robot index cfe1d993..36b1a1c5 100644 --- a/tests/dcaegen2/prh-testcases/resources/prh_library.robot +++ b/tests/dcaegen2/prh-testcases/resources/prh_library.robot @@ -16,7 +16,7 @@ Create sessions Set Suite Variable ${aai_setup_session} aai_setup_session Create Session consul_setup_session ${CONSUL_SETUP_URL} Set Suite Variable ${consul_setup_session} consul_setup_session - Sleep 60s + Sleep 10s Reset Simulators Reset AAI simulator @@ -33,7 +33,7 @@ Valid event processing Set PNF name in AAI ${pnf_name} Set PNF content in AAI ${aai_entry_to_be_set} ${expected_event_pnf_ready_in_dpaap}= create pnf ready_notification as pnf ready ${data} - Wait Until Keyword Succeeds 10x 3000ms Check PNF_READY notification ${expected_event_pnf_ready_in_dpaap} + Wait Until Keyword Succeeds 30x 3000ms Check PNF_READY notification ${expected_event_pnf_ready_in_dpaap} Invalid event processing [Arguments] ${input_invalid_event_in_dmaap} @@ -46,12 +46,12 @@ Invalid event processing Check PRH log [Arguments] ${searched_log} - ${status}= Check for log ${searched_log} + ${status}= Find log entry ${searched_log} Should Be Equal As Strings ${status} True Check PNF_READY notification [Arguments] ${expected_event_pnf_ready_in_dpaap} - ${resp}= Get Request ${dmaap_setup_session} /setup/get_pnf_ready headers=${suite_headers} + ${resp}= Get Request ${dmaap_setup_session} /setup/pnf_ready headers=${suite_headers} Should Be Equal ${resp.text} ${expected_event_pnf_ready_in_dpaap} Set PNF name in AAI @@ -74,7 +74,7 @@ Set PNF content in AAI Set event in DMaaP [Arguments] ${event_in_dmaap} - ${resp}= Put Request ${dmaap_setup_session} /setup/set_ves_event headers=${suite_headers} data=${event_in_dmaap} + ${resp}= Put Request ${dmaap_setup_session} /setup/ves_event headers=${suite_headers} data=${event_in_dmaap} Should Be Equal As Strings ${resp.status_code} 200 Reset AAI simulator @@ -89,4 +89,4 @@ Reset DMaaP simulator Check CBS ready ${resp}= Get Request ${consul_setup_session} /v1/catalog/service/cbs Should Be Equal As Strings ${resp.status_code} 200 - Log CBS ${resp.content}
\ No newline at end of file + Log CBS ${resp.content} diff --git a/tests/dcaegen2/prh-testcases/resources/prh_library2.robot b/tests/dcaegen2/prh-testcases/resources/prh_library2.robot index 99939a06..ecc92f25 100644 --- a/tests/dcaegen2/prh-testcases/resources/prh_library2.robot +++ b/tests/dcaegen2/prh-testcases/resources/prh_library2.robot @@ -1,21 +1,57 @@ *** Settings *** Library RequestsLibrary -Library Collections +Library PrhLibrary.py Resource ../../../common.robot *** Keywords *** -VES event with additional fields +Verify PNF ready sent [Arguments] ${test_case_directory} ${pnf_entry}= Get Data From File ${test_case_directory}/aai-entry.json ${ves_event}= Get Data From File ${test_case_directory}/ves-event.json ${expected_pnf_ready_event}= Get Data From File ${test_case_directory}/expected-pnf-ready-event.json - ${expected_logical_link}= Get Data From File ${test_case_directory}/expected-logical-link.json Add PNF entry in AAI ${pnf_entry} Set VES event in DMaaP ${ves_event} Wait Until Keyword Succeeds 10x 3000ms Check CBS ready Wait Until Keyword Succeeds 10x 3000ms Check recorded PNF_READY notification ${expected_pnf_ready_event} + +Verify PNF ready sent and logical link created + [Arguments] ${test_case_directory} + ${expected_logical_link}= Get Data From File ${test_case_directory}/expected-logical-link.json + Verify PNF ready sent ${test_case_directory} Check recorded Logical Link ${expected_logical_link} +Verify event with missing required field is logged + [Arguments] ${test_case_directory} + ${invalid_ves_event}= Get Data From File ${test_case_directory}/invalid-ves-event.json + Set VES event in DMaaP ${invalid_ves_event} + ${error_msg}= Create event parsing error ${invalid_ves_event} + Wait Until Keyword Succeeds 10x 3000ms Check PRH log ${error_msg} + +Verify incorrect JSON event is logged + [Timeout] 60s + [Arguments] ${test_case_directory} + ${invalid_ves_event}= Get Data From File ${test_case_directory}/invalid-ves-event.json + Set VES event in DMaaP ${invalid_ves_event} + # TODO hangs build + #Wait Until Keyword Succeeds 10x 3000ms Check PRH log |java.lang.IllegalStateException: Not a JSON Array: + +Verify missing AAI record is logged + [Arguments] ${test_case_directory} + ${incorrect_aai_entry}= Get Data From File ${test_case_directory}/incorrect-aai-entry.json + ${ves_event}= Get Data From File ${test_case_directory}/ves-event.json + Add PNF entry in AAI ${incorrect_aai_entry} + Set VES event in DMaaP ${ves_event} + Wait Until Keyword Succeeds 10x 3000ms Check PRH log |AAIProducerTask exception has been registered + Wait Until Keyword Succeeds 10x 3000ms Check PRH log |Chain of tasks have been aborted due to errors in PRH workflow + +Verify AAI not responding is logged + [Arguments] ${test_case_directory} + ${ves_event}= Get Data From File ${test_case_directory}/ves-event.json + Ensure Container Is Exited aai_simulator + Set VES event in DMaaP ${ves_event} + Wait Until Keyword Succeeds 10x 3000ms Check PRH log java.net.UnknownHostException: aai + Ensure Container Is Running aai_simulator + Check CBS ready ${resp}= Get Request ${consul_setup_session} /v1/catalog/service/cbs Should Be Equal As Strings ${resp.status_code} 200 @@ -23,16 +59,27 @@ Check CBS ready Check recorded PNF_READY notification [Arguments] ${expected_event_pnf_ready_in_dpaap} - ${resp}= Get Request ${dmaap_setup_session} /setup/get_pnf_ready headers=${suite_headers} + ${resp}= Get Request ${dmaap_setup_session} /setup/pnf_ready headers=${suite_headers} Should Be Equal As Strings ${resp.status_code} 200 Should Be Equal As JSON ${resp.content} ${expected_event_pnf_ready_in_dpaap} Check recorded Logical Link [Arguments] ${expected_logical_link_in_aai} - ${resp}= Get Request ${aai_setup_session} /setup/get_created_logical_link headers=${suite_headers} + ${resp}= Get Request ${aai_setup_session} /setup/created_logical_link headers=${suite_headers} Should Be Equal As Strings ${resp.status_code} 200 Should Be Equal As JSON ${resp.content} ${expected_logical_link_in_aai} +Check PRH log + [Arguments] ${log_entry} + ${found}= Find log entry ${log_entry} + Should Be True ${found} + +Create event parsing error + [Arguments] ${ves_event} + ${notification}= Create invalid notification ${ves_event} + ${error_msg}= Catenate SEPARATOR= \\n |Incorrect json, consumerDmaapModel can not be created: ${notification} + [Return] ${error_msg} + Add PNF entry in AAI [Arguments] ${pnf_entry} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json @@ -42,7 +89,7 @@ Add PNF entry in AAI Set VES event in DMaaP [Arguments] ${ves_event} - ${resp}= Put Request ${dmaap_setup_session} /setup/set_ves_event headers=${suite_headers} data=${ves_event} + ${resp}= Put Request ${dmaap_setup_session} /setup/ves_event headers=${suite_headers} data=${ves_event} Should Be Equal As Strings ${resp.status_code} 200 Should Be Equal As JSON @@ -71,4 +118,4 @@ Reset DMaaP simulator Create headers ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - Set Suite Variable ${suite_headers} ${headers}
\ No newline at end of file + Set Suite Variable ${suite_headers} ${headers} diff --git a/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py b/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py index 55b2d1f6..4457ef15 100644 --- a/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py +++ b/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py @@ -27,12 +27,12 @@ class AAISetup(BaseHTTPRequestHandler): def do_GET(self): try: - if re.search('/setup/get_patched_pnf', self.path): + if re.search('/setup/patched_pnf', self.path): httpServerLib.set_response_200_ok(self, payload = patched_pnf) - logger.debug('AAISetup GET /setup/get_patched_pnf -> 200 OK') - elif re.search('/setup/get_created_logical_link', self.path): + logger.debug('AAISetup GET /setup/patched_pnf -> 200 OK') + elif re.search('/setup/created_logical_link', self.path): httpServerLib.set_response_200_ok(self, payload = created_logical_link) - logger.debug('AAISetup GET /setup/get_created_logical_link -> 200 OK') + logger.debug('AAISetup GET /setup/created_logical_link -> 200 OK') else: httpServerLib.set_response_404_not_found(self) logger.info('AAISetup GET ' + self.path + ' -> 404 Not found') @@ -129,7 +129,9 @@ class AAIHandler(BaseHTTPRequestHandler): created_logical_link = httpServerLib.get_payload(self) httpServerLib.set_response_200_ok(self) - logger.debug('AAIHandler PUT /aai/v12/network/logical-links/logical-link/' + created_logical_link + ' -> 200 OK') + + logical_link_name = basename(self.path) + logger.debug('AAIHandler PUT /aai/v12/network/logical-links/logical-link/' + logical_link_name + ' -> 200 OK') else: httpServerLib.set_response_404_not_found(self) logger.info('AAIHandler PUT ' + self.path + ' -> 404 Not found') diff --git a/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py b/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py index b2716968..92985cb6 100644 --- a/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py +++ b/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py @@ -24,10 +24,10 @@ class DmaapSetup(BaseHTTPRequestHandler): def do_GET(self): try: - if re.search('/setup/get_pnf_ready', self.path): + if re.search('/setup/pnf_ready', self.path): global captured_prh_event httpServerLib.set_response_200_ok(self, payload = captured_prh_event) - logger.debug('DmaapSetup GET /setup/get_pnf_ready -> 200 OK') + logger.debug('DmaapSetup GET /setup/pnf_ready -> 200 OK') else: httpServerLib.set_response_404_not_found(self) logger.info('DmaapSetup GET ' + self.path + ' -> 404 Not found') @@ -37,11 +37,11 @@ class DmaapSetup(BaseHTTPRequestHandler): def do_PUT(self): try: - if re.search('/setup/set_ves_event', self.path): + if re.search('/setup/ves_event', self.path): global ves_event ves_event = httpServerLib.get_payload(self) httpServerLib.set_response_200_ok(self) - logger.debug('DmaapSetup PUT /setup/set_ves_event -> 200 OK') + logger.debug('DmaapSetup PUT /setup/ves_event -> 200 OK') else: httpServerLib.set_response_404_not_found(self) logger.info('DmaapSetup PUT ' + self.path + ' -> 404 Not found') diff --git a/tests/modeling-toscaparsers-genericparser/test.robot b/tests/modeling-genericparser/test.robot index b83bee47..fb4601a3 100644 --- a/tests/modeling-toscaparsers-genericparser/test.robot +++ b/tests/modeling-genericparser/test.robot @@ -6,23 +6,23 @@ Library json *** Variables *** @{return_ok_list}= 200 201 202 -${queryswagger_url} /api/catalog/v1/swagger.json -${queryVNFPackage_url} /api/catalog/v1/vnfpackages -${queryNSPackages_url} /api/catalog/v1/nspackages -${healthcheck_url} /api/catalog/v1/health_check +${queryswagger_url} /api/genericparser/v1/swagger.json +${queryVNFPackage_url} /api/parser/v1/vnfpackages +${queryNSPackages_url} /api/parser/v1/nspackages +${healthcheck_url} /api/parser/v1/health_check *** Test Cases *** GetVNFPackages ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${CATALOG_IP}:8806 headers=${headers} + Create Session web_session http://${GenericParser_IP}:8806 headers=${headers} ${resp}= Get Request web_session ${queryVNFPackage_url} ${responese_code}= Convert To String ${resp.status_code} List Should Contain Value ${return_ok_list} ${responese_code} -CatalogHealthCheckTest +HealthCheckTest [Documentation] check health for catalog by MSB ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${CATALOG_IP}:8806 headers=${headers} + Create Session web_session http://${GenericParser_IP}:8806 headers=${headers} ${resp}= Get Request web_session ${healthcheck_url} ${responese_code}= Convert To String ${resp.status_code} List Should Contain Value ${return_ok_list} ${responese_code} |