From: Krzysztof Kuzmicki Date: Wed, 12 Aug 2020 09:29:06 +0000 (+0000) Subject: Merge "Move csits form aaf to oom" X-Git-Tag: 7.0.1~56 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=7bf9d5c1e9c94d60b138c73a716bc10bce038992;hp=b7a057e8017b7899de26f977fa3841882035200b;p=integration%2Fcsit.git Merge "Move csits form aaf to oom" --- diff --git a/plans/ccsdk/oran/functionality1/setup.sh b/plans/ccsdk/oran/functionality1/setup.sh new file mode 100755 index 00000000..f9fe0c55 --- /dev/null +++ b/plans/ccsdk/oran/functionality1/setup.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Place the scripts in run order: +source ${WORKSPACE}/scripts/ccsdk/script1.sh + +# CLI internet speed test +curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python - + +# Test download a 100 MB file to check network speed to nexus.onap.org +wget -O /dev/null https://nexus.onap.org/content/repositories/releases/org/onap/appc/appc-dg-shared-installer/1.3.0/appc-dg-shared-installer-1.3.0.zip + +# Test download a 100 MB file to check network speed to nexus3.onap.org +wget -O /dev/null https://nexus3.onap.org/repository/docker.release/v2/-/blobs/sha256:04dc4b8163487bb1c40df1ce16f349b507c262d6e2f202baa2e66a42eb8c64a1 + diff --git a/plans/ccsdk/oran/functionality1/teardown.sh b/plans/ccsdk/oran/functionality1/teardown.sh new file mode 100755 index 00000000..acf2d097 --- /dev/null +++ b/plans/ccsdk/oran/functionality1/teardown.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +kill-instance.sh i-mock + + diff --git a/plans/ccsdk/oran/functionality1/testplan.txt b/plans/ccsdk/oran/functionality1/testplan.txt new file mode 100644 index 00000000..e9485b8c --- /dev/null +++ b/plans/ccsdk/oran/functionality1/testplan.txt @@ -0,0 +1,5 @@ +# Test suites are relative paths under [integration/csit.git]/tests/. +# Place the suites in run order. +# Temporary change to trigger verify job. +ccsdk/oran/suite1 +ccsdk/oran/suite2 diff --git a/plans/modeling-etsicatalog/sanity-check/setup.sh b/plans/modeling-etsicatalog/sanity-check/setup.sh index 9157c41d..e713af21 100644 --- a/plans/modeling-etsicatalog/sanity-check/setup.sh +++ b/plans/modeling-etsicatalog/sanity-check/setup.sh @@ -33,9 +33,9 @@ docker run -d -p 80:80 -e CONSUL_IP=$CONSUL_IP -e SDCLIENT_IP=$DISCOVERY_IP -e " MSB_IP==`get-instance-ip.sh msb_internal_apigateway` echo MSB_IP=${MSB_IP} -docker run -d -p 3306:3306 --name vfc-db -v /var/lib/mysql nexus3.onap.org:10001/onap/vfc/db -VFC_DB_IP=`get-instance-ip.sh vfc-db` -echo VFC_DB_IP=${VFC_DB_IP} +docker run -d -p 3306:3306 --name vfc-db -v /var/lib/mysql -e MYSQL_ROOT_PASSWORD=root nexus3.onap.org:10001/library/mariadb +DB_IP=`get-instance-ip.sh vfc-db` +echo DB_IP=${DB_IP} # Wait for initialization(8500 Consul, 10081 Service Registration & Discovery, 80 api gateway) for i in {1..10}; do @@ -46,7 +46,7 @@ done # Wait for initialization(3306 DB) for i in {1..3}; do - curl -sS -m 1 ${VFC_DB_IP}:3306 && break + curl -sS -m 1 ${DB_IP}:3306 && break echo sleep $i sleep $i done @@ -56,7 +56,7 @@ echo sleep 60 sleep 60 # start modeling-etsicatalog -docker run -d --name modeling-etsicatalog -v /var/lib/mysql -e MSB_ADDR=${DISCOVERY_IP}:10081 -e MYSQL_ADDR=${VFC_DB_IP}:3306 nexus3.onap.org:10001/onap/modeling/etsicatalog +docker run -d --name modeling-etsicatalog -v /var/lib/mysql -e MSB_ADDR=${DISCOVERY_IP}:10081 -e MYSQL_ADDR=${DB_IP}:3306 nexus3.onap.org:10001/onap/modeling/etsicatalog EtsiCatalog_IP=`get-instance-ip.sh modeling-etsicatalog` for i in {1..10}; do curl -sS -m 1 ${EtsiCatalog_IP}:8806 && break diff --git a/scripts/ccsdk/oran/mock-hello.sh b/scripts/ccsdk/oran/mock-hello.sh new file mode 100755 index 00000000..a40f8bf9 --- /dev/null +++ b/scripts/ccsdk/oran/mock-hello.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +curl -v -X PUT -d @- http://$1:1080/expectation < elements, starting at 1", + "type": "string" + }, + "url": { + "description": "Hyperlink to a detailed error resource e.g., an HTML page for browser user agents", + "type": "string" + }, + "variables": { + "description": "List of zero or more strings that represent the contents of the variables used by the message text", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "messageId", + "text" + ] + }, + "sipSignalingFields": { + "description": "sip signaling fields", + "type": "object", + "properties": { + "additionalInformation": { + "$ref": "#/definitions/hashMap" + }, + "compressedSip": { + "description": "the full SIP request/response including headers and bodies", + "type": "string" + }, + "correlator": { + "description": "this is the same for all events on this call", + "type": "string" + }, + "localIpAddress": { + "description": "IP address on xNF", + "type": "string" + }, + "localPort": { + "description": "port on xNF", + "type": "string" + }, + "remoteIpAddress": { + "description": "IP address of peer endpoint", + "type": "string" + }, + "remotePort": { + "description": "port of peer endpoint", + "type": "string" + }, + "sipSignalingFieldsVersion": { + "description": "version of the sipSignalingFields block", + "type": "string", + "enum": [ + "3.0" + ] + }, + "summarySip": { + "description": "the SIP Method or Response ('INVITE', '200 OK', 'BYE', etc)", + "type": "string" + }, + "vendorNfNameFields": { + "$ref": "#/definitions/vendorNfNameFields" + } + }, + "additionalProperties": false, + "required": [ + "correlator", + "localIpAddress", + "localPort", + "remoteIpAddress", + "remotePort", + "sipSignalingFieldsVersion", + "vendorNfNameFields" + ] + }, + "stateChangeFields": { + "description": "stateChange fields", + "type": "object", + "properties": { + "additionalFields": { + "$ref": "#/definitions/hashMap" + }, + "newState": { + "description": "new state of the entity", + "type": "string", + "enum": [ + "inService", + "maintenance", + "outOfService" + ] + }, + "oldState": { + "description": "previous state of the entity", + "type": "string", + "enum": [ + "inService", + "maintenance", + "outOfService" + ] + }, + "stateChangeFieldsVersion": { + "description": "version of the stateChangeFields block", + "type": "string", + "enum": [ + "4.0" + ] + }, + "stateInterface": { + "description": "card or port name of the entity that changed state", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "newState", + "oldState", + "stateChangeFieldsVersion", + "stateInterface" + ] + }, + "stndDefinedFields": { + "description": "stndDefined fields", + "type": "object", + "properties": { + "schemaReference": { + "description": "a uri of a standards-defined JSON object schema; used to valide the stndDefinedFields.data property contents", + "type": "string", + "format": "uri" + }, + "data": { + "description": "a native standards-defined JSON notification", + "type": "object" + }, + "stndDefinedFieldsVersion": { + "description": "version of stndDefinedFields block", + "type": "string", + "enum": [ + "1.0" + ] + } + }, + "additionalProperties": false, + "required": [ + "data", + "stndDefinedFieldsVersion" + ] + }, + "syslogFields": { + "description": "sysLog fields", + "type": "object", + "properties": { + "additionalFields": { + "$ref": "#/definitions/hashMap" + }, + "eventSourceHost": { + "description": "hostname of the device", + "type": "string" + }, + "eventSourceType": { + "description": "type of event source; examples: other, router, switch, host, card, port, slotThreshold, portThreshold, virtualMachine, virtualNetworkFunction", + "type": "string" + }, + "syslogFacility": { + "description": "numeric code from 0 to 23 for facility--see table in documentation", + "type": "integer" + }, + "syslogFieldsVersion": { + "description": "version of the syslogFields block", + "type": "string", + "enum": [ + "4.0" + ] + }, + "syslogMsg": { + "description": "syslog message", + "type": "string" + }, + "syslogMsgHost": { + "description": "hostname parsed from non-VES syslog message", + "type": "string" + }, + "syslogPri": { + "description": "0-192 combined severity and facility", + "type": "integer" + }, + "syslogProc": { + "description": "identifies the application that originated the message", + "type": "string" + }, + "syslogProcId": { + "description": "a change in the value of this field indicates a discontinuity in syslog reporting", + "type": "number" + }, + "syslogSData": { + "description": "syslog structured data consisting of a structured data Id followed by a set of key value pairs", + "type": "string" + }, + "syslogSdId": { + "description": "0-32 char in format name@number for example ourSDID@32473", + "type": "string" + }, + "syslogSev": { + "description": "numerical Code for severity derived from syslogPri as remaider of syslogPri / 8", + "type": "string", + "enum": [ + "Alert", + "Critical", + "Debug", + "Emergency", + "Error", + "Info", + "Notice", + "Warning" + ] + }, + "syslogTag": { + "description": "msgId indicating the type of message such as TCPOUT or TCPIN; NILVALUE should be used when no other value can be provided", + "type": "string" + }, + "syslogTs": { + "description": "timestamp parsed from non-VES syslog message", + "type": "string" + }, + "syslogVer": { + "description": "IANA assigned version of the syslog protocol specification - typically 1", + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "eventSourceType", + "syslogFieldsVersion", + "syslogMsg", + "syslogTag" + ] + }, + "thresholdCrossingAlertFields": { + "description": "fields specific to threshold crossing alert events", + "type": "object", + "properties": { + "additionalFields": { + "$ref": "#/definitions/hashMap" + }, + "additionalParameters": { + "description": "performance counters", + "type": "array", + "items": { + "$ref": "#/definitions/counter" + } + }, + "alertAction": { + "description": "Event action", + "type": "string", + "enum": [ + "CLEAR", + "CONT", + "SET" + ] + }, + "alertDescription": { + "description": "Unique short alert description such as IF-SHUB-ERRDROP", + "type": "string" + }, + "alertType": { + "description": "Event type", + "type": "string", + "enum": [ + "CARD-ANOMALY", + "ELEMENT-ANOMALY", + "INTERFACE-ANOMALY", + "SERVICE-ANOMALY" + ] + }, + "alertValue": { + "description": "Calculated API value (if applicable)", + "type": "string" + }, + "associatedAlertIdList": { + "description": "List of eventIds associated with the event being reported", + "type": "array", + "items": { + "type": "string" + } + }, + "collectionTimestamp": { + "description": "Time when the performance collector picked up the data; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800", + "type": "string" + }, + "dataCollector": { + "description": "Specific performance collector instance used", + "type": "string" + }, + "elementType": { + "description": "type of network element - internal ATT field", + "type": "string" + }, + "eventSeverity": { + "description": "event severity or priority", + "type": "string", + "enum": [ + "CRITICAL", + "MAJOR", + "MINOR", + "WARNING", + "NORMAL" + ] + }, + "eventStartTimestamp": { + "description": "Time closest to when the measurement was made; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800", + "type": "string" + }, + "interfaceName": { + "description": "Physical or logical port or card (if applicable)", + "type": "string" + }, + "networkService": { + "description": "network name - internal ATT field", + "type": "string" + }, + "possibleRootCause": { + "description": "Reserved for future use", + "type": "string" + }, + "thresholdCrossingFieldsVersion": { + "description": "version of the thresholdCrossingAlertFields block", + "type": "string", + "enum": [ + "4.0" + ] + } + }, + "additionalProperties": false, + "required": [ + "additionalParameters", + "alertAction", + "alertDescription", + "alertType", + "collectionTimestamp", + "eventSeverity", + "eventStartTimestamp", + "thresholdCrossingFieldsVersion" + ] + }, + "vendorNfNameFields": { + "description": "provides vendor, nf and nfModule identifying information", + "type": "object", + "properties": { + "vendorName": { + "description": "network function vendor name", + "type": "string" + }, + "nfModuleName": { + "description": "name of the nfModule generating the event", + "type": "string" + }, + "nfName": { + "description": "name of the network function generating the event", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "vendorName" + ] + }, + "voiceQualityFields": { + "description": "provides statistics related to customer facing voice products", + "type": "object", + "properties": { + "additionalInformation": { + "$ref": "#/definitions/hashMap" + }, + "calleeSideCodec": { + "description": "callee codec for the call", + "type": "string" + }, + "callerSideCodec": { + "description": "caller codec for the call", + "type": "string" + }, + "correlator": { + "description": "this is the same for all events on this call", + "type": "string" + }, + "endOfCallVqmSummaries": { + "$ref": "#/definitions/endOfCallVqmSummaries" + }, + "phoneNumber": { + "description": "phone number associated with the correlator", + "type": "string" + }, + "midCallRtcp": { + "description": "Base64 encoding of the binary RTCP data excluding Eth/IP/UDP headers", + "type": "string" + }, + "vendorNfNameFields": { + "$ref": "#/definitions/vendorNfNameFields" + }, + "voiceQualityFieldsVersion": { + "description": "version of the voiceQualityFields block", + "type": "string", + "enum": [ + "4.0" + ] + } + }, + "additionalProperties": false, + "required": [ + "calleeSideCodec", + "callerSideCodec", + "correlator", + "midCallRtcp", + "vendorNfNameFields", + "voiceQualityFieldsVersion" + ] + } + } +} \ No newline at end of file diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-FaultSupervision.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-FaultSupervision.json new file mode 100644 index 00000000..aa026e71 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-FaultSupervision.json @@ -0,0 +1,45 @@ +{ + "event": { + "commonEventHeader": { + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "stndDefinedNamespace": "3GPP-FaultSupervision", + "lastEpochMicrosec": 1234567890, + "priority": "Normal", + "reportingEntityName": "Nokia123456", + "sequence": 0, + "sourceName": "Nokia123456", + "startEpochMicrosec": 1234567890, + "version": "4.1", + "vesEventListenerVersion": "7.2" + }, + "stndDefinedFields": { + "schemaReference": "https://www.3gpp.org/Rel-16/TS28532_generic_fault_supervision.json#definitions/schemas/notifyNewAlarm-NotifType", + "data": { + "uri": "xyz", + "notificationId": "xyz", + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": "xyz", + "perceivedSeverity": "Major", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "No change", + "thresholdInfo": {}, + "stateChangeDefinition": [], + "monitoredAttributes": [], + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": [], + "alarmId": "xyz", + "alarmType": "Environmental Alarm" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Heartbeat.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Heartbeat.json new file mode 100644 index 00000000..7e274c20 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Heartbeat.json @@ -0,0 +1,45 @@ +{ + "event": { + "commonEventHeader": { + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "stndDefinedNamespace": "3GPP-Heartbeat", + "lastEpochMicrosec": 1234567890, + "priority": "Normal", + "reportingEntityName": "Nokia123456", + "sequence": 0, + "sourceName": "Nokia123456", + "startEpochMicrosec": 1234567890, + "version": "4.1", + "vesEventListenerVersion": "7.2" + }, + "stndDefinedFields": { + "schemaReference": "https://www.3gpp.org/Rel-16/TS28532_generic_fault_supervision.json#definitions/schemas/notifyNewAlarm-NotifType", + "data": { + "uri": "xyz", + "notificationId": "xyz", + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": "xyz", + "perceivedSeverity": "Major", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "No change", + "thresholdInfo": {}, + "stateChangeDefinition": [], + "monitoredAttributes": [], + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": [], + "alarmId": "xyz", + "alarmType": "Environmental Alarm" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-PerformanceAssurance.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-PerformanceAssurance.json new file mode 100644 index 00000000..06520396 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-PerformanceAssurance.json @@ -0,0 +1,45 @@ +{ + "event": { + "commonEventHeader": { + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "stndDefinedNamespace": "3GPP-PerformanceAssurance", + "lastEpochMicrosec": 1234567890, + "priority": "Normal", + "reportingEntityName": "Nokia123456", + "sequence": 0, + "sourceName": "Nokia123456", + "startEpochMicrosec": 1234567890, + "version": "4.1", + "vesEventListenerVersion": "7.2" + }, + "stndDefinedFields": { + "schemaReference": "https://www.3gpp.org/Rel-16/TS28532_generic_fault_supervision.json#definitions/schemas/notifyNewAlarm-NotifType", + "data": { + "uri": "xyz", + "notificationId": "xyz", + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": "xyz", + "perceivedSeverity": "Major", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "No change", + "thresholdInfo": {}, + "stateChangeDefinition": [], + "monitoredAttributes": [], + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": [], + "alarmId": "xyz", + "alarmType": "Environmental Alarm" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Provisioning.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Provisioning.json new file mode 100644 index 00000000..d9406615 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Provisioning.json @@ -0,0 +1,45 @@ +{ + "event": { + "commonEventHeader": { + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "stndDefinedNamespace": "3GPP-Provisioning", + "lastEpochMicrosec": 1234567890, + "priority": "Normal", + "reportingEntityName": "Nokia123456", + "sequence": 0, + "sourceName": "Nokia123456", + "startEpochMicrosec": 1234567890, + "version": "4.1", + "vesEventListenerVersion": "7.2" + }, + "stndDefinedFields": { + "schemaReference": "https://www.3gpp.org/Rel-16/TS28532_generic_fault_supervision.json#definitions/schemas/notifyNewAlarm-NotifType", + "data": { + "uri": "xyz", + "notificationId": "xyz", + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": "xyz", + "perceivedSeverity": "Major", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "No change", + "thresholdInfo": {}, + "stateChangeDefinition": [], + "monitoredAttributes": [], + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": [], + "alarmId": "xyz", + "alarmType": "Environmental Alarm" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Provisioning_missing_sourceName.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Provisioning_missing_sourceName.json new file mode 100644 index 00000000..2ffe17c7 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Provisioning_missing_sourceName.json @@ -0,0 +1,44 @@ +{ + "event": { + "commonEventHeader": { + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "stndDefinedNamespace": "3GPP-Provisioning", + "lastEpochMicrosec": 1234567890, + "priority": "Normal", + "reportingEntityName": "Nokia123456", + "sequence": 0, + "startEpochMicrosec": 1234567890, + "version": "4.1", + "vesEventListenerVersion": "7.2" + }, + "stndDefinedFields": { + "schemaReference": "https://www.3gpp.org/Rel-16/TS28532_generic_fault_supervision.json#definitions/schemas/notifyNewAlarm-NotifType", + "data": { + "uri": "xyz", + "notificationId": "xyz", + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": "xyz", + "perceivedSeverity": "Major", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "No change", + "thresholdInfo": {}, + "stateChangeDefinition": [], + "monitoredAttributes": [], + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": [], + "alarmId": "xyz", + "alarmType": "Environmental Alarm" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_empty_namespace.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_empty_namespace.json new file mode 100644 index 00000000..bf5f0953 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_empty_namespace.json @@ -0,0 +1,45 @@ +{ + "event": { + "commonEventHeader": { + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "stndDefinedNamespace": "", + "lastEpochMicrosec": 1234567890, + "priority": "Normal", + "reportingEntityName": "Nokia123456", + "sequence": 0, + "sourceName": "Nokia123456", + "startEpochMicrosec": 1234567890, + "version": "4.1", + "vesEventListenerVersion": "7.2" + }, + "stndDefinedFields": { + "schemaReference": "https://www.3gpp.org/Rel-16/TS28532_generic_fault_supervision.json#definitions/schemas/notifyNewAlarm-NotifType", + "data": { + "uri": "xyz", + "notificationId": "xyz", + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": "xyz", + "perceivedSeverity": "Major", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "No change", + "thresholdInfo": {}, + "stateChangeDefinition": [], + "monitoredAttributes": [], + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": [], + "alarmId": "xyz", + "alarmType": "Environmental Alarm" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_missing_namespace.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_missing_namespace.json new file mode 100644 index 00000000..230dc54e --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_missing_namespace.json @@ -0,0 +1,44 @@ +{ + "event": { + "commonEventHeader": { + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "lastEpochMicrosec": 1234567890, + "priority": "Normal", + "reportingEntityName": "Nokia123456", + "sequence": 0, + "sourceName": "Nokia123456", + "startEpochMicrosec": 1234567890, + "version": "4.1", + "vesEventListenerVersion": "7.2" + }, + "stndDefinedFields": { + "schemaReference": "https://www.3gpp.org/Rel-16/TS28532_generic_fault_supervision.json#definitions/schemas/notifyNewAlarm-NotifType", + "data": { + "uri": "xyz", + "notificationId": "xyz", + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": "xyz", + "perceivedSeverity": "Major", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "No change", + "thresholdInfo": {}, + "stateChangeDefinition": [], + "monitoredAttributes": [], + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": [], + "alarmId": "xyz", + "alarmType": "Environmental Alarm" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} diff --git a/tests/dcaegen2/testcases/resources/DcaeVariables.py b/tests/dcaegen2/testcases/resources/DcaeVariables.py index 84d06ae0..1617714a 100644 --- a/tests/dcaegen2/testcases/resources/DcaeVariables.py +++ b/tests/dcaegen2/testcases/resources/DcaeVariables.py @@ -8,7 +8,7 @@ def get_environment_variable(env_varstr): DCAE_HEALTH_CHECK_URL = "http://135.205.228.129:8500" DCAE_HEALTH_CHECK_URL1 = "http://135.205.228.170:8500" -CommonEventSchema = get_environment_variable('WORKSPACE') + "/tests/dcaegen2/testcases/assets/json_events/CommonEventFormat_30.1.1.json" +CommonEventSchema = get_environment_variable('WORKSPACE') + "/tests/dcaegen2/testcases/assets/json_events/CommonEventFormat_30.2_ONAP.json" HttpServerThread = None HTTPD = None diff --git a/tests/dcaegen2/testcases/resources/collector.properties b/tests/dcaegen2/testcases/resources/collector.properties index 71a38737..088b6352 100755 --- a/tests/dcaegen2/testcases/resources/collector.properties +++ b/tests/dcaegen2/testcases/resources/collector.properties @@ -50,8 +50,18 @@ collector.truststore.passwordfile=etc/trustpasswordfile collector.schema.checkflag=1 collector.schema.file={\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.1.json\",\"v7\":\"./etc/CommonEventFormat_30.2_ONAP.json\"} -## List all streamid per domain to be supported. The streamid should match to channel name on dmaapfile -collector.dmaap.streamid=fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling|notification=ves-notification|pnfRegistration=ves-pnfRegistration|stndDefined=ves-other +## Schema StndDefinedFields Validation checkflag +## default no validation checkflag (-1) +## If enabled (1) - schema files locations must be specified, mapping file path must be specified, schema reference path +## in event json must be specified, path to stndDefined data field in event json must be specified +collector.externalSchema.2ndStageValidation=-1 +collector.externalSchema.schemasLocation=./etc/externalRepo/ +collector.externalSchema.mappingFileLocation=./etc/externalRepo/schema-map.json +collector.externalSchema.schemaRefPath=/event/stndDefinedFields/schemaReference +collector.externalSchema.stndDefinedDataPath=/event/stndDefinedFields/data + +## List all streamid per domain to be supported. The streamid should match to channel name on dmaapfile +collector.dmaap.streamid=fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling|notification=ves-notification|pnfRegistration=ves-pnfRegistration|3GPP-FaultSupervision=ves-3gpp-fault-supervision|3GPP-Heartbeat=ves-3gpp-heartbeat|3GPP-Provisioning=ves-3gpp-provisioning|3GPP-PerformanceAssurance=ves-3gpp-performance-assurance collector.dmaapfile=./etc/DmaapConfig.json ## Event transformation Flag - when set expects configurable transformation diff --git a/tests/dcaegen2/testcases/resources/dcae_keywords.robot b/tests/dcaegen2/testcases/resources/dcae_keywords.robot index 059372fb..52424e63 100644 --- a/tests/dcaegen2/testcases/resources/dcae_keywords.robot +++ b/tests/dcaegen2/testcases/resources/dcae_keywords.robot @@ -139,6 +139,13 @@ Publish Event To VES Collector With Put Method ${resp}= Put Request ${session} ${evtpath} data=${evtdata} headers=${suite_headers} [Return] ${resp} +Send Request And Validate Response And Error Message + [Documentation] Post singel event to passed url and validate received response code and content + [Arguments] ${keyword} ${session} ${evtpath} ${evtjson} ${resp_code} ${msg_content} + ${resp}= Send Request And Validate Response ${keyword} ${session} ${evtpath} ${evtjson} ${resp_code} + ${error_message}= Set Variable ${resp.json()['requestError']['ServiceException']['text']} + Should Be Equal As Strings ${msg_content} ${error_message} + Send Request And Validate Response [Documentation] Post singel event to passed url with passed data and validate received response [Arguments] ${keyword} ${session} ${evtpath} ${evtjson} ${resp_code} ${msg_code}=None ${topic}=None @@ -149,6 +156,7 @@ Send Request And Validate Response ${isEmpty}= Is Json Empty ${resp} Run Keyword If '${isEmpty}' == False Log ${resp.json()} Run Keyword If '${msg_code}' != 'None' Check Whether Message Received ${msg_code} ${topic} + [Return] ${resp} Check Whether Message Received [Documentation] Validare if message has been received diff --git a/tests/dcaegen2/testcases/resources/dcae_properties.robot b/tests/dcaegen2/testcases/resources/dcae_properties.robot index e9626411..cab31afa 100644 --- a/tests/dcaegen2/testcases/resources/dcae_properties.robot +++ b/tests/dcaegen2/testcases/resources/dcae_properties.robot @@ -46,6 +46,13 @@ ${EVENT_THROTTLING_STATE_DATA_FILE} %{WORKSPACE}/tests/dcaegen2/testcases/a ${EVENT_PNF_REGISTRATION} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_pnf_registration_event.json ${EVENT_PNF_REGISTRATION_V7} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_pnf_registration_event.json ${DCAE_HEALTH_CHECK_BODY} %{WORKSPACE}/tests/dcae/testcases/assets/json_events/dcae_healthcheck.json +${VES_STDN_DEFINED_EMMPTY_NAMESPACE} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_empty_namespace.json +${VES_STDN_DEFINED_MISSING_NAMESPACE} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_missing_namespace.json +${VES_NAMESPACE_3GPP_PROVISIONING_MISSING_SOURCENAME} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Provisioning_missing_sourceName.json +${VES_STDN_DEFINED_3GPP_PROVISIONING} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Provisioning.json +${VES_STDN_DEFINED_3GPP_HEARTBEAT} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Heartbeat.json +${VES_STDN_DEFINED_3GPP_FAULTSUPERVISION} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-FaultSupervision.json +${VES_STDN_DEFINED_3GPP_PERFORMANCE_ASSURANCE} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-PerformanceAssurance.json #DCAE Health Check ${CONFIG_BINDING_URL} http://localhost:8443 diff --git a/tests/sdnc/sdnc_netconf_tls_post_deploy/csr/sdnc_csr.env b/tests/sdnc/sdnc_netconf_tls_post_deploy/csr/sdnc_csr.env index 57894753..5d647de6 100644 --- a/tests/sdnc/sdnc_netconf_tls_post_deploy/csr/sdnc_csr.env +++ b/tests/sdnc/sdnc_netconf_tls_post_deploy/csr/sdnc_csr.env @@ -2,7 +2,7 @@ REQUEST_TIMEOUT=30000 OUTPUT_PATH=/var/certs CA_NAME=RA -OUTPUT_TYPE=JKS +OUTPUT_TYPE=PEM KEYSTORE_PATH=/etc/onap/aaf/certservice/certs/certServiceClient-keystore.jks KEYSTORE_PASSWORD=secret TRUSTSTORE_PATH=/etc/onap/aaf/certservice/certs/truststore.jks diff --git a/tests/sdnc/sdnc_netconf_tls_post_deploy/libraries/ClientManager.py b/tests/sdnc/sdnc_netconf_tls_post_deploy/libraries/ClientManager.py index b2399dfb..b1c024ff 100644 --- a/tests/sdnc/sdnc_netconf_tls_post_deploy/libraries/ClientManager.py +++ b/tests/sdnc/sdnc_netconf_tls_post_deploy/libraries/ClientManager.py @@ -25,7 +25,6 @@ import shutil import subprocess import docker -import jks from OpenSSL import crypto from docker.types import Mount @@ -39,13 +38,14 @@ class ClientManager: def __init__(self, mount_path, truststore_path): self.mount_path = mount_path self.truststore_path = truststore_path + self.keyPem = mount_path + '/key.pem' self.caCertPem = mount_path + '/ca.pem' self.serverKeyPem = mount_path + '/server_key.pem' self.serverCertPem = mount_path + '/server_cert.pem' - self.keystoreJksPath = mount_path + '/keystore.jks' + self.keystorePemPath = mount_path + '/keystore.pem' self.keystoreP12Path = mount_path + '/keystore.p12' self.keystorePassPath = mount_path + '/keystore.pass' - self.truststoreJksPath = mount_path + '/truststore.jks' + self.truststorePemPath = mount_path + '/truststore.pem' self.truststoreP12Path = mount_path + '/truststore.p12' self.truststorePassPath = mount_path + '/truststore.pass' @@ -71,18 +71,19 @@ class ClientManager: # Function to validate keystore/truststore can be opened with generated pass-phrase. def can_open_keystore_and_truststore_with_pass(self, container_name): if container_name != NETCONF_PNP_SIM_CONTAINER_NAME: - return self.can_open_keystore_and_truststore_jks_files() + return self.can_open_keystore_and_truststore_pem_files() else: return self.can_open_keystore_and_truststore_p12_files() - # Function to validate keystore.jks/truststore.jks can be opened with generated pass-phrase. - def can_open_keystore_and_truststore_jks_files(self): + # Function to validate keystore.pem/truststore.pem exist and are not empty. + def can_open_keystore_and_truststore_pem_files(self): try: - jks.KeyStore.load(self.keystoreJksPath, open(self.keystorePassPath, 'rb').read()) - jks.KeyStore.load(self.truststoreJksPath, open(self.truststorePassPath, 'rb').read()) - return True + private_key = self.file_exist_and_not_empty(self.keyPem) + keystore_pem = self.file_exist_and_not_empty(self.keystorePemPath) + truststore_pem = self.file_exist_and_not_empty(self.truststorePemPath) + return private_key and keystore_pem and truststore_pem except Exception as e: - print("UnExpected Error in validating keystore.jks/truststore.jks: {0}".format(e)) + print("UnExpected Error in validating keystore.pem/truststore.pem: {0}".format(e)) return False # Function to validate keystore.p12/truststore.p12 can be opened with generated pass-phrase. @@ -93,12 +94,14 @@ class ClientManager: # Method for Uploading Certificate in SDNC-Container. # Creating/Uploading Server-key, Server-cert, Ca-cert PEM files in Netconf-Pnp-Simulator. - def can_install_keystore_and_truststore_certs(self, cmd, container_name): + def can_install_keystore_and_truststore_certs(self, cmd, cmd_tls, container_name): continue_exec = True if container_name == NETCONF_PNP_SIM_CONTAINER_NAME: print("Generating PEM files for {0} from P12 files".format(container_name)) continue_exec = self.create_pem(self.keystorePassPath, self.keystoreP12Path, self.truststorePassPath, self.truststoreP12Path) + else: + cmd = cmd_tls if continue_exec: print("Initiate Configuration Push for : {0}".format(container_name)) resp_code = self.execute_bash_config(cmd, container_name) @@ -165,6 +168,9 @@ class ClientManager: def remove_mount_dir(self): shutil.rmtree(self.mount_path) + def file_exist_and_not_empty(self, path_to_file): + return os.path.isfile(path_to_file) and os.path.getsize(path_to_file) > 0 + @staticmethod def get_pkcs12(pass_file_path, p12_file_path): # Load PKCS12 Object diff --git a/tests/sdnc/sdnc_netconf_tls_post_deploy/libraries/config_tls.sh b/tests/sdnc/sdnc_netconf_tls_post_deploy/libraries/config_tls.sh new file mode 100755 index 00000000..323f8100 --- /dev/null +++ b/tests/sdnc/sdnc_netconf_tls_post_deploy/libraries/config_tls.sh @@ -0,0 +1,104 @@ +#!/bin/bash + +# ============LICENSE_START======================================================= +# Copyright (C) 2020 Nordix Foundation. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +set -o errexit +set -o pipefail +set -o nounset +[ "${SHELL_XTRACE:-false}" = "true" ] && set -o xtrace + +CONFIG=${CONFIG:-"${WORKSPACE}"/tests/sdnc/sdnc_netconf_tls_post_deploy/cert-data} +CONTAINER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' sdnc) +ODL_URL=${ODL_URL:-http://"${CONTAINER_IP}":8282} +PROC_NAME=${0##*/} +PROC_NAME=${PROC_NAME%.sh} + +function now_ms() { + # Requires coreutils package + date +"%Y-%m-%d %H:%M:%S.%3N" +} + +function log() { + local level=$1 + shift + local message="$*" + printf "%s %-5s [%s] %s\n" "$(now_ms)" $level $PROC_NAME "$message" +} + +# Extracts the body of a PEM file by removing the dashed header and footer +pem_body() { + grep -Fv -- ----- $1 +} + +CA_CERT_ID=xNF_CA_certificate_0_0 +CA_CERT=$(pem_body $CONFIG/truststore.pem) + +SERVER_PRIV_KEY_ID=ODL_private_key_0 +SERVER_KEY=$(pem_body $CONFIG/key.pem) +SERVER_CERT=$(pem_body $CONFIG/keystore.pem) + +RESTCONF_URL=$ODL_URL/restconf +NETCONF_KEYSTORE_PATH=$RESTCONF_URL/config/netconf-keystore:keystore + +xcurl() { + curl -s -o /dev/null -H "Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==" -w %{http_code} "$@" +} + +log INFO Delete Keystore +sc=$(xcurl -X DELETE $NETCONF_KEYSTORE_PATH) + +if [ "$sc" != "200" -a "$sc" != "404" ]; then + log ERROR "Keystore deletion failed with SC=$sc" + exit 1 +fi + +log INFO Load CA certificate +sc=$(xcurl -X POST $NETCONF_KEYSTORE_PATH --header "Content-Type: application/json" --data " +{ + \"trusted-certificate\": [ + { + \"name\": \"$CA_CERT_ID\", + \"certificate\": \"$CA_CERT\" + } + ] +} +") + +if [ "$sc" != "200" -a "$sc" != "204" ]; then + log ERROR Trusted-certificate update failed with SC=$sc + exit 1 +fi + +log INFO Load server private key and certificate +sc=$(xcurl -X POST $NETCONF_KEYSTORE_PATH --header "Content-Type: application/json" --data " +{ + \"private-key\": { + \"name\": \"$SERVER_PRIV_KEY_ID\", + \"certificate-chain\": [ + \"$SERVER_CERT\" + ], + \"data\": \"$SERVER_KEY\" + } +} +") + +if [ "$sc" != "200" -a "$sc" != "204" ]; then + log ERROR Private-key update failed with SC=$sc + exit 1 +fi \ No newline at end of file diff --git a/tests/sdnc/sdnc_netconf_tls_post_deploy/resources/sdnc-keywords.robot b/tests/sdnc/sdnc_netconf_tls_post_deploy/resources/sdnc-keywords.robot index a7fbcccc..52cc5d2f 100644 --- a/tests/sdnc/sdnc_netconf_tls_post_deploy/resources/sdnc-keywords.robot +++ b/tests/sdnc/sdnc_netconf_tls_post_deploy/resources/sdnc-keywords.robot @@ -77,7 +77,7 @@ Run Cert Service Client And Validate JKS File Creation And Client Exit Code [Arguments] ${env_file} ${CONTAINER_NAME} ${expected_exit_code} ${exit_code}= Run Client Container ${DOCKER_CLIENT_IMAGE} ${CLIENT_CONTAINER_NAME} ${env_file} ${CERT_SERVICE_ADDRESS}${CERT_SERVICE_ENDPOINT} ${CERT_SERVICE_NETWORK} ${can_open}= Can Open Keystore And Truststore With Pass ${CONTAINER_NAME} - ${install_certs}= Can Install Keystore And Truststore Certs ${CONF_SCRIPT} ${CONTAINER_NAME} + ${install_certs}= Can Install Keystore And Truststore Certs ${CONF_SCRIPT} ${CONF_TLS_SCRIPT} ${CONTAINER_NAME} Remove Client Container And Save Logs ${CLIENT_CONTAINER_NAME} positive_path Should Be Equal As Strings ${exit_code} ${expected_exit_code} Client return: ${exitcode} exit code, but expected: ${expected_exit_code} Should Be True ${can_open} Cannot Open Keystore/TrustStore by Passphrase