From: Bartek Grzybowski Date: Thu, 30 Jul 2020 09:36:24 +0000 (+0000) Subject: Merge "[SDNC-Netconf-TLS] Update SDNC CSIT" X-Git-Tag: 7.0.1~65 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=9031bef617fc2996b5b2182ad07e2531c10e145c;hp=2015144ab3a335fe2d0a39f64b6da7b488252040;p=integration%2Fcsit.git Merge "[SDNC-Netconf-TLS] Update SDNC CSIT" --- diff --git a/plans/dcaegen2-collectors-datafile/Functional-suite/setup.sh b/plans/dcaegen2-collectors-datafile/Functional-suite/setup.sh index bdee34ee..7736d4a7 100644 --- a/plans/dcaegen2-collectors-datafile/Functional-suite/setup.sh +++ b/plans/dcaegen2-collectors-datafile/Functional-suite/setup.sh @@ -52,11 +52,11 @@ docker build -t drsim_common:latest . cd $SIMGROUP_ROOT #Copy ftp config for the ftp servers -cp -r ../ftps-sftp-server/configuration . -cp -r ../ftps-sftp-server/tls . +cp -r ../ftpes-sftp-server/configuration . +cp -r ../ftpes-sftp-server/tls . -cd ../ftps-sftp-server -docker build -t ftps_vsftpd:latest -f Dockerfile-ftps . +cd ../ftpes-sftp-server +docker build -t ftpes_vsftpd:latest -f Dockerfile-ftpes . #All containers will be started and stopped via the robot tests. diff --git a/plans/dcaegen2-collectors-datafile/Functional-suite/testplan.txt b/plans/dcaegen2-collectors-datafile/Functional-suite/testplan.txt index 30d7a2d7..052ab7c8 100755 --- a/plans/dcaegen2-collectors-datafile/Functional-suite/testplan.txt +++ b/plans/dcaegen2-collectors-datafile/Functional-suite/testplan.txt @@ -1,3 +1,4 @@ # Test suites are relative paths under [integration/csit.git]/tests/. # Place the suites in run order. dcaegen2-collectors-datafile/testsuites/Functional-Single-File-suite +dcaegen2-collectors-datafile/testsuites/Strict-Host-Checking-suite diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/aai_sim/aai-initializer.json b/plans/dcaegen2-services-pmsh/testsuite/assets/aai_sim/aai-initializer.json index 5406f99c..3b8c127e 100644 --- a/plans/dcaegen2-services-pmsh/testsuite/assets/aai_sim/aai-initializer.json +++ b/plans/dcaegen2-services-pmsh/testsuite/assets/aai_sim/aai-initializer.json @@ -1,7 +1,7 @@ [ { "httpRequest": { - "path": "/aai/v16/query.*" + "path": "/aai/v19/query.*" }, "httpResponse": { "statusCode": 200, diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/aai_sim/aai_mockserver.properties b/plans/dcaegen2-services-pmsh/testsuite/assets/aai_sim/aai_mockserver.properties index 9c592303..04b9cc4e 100644 --- a/plans/dcaegen2-services-pmsh/testsuite/assets/aai_sim/aai_mockserver.properties +++ b/plans/dcaegen2-services-pmsh/testsuite/assets/aai_sim/aai_mockserver.properties @@ -14,10 +14,13 @@ mockserver.deleteGeneratedKeyStoreOnExit=true # certificate domain name (default "localhost") mockserver.sslCertificateDomainName=localhost # comma separated list of domain names for Subject Alternative Name domain names (default empty list) -mockserver.sslSubjectAlternativeNameDomains=www.example.com,www.another.com +mockserver.sslSubjectAlternativeNameDomains=aai,aai.onap # comma separated list of ip addresses for Subject Alternative Name ips (default empty list) mockserver.sslSubjectAlternativeNameIps=127.0.0.1 +mockserver.certificateAuthorityPrivateKey=/var/tmp/mock_server_key.pem +mockserver.certificateAuthorityCertificate=/var/tmp/mock_server_cacert.pem + # CORS # enable CORS for MockServer REST API diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json b/plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json index 1a1ba9eb..16d6893a 100644 --- a/plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json +++ b/plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json @@ -77,12 +77,14 @@ "control_loop_name": "pmsh-control-loop", "operational_policy_name": "pmsh-operational-policy", "cert_path": "/opt/app/pmsh/etc/certs/cert.pem", + "enable_tls": true, + "ca_cert_path": "/opt/app/pmsh/etc/certs/cacert.pem", "streams_publishes": { "policy_pm_publisher": { "dmaap_info": { "client_id": "1475976809466", "client_role": "org.onap.dcae.pmPublisher", - "topic_url": "https://mr-sim:3095/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS", + "topic_url": "https://mr-sim:3095/events/unauthenticated.DCAE_CL_OUTPUT", "location": "san-francisco" }, "type": "message_router" @@ -101,7 +103,7 @@ "policy_pm_subscriber": { "dmaap_info": { "location": "san-francisco", - "topic_url": "https://mr-sim:3095/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS", + "topic_url": "https://mr-sim:3095/events/unauthenticated.PMSH_CL_INPUT", "client_role": "org.onap.dcae.pmSubscriber", "client_id": "1575876809456" }, diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json b/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json index 2eac8406..6b12a831 100644 --- a/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json +++ b/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json @@ -1,7 +1,10 @@ [ { "httpRequest": { - "path": "/events/AAI_EVENT/dcae_pmsh_cg/AAI-EVENT" + "path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event", + "queryStringParameters" : { + "timeout" : [ "1000" ] + } }, "httpResponse": { "statusCode": 200, @@ -15,7 +18,10 @@ }, { "httpRequest": { - "path": "/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS" + "path": "/events/unauthenticated.DCAE_CL_OUTPUT", + "queryStringParameters" : { + "timeout" : [ "1000" ] + } }, "httpResponse": { "statusCode": 200, @@ -32,7 +38,10 @@ }, { "httpRequest": { - "path": "/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/dcae_pmsh_cg/policy_response_consumer" + "path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input", + "queryStringParameters" : { + "timeout" : [ "1000" ] + } }, "httpResponse": { "statusCode": 200, diff --git a/plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml b/plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml index ed991c38..6df60f1e 100644 --- a/plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml +++ b/plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml @@ -11,15 +11,18 @@ services: networks: pmsh-network: - aai-sim: + aai: container_name: aai-sim image: mockserver/mockserver:mockserver-5.9.0 environment: MOCKSERVER_PROPERTY_FILE: /config/mockserver.properties MOCKSERVER_INITIALIZATION_JSON_PATH: /config/aai-initializer.json + LOG_LEVEL: "DEBUG" volumes: - ./assets/aai_sim/aai_mockserver.properties:/config/mockserver.properties - ./assets/aai_sim/aai-initializer.json:/config/aai-initializer.json + - ./assets/ssl_certs/mock_server_cacert.pem:/var/tmp/mock_server_cacert.pem + - ./assets/ssl_certs/mock_server_key.pem:/var/tmp/mock_server_key.pem networks: pmsh-network: @@ -68,7 +71,6 @@ services: PMSH_PG_URL: db PMSH_PG_USERNAME: $DB_USER PMSH_PG_PASSWORD: $DB_PASSWORD - AAI_SERVICE_HOST: aai-sim AAI_SERVICE_PORT: 1080 DCAE_CA_CERTPATH: '/opt/app/pmsh/etc/certs/cacert.pem' networks: diff --git a/plans/dcaegen2-services-pmsh/testsuite/setup.sh b/plans/dcaegen2-services-pmsh/testsuite/setup.sh index eb2196a0..4b939fd0 100644 --- a/plans/dcaegen2-services-pmsh/testsuite/setup.sh +++ b/plans/dcaegen2-services-pmsh/testsuite/setup.sh @@ -6,7 +6,7 @@ export DB_PASSWORD=pmsh TEST_PLANS_DIR=$WORKSPACE/plans/dcaegen2-services-pmsh/testsuite -docker-compose -f ${TEST_PLANS_DIR}/docker-compose.yml up -d db aai-sim cbs-sim mr-sim +docker-compose -f ${TEST_PLANS_DIR}/docker-compose.yml up -d db aai cbs-sim mr-sim # Slow machine running CSITs can affect db coming up in time for PMSH echo "Waiting for postgres db to come up..." diff --git a/plans/dcaegen2-services-pmsh/testsuite/teardown.sh b/plans/dcaegen2-services-pmsh/testsuite/teardown.sh index c5bac315..a01dfda0 100644 --- a/plans/dcaegen2-services-pmsh/testsuite/teardown.sh +++ b/plans/dcaegen2-services-pmsh/testsuite/teardown.sh @@ -2,7 +2,7 @@ echo "Starting teardown script" TEST_PLANS_DIR=$WORKSPACE/plans/dcaegen2-services-pmsh/testsuite mkdir -p $WORKSPACE/archives -docker exec pmsh /bin/sh -c "ls -l /var/log/ONAP/dcaegen2/services/pmsh/" docker exec pmsh /bin/sh -c "cat /var/log/ONAP/dcaegen2/services/pmsh/*" +docker cp pmsh:/var/log/ONAP/dcaegen2/services/pmsh/application.log $WORKSPACE/archives/ docker-compose -f $TEST_PLANS_DIR/docker-compose.yml logs --no-color > $WORKSPACE/archives/pmsh-docker-compose.log docker-compose -f $TEST_PLANS_DIR/docker-compose.yml down -v diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/cbs_sim/cbs-initializer.json b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/cbs_sim/cbs-initializer.json index e1677bab..25816a50 100644 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/cbs_sim/cbs-initializer.json +++ b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/cbs_sim/cbs-initializer.json @@ -13,7 +13,7 @@ "pm-mapper" ], "User-Agent":[ - "Java/1.8.0_171" + "Java/11.0.7" ], "Host":[ "!some-random-host:10000" diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dfc/datafile_endpoints.json b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dfc/datafile_endpoints.json index 6abfb566..bd13327b 100644 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dfc/datafile_endpoints.json +++ b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dfc/datafile_endpoints.json @@ -10,6 +10,7 @@ "dmaap.security.keyStorePath": "/opt/app/datafile/etc/cert/cert.jks", "dmaap.security.keyStorePasswordPath": "/opt/app/datafile/etc/cert/jks.pass", "dmaap.security.enableDmaapCertAuth": "false", + "sftp.security.strictHostKeyChecking": "true", "streams_publishes": { "PM_MEAS_FILES": { "type": "data_router", diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/composefile/docker-compose-e2e.yml b/plans/usecases-5G-bulkpm/5G-bulkpm/composefile/docker-compose-e2e.yml index e2f16a7c..dff4824c 100644 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/composefile/docker-compose-e2e.yml +++ b/plans/usecases-5G-bulkpm/5G-bulkpm/composefile/docker-compose-e2e.yml @@ -110,6 +110,8 @@ services: tmp_bulk-pm-network: aliases: - dcaegen2-datafile-collector + environment: + KNOWN_HOSTS_FILE_PATH: "/home/datafile/.ssh/known_hosts" cbs-sim: container_name: config-binding-service-sim diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/setup.sh b/plans/usecases-5G-bulkpm/5G-bulkpm/setup.sh index 1f5f26df..8cb3d9f8 100644 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/setup.sh +++ b/plans/usecases-5G-bulkpm/5G-bulkpm/setup.sh @@ -78,6 +78,11 @@ DR_GATEWAY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dmaap-message-router-server) VESC_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dcaegen2-vescollector) +#Add SFTP server pubilc key to known hosts of datafile collector +HOST_NAMES=$(docker inspect -f '{{ range .NetworkSettings.Networks}}{{join .Aliases ","}}{{end}}' sftp) +KEY_ENTRY=$(echo $HOST_NAMES "$(docker exec sftp cat /etc/ssh/ssh_host_rsa_key.pub)" | sed -e 's/\w*@\w*$//') +docker exec -i -u root dcaegen2-datafile-collector sh -c "echo $KEY_ENTRY >> /home/datafile/.ssh/known_hosts" + # Add gateway IP to DR Prov docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/NODES?val=dmaap-dr-node\|$DR_GATEWAY_IP" docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/PROV_AUTH_ADDRESSES?val=dmaap-dr-prov\|$DR_GATEWAY_IP" @@ -116,4 +121,4 @@ export VESC_PORT=8080 export DMAAP_MR_IP=${DMAAP_MR_IP} #Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v DR_PROV_IP:${DR_PROV_IP} -v DMAAP_MR_IP:${DMAAP_MR_IP} -v VESC_IP:${VESC_IP} -v VESC_PORT:${VESC_PORT}" \ No newline at end of file +ROBOT_VARIABLES="-v DR_PROV_IP:${DR_PROV_IP} -v DMAAP_MR_IP:${DMAAP_MR_IP} -v VESC_IP:${VESC_IP} -v VESC_PORT:${VESC_PORT}" diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/simulators/pnfsim/docker-compose.yml b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/simulators/pnfsim/docker-compose.yml index 2e9afeb3..7b1d5a8f 100755 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/simulators/pnfsim/docker-compose.yml +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/simulators/pnfsim/docker-compose.yml @@ -2,7 +2,7 @@ version: '3' services: netconf-pnp-simulator: - image: nexus3.onap.org:10001/onap/integration/simulators/netconf-pnp-simulator:2.8.5 + image: nexus3.onap.org:10001/onap/integration/simulators/netconf-pnp-simulator:2.8.6 container_name: netconf-pnp-simulator restart: always ports: diff --git a/plans/vfc-nfvo-driver-ems/sanity-check/setup.sh b/plans/vfc-nfvo-driver-ems/sanity-check/setup.sh deleted file mode 100755 index d381f8f3..00000000 --- a/plans/vfc-nfvo-driver-ems/sanity-check/setup.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -# -# Copyright 2017 ZTE Corporation. -# -# 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: -# Start all process required for executing test case - -source ${SCRIPTS}/common_functions.sh - -#start msb -docker run -d -p 8500:8500 --name msb_consul consul:0.9.3 -MSB_CONSUL_IP=`get-instance-ip.sh msb_consul` -echo MSB_CONSUL_IP=${MSB_CONSUL_IP} - -docker run -d -p 10081:10081 -e CONSUL_IP=$MSB_CONSUL_IP --name msb_discovery nexus3.onap.org:10001/onap/msb/msb_discovery -MSB_DISCOVERY_IP=`get-instance-ip.sh msb_discovery` -echo DISCOVERY_IP=${MSB_DISCOVERY_IP} - -docker run -d -p 80:80 -e CONSUL_IP=$MSB_CONSUL_IP -e SDCLIENT_IP=$MSB_DISCOVERY_IP -e "ROUTE_LABELS=visualRange:1" --name msb_internal_apigateway nexus3.onap.org:10001/onap/msb/msb_apigateway -MSB_IAG_IP=`get-instance-ip.sh msb_internal_apigateway` -echo MSB_IAG_IP=${MSB_IAG_IP} - -# Wait for initialization(8500 Consul, 10081 Service Registration & Discovery, 80 api gateway) -for i in {1..10}; do - curl -sS -m 1 ${MSB_CONSUL_IP}:8500 && curl -sS -m 1 ${MSB_DISCOVERY_IP}:10081 && curl -sS -m 1 ${MSB_IAG_IP}:80 && break - echo sleep $i - sleep $i -done - -# Need some time so service info can be synced from discovery to api gateway -echo sleep 60 -sleep 60 - -# start vfc-emsdriver -docker run -d --name vfc-emsdriver -e MSB_ADDR=${MSB_IAG_IP}:80 nexus3.onap.org:10001/onap/vfc/emsdriver -EMS_DRV_IP=`get-instance-ip.sh vfc-emsdriver` -docker logs -f vfc-emsdriver > emsdriver.log & - -# Wait for initialization -for i in {1..10}; do - curl -sS -m 1 ${EMS_DRV_IP}:8206 && break - echo sleep $i - sleep $i -done - -echo "===============" -cat emsdriver.log - -# Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP} -v EMS_DRV_IP:${EMS_DRV_IP}" diff --git a/plans/vfc-nfvo-driver-ems/sanity-check/teardown.sh b/plans/vfc-nfvo-driver-ems/sanity-check/teardown.sh deleted file mode 100755 index aa676b2f..00000000 --- a/plans/vfc-nfvo-driver-ems/sanity-check/teardown.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# -# Copyright 2017 ZTE Corporation. -# -# 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. -# - -# This script is sourced by run-csit.sh after Robot test completion. -kill-instance.sh msb_internal_apigateway -kill-instance.sh msb_discovery -kill-instance.sh msb_consul -kill-instance.sh vfc-emsdriver diff --git a/plans/vfc-nfvo-driver-ems/sanity-check/testplan.txt b/plans/vfc-nfvo-driver-ems/sanity-check/testplan.txt deleted file mode 100644 index cb2a8026..00000000 --- a/plans/vfc-nfvo-driver-ems/sanity-check/testplan.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. -vfc/nfvo-driver-ems/test.robot diff --git a/plans/vfc-nfvo-driver-sfc/sanity-check/setup.sh b/plans/vfc-nfvo-driver-sfc/sanity-check/setup.sh deleted file mode 100755 index 85a3e69f..00000000 --- a/plans/vfc-nfvo-driver-sfc/sanity-check/setup.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -# -# Copyright 2017 ZTE Corporation. -# -# 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: -# Start all process required for executing test case - -source ${SCRIPTS}/common_functions.sh - -#start msb -docker run -d -p 8500:8500 --name msb_consul consul:0.9.3 -MSB_CONSUL_IP=`get-instance-ip.sh msb_consul` -echo MSB_CONSUL_IP=${MSB_CONSUL_IP} - -docker run -d -p 10081:10081 -e CONSUL_IP=$MSB_CONSUL_IP --name msb_discovery nexus3.onap.org:10001/onap/msb/msb_discovery -MSB_DISCOVERY_IP=`get-instance-ip.sh msb_discovery` -echo DISCOVERY_IP=${MSB_DISCOVERY_IP} - -docker run -d -p 80:80 -e CONSUL_IP=$MSB_CONSUL_IP -e SDCLIENT_IP=$MSB_DISCOVERY_IP -e "ROUTE_LABELS=visualRange:1" --name msb_internal_apigateway nexus3.onap.org:10001/onap/msb/msb_apigateway -MSB_IAG_IP=`get-instance-ip.sh msb_internal_apigateway` -echo MSB_IAG_IP=${MSB_IAG_IP} - -# Wait for initialization(8500 Consul, 10081 Service Registration & Discovery, 80 api gateway) -for i in {1..10}; do - curl -sS -m 1 ${MSB_CONSUL_IP}:8500 && curl -sS -m 1 ${MSB_DISCOVERY_IP}:10081 && curl -sS -m 1 ${MSB_IAG_IP}:80 && break - echo sleep $i - sleep $i -done - -# Need some time so service info can be synced from discovery to api gateway -echo sleep 60 -sleep 60 - -# start vfc-ztesdncdriver -docker run -d --name vfc-ztesdncdriver -e MSB_ADDR=${MSB_IAG_IP}:80 nexus3.onap.org:10001/onap/vfc/ztesdncdriver -SFC_DRV_IP=`get-instance-ip.sh vfc-ztesdncdriver` -docker logs -f vfc-ztesdncdriver > ztesdncdriver.log & - -# Wait for initialization -for i in {1..10}; do - curl -sS -m 1 ${SFC_DRV_IP}:8411 && break - echo sleep $i - sleep $i -done - -echo "===============================" -cat ztesdncdriver.log - -# Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP} -v SFC_DRV_IP:${SFC_DRV_IP}" diff --git a/plans/vfc-nfvo-driver-sfc/sanity-check/teardown.sh b/plans/vfc-nfvo-driver-sfc/sanity-check/teardown.sh deleted file mode 100755 index ce5402ef..00000000 --- a/plans/vfc-nfvo-driver-sfc/sanity-check/teardown.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# -# Copyright 2017 ZTE Corporation. -# -# 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. -# - -# This script is sourced by run-csit.sh after Robot test completion. -kill-instance.sh msb_internal_apigateway -kill-instance.sh msb_discovery -kill-instance.sh msb_consul -kill-instance.sh vfc-ztesdncdriver diff --git a/plans/vfc-nfvo-driver-sfc/sanity-check/testplan.txt b/plans/vfc-nfvo-driver-sfc/sanity-check/testplan.txt deleted file mode 100644 index 3fa996f6..00000000 --- a/plans/vfc-nfvo-driver-sfc/sanity-check/testplan.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. -vfc/nfvo-driver-sfc/test.robot diff --git a/plans/vfc-nfvo-multivimproxy/sanity-check/setup.sh b/plans/vfc-nfvo-multivimproxy/sanity-check/setup.sh deleted file mode 100644 index 4d97f33e..00000000 --- a/plans/vfc-nfvo-multivimproxy/sanity-check/setup.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# -# Copyright 2018 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: -# Start all process required for executing test case - -#login to the onap nexus docker repo -docker login -u docker -p docker nexus3.onap.org:10001 - -# Start MSB -docker run -d -p 8500:8500 --name msb_consul consul:0.9.3 -CONSUL_IP=`get-instance-ip.sh msb_consul` -echo CONSUL_IP=${CONSUL_IP} -docker run -d -p 10081:10081 -e CONSUL_IP=$CONSUL_IP --name msb_discovery nexus3.onap.org:10001/onap/msb/msb_discovery -DISCOVERY_IP=`get-instance-ip.sh msb_discovery` -echo DISCOVERY_IP=${DISCOVERY_IP} -docker run -d -p 80:80 -e CONSUL_IP=$CONSUL_IP -e SDCLIENT_IP=$DISCOVERY_IP --name msb_internal_apigateway nexus3.onap.org:10001/onap/msb/msb_apigateway -MSB_IP==`get-instance-ip.sh msb_internal_apigateway` -echo MSB_IP=${MSB_IP} - -# Start resmgr -docker run -d --name vfc-multivimproxy -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/multivimproxy -RESMGR_IP=`get-instance-ip.sh vfc-multivimproxy` -for i in {1..20}; do - curl -sS ${RESMGR_IP}:8486 && break - echo sleep $i - sleep $i -done - -# Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v MSB_IP:${MSB_IP} -v RESMGR_IP:${RESMGR_IP}" diff --git a/plans/vfc-nfvo-multivimproxy/sanity-check/teardown.sh b/plans/vfc-nfvo-multivimproxy/sanity-check/teardown.sh deleted file mode 100644 index c158d199..00000000 --- a/plans/vfc-nfvo-multivimproxy/sanity-check/teardown.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# -# Copyright 2018 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. -# - -# This script is sourced by run-csit.sh after Robot test completion. -kill-instance.sh msb_internal_apigateway -kill-instance.sh msb_discovery -kill-instance.sh msb_consul -kill-instance.sh vfc-multivimproxy diff --git a/plans/vfc-nfvo-multivimproxy/sanity-check/testplan.txt b/plans/vfc-nfvo-multivimproxy/sanity-check/testplan.txt deleted file mode 100644 index 5d1c6e9d..00000000 --- a/plans/vfc-nfvo-multivimproxy/sanity-check/testplan.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. -vfc/nfvo-multivimproxy/test.robot \ No newline at end of file diff --git a/plans/vfc-nfvo-resmanagement/sanity-check/setup.sh b/plans/vfc-nfvo-resmanagement/sanity-check/setup.sh deleted file mode 100644 index 68b78431..00000000 --- a/plans/vfc-nfvo-resmanagement/sanity-check/setup.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# -# Copyright 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: -# Start all process required for executing test case - -#login to the onap nexus docker repo -docker login -u docker -p docker nexus3.onap.org:10001 - -# Start MSB -docker run -d -p 8500:8500 --name msb_consul consul:0.9.3 -CONSUL_IP=`get-instance-ip.sh msb_consul` -echo CONSUL_IP=${CONSUL_IP} -docker run -d -p 10081:10081 -e CONSUL_IP=$CONSUL_IP --name msb_discovery nexus3.onap.org:10001/onap/msb/msb_discovery -DISCOVERY_IP=`get-instance-ip.sh msb_discovery` -echo DISCOVERY_IP=${DISCOVERY_IP} -docker run -d -p 80:80 -e CONSUL_IP=$CONSUL_IP -e SDCLIENT_IP=$DISCOVERY_IP --name msb_internal_apigateway nexus3.onap.org:10001/onap/msb/msb_apigateway -MSB_IP==`get-instance-ip.sh msb_internal_apigateway` -echo MSB_IP=${MSB_IP} - -# Start resmgr -docker run -d --name vfc-resmanagement -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/resmanagement -RESMGR_IP=`get-instance-ip.sh vfc-resmanagement` -for i in {1..20}; do - curl -sS ${RESMGR_IP}:8480 && break - echo sleep $i - sleep $i -done - -# Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v MSB_IP:${MSB_IP} -v RESMGR_IP:${RESMGR_IP}" diff --git a/plans/vfc-nfvo-resmanagement/sanity-check/teardown.sh b/plans/vfc-nfvo-resmanagement/sanity-check/teardown.sh deleted file mode 100644 index 2ad95c6b..00000000 --- a/plans/vfc-nfvo-resmanagement/sanity-check/teardown.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# -# Copyright 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. -# - -# This script is sourced by run-csit.sh after Robot test completion. -kill-instance.sh msb_internal_apigateway -kill-instance.sh msb_discovery -kill-instance.sh msb_consul -kill-instance.sh vfc-resmanagement diff --git a/plans/vfc-nfvo-resmanagement/sanity-check/testplan.txt b/plans/vfc-nfvo-resmanagement/sanity-check/testplan.txt deleted file mode 100644 index ae6d3a56..00000000 --- a/plans/vfc-nfvo-resmanagement/sanity-check/testplan.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. -vfc/nfvo-resmanagement/test.robot \ No newline at end of file diff --git a/plans/vfc-nfvo-wfengine/sanity-check/setup.sh b/plans/vfc-nfvo-wfengine/sanity-check/setup.sh deleted file mode 100644 index 387ccf87..00000000 --- a/plans/vfc-nfvo-wfengine/sanity-check/setup.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash -# -# Copyright 2017 ZTE Corporation. -# -# 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: -# Start all process required for executing test case - -source ${SCRIPTS}/common_functions.sh - - -#start msb -docker run -d -p 8500:8500 --name msb_consul consul:0.9.3 -MSB_CONSUL_IP=`get-instance-ip.sh msb_consul` -echo MSB_CONSUL_IP=${MSB_CONSUL_IP} -docker run -d -p 10081:10081 -e CONSUL_IP=$MSB_CONSUL_IP --name msb_discovery nexus3.onap.org:10001/onap/msb/msb_discovery:1.1.0 -MSB_DISCOVERY_IP=`get-instance-ip.sh msb_discovery` -echo MSB_DISCOVERY_IP=${MSB_DISCOVERY_IP} -docker run -d -p 80:80 -e CONSUL_IP=$MSB_CONSUL_IP -e SDCLIENT_IP=$MSB_DISCOVERY_IP --name msb_internal_apigateway nexus3.onap.org:10001/onap/msb/msb_apigateway:1.1.0 -MSB_IAG_IP=`get-instance-ip.sh msb_internal_apigateway` -echo MSB_IAG_IP=${MSB_IAG_IP} - -# Wait for initialization(8500 Consul, 10081 Service Registration & Discovery, 80 api gateway) -for i in {1..10}; do - curl -sS -m 1 ${MSB_CONSUL_IP}:8500 && curl -sS -m 1 ${MSB_DISCOVERY_IP}:10081 && curl -sS -m 1 ${MSB_IAG_IP}:80 && break - echo sleep $i - sleep $i -done - -# wait for container initalization -echo sleep 30 -sleep 30 - -ORG="onap" -PROJECT="vfc" -DOCKER_REPOSITORY="nexus3.onap.org:10001" -IMAGE="wfengine-activiti" -IMAGE_ACTIVITI_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}" - -#get current host IP addres -SERVICE_IP=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $7}') - -# start wfengine-activiti -# docker run -d --name vfc_wfengine_activiti -p 8804:8080 -e SERVICE_IP=$SERVICE_IP -e SERVICE_PORT=8804 -e OPENPALETTE_MSB_IP=${MSB_IAG_IP} -e OPENPALETTE_MSB_PORT=80 ${IMAGE_ACTIVITI_NAME} -docker run -d --name vfc_wfengine_activiti -p 8804:8080 -e SERVICE_PORT=8080 -e OPENPALETTE_MSB_IP=${MSB_IAG_IP} -e OPENPALETTE_MSB_PORT=80 ${IMAGE_ACTIVITI_NAME} -WFENGINE_ACTIVITI_IP=`get-instance-ip.sh vfc_wfengine_activiti` - -# Wait for initialization -for i in {1..10}; do - curl -sS ${WFENGINE_ACTIVITI_IP}:8080 && break - echo sleep $i - sleep $i -done -for i in {1..10}; do - curl -sS ${SERVICE_IP}:8804 && break - echo sleep $i - sleep $i -done -docker logs vfc_wfengine_activiti - -IMAGE="wfengine-mgrservice" -IMAGE_MGRSERVICE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}" - -# Start wfengine-mgrservice -#docker run -d --name vfc_wfengine_mgrservice -p 8805:10550 -e SERVICE_IP=$SERVICE_IP -e SERVICE_PORT=8805 -e OPENPALETTE_MSB_IP=${MSB_IAG_IP} -e OPENPALETTE_MSB_PORT=80 ${IMAGE_MGRSERVICE_NAME} -#docker run -d --name vfc_wfengine_mgrservice -p 8805:10550 -e SERVICE_PORT=10550 -e OPENPALETTE_MSB_IP=${MSB_IAG_IP} -e OPENPALETTE_MSB_PORT=80 ${IMAGE_MGRSERVICE_NAME} -docker run -d --name vfc_wfengine_mgrservice -p 8805:10550 -e SERVICE_PORT=10550 -e OPENPALETTE_MSB_IP=${WFENGINE_ACTIVITI_IP} -e OPENPALETTE_MSB_PORT=8080 ${IMAGE_MGRSERVICE_NAME} - -##docker run -d --name ${IMAGE} -e OPENPALETTE_MSB_IP=${WFENGINEACTIVITIR_IP} -e OPENPALETTE_MSB_PORT=8080 ${IMAGE_MGRSERVICE_NAME} -WFENGINE_MGRSERVICE_IP=`get-instance-ip.sh vfc_wfengine_mgrservice` -for i in {1..10}; do - curl -sS ${WFENGINE_MGRSERVICE_IP}:10550 && break - echo sleep $i - sleep $i -done -docker logs vfc_wfengine_mgrservice - -# Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP} -v MSB_IP:${MSB_IAG_IP} -v MSB_PORT:80 -v MSB_DISCOVERY_IP:${MSB_DISCOVERY_IP} -v ACTIVITI_IP:${WFENGINE_ACTIVITI_IP} -v ACTIVITI_PORT:8080 -v MGRSERVICE_IP:${WFENGINE_MGRSERVICE_IP} -v MGRSERVICE_PORT:10550 -v SCRIPTS:${SCRIPTS}" -##ROBOT_VARIABLES="-v MSB_IAG_IP:${WFENGINEACTIVITIR_IP} -v MSB_IP:${WFENGINEMGRSERVICE_IP} -v MSB_PORT:10550 -v MSB_DISCOVERY_IP:${WFENGINEACTIVITIR_IP} -v MSB_DISCOVERY_PORT:8080 -v WFENGINEACTIVITIR_IP:${WFENGINEACTIVITIR_IP} -v WFENGINEACTIVITIR_PORT:8080 -v WFENGINEMGRSERVICE_IP:${WFENGINEMGRSERVICE_IP} -v WFENGINEMGRSERVICE_PORT:10550 -v SCRIPTS:${SCRIPTS}" \ No newline at end of file diff --git a/plans/vfc-nfvo-wfengine/sanity-check/teardown.sh b/plans/vfc-nfvo-wfengine/sanity-check/teardown.sh deleted file mode 100644 index bca33569..00000000 --- a/plans/vfc-nfvo-wfengine/sanity-check/teardown.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# -# Copyright 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. -# - -# This script is sourced by run-csit.sh after Robot test completion. -echo === logs vfc_wfengine_activiti === -docker logs vfc_wfengine_activiti - -echo === logs vfc_wfengine_mgrservice === -docker logs vfc_wfengine_mgrservice - -kill-instance.sh msb_internal_apigateway -kill-instance.sh msb_discovery -kill-instance.sh msb_consul -kill-instance.sh vfc_wfengine_mgrservice -kill-instance.sh vfc_wfengine_activiti diff --git a/plans/vfc-nfvo-wfengine/sanity-check/testplan.txt b/plans/vfc-nfvo-wfengine/sanity-check/testplan.txt deleted file mode 100644 index 2d03683d..00000000 --- a/plans/vfc-nfvo-wfengine/sanity-check/testplan.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. - -vfc/nfvo-wfengine/workflow.robot \ No newline at end of file diff --git a/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-kill.sh b/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-kill.sh index 205a6009..b3074b3a 100755 --- a/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-kill.sh +++ b/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-kill.sh @@ -2,3 +2,4 @@ docker exec -i dfc_app0 cat /var/log/ONAP/application.log docker kill dfc_app0 +docker rm dfc_app0 diff --git a/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-start.sh b/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-start.sh index 808b0b17..38b78f2d 100755 --- a/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-start.sh +++ b/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-start.sh @@ -1,12 +1,30 @@ #!/bin/bash +#function to load sftp servers keys to dfc app depending on KNOWN_HOSTS environment variable +# when KNOWN_HOSTS == "all_hosts_keys" or is not set, public keys of all sftp servers are loaded +# when KNOWN_HOSTS == "known_hosts_empty", empty known hosts file is created +# for other strings known hosts file is not created +function load-sftp-servers-keys() { + if [ -z "$KNOWN_HOSTS" ] || [ "$KNOWN_HOSTS" == "all_hosts_keys" ]; then + SFTP_SERVERS="$(docker ps -q --filter='name=dfc_sftp')" + + for SFTP_SERVER in $SFTP_SERVERS; do + HOST_NAMES=$(docker inspect -f '{{ join .NetworkSettings.Networks.dfcnet.Aliases ","}}' $SFTP_SERVER) + KEY_ENTRY=$(echo $HOST_NAMES "$(docker exec $SFTP_SERVER cat /etc/ssh/ssh_host_rsa_key.pub)" | + sed -e 's/\w*@\w*$//') + docker exec -u root dfc_app0 sh -c "echo $KEY_ENTRY >> /home/datafile/.ssh/known_hosts" + done + elif [ "$KNOWN_HOSTS" == "known_hosts_empty" ]; then + docker exec -u root dfc_app0 sh -c "touch /home/datafile/.ssh/known_hosts" + fi +} + set -x #Start DFC app - DOCKER_SIM_NWNAME="dfcnet" echo "Creating docker network $DOCKER_SIM_NWNAME, if needed" -docker network ls| grep $DOCKER_SIM_NWNAME > /dev/null || docker network create $DOCKER_SIM_NWNAME +docker network ls | grep $DOCKER_SIM_NWNAME >/dev/null || docker network create $DOCKER_SIM_NWNAME docker-compose up -d @@ -14,21 +32,23 @@ DFC_APP="$(docker ps -q --filter='name=dfc_app0')" #Wait for initialization of docker containers for dfc app and all simulators for i in {1..10}; do - if [ $(docker inspect --format '{{ .State.Running }}' $DFC_APP) ] - then - echo "DFC app Running" - # enable TRACE logging of DFC - docker exec $DFC_APP /bin/sh -c " sed -i 's/org.onap.dcaegen2.collectors.datafile: WARN/org.onap.dcaegen2.collectors.datafile: TRACE/g' /opt/app/datafile/config/application.yaml" - - #enable TRACE logging of spring-framework - docker exec $DFC_APP /bin/sh -c " sed -i 's/org.springframework.data: ERROR/org.springframework.data: TRACE/g' /opt/app/datafile/config/application.yaml" - - docker restart $DFC_APP - sleep 10 - - break - else - echo sleep $i - sleep $i + if [ $(docker inspect --format '{{ .State.Running }}' $DFC_APP) ]; then + echo "DFC app Running" + + load-sftp-servers-keys + + # enable TRACE logging of DFC + docker exec $DFC_APP /bin/sh -c " sed -i 's/org.onap.dcaegen2.collectors.datafile: WARN/org.onap.dcaegen2.collectors.datafile: TRACE/g' /opt/app/datafile/config/application.yaml" + + #enable TRACE logging of spring-framework + docker exec $DFC_APP /bin/sh -c " sed -i 's/org.springframework.data: ERROR/org.springframework.data: TRACE/g' /opt/app/datafile/config/application.yaml" + + docker restart $DFC_APP + sleep 10 + + break + else + echo sleep $i + sleep $i fi done diff --git a/scripts/dcaegen2-collectors-datafile/dfc-management/docker-compose.yml b/scripts/dcaegen2-collectors-datafile/dfc-management/docker-compose.yml index 9e15ccf0..f92d19f6 100644 --- a/scripts/dcaegen2-collectors-datafile/dfc-management/docker-compose.yml +++ b/scripts/dcaegen2-collectors-datafile/dfc-management/docker-compose.yml @@ -15,8 +15,11 @@ services: - "8433:8433" networks: dfcnet: null + volumes: + - $SIMGROUP_ROOT/tls/:/opt/app/datafile/etc/cert/ environment: CONSUL_HOST: "consul-server" CONSUL_PORT: 8500 CONFIG_BINDING_SERVICE: "config-binding-service" HOSTNAME: "dfc_app0" + KNOWN_HOSTS_FILE_PATH: "/home/datafile/.ssh/known_hosts" diff --git a/tests/dcaegen2-collectors-datafile/resources/common-keywords.robot b/tests/dcaegen2-collectors-datafile/resources/common-keywords.robot index 76dc0338..c425fe2a 100644 --- a/tests/dcaegen2-collectors-datafile/resources/common-keywords.robot +++ b/tests/dcaegen2-collectors-datafile/resources/common-keywords.robot @@ -37,4 +37,20 @@ DR Redir Sim Downloaded Volume Equal [Documentation] Verify that the size of the downloaded data volume is equal to a target value [Arguments] ${target_ctr_value} ${resp}= Run Process ${CLI_DR_REDIR_SIM_DOWNLOADED_VOLUME} shell=yes - Should Be Equal As Strings ${resp.stdout} ${target_ctr_value} \ No newline at end of file + Should Be Equal As Strings ${resp.stdout} ${target_ctr_value} + +Start DFC + [Documentation] Start DFC container + ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT} env:SIMGROUP_ROOT=${SIMGROUP_ROOT} + Log To Console Dfc-start: + Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} + + +Test Teardown + [Documentation] Cleanup containers + ${cli_cmd_output}= Run Process ${SIMGROUP_ROOT}/simulators-kill.sh + Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} + ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-kill.sh + Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} + ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh stderr=STDOUT + Log To Console Dfc containter clean: ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} diff --git a/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-suite/FuncSingleFile.robot b/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-suite/FuncSingleFile.robot index 3f8be179..8213c702 100755 --- a/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-suite/FuncSingleFile.robot +++ b/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-suite/FuncSingleFile.robot @@ -18,126 +18,77 @@ Verify single event with single 1MB SFTP file. From event poll to published file [TAGS] DFC_FUNCTIONAL_1 [Documentation] Verify single event with single SFTP 1MB file from event poll to published file. ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh stderr=STDOUT - Log To Console Dfc containter clean: ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - Set Environment Variable MR_TC --tc100 - Set Environment Variable DR_TC --tc normal - Set Environment Variable DR_REDIR_TC --tc normal - Set Environment Variable MR_GROUPS OpenDcae-c12:PM_MEAS_FILES - Set Environment Variable MR_FILE_PREFIX_MAPPING PM_MEAS_FILES:A - Set Environment Variable DR_REDIR_FEEDS 2:A - Set Environment Variable FTP_FILE_PREFIXES A - Set Environment Variable NUM_FTPFILES 1 - Set Environment Variable NUM_PNFS 1 - Set Environment Variable FILE_SIZE 1MB - Set Environment Variable FTP_TYPE SFTP - Set Environment Variable NUM_FTP_SERVERS 1 - Set Environment Variable DR_FEEDS 2:A - Set Environment Variable DR_REDIR_SIM drsim_redir - Set Environment Variable SFTP_SIMS sftp-server0:22 - Set Environment Variable FTPS_SIMS ftpes-server-vsftpd0:21 + Verify Single Event From Event Poll To Published File 1 --tc100 SFTP - ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT} - Log To Console Simulator-start: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim - DR Sim Published Files Equal 0 #Verify 0 file published to DR sim - ${cli_cmd_output}= Run Process ${CONSUL_UPL_APP} shell=yes - Log To Console Consul APP write: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} +Verify single event with single 5MB SFTP file. From event poll to published file + [TAGS] DFC_FUNCTIONAL_2 + [Documentation] Verify single event with single SFTP 5MB file from event poll to published file. + Verify Single Event From Event Poll To Published File 5 --tc101 SFTP - ${cli_cmd_output}= Run Process ${CONSUL_GET_APP} shell=yes - Log To Console Consul APP read: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - ${cli_cmd_output}= Run Process ${CBS_GET_MERGED_CONFIG} shell=yes - Log To Console CBS merged configuration: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} +Verify single event with single 50MB SFTP file. From event poll to published file + [TAGS] DFC_FUNCTIONAL_3 + [Documentation] Verify single event with single SFTP 50MB file from event poll to published file. + Verify Single Event From Event Poll To Published File 50 --tc102 SFTP - Sleep 10 - ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT} - Log To Console Dfc-start: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} +######## Single file, FTPES +Verify single event with single 1MB FTPES file. From event poll to published file + [TAGS] DFC_FUNCTIONAL_10 + [Documentation] Verify single event with single FTPES 1MB file from event poll to published file. + Verify Single Event From Event Poll To Published File 1 --tc200 FTPES - Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim - Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files - Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim - DR Redir Sim Downloaded Volume Equal 1 000 000 #Verify 1 000 000 bytes published file data in DR redir sim +Verify single event with single 5MB FTPES file. From event poll to published file + [TAGS] DFC_FUNCTIONAL_11 + [Documentation] Verify single event with single FTPES 5MB file from event poll to published file. + Verify Single Event From Event Poll To Published File 5 --tc201 FTPES - ${cli_cmd_output}= Run Process ${SIMGROUP_ROOT}/simulators-kill.sh - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-kill.sh - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} +Verify single event with single 50MB FTEPS file. From event poll to published file + [TAGS] DFC_FUNCTIONAL_12 + [Documentation] Verify single event with single FTPES 50MB file from event poll to published file. + Verify Single Event From Event Poll To Published File 50 --tc202 FTPES -Verify single event with single 5MB SFTP file. From event poll to published file - [TAGS] DFC_FUNCTIONAL_2 - [Documentation] Verify single event with single SFTP 5MB file from event poll to published file. - ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh stderr=STDOUT - Log To Console Dfc containter clean: ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - Set Environment Variable MR_TC --tc101 - Set Environment Variable DR_TC --tc normal - Set Environment Variable DR_REDIR_TC --tc normal - Set Environment Variable MR_GROUPS OpenDcae-c12:PM_MEAS_FILES - Set Environment Variable MR_FILE_PREFIX_MAPPING PM_MEAS_FILES:A - Set Environment Variable DR_REDIR_FEEDS 2:A - Set Environment Variable FTP_FILE_PREFIXES A - Set Environment Variable NUM_FTPFILES 1 - Set Environment Variable NUM_PNFS 1 - Set Environment Variable FILE_SIZE 5MB - Set Environment Variable FTP_TYPE SFTP - Set Environment Variable NUM_FTP_SERVERS 1 - Set Environment Variable DR_FEEDS 2:A - Set Environment Variable DR_REDIR_SIM drsim_redir - Set Environment Variable SFTP_SIMS sftp-server0:22 - Set Environment Variable FTPS_SIMS ftpes-server-vsftpd0:21 +*** Keywords *** +Verify Single Event From Event Poll To Published File + [Documentation] Keyword to verify single event with file with given parameters. + [Arguments] ${file_size_in_mb} ${mr_tc} ${ftp_type} + Set Environment Variable MR_TC ${mr_tc} + Set Environment Variable FILE_SIZE ${file_size_in_mb}MB + Set Environment Variable FTP_TYPE ${ftp_type} + Set Default Environment Variables ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT} - Log To Console Simulator-start: ${cli_cmd_output.stdout} + Log To Console Simulator-start: + Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim DR Sim Published Files Equal 0 #Verify 0 file published to DR sim - ${cli_cmd_output}= Run Process ${CONSUL_UPL_APP} shell=yes + ${cli_cmd_output}= Run Process ${CONSUL_UPL_APP} shell=yes Log To Console Consul APP write: Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - ${cli_cmd_output}= Run Process ${CONSUL_GET_APP} shell=yes + ${cli_cmd_output}= Run Process ${CONSUL_GET_APP} shell=yes Log To Console Consul APP read: Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - ${cli_cmd_output}= Run Process ${CBS_GET_MERGED_CONFIG} shell=yes + ${cli_cmd_output}= Run Process ${CBS_GET_MERGED_CONFIG} shell=yes Log To Console CBS merged configuration: Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} Sleep 10 - ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT} - Log To Console Dfc-start: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} + Start DFC Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim - DR Redir Sim Downloaded Volume Equal 5 000 000 #Verify 5 000 000 bytes published file data in DR redir sim + DR Redir Sim Downloaded Volume Equal ${file_size_in_mb} 000 000 #Verify correct number of bytes published file data in DR redir sim - ${cli_cmd_output}= Run Process ${SIMGROUP_ROOT}/simulators-kill.sh - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-kill.sh - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - - ${cli_cmd_output}= Run Process docker stop $(docker ps -aq) shell=yes - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - - ${cli_cmd_output}= Run Process docker rm $(docker ps -aq) shell=yes - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - - Sleep 10 + [Teardown] Test Teardown -Verify single event with single 50MB SFTP file. From event poll to published file - [TAGS] DFC_FUNCTIONAL_3 - [Documentation] Verify single event with single SFTP 50MB file from event poll to published file. - ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh - Set Environment Variable MR_TC --tc102 +Set Default Environment Variables + [Documentation] Set default environment variables for simulators setup Set Environment Variable DR_TC --tc normal Set Environment Variable DR_REDIR_TC --tc normal Set Environment Variable MR_GROUPS OpenDcae-c12:PM_MEAS_FILES @@ -146,115 +97,8 @@ Verify single event with single 50MB SFTP file. From event poll to published fil Set Environment Variable FTP_FILE_PREFIXES A Set Environment Variable NUM_FTPFILES 1 Set Environment Variable NUM_PNFS 1 - Set Environment Variable FILE_SIZE 50MB - Set Environment Variable FTP_TYPE SFTP Set Environment Variable NUM_FTP_SERVERS 1 Set Environment Variable DR_FEEDS 2:A Set Environment Variable DR_REDIR_SIM drsim_redir Set Environment Variable SFTP_SIMS sftp-server0:22 - Set Environment Variable FTPS_SIMS ftpes-server-vsftpd0:21 - - ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT} - Log To Console Simulator-start: ${cli_cmd_output.stdout} - MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim - DR Sim Published Files Equal 0 #Verify 0 file published to DR sim - - ${cli_cmd_output}= Run Process ${CONSUL_UPL_APP} shell=yes - Log To Console Consul APP write: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - - ${cli_cmd_output}= Run Process ${CONSUL_GET_APP} shell=yes - Log To Console Consul APP read: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - - ${cli_cmd_output}= Run Process ${CBS_GET_MERGED_CONFIG} shell=yes - Log To Console CBS merged configuration: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - - Sleep 10 - - ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT} - Log To Console Dfc-start: - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - - Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim - Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files - Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim - DR Redir Sim Downloaded Volume Equal 50 000 000 #Verify 50 000 000 bytes published file data in DR redir sim - - ${cli_cmd_output}= Run Process ${SIMGROUP_ROOT}/simulators-kill.sh - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-kill.sh - Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} - -######### Single file, FTPS -# Temporarily removed due to issues with the certificates for the ftsp server simulator cert. -#Verify single event with single 1MB FTPS file. From event poll to published file -# [TAGS] DFC_FUNCTIONAL_10 -# [Documentation] Verify single event with single FTPS 1MB file from event poll to published file. -# ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh -# Set Environment Variable MR_TC --tc200 -# Set Environment Variable DR_TC --tc normal -# Set Environment Variable DR_REDIR_TC --tc normal -# Set Environment Variable NUM_FTPFILES 1 -# Set Environment Variable NUM_PNFS 1 -# Set Environment Variable FILE_SIZE 1MB -# Set Environment Variable FTP_TYPE FTPS -# ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT} -# MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim -# DR Sim Published Files Equal 0 #Verify 0 file published to DR sim -# ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT} -# Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim -# Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files -# Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim -# DR Redir Sim Downloaded Volume Equal 1 000 000 #Verify 1 000 000 bytes published file data in DR redir sim -# ${cli_cmd_output}= Run Process ${SIMGROUP_ROOT}/simulators-kill.sh -# ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-kill.sh -# -#Verify single event with single 5MB FTPS file. From event poll to published file -# [TAGS] DFC_FUNCTIONAL_11 -# [Documentation] Verify single event with single FTPS 5MB file from event poll to published file. -# ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh -# Set Environment Variable MR_TC --tc201 -# Set Environment Variable DR_TC --tc normal -# Set Environment Variable DR_REDIR_TC --tc normal -# Set Environment Variable NUM_FTPFILES 1 -# Set Environment Variable NUM_PNFS 1 -# Set Environment Variable FILE_SIZE 5MB -# Set Environment Variable FTP_TYPE FTPS -# ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT} -# MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim -# DR Sim Published Files Equal 0 #Verify 0 file published to DR sim -# ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT} -# Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim -# Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files -# Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim -# DR Redir Sim Downloaded Volume Equal 5 000 000 #Verify 5 000 000 bytes published file data in DR redir sim -# ${cli_cmd_output}= Run Process ${SIMGROUP_ROOT}/simulators-kill.sh -# ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-kill.sh -# -#Verify single event with single 50MB FTPS file. From event poll to published file -# [TAGS] DFC_FUNCTIONAL_12 -# [Documentation] Verify single event with single FTPS 50MB file from event poll to published file. -# ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh -# Set Environment Variable MR_TC --tc202 -# Set Environment Variable DR_TC --tc normal -# Set Environment Variable DR_REDIR_TC --tc normal -# Set Environment Variable NUM_FTPFILES 1 -# Set Environment Variable NUM_PNFS 1 -# Set Environment Variable FILE_SIZE 50MB -# Set Environment Variable FTP_TYPE FTPS -# ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT} -# MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim -# DR Sim Published Files Equal 0 #Verify 0 file published to DR sim -# ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT} -# Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim -# Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files -# Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim -# DR Redir Sim Downloaded Volume Equal 50 000 000 #Verify 50 000 000 bytes published file data in DR redir sim -# ${cli_cmd_output}= Run Process ${SIMGROUP_ROOT}/simulators-kill.sh -# ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-kill.sh -# - -*** Keywords *** - + Set Environment Variable FTPES_SIMS ftpes-server-vsftpd0:21 diff --git a/tests/dcaegen2-collectors-datafile/testsuites/Strict-Host-Checking-suite/StrictHostChecking.robot b/tests/dcaegen2-collectors-datafile/testsuites/Strict-Host-Checking-suite/StrictHostChecking.robot new file mode 100755 index 00000000..3962d4e5 --- /dev/null +++ b/tests/dcaegen2-collectors-datafile/testsuites/Strict-Host-Checking-suite/StrictHostChecking.robot @@ -0,0 +1,112 @@ +*** Settings *** +Library OperatingSystem +Library RequestsLibrary +Library Process + +Resource ../../resources/common-keywords.robot + +Test Teardown + +*** Variables *** +${CONSUL_UPL_APP} /usr/bin/curl -v http://127.0.0.1:8500/v1/kv/dfc_app0?dc=dc1 -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data-binary @${SIMGROUP_ROOT}/consul/c12_feed2_PM_MEAS.json +${CONSUL_UPL_APP_INSECURE_SFTP} /usr/bin/curl -v http://127.0.0.1:8500/v1/kv/dfc_app0?dc=dc1 -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data-binary @${SIMGROUP_ROOT}/consul/c12_feed2_PM_MEAS_no_strict_host_key_checking.json +${CONSUL_GET_APP} /usr/bin/curl -v http://127.0.0.1:8500/v1/kv/dfc_app0?raw +${CBS_GET_MERGED_CONFIG} /usr/bin/curl -v http://127.0.0.1:10000/service_component_all/dfc_app0 + +*** Test Cases *** + +######### Single file, SFTP, various SFTP Strict host key checking settings + +Verify single event with SFTP file, when host known and strict host key checking enabled. From event poll to published file + [TAGS] DFC_STRICT_HOST_KEY_CHECKING_1 + [Documentation] Verify single event with SFTP file, when host known and strict host key checking enabled. From event poll to published file. + [Setup] Setup Strict Host Key Checking Test ${CONSUL_UPL_APP} all_hosts_keys + + Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim + Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files + Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim + DR Redir Sim Downloaded Volume Equal 1 000 000 #Verify 1 000 000 bytes published file data in DR redir sim + + [Teardown] Test Teardown + +Verify single event with SFTP file, when host unknown and strict host key checking disabled. From event poll to published file + [TAGS] DFC_STRICT_HOST_KEY_CHECKING_2 + [Documentation] Verify single event with SFTP file, when host unknown and strict host key checking disabled. From event poll to published file. + [Setup] Setup Strict Host Key Checking Test ${CONSUL_UPL_APP_INSECURE_SFTP} known_hosts_empty + + Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim + Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files + Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim + DR Redir Sim Downloaded Volume Equal 1 000 000 #Verify 1 000 000 bytes published file data in DR redir sim + + [Teardown] Test Teardown + +Verify single event with SFTP file, when no known hosts file and strict host key checking enabled. From event poll to published file + [TAGS] DFC_STRICT_HOST_KEY_CHECKING_3 + [Documentation] Verify single event with SFTP file, when host unknown and strict host key checking enabled. File not published. + [Setup] Setup Strict Host Key Checking Test ${CONSUL_UPL_APP} no_known_hosts_file + + Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim + Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files + Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim + DR Redir Sim Downloaded Volume Equal 1 000 000 #Verify 1 000 000 bytes published file data in DR redir sim + + [Teardown] Test Teardown + + + +Verify single event with SFTP file, when host unknown and strict host key checking enabled. File not published + [TAGS] DFC_STRICT_HOST_KEY_CHECKING_4 + [Documentation] Verify single event with SFTP file, when host unknown and strict host key checking enabled. File not published. + [Setup] Setup Strict Host Key Checking Test ${CONSUL_UPL_APP} known_hosts_empty + Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim + Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files + Sleep 60 + DR Sim Published Files Equal 0 #Verify no file was published to DR sim + [Teardown] Test Teardown + +*** Keywords *** + +Setup Strict Host Key Checking Test + [Documentation] Sets up strict host key checking test with single 1MB file + [Arguments] ${consul_config_request} ${known_hosts_file} + Set Environment Variable MR_TC --tc100 + Set Environment Variable DR_TC --tc normal + Set Environment Variable DR_REDIR_TC --tc normal + Set Environment Variable MR_GROUPS OpenDcae-c12:PM_MEAS_FILES + Set Environment Variable MR_FILE_PREFIX_MAPPING PM_MEAS_FILES:A + Set Environment Variable DR_REDIR_FEEDS 2:A + Set Environment Variable FTP_FILE_PREFIXES A + Set Environment Variable NUM_FTPFILES 1 + Set Environment Variable NUM_PNFS 1 + Set Environment Variable FILE_SIZE 1MB + Set Environment Variable FTP_TYPE SFTP + Set Environment Variable NUM_FTP_SERVERS 1 + Set Environment Variable DR_FEEDS 2:A + Set Environment Variable DR_REDIR_SIM drsim_redir + Set Environment Variable SFTP_SIMS sftp-server0:22 + Set Environment Variable FTPS_SIMS ftpes-server-vsftpd0:21 + + ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT} + Log To Console Simulator-start: + Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} + MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim + DR Sim Published Files Equal 0 #Verify 0 file published to DR sim + + ${cli_cmd_output}= Run Process ${consul_config_request} shell=yes + Log To Console Consul APP write: + Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} + + ${cli_cmd_output}= Run Process ${CONSUL_GET_APP} shell=yes + Log To Console Consul APP read: + Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} + + ${cli_cmd_output}= Run Process ${CBS_GET_MERGED_CONFIG} shell=yes + Log To Console CBS merged configuration: + Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} + + Sleep 10 + + ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT} env:KNOWN_HOSTS=${known_hosts_file} + Log To Console Dfc-start: + Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} diff --git a/tests/dcaegen2-collectors-datafile/testsuites/Strict-Host-Checking-suite/__init__.robot b/tests/dcaegen2-collectors-datafile/testsuites/Strict-Host-Checking-suite/__init__.robot new file mode 100755 index 00000000..77743849 --- /dev/null +++ b/tests/dcaegen2-collectors-datafile/testsuites/Strict-Host-Checking-suite/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Documentation DFC Strict Host Checking test suite. Single event with single file. diff --git a/tests/dcaegen2-pmmapper/pmmapper/assets/new_radio/A20181004.0000-1000-0015-1000_5G.xml b/tests/dcaegen2-pmmapper/pmmapper/assets/new_radio/A20181004.0000-1000-0015-1000_5G.xml index d826157e..8d42d62c 100644 --- a/tests/dcaegen2-pmmapper/pmmapper/assets/new_radio/A20181004.0000-1000-0015-1000_5G.xml +++ b/tests/dcaegen2-pmmapper/pmmapper/assets/new_radio/A20181004.0000-1000-0015-1000_5G.xml @@ -1,14 +1,14 @@ - - +xsi:schemaLocation="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData"> + - + - + @@ -83,6 +83,6 @@ xsi:schemaLocation="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measD - + - + diff --git a/tests/dcaegen2-pmmapper/pmmapper/assets/new_radio/C20190329.0000-0015.xml b/tests/dcaegen2-pmmapper/pmmapper/assets/new_radio/C20190329.0000-0015.xml index 439d5768..9c1b9857 100644 --- a/tests/dcaegen2-pmmapper/pmmapper/assets/new_radio/C20190329.0000-0015.xml +++ b/tests/dcaegen2-pmmapper/pmmapper/assets/new_radio/C20190329.0000-0015.xml @@ -1,11 +1,11 @@ - + + fileFormatVersion="28.532 V1.0"> - + - + @@ -18,7 +18,7 @@ - + @@ -31,7 +31,7 @@ - + @@ -44,6 +44,6 @@ - + - + diff --git a/tests/dcaegen2-pmmapper/pmmapper/assets/new_radio/valid_metadata.json b/tests/dcaegen2-pmmapper/pmmapper/assets/new_radio/valid_metadata.json index 4c5c84f1..f75adb84 100644 --- a/tests/dcaegen2-pmmapper/pmmapper/assets/new_radio/valid_metadata.json +++ b/tests/dcaegen2-pmmapper/pmmapper/assets/new_radio/valid_metadata.json @@ -7,6 +7,6 @@ "timeZoneOffset": "UTC+05.00", "location": "ftpes://192.168.0.101:22/ftp/rop/A20161224.1045-1100.bin.gz", "compression": "gzip", - "fileFormatType": "org.3GPP.28.550#measData", + "fileFormatType": "org.3GPP.28.532#measData", "fileFormatVersion": "V9" } diff --git a/tests/dcaegen2-pmmapper/pmmapper/assets/pm_filter_regex_config.json b/tests/dcaegen2-pmmapper/pmmapper/assets/pm_filter_regex_config.json new file mode 100644 index 00000000..5cd7146e --- /dev/null +++ b/tests/dcaegen2-pmmapper/pmmapper/assets/pm_filter_regex_config.json @@ -0,0 +1,42 @@ +{ + "pm-mapper-filter": { + "filters":[{ + "pmDefVsn": "1.0", + "nfType": "gnb", + "vendor": "Ericsson", + "measTypes": ["att.*"] + }] + }, + "key_store_path": "/opt/app/pm-mapper/etc/cert.jks.b64", + "key_store_pass_path": "/opt/app/pm-mapper/etc/jks.pass", + "trust_store_path": "/opt/app/pm-mapper/etc/trust.jks.b64", + "trust_store_pass_path": "/opt/app/pm-mapper/etc/trust.pass", + "dmaap_dr_delete_endpoint": "https://dmaap-dr-node:8443/delete", + "dmaap_dr_feed_name": "1", + "aaf_identity": "aaf_admin@people.osaaf.org", + "aaf_password": "demo123456!", + "enable_http": true, + "streams_publishes": { + "dmaap_publisher": { + "type": "message_router", + "dmaap_info": { + "topic_url": "http://message-router:3904/events/org.onap.dmaap.mr.VES_PM", + "client_role": "org.onap.dcae.pmPublisher", + "location": "csit-pmmapper", + "client_id": "1562763644939" + } + } + }, + "streams_subscribes": { + "dmaap_subscriber": { + "type": "data_router", + "dmaap_info": { + "username": "username", + "password": "password", + "location": "csit-pmmapper", + "delivery_url": "http://dcae-pm-mapper:8081/delivery", + "subscriber_id": 1 + } + } + } +} \ No newline at end of file diff --git a/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot b/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot index 96d33a86..0b18320f 100644 --- a/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot +++ b/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot @@ -31,6 +31,7 @@ ${NR-TYPE-A_PM_DATA_FILE_PATH} %{WORKSPACE}/tests/dcaegen2-pmmapper/pm ${NR-TYPE-C_PM_DATA_FILE_PATH} %{WORKSPACE}/tests/dcaegen2-pmmapper/pmmapper/assets/new_radio/C20190329.0000-0015.xml ${CLI_EXEC_VENDOR_FILTER} curl 'http://${CONSUL_IP}:8500/v1/kv/pmmapper?dc=dc1' -X PUT -H 'Accept: application/^Con' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data @$WORKSPACE/tests/dcaegen2-pmmapper/pmmapper/assets/vendor_filter_config.json ${CLI_EXEC_PM_FILTER} curl 'http://${CONSUL_IP}:8500/v1/kv/pmmapper?dc=dc1' -X PUT -H 'Accept: application/^Con' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data @$WORKSPACE/tests/dcaegen2-pmmapper/pmmapper/assets/pm_filter_config.json +${CLI_EXEC_PM_FILTER_regex} curl 'http://${CONSUL_IP}:8500/v1/kv/pmmapper?dc=dc1' -X PUT -H 'Accept: application/^Con' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data @$WORKSPACE/tests/dcaegen2-pmmapper/pmmapper/assets/pm_filter_regex_config.json ${CLI_MESSAGE_ROUTER_TOPIC} curl http://${DMAAP_MR_IP}:3904/events/PM_MAPPER/CG1/C1?timeout=1000 > /tmp/mr.log ${CLI_MR_LOG} cat /tmp/mr.log @@ -39,7 +40,7 @@ ${CLI_MR_LOG} cat /tmp/mr.log Verify PM Mapper Receive Configuraton From Config Binding Service [Tags] PM_MAPPER_01 [Documentation] Verify 3gpp pm mapper successfully receive config data from CBS - CheckLog ${CLI_EXEC_CLI_CONFIG} Received pm-mapper configuration + CheckLog ${CLI_EXEC_CLI_CONFIG} Response code: 200, Server Response Received Verify Health Check returns 200 when a REST GET request to healthcheck url [Tags] PM_MAPPER_02 @@ -138,6 +139,22 @@ Verify that PM Mapper correctly maps an NR Type-C file based on counter filterin SendToDatarouter ${NR-TYPE-C_PM_DATA_FILE_PATH} ${NR_VALID_METADATA_PATH} X-ONAP-RequestID=12 CheckLog ${CLI_EXEC_CLI_PM_LOG} Successfully published VES events to messagerouter +Verify 3GPP PM Mapper maps Type-A file based on counter filtering with regexp + [Tags] PM_MAPPER_13 + [Documentation] Verify 3GPP PM Mapper maps Type-A file based on counter filtering with wildcards/regexp and publish 3gpp perf VES evnets to message router. + [Timeout] 1 minute + ${cli_cmd_output}= Run Process ${CLI_EXEC_PM_FILTER_regex} shell=yes + ${resp}= Get Request mapper_session ${RECONFIGURE_ENDPOINT} + Sleep 5s + SendToDatarouter ${TYPE-A_PM_DATA_FILE_PATH} ${VALID_METADATA_PATH} X-ONAP-RequestID=6 + CheckLog ${CLI_EXEC_CLI_PM_LOG} Successfully published VES events to messagerouter + +Verify that password receive from CBS are successfully encrypted + [Tags] PM_MAPPER_14 + [Documentation] Verify that password receive from CBS are successfully encrypted. + CheckLog ${CLI_EXEC_CLI_CONFIG} "aaf_password": ***** + CheckLog ${CLI_EXEC_CLI_CONFIG} "password": ***** + *** Keywords *** SendToDatarouter @@ -164,4 +181,4 @@ CheckLog VerifyResponse [Arguments] ${actual_response_value} ${expected_response_value} - Should Be Equal As Strings ${actual_response_value} ${expected_response_value} \ No newline at end of file + Should Be Equal As Strings ${actual_response_value} ${expected_response_value} diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json b/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json index 569e9383..b70b41d1 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json @@ -77,6 +77,8 @@ "control_loop_name": "pmsh-control-loop", "operational_policy_name": "pmsh-operational-policy", "cert_path": "/opt/app/pmsh/etc/certs/cert.pem", + "enable_tls": true, + "ca_cert_path": "/opt/app/pmsh/etc/certs/cacert.pem", "streams_publishes": { "policy_pm_publisher": { "dmaap_info": { diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json index 9c9dc6e5..1a027f21 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json @@ -1,7 +1,10 @@ [ { "httpRequest": { - "path": "/events/AAI_EVENT/dcae_pmsh_cg/AAI-EVENT" + "path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event", + "queryStringParameters" : { + "timeout" : [ "1000" ] + } }, "httpResponse": { "statusCode": 200, @@ -21,7 +24,10 @@ }, { "httpRequest": { - "path": "/events/AAI_EVENT/dcae_pmsh_cg/AAI-EVENT" + "path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event", + "queryStringParameters" : { + "timeout" : [ "1000" ] + } }, "httpResponse": { "statusCode": 200, diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json index c0accc8c..e5c4dd84 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json @@ -1,7 +1,10 @@ [ { "httpRequest": { - "path": "/events/AAI_EVENT/dcae_pmsh_cg/AAI-EVENT" + "path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event", + "queryStringParameters" : { + "timeout" : [ "1000" ] + } }, "httpResponse": { "statusCode": 200, @@ -21,7 +24,10 @@ }, { "httpRequest": { - "path": "/events/AAI_EVENT/dcae_pmsh_cg/AAI-EVENT" + "path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event", + "queryStringParameters" : { + "timeout" : [ "1000" ] + } }, "httpResponse": { "statusCode": 200, diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json index cc14f3c9..eba4e4ee 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json @@ -1,7 +1,10 @@ [ { "httpRequest": { - "path": "/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/dcae_pmsh_cg/policy_response_consumer" + "path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input", + "queryStringParameters" : { + "timeout" : [ "1000" ] + } }, "httpResponse": { "statusCode": 200, @@ -21,7 +24,10 @@ }, { "httpRequest": { - "path": "/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/dcae_pmsh_cg/policy_response_consumer" + "path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input", + "queryStringParameters" : { + "timeout" : [ "1000" ] + } }, "httpResponse": { "statusCode": 200, diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-new.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-new.json index 79bfb44f..f73fee82 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-new.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-new.json @@ -1,7 +1,10 @@ [ { "httpRequest": { - "path": "/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/dcae_pmsh_cg/policy_response_consumer" + "path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input", + "queryStringParameters" : { + "timeout" : [ "1000" ] + } }, "httpResponse": { "statusCode": 200, @@ -21,7 +24,10 @@ }, { "httpRequest": { - "path": "/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/dcae_pmsh_cg/policy_response_consumer" + "path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input", + "queryStringParameters" : { + "timeout" : [ "1000" ] + } }, "httpResponse": { "statusCode": 200, diff --git a/tests/dcaegen2-services-pmsh/testcases/pmsh.robot b/tests/dcaegen2-services-pmsh/testcases/pmsh.robot index 08ab197c..a2b8cad6 100644 --- a/tests/dcaegen2-services-pmsh/testcases/pmsh.robot +++ b/tests/dcaegen2-services-pmsh/testcases/pmsh.robot @@ -64,7 +64,7 @@ Verify Policy response on MR is handled [Documentation] Verify policy response on MR is handled [Timeout] 40 seconds SimulatePolicyResponse ${MR_EXPECTATION_POLICY_RESPONSE_PNF_EXISTING} - Sleep 7 seconds Ensure Policy response on MR is picked up + Sleep 15 seconds Ensure Policy response on MR is picked up ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT} Should Be Equal As Strings ${resp.json()[0]['network_functions'][0]['nf_sub_status']} CREATED @@ -73,7 +73,7 @@ Verify AAI event on MR detailing new PNF being detected is handled [Documentation] Verify PNF created AAI event on MR is handled [Timeout] 30 seconds SimulateNewPNF - Sleep 12 seconds Ensure AAI event on MR is picked up + Sleep 15 seconds Ensure AAI event on MR is picked up ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT} Should Be Equal As Strings ${resp.json()[0]['network_functions'][1]['nf_name']} pnf_newly_discovered Should Be Equal As Strings ${resp.json()[0]['network_functions'][1]['orchestration_status']} Active @@ -105,7 +105,7 @@ SetAdministrativeStateToUnlocked SimulateNewPNF ${data}= Get Data From File ${MR_EXPECTATION_AAI_PNF_CREATED} - ${resp} = Put Request mr_sim_session /clear data={"path": "/events/AAI_EVENT/dcae_pmsh_cg/AAI-EVENT"} + ${resp} = Put Request mr_sim_session /clear data={"path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event"} Should Be True ${resp.status_code} == 200 ${resp} = Put Request mr_sim_session /expectation data=${data} Should Be True ${resp.status_code} == 201 @@ -113,14 +113,14 @@ SimulateNewPNF SimulatePolicyResponse [Arguments] ${expected_contents} ${data}= Get Data From File ${expected_contents} - ${resp} = Put Request mr_sim_session /clear data={"path": "/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS/dcae_pmsh_cg/policy_response_consumer"} + ${resp} = Put Request mr_sim_session /clear data={"path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input"} Should Be True ${resp.status_code} == 200 ${resp} = Put Request mr_sim_session /expectation data=${data} Should Be True ${resp.status_code} == 201 SimulateDeletedPNF ${data}= Get Data From File ${MR_EXPECTATION_AAI_PNF_REMOVED} - ${resp} = Put Request mr_sim_session /clear data={"path": "/events/AAI_EVENT/dcae_pmsh_cg/AAI-EVENT"} + ${resp} = Put Request mr_sim_session /clear data={"path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event"} Should Be True ${resp.status_code} == 200 ${resp} = Put Request mr_sim_session /expectation data=${data} Should Be True ${resp.status_code} == 201 diff --git a/tests/dcaegen2/testcases/01__no_auth_tests.robot b/tests/dcaegen2/testcases/01__no_auth_tests.robot new file mode 100644 index 00000000..7e7f9767 --- /dev/null +++ b/tests/dcaegen2/testcases/01__no_auth_tests.robot @@ -0,0 +1,107 @@ +*** Settings *** +Resource ./resources/dcae_keywords.robot +*** Test Cases *** +VES Collector HTTP Health Check + [Tags] DCAE-VESC-R1 DCAE-VESC-HC + [Documentation] Run healthcheck over HTTP + Run Healthcheck ${http_session} + +Publish Single VES VNF Measurement Event API V7 + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with valid data to /eventListener/v7 endpoint and expect 202 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7} 202 ab305d54-85b4-a31b-7db2-fb6b9e546015 + +Publish Single VES VNF Measurement Event with Standard Defined Fields API V7 + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with valid data with Standard Defined Fields to /eventListener/v7 endpoint and expect 202 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7_STND_DEF_FIELDS} 202 stndDefined-gNB-Nokia-PowerLost unauthenticated.SEC_OTHER_OUTPUT + +Publish Single VES VNF Measurement Event with wrong JSON + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with invalid data to /eventListener/v7 endpoint and expect 400 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_INVALID_JSON_V7} 400 + +Publish Single VES VNF Measurement Event with missing mandatory parameter + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with lack of one of the mandatory parameters "domain" to /eventListener/v7 endpoint and expect 400 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_MISSING_MANDATORY_PARAMETER_V7} 400 + +Publish Single VES VNF Measurement Event with empty json + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with empty json to /eventListener/v7 endpoint and expect 400 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_EMPTY_JSON} 400 + +Publish Single VES VNF Measurement Event with parameter out of schema + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with parameter which is not defined in schema and send to /eventListener/v7 endpoint. Expected 400 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_PARAMETER_OUT_OF_SCHEMA_V7} 400 + +Publish Single VES VNF Measurement Event with No Auth over HTTPS + [Tags] DCAE-VESC-R1 + [Documentation] Post single event over HTTPS with authentication disabled and expect ConnectionError + @{err_content} Create List Errno 111 + Send Request And Expect Error Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7} ConnectionError:* @{err_content} + +Publish Single VES VoLTE Fault Event + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with valid data to /eventListener/v5 endpoint and expect 202 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_ANY_EVENT_PATH} ${EVENT_DATA_FILE} 202 ab305d54-85b4-a31b-7db2-fb6b9e546015 + +Publish Single VES VNF Measurement Event API V5 + [Tags] DCAE-VESC-R1 + [Documentation] Post single measurement event with valid data to /eventListener/v5 endpoint and expect 202 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_ANY_EVENT_PATH} ${EVENT_MEASURE_FILE} 202 0b2b5790-3673-480a-a4bd-5a00b88e5af6 + +Publish VES VoLTE Fault Batch Events + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with valid data to /eventListener/v5/eventBatch endpoint and expect 202 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_BATCH_EVENT_PATH} ${EVENT_BATCH_DATA_FILE} 202 ab305d54-85b4-a31b-7db2-fb6b9e546025 + +Publish VES Batch Events with empty json + [Tags] DCAE-VESC-R1 + [Documentation] Post empty json to /eventListener/v7/eventBatch endpoint and expect 400 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_BATCH_EVENT_ENDPOINT_V7} ${VES_EMPTY_JSON} 400 + +Publish VES Batch Events with missing mandatory parameter + [Tags] DCAE-VESC-R1 + [Documentation] Post event list where one of the events doesn't have mandatory domain param, to /eventListener/v7/eventBatch endpoint and expect 400 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_BATCH_EVENT_ENDPOINT_V7} ${VES_BATCH_MISSING_MANDATORY_PARAM_V7} 400 + +Publish VES Batch Events wih parameter out of schema + [Tags] DCAE-VESC-R1 + [Documentation] Post event list where one of the events have additional dummy param, to /eventListener/v7/eventBatch endpoint and expect 400 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_BATCH_EVENT_ENDPOINT_V7} ${VES_BATCH_PARAM_OUT_OF_SCHEMA_V7} 400 + +Publish VES Event With Invalid Method + [Tags] DCAE-VESC-R1 + [Documentation] Use invalid Put instead of Post method to expect 405 Response Status Code + Log Send HTTP Request with invalid method Put instead of Post + Send Request And Validate Response Publish Event To VES Collector With Put Method ${http_session} ${VES_ANY_EVENT_PATH} ${EVENT_DATA_FILE} 405 + +Publish VES Event With Invalid URL Path + [Tags] DCAE-VESC-R1 + [Documentation] Post single event to invalid url path and expect 404 Response Status Code + Log Send HTTP Request with invalid /listener/v5/ instead of /eventListener/v5 path + Send Request And Validate Response Publish Event To VES Collector ${http_session} /listener/v5/ ${EVENT_DATA_FILE} 404 + +Publish 'Other' Registration Event + [Tags] DCAE-VESC-R1 + [Documentation] Post an event aligned with “other” domain and expect HTTP 202 Accepeted Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_ANY_EVENT_PATH} ${EVENT_PNF_REGISTRATION} 202 QTFCOC540002E-reg + +Publish VES Event With Invalid Method V7 + [Tags] DCAE-VESC-R1 + [Documentation] Use invalid Put instead of Post method to expect 405 Response Status Code + Log Send HTTP Request with invalid method Put instead of Post + Send Request And Validate Response Publish Event To VES Collector With Put Method ${http_session} ${VES_EVENTLISTENER_V7} ${EVENT_DATA_FILE} 405 + +Publish VES Event With Invalid URL Path V7 + [Tags] DCAE-VESC-R1 + [Documentation] Post single event to invalid url path and expect 404 Response Status Code + Log Send HTTP Request with invalid /listener/v5/ instead of /eventListener/v5 path + Send Request And Validate Response Publish Event To VES Collector ${http_session} /listener/v7/ ${EVENT_DATA_FILE} 404 + +Publish PNF Registration Event + [Tags] DCAE-VESC-R1 + [Documentation] Post PNF Registration event and expect HTTP 202 Accepeted Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${EVENT_PNF_REGISTRATION_V7} 202 registration_38407540 diff --git a/tests/dcaegen2/testcases/dcae_ves.robot b/tests/dcaegen2/testcases/02__cert_basic_auth_tests.robot similarity index 53% rename from tests/dcaegen2/testcases/dcae_ves.robot rename to tests/dcaegen2/testcases/02__cert_basic_auth_tests.robot index 4a4a079d..1e221ce9 100644 --- a/tests/dcaegen2/testcases/dcae_ves.robot +++ b/tests/dcaegen2/testcases/02__cert_basic_auth_tests.robot @@ -1,123 +1,6 @@ *** Settings *** -Documentation Run healthchecks for DCAE VES -... Testing /eventListener/v7 and /eventListener/v7/eventBatch endpoints for DCEA VES v7. -... Testing /eventListener/v5 and /eventListener/v5/eventBatch for DCEA VES v5 with various event feeds from VoLTE, vFW and PNF -Library RequestsLibrary -Library OperatingSystem -Library Collections -Library DcaeLibrary Resource ./resources/dcae_keywords.robot - -Test Teardown Cleanup VES Events -Suite Setup Run keywords VES Collector Suite Setup DMaaP Generate Certs Create sessions Create header -Suite Teardown Run keywords VES Collector Suite Shutdown DMaaP Remove Certs - *** Test Cases *** - -#No authentication tests - -VES Collector HTTP Health Check - [Tags] DCAE-VESC-R1 DCAE-VESC-HC - [Documentation] Run healthcheck over HTTP - Run Healthcheck ${http_session} - -Publish Single VES VNF Measurement Event API V7 - [Tags] DCAE-VESC-R1 - [Documentation] Post single event with valid data to /eventListener/v7 endpoint and expect 202 Response Status Code - Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7} 202 ab305d54-85b4-a31b-7db2-fb6b9e546015 - -Publish Single VES VNF Measurement Event with wrong JSON - [Tags] DCAE-VESC-R1 - [Documentation] Post single event with invalid data to /eventListener/v7 endpoint and expect 400 Response Status Code - Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_INVALID_JSON_V7} 400 - -Publish Single VES VNF Measurement Event with missing mandatory parameter - [Tags] DCAE-VESC-R1 - [Documentation] Post single event with lack of one of the mandatory parameters "domain" to /eventListener/v7 endpoint and expect 400 Response Status Code - Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_MISSING_MANDATORY_PARAMETER_V7} 400 - -Publish Single VES VNF Measurement Event with empty json - [Tags] DCAE-VESC-R1 - [Documentation] Post single event with empty json to /eventListener/v7 endpoint and expect 400 Response Status Code - Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_EMPTY_JSON} 400 - -Publish Single VES VNF Measurement Event with parameter out of schema - [Tags] DCAE-VESC-R1 - [Documentation] Post single event with parameter which is not defined in schema and send to /eventListener/v7 endpoint. Expected 400 Response Status Code - Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_PARAMETER_OUT_OF_SCHEMA_V7} 400 - -Publish Single VES VNF Measurement Event with No Auth over HTTPS - [Tags] DCAE-VESC-R1 - [Documentation] Post single event over HTTPS with authentication disabled and expect ConnectionError - @{err_content} Create List Errno 111 - Send Request And Expect Error Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7} ConnectionError:* @{err_content} - -Publish Single VES VoLTE Fault Event - [Tags] DCAE-VESC-R1 - [Documentation] Post single event with valid data to /eventListener/v5 endpoint and expect 202 Response Status Code - Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_ANY_EVENT_PATH} ${EVENT_DATA_FILE} 202 ab305d54-85b4-a31b-7db2-fb6b9e546015 - -Publish Single VES VNF Measurement Event API V5 - [Tags] DCAE-VESC-R1 - [Documentation] Post single measurement event with valid data to /eventListener/v5 endpoint and expect 202 Response Status Code - Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_ANY_EVENT_PATH} ${EVENT_MEASURE_FILE} 202 0b2b5790-3673-480a-a4bd-5a00b88e5af6 - -Publish VES VoLTE Fault Batch Events - [Tags] DCAE-VESC-R1 - [Documentation] Post single event with valid data to /eventListener/v5/eventBatch endpoint and expect 202 Response Status Code - Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_BATCH_EVENT_PATH} ${EVENT_BATCH_DATA_FILE} 202 ab305d54-85b4-a31b-7db2-fb6b9e546025 - -Publish VES Batch Events with empty json - [Tags] DCAE-VESC-R1 - [Documentation] Post empty json to /eventListener/v7/eventBatch endpoint and expect 400 Response Status Code - Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_BATCH_EVENT_ENDPOINT_V7} ${VES_EMPTY_JSON} 400 - -Publish VES Batch Events with missing mandatory parameter - [Tags] DCAE-VESC-R1 - [Documentation] Post event list where one of the events doesn't have mandatory domain param, to /eventListener/v7/eventBatch endpoint and expect 400 Response Status Code - Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_BATCH_EVENT_ENDPOINT_V7} ${VES_BATCH_MISSING_MANDATORY_PARAM_V7} 400 - -Publish VES Batch Events wih parameter out of schema - [Tags] DCAE-VESC-R1 - [Documentation] Post event list where one of the events have additional dummy param, to /eventListener/v7/eventBatch endpoint and expect 400 Response Status Code - Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_BATCH_EVENT_ENDPOINT_V7} ${VES_BATCH_PARAM_OUT_OF_SCHEMA_V7} 400 - -Publish VES Event With Invalid Method - [Tags] DCAE-VESC-R1 - [Documentation] Use invalid Put instead of Post method to expect 405 Response Status Code - Log Send HTTP Request with invalid method Put instead of Post - Send Request And Validate Response Publish Event To VES Collector With Put Method ${http_session} ${VES_ANY_EVENT_PATH} ${EVENT_DATA_FILE} 405 - -Publish VES Event With Invalid URL Path - [Tags] DCAE-VESC-R1 - [Documentation] Post single event to invalid url path and expect 404 Response Status Code - Log Send HTTP Request with invalid /listener/v5/ instead of /eventListener/v5 path - Send Request And Validate Response Publish Event To VES Collector ${http_session} /listener/v5/ ${EVENT_DATA_FILE} 404 - -Publish 'Other' Registration Event - [Tags] DCAE-VESC-R1 - [Documentation] Post an event aligned with “other” domain and expect HTTP 202 Accepeted Response Status Code - Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_ANY_EVENT_PATH} ${EVENT_PNF_REGISTRATION} 202 QTFCOC540002E-reg - -Publish VES Event With Invalid Method V7 - [Tags] DCAE-VESC-R1 - [Documentation] Use invalid Put instead of Post method to expect 405 Response Status Code - Log Send HTTP Request with invalid method Put instead of Post - Send Request And Validate Response Publish Event To VES Collector With Put Method ${http_session} ${VES_EVENTLISTENER_V7} ${EVENT_DATA_FILE} 405 - -Publish VES Event With Invalid URL Path V7 - [Tags] DCAE-VESC-R1 - [Documentation] Post single event to invalid url path and expect 404 Response Status Code - Log Send HTTP Request with invalid /listener/v5/ instead of /eventListener/v5 path - Send Request And Validate Response Publish Event To VES Collector ${http_session} /listener/v7/ ${EVENT_DATA_FILE} 404 - -Publish PNF Registration Event - [Tags] DCAE-VESC-R1 - [Documentation] Post PNF Registration event and expect HTTP 202 Accepeted Response Status Code - Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${EVENT_PNF_REGISTRATION_V7} 202 registration_38407540 - -# Auth by certificate and basic auth username / password - Enable VESC HTTPS with certBasicAuth [Tags] DCAE-VESC-R1 DCAE-VESC-HC [Documentation] Enable VESC Https and Authentication and Run Health Check @@ -127,7 +10,6 @@ Enable VESC HTTPS with certBasicAuth VES Collector HTTP Health Check with certBasicAuth [Tags] DCAE-VESC-R1 DCAE-VESC-HC [Documentation] Run healthcheck over HTTP with certBasicAuth - Enable VESC with certBasicAuth Run Healthcheck ${http_session} Healthcheck with Outdated Cert @@ -171,6 +53,12 @@ Publish Single VES VNF Measurement Event with certBasicAuth over HTTPS [Documentation] Post single event with valid data and valid username/password to /eventListener/v7 endpoint over HTTPS and expect 202 Response Status Code Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7} 202 ab305d54-85b4-a31b-7db2-fb6b9e546015 +Publish Single VES VNF Measurement Event with Standard Defined Fields with certBasicAuth over HTTPS + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with valid data with Standard Defined Fields and valid username/password to /eventListener/v7 endpoint over HTTPS and expect 202 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7_STND_DEF_FIELDS} 202 stndDefined-gNB-Nokia-PowerLost + + Publish Single VES VNF Measurement Event over HTTPS with wrong JSON [Tags] DCAE-VESC-R1 [Documentation] Post single event with invalid data and valid username/password to /eventListener/v7 endpoint over HTTPS and expect 400 Response Status Code diff --git a/tests/dcaegen2/testcases/__init__.robot b/tests/dcaegen2/testcases/__init__.robot index e69de29b..9f34cd82 100644 --- a/tests/dcaegen2/testcases/__init__.robot +++ b/tests/dcaegen2/testcases/__init__.robot @@ -0,0 +1,9 @@ +*** Settings *** +Documentation Run healthchecks for DCAE VES +... Testing /eventListener/v7 and /eventListener/v7/eventBatch endpoints for DCEA VES v7. +... Testing /eventListener/v5 and /eventListener/v5/eventBatch for DCEA VES v5 with various event feeds from VoLTE, vFW and PNF +Resource ./resources/dcae_keywords.robot + +Test Teardown Cleanup VES Events +Suite Setup Run keywords VES Collector Suite Setup DMaaP Generate Certs Create sessions Create header +Suite Teardown Run keywords VES Collector Suite Shutdown DMaaP Remove Certs \ No newline at end of file diff --git a/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields.json b/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields.json new file mode 100644 index 00000000..5d40b9d9 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields.json @@ -0,0 +1,49 @@ +{ + "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": { + "header": { + "uri": "xyz", + "notificationId": "xyz", + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz" + }, + "body": { + "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" + } + } +} \ No newline at end of file diff --git a/tests/dcaegen2/testcases/resources/DMaaP.py b/tests/dcaegen2/testcases/resources/DMaaP.py index 500afd5d..4c245614 100644 --- a/tests/dcaegen2/testcases/resources/DMaaP.py +++ b/tests/dcaegen2/testcases/resources/DMaaP.py @@ -106,14 +106,16 @@ class DMaaPHandler(BaseHTTPServer.BaseHTTPRequestHandler): ''' if resp_code == 0: + topic = self.extract_topic_from_path() content_len = int(self.headers.getheader('content-length', 0)) post_body = self.rfile.read(content_len) indx = post_body.index("{") if indx != 0: post_body = post_body[indx:] - - if not enque_event(post_body): + + event = "\""+topic+"\":" + post_body + if not enque_event(event): print "enque event fails" global EvtSchema @@ -180,6 +182,9 @@ class DMaaPHandler(BaseHTTPServer.BaseHTTPRequestHandler): ''' return + def extract_topic_from_path(self): + return self.path["/events/".__len__():] + def do_GET(self): """Serve a GET request.""" f = self.send_head() diff --git a/tests/dcaegen2/testcases/resources/DcaeLibrary.py b/tests/dcaegen2/testcases/resources/DcaeLibrary.py index 6b96826c..a9d5def8 100644 --- a/tests/dcaegen2/testcases/resources/DcaeLibrary.py +++ b/tests/dcaegen2/testcases/resources/DcaeLibrary.py @@ -87,6 +87,18 @@ class DcaeLibrary(object): time.sleep(5) return + @staticmethod + def dmaap_message_receive_on_topic(evtobj, topic): + + evt_str = DMaaP.deque_event() + while evt_str != None: + if evtobj in evt_str and topic in evt_str: + logger.info("DMaaP Receive Expected Publish Event:\n" + evt_str) + logger.info("On Expected Topic:\n" + topic) + return 'true' + evt_str = DMaaP.deque_event() + return 'false' + @staticmethod def dmaap_message_receive(evtobj, action='contain'): diff --git a/tests/dcaegen2/testcases/resources/collector.properties b/tests/dcaegen2/testcases/resources/collector.properties index c555e485..71a38737 100755 --- a/tests/dcaegen2/testcases/resources/collector.properties +++ b/tests/dcaegen2/testcases/resources/collector.properties @@ -25,8 +25,6 @@ collector.service.secure.port=8443 # auth.method flags: # # noAuth - default option - no security (http) -# certOnly - auth by certificate (https) -# basicAuth - auth by basic auth username and password (https) # certBasicAuth - auth by certificate and basic auth username / password (https) auth.method=certBasicAuth @@ -50,16 +48,16 @@ collector.truststore.passwordfile=etc/trustpasswordfile ## default no validation checkflag (-1) ## If enabled (1) - schemafile location must be specified 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.0.1.json\"} +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 +## 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 collector.dmaapfile=./etc/DmaapConfig.json ## Event transformation Flag - when set expects configurable transformation ## defined under ./etc/eventTransform.json ## Enabled by default; to disable set to 0 -event.transform.flag=0 +event.transform.flag=1 # Describes at what frequency (measured in minutes) should application try to fetch config from CBS collector.dynamic.config.update.frequency=5 diff --git a/tests/dcaegen2/testcases/resources/dcae_keywords.robot b/tests/dcaegen2/testcases/resources/dcae_keywords.robot index 89a87868..059372fb 100644 --- a/tests/dcaegen2/testcases/resources/dcae_keywords.robot +++ b/tests/dcaegen2/testcases/resources/dcae_keywords.robot @@ -18,23 +18,23 @@ Create sessions ${wrong_certs}= Create List ${VESC_WRONG_CERT} ${VESC_WRONG_KEY} ${outdated_certs}= Create List ${VESC_OUTDATED_CERT} ${VESC_OUTDATED_KEY} Create Session dcae_vesc_url ${VESC_URL} - Set Suite Variable ${http_session} dcae_vesc_url + Set Global Variable ${http_session} dcae_vesc_url Create Session dcae_vesc_url_https ${VESC_URL_HTTPS} auth=${auth} disable_warnings=1 - Set Suite Variable ${https_basic_auth_session} dcae_vesc_url_https + Set Global Variable ${https_basic_auth_session} dcae_vesc_url_https Create Session dcae_vesc_url_https_wrong_auth ${VESC_URL_HTTPS} auth=${wrong_auth} disable_warnings=1 - Set Suite Variable ${https_wrong_auth_session} dcae_vesc_url_https_wrong_auth + Set Global Variable ${https_wrong_auth_session} dcae_vesc_url_https_wrong_auth Create Client Cert Session dcae_vesc_url_https_cert ${VESC_URL_HTTPS} client_certs=${certs} disable_warnings=1 - Set Suite Variable ${https_valid_cert_session} dcae_vesc_url_https_cert + Set Global Variable ${https_valid_cert_session} dcae_vesc_url_https_cert Create Client Cert Session dcae_vesc_url_https_wrong_cert ${VESC_URL_HTTPS} client_certs=${wrong_certs} disable_warnings=1 verify=${False} - Set Suite Variable ${https_invalid_cert_session} dcae_vesc_url_https_wrong_cert + Set Global Variable ${https_invalid_cert_session} dcae_vesc_url_https_wrong_cert Create Client Cert Session dcae_vesc_url_https_outdated_cert ${VESC_URL_HTTPS} client_certs=${outdated_certs} disable_warnings=1 verify=${False} - Set Suite Variable ${https_outdated_cert_session} dcae_vesc_url_https_outdated_cert + Set Global Variable ${https_outdated_cert_session} dcae_vesc_url_https_outdated_cert Create Session dcae_vesc_url_https_wo_auth ${VESC_URL_HTTPS} disable_warnings=1 - Set Suite Variable ${https_no_cert_no_auth_session} dcae_vesc_url_https_wo_auth + Set Global Variable ${https_no_cert_no_auth_session} dcae_vesc_url_https_wo_auth Create header ${headers}= Create Dictionary Content-Type=application/json - Set Suite Variable ${suite_headers} ${headers} + Set Global Variable ${suite_headers} ${headers} Get DCAE Nodes [Documentation] Get DCAE Nodes from Consul Catalog @@ -141,19 +141,20 @@ Publish Event To VES Collector With Put Method 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 + [Arguments] ${keyword} ${session} ${evtpath} ${evtjson} ${resp_code} ${msg_code}=None ${topic}=None ${evtdata}= Get Data From File ${evtjson} ${resp}= Run Keyword ${keyword} ${session} ${evtpath} ${evtdata} Log Receive HTTPS Status code ${resp.status_code} Should Be Equal As Strings ${resp.status_code} ${resp_code} ${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} + Run Keyword If '${msg_code}' != 'None' Check Whether Message Received ${msg_code} ${topic} Check Whether Message Received [Documentation] Validare if message has been received - [Arguments] ${msg_code} - ${ret}= DMaaP Message Receive ${msg_code} + [Arguments] ${msg_code} ${topic} + ${ret}= Run Keyword If '${topic}' != 'None' DMaaP Message Receive On Topic ${msg_code} ${topic} + ... ELSE DMaaP Message Receive ${msg_code} Should Be Equal As Strings ${ret} true Send Request And Expect Error diff --git a/tests/dcaegen2/testcases/resources/dcae_properties.robot b/tests/dcaegen2/testcases/resources/dcae_properties.robot index 961bb46d..e9626411 100644 --- a/tests/dcaegen2/testcases/resources/dcae_properties.robot +++ b/tests/dcaegen2/testcases/resources/dcae_properties.robot @@ -30,6 +30,7 @@ ${VES_THROTTLE_STATE_EVENT_PATH} /eventListener/v5/clientThrottlingState ${VES_EVENTLISTENER_V7} /eventListener/v7 ${VES_BATCH_EVENT_ENDPOINT_V7} /eventListener/v7/eventBatch ${VES_VALID_JSON_V7} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_valid.json +${VES_VALID_JSON_V7_STND_DEF_FIELDS} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields.json ${VES_INVALID_JSON_V7} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_invalid.json ${VES_PARAMETER_OUT_OF_SCHEMA_V7} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_parameter_out_of_schema.json ${VES_MISSING_MANDATORY_PARAMETER_V7} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_missing_mandatory_parameter.json diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/BulkpmE2E.robot b/tests/usecases-5G-bulkpm/5G-bulkpm/BulkpmE2E.robot index fe3b1cec..660c5f64 100644 --- a/tests/usecases-5G-bulkpm/5G-bulkpm/BulkpmE2E.robot +++ b/tests/usecases-5G-bulkpm/5G-bulkpm/BulkpmE2E.robot @@ -25,7 +25,7 @@ ${CLI_EXEC_CLI_DFC_LOG_GREP} grep "Datafile file published" %{WORKSP ${CLI_EXEC_CLI_FILECONSUMER_CP} docker cp fileconsumer-node:/opt/app/subscriber/delivery/A20181002.0000-1000-0015-1000_5G.xml.M %{WORKSPACE} ${CLI_EXEC_RENAME_METADATA} mv %{WORKSPACE}/A20181002.0000-1000-0015-1000_5G.xml.M %{WORKSPACE}/archives/metadata.json ${CLI_EXEC_CLI_PMMAPPER_LOG} docker exec dcaegen2-pm-mapper /bin/sh -c "cat /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log" > %{WORKSPACE}/archives/pmmapper_docker.log -${CLI_EXEC_CLI_PMMAPPER_LOG_GREP} grep "XML validation successful Event" %{WORKSPACE}/archives/pmmapper_docker.log +${CLI_EXEC_CLI_PMMAPPER_LOG_GREP} grep "XML validation successful" %{WORKSPACE}/archives/pmmapper_docker.log ${CLI_EXEC_CLI_PMMAPPER_LOG_GREP_VES} grep "Successfully published VES events to messagerouter" %{WORKSPACE}/archives/pmmapper_docker.log ${metadataSchemaPath} %{WORKSPACE}/tests/usecases-5G-bulkpm/5G-bulkpm/assets/metadata.schema.json ${metadataJsonPath} %{WORKSPACE}/archives/metadata.json @@ -113,7 +113,7 @@ Verify PM-Mapper successfully receives uncompressed the PM XML file ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_PMMAPPER_LOG_GREP} shell=yes Log ${cli_cmd_output.stdout} Should Be Equal As Strings ${cli_cmd_output.rc} 0 - Should Contain ${cli_cmd_output.stdout} XML validation successful Event + Should Contain ${cli_cmd_output.stdout} XML validation successful Verify PM-Mapper successfully publishes VES event the Message Router [Tags] Bulk_PM_E2E_08 diff --git a/tests/vfc/nfvo-driver-ems/test.robot b/tests/vfc/nfvo-driver-ems/test.robot deleted file mode 100755 index 29aa10a5..00000000 --- a/tests/vfc/nfvo-driver-ems/test.robot +++ /dev/null @@ -1,21 +0,0 @@ -*** Settings *** -Library Collections -Library RequestsLibrary -Library OperatingSystem -Library json - -*** Variables *** -@{return_ok_list}= 200 201 202 -${queryswagger_url} /api/emsdriver/v1/swagger.json - -*** Test Cases *** -EMSDriverSwaggerTest - [Documentation] query swagger info of emsdriver - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${EMS_DRV_IP}:8206 headers=${headers} - ${resp}= Get Request web_session ${queryswagger_url} - ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - ${response_json} json.loads ${resp.content} - ${swagger_version}= Convert To String ${response_json['swagger']} - Should Be Equal ${swagger_version} 2.0 diff --git a/tests/vfc/nfvo-driver-sfc/test.robot b/tests/vfc/nfvo-driver-sfc/test.robot deleted file mode 100644 index 13115943..00000000 --- a/tests/vfc/nfvo-driver-sfc/test.robot +++ /dev/null @@ -1,21 +0,0 @@ -*** settings *** -Library Collections -Library RequestsLibrary -Library OperatingSystem -Library json - -*** Variables *** -@{return_ok_list}= 200 201 202 -${queryswagger_url} /api/ztesdncdriver/v1/swagger - -*** Test Cases *** -ZteSdncDriverSwaggerTest - [Documentation] query swagger info of ztesdncdriver - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${SFC_DRV_IP}:8411 headers=${headers} - ${resp}= Get Request web_session ${queryswagger_url} - ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - ${response_json} json.loads ${resp.content} - ${swagger_version}= Convert To String ${response_json['swagger']} - Should Be Equal ${swagger_version} 2.0 diff --git a/tests/vfc/nfvo-multivimproxy/test.robot b/tests/vfc/nfvo-multivimproxy/test.robot deleted file mode 100644 index fab3694e..00000000 --- a/tests/vfc/nfvo-multivimproxy/test.robot +++ /dev/null @@ -1,24 +0,0 @@ -*** settings *** -Resource ../../common.robot -Library Collections -Library RequestsLibrary -Library simplejson -Library OperatingSystem -Library json -Library HttpLibrary.HTTP - -*** Variables *** -@{return_ok_list}= 200 201 202 -${queryswagger_url} /api/multivimproxy/v1/swagger.json - -*** Test Cases *** -SwaggerFuncTest - [Documentation] query swagger info rest test - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${RESMGR_IP}:8481 headers=${headers} - ${resp}= Get Request web_session ${queryswagger_url} - ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - ${response_json} json.loads ${resp.content} - ${swagger_version}= Convert To String ${response_json['swagger']} - Should Be Equal ${swagger_version} 2.0 \ No newline at end of file diff --git a/tests/vfc/nfvo-resmanagement/test.robot b/tests/vfc/nfvo-resmanagement/test.robot deleted file mode 100644 index 2f247553..00000000 --- a/tests/vfc/nfvo-resmanagement/test.robot +++ /dev/null @@ -1,24 +0,0 @@ -*** settings *** -Resource ../../common.robot -Library Collections -Library RequestsLibrary -Library simplejson -Library OperatingSystem -Library json -Library HttpLibrary.HTTP - -*** Variables *** -@{return_ok_list}= 200 201 202 -${queryswagger_url} /api/resmgr/v1/swagger.json - -*** Test Cases *** -SwaggerFuncTest - [Documentation] query swagger info rest test - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${RESMGR_IP}:8480 headers=${headers} - ${resp}= Get Request web_session ${queryswagger_url} - ${responese_code}= Convert To String ${resp.status_code} - List Should Contain Value ${return_ok_list} ${responese_code} - ${response_json} json.loads ${resp.content} - ${swagger_version}= Convert To String ${response_json['swagger']} - Should Be Equal ${swagger_version} 2.0 \ No newline at end of file diff --git a/tests/vfc/nfvo-wfengine/workflow.robot b/tests/vfc/nfvo-wfengine/workflow.robot deleted file mode 100644 index 8039ae17..00000000 --- a/tests/vfc/nfvo-wfengine/workflow.robot +++ /dev/null @@ -1,113 +0,0 @@ -*** Settings *** -Resource ../../common.robot -Library Collections -Library json -Library OperatingSystem -Library RequestsLibrary -Library HttpLibrary.HTTP - -*** Variables *** -${MSB_IP} 127.0.0.1 -${MSB_PORT} 10550 -${ACTIVITI_IP} 127.0.0.1 -${ACTIVITI_PORT} 8804 -${MGRSERVICE_IP} 127.0.0.1 -${MGRSERVICE_PORT} 8805 -${processId} demo -${deployid} 0 -${bmpfilepath} ${SCRIPTS}/nfvo-wfengine/demo.bpmn20.xml - -*** Test Cases *** -Deploy BPMN File Test On Activiti - [Documentation] Check if the test bpmn file can be deployed in activiti engine - ${auth}= Create List kermit kermit - ${headers}= Create Dictionary Accept=application/json - Create Session web_session http://${ACTIVITI_IP}:${ACTIVITI_PORT} headers=${headers} auth=${auth} - ${files}= evaluate {"file":open('${bmpfilepath}','rb')} - ${resp}= Post Request web_session /activiti-rest/service/repository/deployments files=${files} - Should Be Equal ${resp.status_code} ${201} - Log ${resp.json()} - ${deployedId}= Set Variable ${resp.json()["id"]} - Set Global Variable ${deployedId} - -Exectue BPMN File Testt On Activiti - [Documentation] Check if the test bpmn file can be exectued in activiti engine - ${headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Basic a2VybWl0Omtlcm1pdA== - Create Session web_session http://${ACTIVITI_IP}:${ACTIVITI_PORT} headers=${headers} - ${body} Create Dictionary processDefinitionKey=${processId} - ${body} dumps ${body} - ${resp}= Post Request web_session /activiti-rest/service/runtime/process-instances ${body} - Should Be Equal ${resp.status_code} ${201} - -UnDeploy BPMN File Testt On Activiti - [Documentation] Check if the test bpmn file can be undeployed in activiti engine - log ${deployedId} - ${auth}= Create List kermit kermit - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${ACTIVITI_IP}:${ACTIVITI_PORT} headers=${headers} auth=${auth} - ${resp}= Delete Request web_session /activiti-rest/service/repository/deployments/${deployedId}?cascade=true - Should Be Equal ${resp.status_code} ${204} - -Deploy BPMN File Test On MgrService - [Documentation] Check if the test bpmn file can be deployed in Management Service - ${auth}= Create List kermit kermit - ${headers}= Create Dictionary Accept=application/json - Create Session web_session http://${MGRSERVICE_IP}:${MGRSERVICE_PORT} headers=${headers} auth=${auth} - ${files}= evaluate {"file":open('${bmpfilepath}','rb')} - ${resp}= Post Request web_session api/workflow/v1/package files=${files} - Should Be Equal ${resp.status_code} ${200} - Log ${resp.json()} - ${deployedId}= Set Variable ${resp.json()["deployedId"]} - Set Global Variable ${deployedId} - -Exectue BPMN File Testt On MgrService - [Documentation] Check if the test bpmn file can be exectued in Management Service - ${headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Basic a2VybWl0Omtlcm1pdA== - Create Session web_session http://${MGRSERVICE_IP}:${MGRSERVICE_PORT} headers=${headers} - ${body} Create Dictionary processDefinitionKey=${processId} - ${body} dumps ${body} - ${resp}= Post Request web_session api/workflow/v1/process/instance ${body} - Should Be Equal ${resp.status_code} ${200} - Log ${resp.json()} - Should Be Equal ${resp.json()["processDefinitionKey"]} ${processId} - -UnDeploy BPMN File Testt On MgrService - [Documentation] Check if the test bpmn file can be undeployed in Management Service - log ${deployedId} - ${auth}= Create List kermit kermit - ${headers} Create Dictionary Content-Type=application/json Accept=application/json - Create Session web_session http://${MGRSERVICE_IP}:${MGRSERVICE_PORT} headers=${headers} auth=${auth} - ${resp}= Delete Request web_session /api/workflow/v1/package/${deployedId} - Should Be Equal ${resp.status_code} ${200} - -# Deploy BPMN File Test On MSB -# [Documentation] Check if the test bpmn file can be deployed in activiti engine -# ${auth}= Create List kermit kermit -# ${headers}= Create Dictionary Accept=application/json -# Create Session web_session http://${MSB_IP}:${MSB_PORT} headers=${headers} auth=${auth} -# ${files}= evaluate {"file":open('${bmpfilepath}','rb')} -# ${resp}= Post Request web_session api/workflow/v1/package files=${files} -# Should Be Equal ${resp.status_code} ${200} -# Log ${resp.json()} -# ${deployedId}= Set Variable ${resp.json()["deployedId"]} -# Set Global Variable ${deployedId} - -# Exectue BPMN File Testt On MSB -# [Documentation] Check if the test bpmn file can be exectued in MSB -# ${headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Basic a2VybWl0Omtlcm1pdA== -# Create Session web_session http://${MSB_IP}:${MSB_PORT} headers=${headers} -# ${body} Create Dictionary processDefinitionKey=${processId} -# ${body} dumps ${body} -# ${resp}= Post Request web_session api/workflow/v1/process/instance ${body} -# Should Be Equal ${resp.status_code} ${200} -# Log ${resp.json()} -# Should Be Equal ${resp.json()["processDefinitionKey"]} ${processId} - -# UnDeploy BPMN File Testt On MSB -# [Documentation] Check if the test bpmn file can be undeployed in MSB -# log ${deployedId} -# ${auth}= Create List kermit kermit -# ${headers} Create Dictionary Content-Type=application/json Accept=application/json -# Create Session web_session http://${MSB_IP}:${MSB_PORT} headers=${headers} auth=${auth} -# ${resp}= Delete Request web_session /api/workflow/v1/package/${deployedId} -# Should Be Equal ${resp.status_code} ${200}