From 26b89ecb973531dfcc0fd30bd50f083e585e1f4f Mon Sep 17 00:00:00 2001 From: Mariusz Wagner Date: Tue, 19 Jun 2018 09:52:01 +0200 Subject: Rename folder for jenkins job Issue-ID: DCAEGEN2-206 Change-Id: Id2414fa53bd7999fbf5ea551bd89e62bb7d72700 Signed-off-by: Mariusz Wagner --- test/csit/plans/dcaegen2/prh-testsuites/setup.sh | 57 +++++++++++++ .../csit/plans/dcaegen2/prh-testsuites/teardown.sh | 20 +++++ .../plans/dcaegen2/prh-testsuites/testplan.txt | 3 + test/csit/plans/dcaegen2/prh_testsuites/setup.sh | 57 ------------- .../csit/plans/dcaegen2/prh_testsuites/teardown.sh | 20 ----- .../plans/dcaegen2/prh_testsuites/testplan.txt | 3 - .../tests/dcaegen2/prh-testcases/__init__.robot | 0 .../tests/dcaegen2/prh-testcases/prh_tests.robot | 97 ++++++++++++++++++++++ .../dcaegen2/prh-testcases/resources/PrhLibrary.py | 16 ++++ .../prh-testcases/resources/docker-compose.yml | 44 ++++++++++ .../prh-testcases/resources/simulator/AAI.py | 59 +++++++++++++ .../resources/simulator/AAI_simulator | 11 +++ .../prh-testcases/resources/simulator/DMaaP.py | 75 +++++++++++++++++ .../resources/simulator/DMaaP_simulator | 11 +++ .../tests/dcaegen2/prh_testcases/__init__.robot | 0 .../tests/dcaegen2/prh_testcases/prh_tests.robot | 97 ---------------------- .../dcaegen2/prh_testcases/resources/PrhLibrary.py | 16 ---- .../prh_testcases/resources/docker-compose.yml | 44 ---------- .../prh_testcases/resources/simulator/AAI.py | 59 ------------- .../resources/simulator/AAI_simulator | 11 --- .../prh_testcases/resources/simulator/DMaaP.py | 75 ----------------- .../resources/simulator/DMaaP_simulator | 11 --- 22 files changed, 393 insertions(+), 393 deletions(-) create mode 100644 test/csit/plans/dcaegen2/prh-testsuites/setup.sh create mode 100644 test/csit/plans/dcaegen2/prh-testsuites/teardown.sh create mode 100644 test/csit/plans/dcaegen2/prh-testsuites/testplan.txt delete mode 100644 test/csit/plans/dcaegen2/prh_testsuites/setup.sh delete mode 100644 test/csit/plans/dcaegen2/prh_testsuites/teardown.sh delete mode 100644 test/csit/plans/dcaegen2/prh_testsuites/testplan.txt create mode 100644 test/csit/tests/dcaegen2/prh-testcases/__init__.robot create mode 100644 test/csit/tests/dcaegen2/prh-testcases/prh_tests.robot create mode 100644 test/csit/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py create mode 100644 test/csit/tests/dcaegen2/prh-testcases/resources/docker-compose.yml create mode 100644 test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py create mode 100644 test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI_simulator create mode 100644 test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py create mode 100644 test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP_simulator delete mode 100644 test/csit/tests/dcaegen2/prh_testcases/__init__.robot delete mode 100644 test/csit/tests/dcaegen2/prh_testcases/prh_tests.robot delete mode 100644 test/csit/tests/dcaegen2/prh_testcases/resources/PrhLibrary.py delete mode 100644 test/csit/tests/dcaegen2/prh_testcases/resources/docker-compose.yml delete mode 100644 test/csit/tests/dcaegen2/prh_testcases/resources/simulator/AAI.py delete mode 100644 test/csit/tests/dcaegen2/prh_testcases/resources/simulator/AAI_simulator delete mode 100644 test/csit/tests/dcaegen2/prh_testcases/resources/simulator/DMaaP.py delete mode 100644 test/csit/tests/dcaegen2/prh_testcases/resources/simulator/DMaaP_simulator (limited to 'test') diff --git a/test/csit/plans/dcaegen2/prh-testsuites/setup.sh b/test/csit/plans/dcaegen2/prh-testsuites/setup.sh new file mode 100644 index 000000000..cdac9d210 --- /dev/null +++ b/test/csit/plans/dcaegen2/prh-testsuites/setup.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +source ${SCRIPTS}/common_functions.sh + +export PRH_SERVICE="prh" +export DMAAP_SIMULATOR="dmaap_simulator" +export AAI_SIMULATOR="aai_simulator" + +cd ${WORKSPACE}/test/csit/tests/dcaegen2/prh-testcases/resources/ + +docker login -u docker -p docker nexus3.onap.org:10003 +docker-compose up -d --build + +# Wait for initialization of Docker containers +for i in {1..50}; do + if [ $(docker inspect --format '{{ .State.Running }}' ${PRH_SERVICE}) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' ${DMAAP_SIMULATOR}) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' ${AAI_SIMULATOR}) ] + then + echo "dmaap_simulator, aai_simulator and prh services are running" + break + else + echo sleep ${i} + sleep ${i} + fi +done + +PRH_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${PRH_SERVICE}) +DMAAP_SIMULATOR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${DMAAP_SIMULATOR}) +AAI_SIMULATOR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${AAI_SIMULATOR}) + +bypass_ip_adress ${PRH_IP} +bypass_ip_adress ${DMAAP_SIMULATOR_IP} +bypass_ip_adress ${AAI_SIMULATOR_IP} + +echo PRH_IP=${PRH_IP} +echo DMAAP_SIMULATOR_IP=${DMAAP_SIMULATOR_IP} +echo AAI_SIMULATOR_IP=${AAI_SIMULATOR_IP} + +# Wait for initialization of docker services +for i in {1..50}; do + curl -sS -m 1 localhost:2222 && \ + curl -sS -m 1 localhost:3333 && \ + curl -sS -m 1 localhost:8100/heartbeat && break + echo sleep ${i} + sleep ${i} +done + +docker cp prh:/config/prh_endpoints.json ${WORKDIR} +sed -i -e 's/"dmaapHostName":.*/"dmaapHostName": "'${DMAAP_SIMULATOR_IP}'",/g' ${WORKDIR}/prh_endpoints.json +sed -i -e 's/"aaiHost":.*/"aaiHost": "'${AAI_SIMULATOR_IP}'",/g' ${WORKDIR}/prh_endpoints.json +docker cp ${WORKDIR}/prh_endpoints.json prh:/config/ + +#Pass any variables required by Robot test suites in ROBOT_VARIABLES +ROBOT_VARIABLES="-v DMAAP_SIMULATOR:localhost:2222 -v AAI_SIMULATOR:localhost:3333 -v PRH:localhost:8100" + +pip install docker diff --git a/test/csit/plans/dcaegen2/prh-testsuites/teardown.sh b/test/csit/plans/dcaegen2/prh-testsuites/teardown.sh new file mode 100644 index 000000000..bd1e5ba06 --- /dev/null +++ b/test/csit/plans/dcaegen2/prh-testsuites/teardown.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Copyright 2017 Nokia, Inc. and others. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +kill-instance.sh prh +kill-instance.sh dmaap_simulator +kill-instance.sh aai_simulator diff --git a/test/csit/plans/dcaegen2/prh-testsuites/testplan.txt b/test/csit/plans/dcaegen2/prh-testsuites/testplan.txt new file mode 100644 index 000000000..9007a64b5 --- /dev/null +++ b/test/csit/plans/dcaegen2/prh-testsuites/testplan.txt @@ -0,0 +1,3 @@ +# Test suites are relative paths under [integration.git]/test/csit/tests/. +# Place the suites in run order. +dcaegen2/prh-testcases diff --git a/test/csit/plans/dcaegen2/prh_testsuites/setup.sh b/test/csit/plans/dcaegen2/prh_testsuites/setup.sh deleted file mode 100644 index 39c1fcef5..000000000 --- a/test/csit/plans/dcaegen2/prh_testsuites/setup.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash - -source ${SCRIPTS}/common_functions.sh - -export PRH_SERVICE="prh" -export DMAAP_SIMULATOR="dmaap_simulator" -export AAI_SIMULATOR="aai_simulator" - -cd ${WORKSPACE}/test/csit/tests/dcaegen2/prh_testcases/resources/ - -docker login -u docker -p docker nexus3.onap.org:10003 -docker-compose up -d --build - -# Wait for initialization of Docker containers -for i in {1..50}; do - if [ $(docker inspect --format '{{ .State.Running }}' ${PRH_SERVICE}) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' ${DMAAP_SIMULATOR}) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' ${AAI_SIMULATOR}) ] - then - echo "dmaap_simulator, aai_simulator and prh services are running" - break - else - echo sleep ${i} - sleep ${i} - fi -done - -PRH_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${PRH_SERVICE}) -DMAAP_SIMULATOR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${DMAAP_SIMULATOR}) -AAI_SIMULATOR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${AAI_SIMULATOR}) - -bypass_ip_adress ${PRH_IP} -bypass_ip_adress ${DMAAP_SIMULATOR_IP} -bypass_ip_adress ${AAI_SIMULATOR_IP} - -echo PRH_IP=${PRH_IP} -echo DMAAP_SIMULATOR_IP=${DMAAP_SIMULATOR_IP} -echo AAI_SIMULATOR_IP=${AAI_SIMULATOR_IP} - -# Wait for initialization of docker services -for i in {1..50}; do - curl -sS -m 1 localhost:2222 && \ - curl -sS -m 1 localhost:3333 && \ - curl -sS -m 1 localhost:8100/heartbeat && break - echo sleep ${i} - sleep ${i} -done - -docker cp prh:/config/prh_endpoints.json ${WORKDIR} -sed -i -e 's/"dmaapHostName":.*/"dmaapHostName": "'${DMAAP_SIMULATOR_IP}'",/g' ${WORKDIR}/prh_endpoints.json -sed -i -e 's/"aaiHost":.*/"aaiHost": "'${AAI_SIMULATOR_IP}'",/g' ${WORKDIR}/prh_endpoints.json -docker cp ${WORKDIR}/prh_endpoints.json prh:/config/ - -#Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v DMAAP_SIMULATOR:localhost:2222 -v AAI_SIMULATOR:localhost:3333 -v PRH:localhost:8100" - -pip install docker diff --git a/test/csit/plans/dcaegen2/prh_testsuites/teardown.sh b/test/csit/plans/dcaegen2/prh_testsuites/teardown.sh deleted file mode 100644 index bd1e5ba06..000000000 --- a/test/csit/plans/dcaegen2/prh_testsuites/teardown.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# -# Copyright 2017 Nokia, Inc. and others. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -kill-instance.sh prh -kill-instance.sh dmaap_simulator -kill-instance.sh aai_simulator diff --git a/test/csit/plans/dcaegen2/prh_testsuites/testplan.txt b/test/csit/plans/dcaegen2/prh_testsuites/testplan.txt deleted file mode 100644 index 8c1f3274a..000000000 --- a/test/csit/plans/dcaegen2/prh_testsuites/testplan.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Test suites are relative paths under [integration.git]/test/csit/tests/. -# Place the suites in run order. -dcaegen2/prh_testcases diff --git a/test/csit/tests/dcaegen2/prh-testcases/__init__.robot b/test/csit/tests/dcaegen2/prh-testcases/__init__.robot new file mode 100644 index 000000000..e69de29bb diff --git a/test/csit/tests/dcaegen2/prh-testcases/prh_tests.robot b/test/csit/tests/dcaegen2/prh-testcases/prh_tests.robot new file mode 100644 index 000000000..e507dcba7 --- /dev/null +++ b/test/csit/tests/dcaegen2/prh-testcases/prh_tests.robot @@ -0,0 +1,97 @@ +*** Settings *** +Library RequestsLibrary +Library Process +Library resources/PrhLibrary.py + +*** Variables *** +${DMAAP_SIM_URL} http://${DMAAP_SIMULATOR} +${AAI_SIM_URL} http://${AAI_SIMULATOR} +${PRH_URL} http://${PRH} + +*** Test Cases *** +Getting and Consuming Positive Scenario + [Documentation] Get message from new topic and consume it - positive scenarios + [Tags] PRH + [Setup] Start prh + [Template] Run Getting and Consuming + {"pnfName":"NOKQTFCOC540002E","ipv4":"10.16.123.234","ipv6":"2001:0db8:85a3:0000:0000:8a2e:0370:7334"} NOKQTFCOC540002E {"event": {"commonEventHeader": {"sourceId":"QTFCOC540002E", "startEpochMicrosec":1519837825682, "eventId":"QTFCOC540002E-reg", "nfcNamingCode":"5DU", "internalHeaderFields":{"collectorTimeStamp":"Fri, 04 27 2018 09:01:10 GMT"}, "eventType":"pnfRegistration", "priority":"Normal", "version":3, "reportingEntityName":"5GRAN_DU", "sequence":0, "domain":"other", "lastEpochMicrosec":1519837825682, "eventName":"pnfRegistration_5GDU", "sourceName":"5GRAN_DU", "nfNamingCode":"5GRAN"}, "otherFields": {"pnfLastServiceDate":1517206400, "pnfOamIpv6Address":"2001:0db8:85a3:0000:0000:8a2e:0370:7334", "pnfVendorName":"Nokia", "pnfModelNumber":"AJ02", "pnfFamily":"BBU", "pnfType":"AirScale", "otherFieldsVersion":1, "pnfOamIpv4Address":"10.16.123.234", "pnfSoftwareVersion":"v4.5.0.1", "pnfSerialNumber":"QTFCOC540002E", "pnfManufactureDate":1516406400}}} + {"pnfName":"NOKQTFCOC540002F","ipv4":"","ipv6":"2001:0db8:85a3:0000:0000:8a2e:0370:7334"} NOKQTFCOC540002F {"event": {"commonEventHeader": {"sourceId":"QTFCOC540002F", "startEpochMicrosec":1519837825682, "eventId":"QTFCOC540002F-reg", "nfcNamingCode":"5DU", "internalHeaderFields":{"collectorTimeStamp":"Fri, 04 27 2018 09:01:10 GMT"}, "eventType":"pnfRegistration", "priority":"Normal", "version":3, "reportingEntityName":"5GRAN_DU", "sequence":0, "domain":"other", "lastEpochMicrosec":1519837825682, "eventName":"pnfRegistration_5GDU", "sourceName":"5GRAN_DU", "nfNamingCode":"5GRAN"}, "otherFields": {"pnfLastServiceDate":1517206400, "pnfOamIpv6Address":"2001:0db8:85a3:0000:0000:8a2e:0370:7334", "pnfVendorName":"Nokia", "pnfModelNumber":"AJ02", "pnfFamily":"BBU", "pnfType":"AirScale", "otherFieldsVersion":1, "pnfOamIpv4Address":"", "pnfSoftwareVersion":"v4.5.0.1", "pnfSerialNumber":"QTFCOC540002F", "pnfManufactureDate":1516406400}}} + {"pnfName":"NOKQTFCOC540002G","ipv4":"10.16.123.234","ipv6":""} NOKQTFCOC540002G {"event": {"commonEventHeader": {"sourceId":"QTFCOC540002G", "startEpochMicrosec":1519837825682, "eventId":"QTFCOC540002G-reg", "nfcNamingCode":"5DU", "internalHeaderFields":{"collectorTimeStamp":"Fri, 04 27 2018 09:01:10 GMT"}, "eventType":"pnfRegistration", "priority":"Normal", "version":3, "reportingEntityName":"5GRAN_DU", "sequence":0, "domain":"other", "lastEpochMicrosec":1519837825682, "eventName":"pnfRegistration_5GDU", "sourceName":"5GRAN_DU", "nfNamingCode":"5GRAN"}, "otherFields": {"pnfLastServiceDate":1517206400, "pnfOamIpv6Address":"", "pnfVendorName":"Nokia", "pnfModelNumber":"AJ02", "pnfFamily":"BBU", "pnfType":"AirScale", "otherFieldsVersion":1, "pnfOamIpv4Address":"10.16.123.234", "pnfSoftwareVersion":"v4.5.0.1", "pnfSerialNumber":"QTFCOC540002G", "pnfManufactureDate":1516406400}}} + {"pnfName":"ERIQTFCOC5400000","ipv4":"10.16.123.23","ipv6":""} ERIQTFCOC5400000 {"event": {"commonEventHeader": {"sourceId":"QTFCOC5400000", "startEpochMicrosec":1519837825682, "eventId":"QTFCOC5400000-reg", "nfcNamingCode":"5DU", "internalHeaderFields":{"collectorTimeStamp":"Fri, 04 27 2018 09:01:10 GMT"}, "eventType":"pnfRegistration", "priority":"Normal", "version":3, "reportingEntityName":"5GRAN_DU", "sequence":0, "domain":"other", "lastEpochMicrosec":1519837825682, "eventName":"pnfRegistration_5GDU", "sourceName":"5GRAN_DU", "nfNamingCode":"5GRAN"}, "otherFields": {"pnfLastServiceDate":1517206400, "pnfOamIpv6Address":"", "pnfVendorName":"Ericsson", "pnfModelNumber":"AJ02", "pnfFamily":"BBU", "pnfType":"AirScale", "otherFieldsVersion":1, "pnfOamIpv4Address":"10.16.123.23", "pnfSoftwareVersion":"v4.5.0.1", "pnfSerialNumber":"QTFCOC5400000", "pnfManufactureDate":1516406400}}} + [Teardown] Stop prh + +Missing IPv4 and IPv6 + [Documentation] Test get event from DMaaP without IPv4 and IPv6 + [Tags] PRH no_IPv4 no_IPv6 + [Setup] Start prh + Missing IP {"event": {"commonEventHeader": {"sourceId":"QTFCOC540002E", "startEpochMicrosec":1519837825682, "eventId":"QTFCOC540002E-reg", "nfcNamingCode":"5DU", "internalHeaderFields":{"collectorTimeStamp":"Fri, 04 27 2018 09:01:10 GMT"}, "eventType":"pnfRegistration", "priority":"Normal", "version":3, "reportingEntityName":"5GRAN_DU", "sequence":0, "domain":"other", "lastEpochMicrosec":1519837825682, "eventName":"pnfRegistration_5GDU", "sourceName":"5GRAN_DU", "nfNamingCode":"5GRAN"}, "otherFields": {"pnfLastServiceDate":1517206400, "pnfOamIpv6Address":"", "pnfVendorName":"Nokia", "pnfModelNumber":"AJ02", "pnfFamily":"BBU", "pnfType":"AirScale", "otherFieldsVersion":1, "pnfOamIpv4Address":"", "pnfSoftwareVersion":"v4.5.0.1", "pnfSerialNumber":"QTFCOC540002E", "pnfManufactureDate":1516406400}}} + [Teardown] Stop prh + +Wrong AAI record + [Documentation] Wrong or missing record in AAI + [Tags] PRH AAI + [Setup] Start prh + Wrong AAI record {"event": {"commonEventHeader": {"sourceId":"QTFCOC540002E", "startEpochMicrosec":1519837825682, "eventId":"QTFCOC540002E-reg", "nfcNamingCode":"5DU", "internalHeaderFields":{"collectorTimeStamp":"Fri, 04 27 2018 09:01:10 GMT"}, "eventType":"pnfRegistration", "priority":"Normal", "version":3, "reportingEntityName":"5GRAN_DU", "sequence":0, "domain":"other", "lastEpochMicrosec":1519837825682, "eventName":"pnfRegistration_5GDU", "sourceName":"5GRAN_DU", "nfNamingCode":"5GRAN"}, "otherFields": {"pnfLastServiceDate":1517206400, "pnfOamIpv6Address":"2001:0db8:85a3:0000:0000:8a2e:0370:7334", "pnfVendorName":"Nokia", "pnfModelNumber":"AJ02", "pnfFamily":"BBU", "pnfType":"AirScale", "otherFieldsVersion":1, "pnfOamIpv4Address":"10.16.123.234", "pnfSoftwareVersion":"v4.5.0.1", "pnfSerialNumber":"QTFCOC540002E", "pnfManufactureDate":1516406400}}} + [Teardown] Stop prh + +*** Keywords *** +Wrong AAI record + [Arguments] ${event_in_dmaap} + [Timeout] 1m + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + Set get event in DMAAP ${event_in_dmaap} ${headers} + Set pnfs name in AAI wrong_aai_record + ${check}= check for log org.onap.dcaegen2.services.prh.exceptions.AAINotFoundException: Incorrect response code for continuation of tasks workflow + Should Be Equal As Strings ${check} True + +Missing IP + [Arguments] ${event_in_dmaap} + [Timeout] 1m + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + Set get event in DMAAP ${event_in_dmaap} ${headers} + ${check}= check for log org.onap.dcaegen2.services.prh.exceptions.DmaapNotFoundException: IPV4 and IPV6 are empty + Should Be Equal As Strings ${check} True + +Run Getting and Consuming + [Arguments] ${posted_event_to_dmaap} ${pnfs_name} ${event_in_dmaap} + [Timeout] 1m + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + Set pnfs name in AAI ${pnfs_name} + Set get event in DMAAP ${event_in_dmaap} ${headers} + : FOR ${Index} IN RANGE 1 30 + \ Create Session prh_ready ${DMAAP_SIM_URL} + \ ${resp}= Get Request prh_ready /events/pnfReady headers=${headers} + \ Exit For Loop If '${resp.text}' == '${posted_event_to_dmaap}' + \ Sleep 1s + Should Be Equal ${resp.text} ${posted_event_to_dmaap} + +Start prh + [Timeout] 1m + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + Create Session prh_start ${PRH_URL} + ${resp}= Get Request prh_start /start headers=${headers} + Should Be Equal ${resp.text} "PRH Service has been started!" + +Stop prh + [Timeout] 1m + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + Create Session prh_stop ${PRH_URL} + ${resp}= Get Request prh_stop /stopPrh headers=${headers} + Should Be Equal ${resp.text} "PRH Service has already been stopped!" + +Set pnfs name in AAI + [Arguments] ${pnfs_name} + [Timeout] 1 minute + ${headers}= Create Dictionary Accept=application/json Content-Type=text/html + Create Session set_pnfs_in_aai ${AAI_SIM_URL} + ${resp}= Put Request set_pnfs_in_aai /set_pnfs headers=${headers} data=${pnfs_name} + Should Be Equal As Strings ${resp.status_code} 200 + Log To Console ${resp.text} + +Set get event in DMAAP + [Arguments] ${event_in_dmaap} ${headers} + [Timeout] 1m + Create Session set_get_event ${DMAAP_SIM_URL} + ${resp}= Put Request set_get_event /set_get_event headers=${headers} data=${event_in_dmaap} + Should Be Equal As Strings ${resp.status_code} 200 + Log To Console ${resp.text} diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py b/test/csit/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py new file mode 100644 index 000000000..f07f385f5 --- /dev/null +++ b/test/csit/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py @@ -0,0 +1,16 @@ +import docker + +class PrhLibrary(object): + + def __init__(self): + pass + + def check_for_log(self, search_for): + client = docker.from_env() + container = client.containers.get('prh') + for line in container.logs(stream=True): + if search_for in line.strip(): + return True + else: + return False + \ No newline at end of file diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/docker-compose.yml b/test/csit/tests/dcaegen2/prh-testcases/resources/docker-compose.yml new file mode 100644 index 000000000..e773b76a9 --- /dev/null +++ b/test/csit/tests/dcaegen2/prh-testcases/resources/docker-compose.yml @@ -0,0 +1,44 @@ +version: '3' +services: + prh: + image: nexus3.onap.org:10003/onap/org.onap.dcaegen2.services.prh.prh-app-server + command: > + --dmaap.dmaapConsumerConfiguration.dmaapPortNumber=2222 + --dmaap.dmaapProducerConfiguration.dmaapPortNumber=2222 + --aai.aaiClientConfiguration.aaiHostPortNumber=3333 + --aai.aaiClientConfiguration.aaiProtocol=http + entrypoint: + - java + - -Dspring.profiles.active=dev + - -Dlogging.level.org.onap.dcaegen2.services.prh=TRACE + - -jar + - /opt/prh-app-server.jar + ports: + - "8100:8100" + - "8433:8433" + container_name: prh + + dmaap_simulator: + build: + context: simulator + dockerfile: DMaaP_simulator + args: + - https_proxy=${HTTPS_PROXY} + ports: + - "2222:2222" + container_name: dmaap_simulator + depends_on: + - prh + + aai_simulator: + build: + context: simulator + dockerfile: AAI_simulator + args: + - https_proxy=${HTTPS_PROXY} + ports: + - "3333:3333" + container_name: aai_simulator + depends_on: + - prh + diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py new file mode 100644 index 000000000..2c0b42dcd --- /dev/null +++ b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py @@ -0,0 +1,59 @@ +import BaseHTTPServer +import re +import sys + +from robot.api import logger + +pnfs = 'Empty' + +class AAIHandler(BaseHTTPServer.BaseHTTPRequestHandler): + def do_PUT(self): + if re.search('/set_pnfs', self.path): + global pnfs + content_length = int(self.headers['Content-Length']) + pnfs = self.rfile.read(content_length) + self.send_response(200) + self.send_header('Content-Type', 'application/json') + self.end_headers() + + return + + def do_PATCH(self): + pnfs_name = '/aai/v12/network/pnfs/pnf/' + pnfs + if re.search('wrong_aai_record', self.path): + self.send_response(400) + self.end_headers() + elif re.search(pnfs_name, self.path): + self.send_response(200) + self.end_headers() + + return + + def do_GET(self): + self.send_response(200) + self.send_header('Content-Type', 'application/json') + self.end_headers() + self.wfile.write('GET') + self.wfile.close() + + return + +def _main_ (HandlerClass = AAIHandler, + ServerClass = BaseHTTPServer.HTTPServer, protocol="HTTP/1.0"): + + if sys.argv[1:]: + port = int(sys.argv[1]) + else: + port = 3333 + + server_address = ('', port) + + HandlerClass.protocol_version = protocol + httpd = ServerClass(server_address, HandlerClass) + + sa = httpd.socket.getsockname() + print "Serving HTTP on", sa[0], "port", sa[1], "..." + httpd.serve_forever() + +if __name__ == '__main__': + _main_() diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI_simulator b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI_simulator new file mode 100644 index 000000000..2d96d8925 --- /dev/null +++ b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI_simulator @@ -0,0 +1,11 @@ +FROM python:2 + +ENV https_proxy "$https_proxy" + +ADD AAI.py / + +RUN pip install robotframework + +EXPOSE 3333 + +CMD [ "python", "./AAI.py" ] diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py new file mode 100644 index 000000000..af716fd06 --- /dev/null +++ b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py @@ -0,0 +1,75 @@ +import BaseHTTPServer +import re +import sys + +from robot.api import logger + +posted_event_from_prh = 'Empty' +received_event_to_get_method = 'Empty' + +class DMaaPHandler(BaseHTTPServer.BaseHTTPRequestHandler): + def do_PUT(self): + if re.search('/set_get_event', self.path): + global received_event_to_get_method + content_length = int(self.headers['Content-Length']) + received_event_to_get_method = self.rfile.read(content_length) + self.send_response(200) + self.send_header('Content-Type', 'application/json') + self.end_headers() + + return + + def do_POST(self): + if re.search('/events/pnfReady', self.path): + global posted_event_from_prh + content_length = int(self.headers['Content-Length']) + posted_event_from_prh = self.rfile.read(content_length) + self.send_response(200) + self.send_header('Content-Type', 'application/json') + self.end_headers() + + return + + def do_GET(self): + if re.search('/events/unauthenticated.SEC_OTHER_OUTPUT', self.path): + self.send_response(200) + self.send_header('Content-Type', 'application/json') + self.end_headers() + self.wfile.write(received_event_to_get_method) + self.wfile.close() + elif re.search('/events/pnfReady', self.path): + self.send_response(200) + self.send_header('Content-Type', 'application/json') + self.end_headers() + self.wfile.write(posted_event_from_prh) + global posted_event_from_prh + posted_event_from_prh = 'Empty' + self.wfile.close() + else: + self.send_response(200) + self.send_header('Content-Type', 'application/json') + self.end_headers() + self.wfile.write('GET else') + self.wfile.close() + + return + +def _main_ (HandlerClass = DMaaPHandler, + ServerClass = BaseHTTPServer.HTTPServer, protocol="HTTP/1.0"): + + if sys.argv[1:]: + port = int(sys.argv[1]) + else: + port = 2222 + + server_address = ('', port) + + HandlerClass.protocol_version = protocol + httpd = ServerClass(server_address, HandlerClass) + + sa = httpd.socket.getsockname() + print "Serving HTTP on", sa[0], "port", sa[1], "..." + httpd.serve_forever() + +if __name__ == '__main__': + _main_() diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP_simulator b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP_simulator new file mode 100644 index 000000000..4de65393d --- /dev/null +++ b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP_simulator @@ -0,0 +1,11 @@ +FROM python:2 + +ENV https_proxy "$https_proxy" + +ADD DMaaP.py / + +RUN pip install robotframework + +EXPOSE 2222 + +CMD [ "python", "./DMaaP.py" ] diff --git a/test/csit/tests/dcaegen2/prh_testcases/__init__.robot b/test/csit/tests/dcaegen2/prh_testcases/__init__.robot deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/csit/tests/dcaegen2/prh_testcases/prh_tests.robot b/test/csit/tests/dcaegen2/prh_testcases/prh_tests.robot deleted file mode 100644 index e507dcba7..000000000 --- a/test/csit/tests/dcaegen2/prh_testcases/prh_tests.robot +++ /dev/null @@ -1,97 +0,0 @@ -*** Settings *** -Library RequestsLibrary -Library Process -Library resources/PrhLibrary.py - -*** Variables *** -${DMAAP_SIM_URL} http://${DMAAP_SIMULATOR} -${AAI_SIM_URL} http://${AAI_SIMULATOR} -${PRH_URL} http://${PRH} - -*** Test Cases *** -Getting and Consuming Positive Scenario - [Documentation] Get message from new topic and consume it - positive scenarios - [Tags] PRH - [Setup] Start prh - [Template] Run Getting and Consuming - {"pnfName":"NOKQTFCOC540002E","ipv4":"10.16.123.234","ipv6":"2001:0db8:85a3:0000:0000:8a2e:0370:7334"} NOKQTFCOC540002E {"event": {"commonEventHeader": {"sourceId":"QTFCOC540002E", "startEpochMicrosec":1519837825682, "eventId":"QTFCOC540002E-reg", "nfcNamingCode":"5DU", "internalHeaderFields":{"collectorTimeStamp":"Fri, 04 27 2018 09:01:10 GMT"}, "eventType":"pnfRegistration", "priority":"Normal", "version":3, "reportingEntityName":"5GRAN_DU", "sequence":0, "domain":"other", "lastEpochMicrosec":1519837825682, "eventName":"pnfRegistration_5GDU", "sourceName":"5GRAN_DU", "nfNamingCode":"5GRAN"}, "otherFields": {"pnfLastServiceDate":1517206400, "pnfOamIpv6Address":"2001:0db8:85a3:0000:0000:8a2e:0370:7334", "pnfVendorName":"Nokia", "pnfModelNumber":"AJ02", "pnfFamily":"BBU", "pnfType":"AirScale", "otherFieldsVersion":1, "pnfOamIpv4Address":"10.16.123.234", "pnfSoftwareVersion":"v4.5.0.1", "pnfSerialNumber":"QTFCOC540002E", "pnfManufactureDate":1516406400}}} - {"pnfName":"NOKQTFCOC540002F","ipv4":"","ipv6":"2001:0db8:85a3:0000:0000:8a2e:0370:7334"} NOKQTFCOC540002F {"event": {"commonEventHeader": {"sourceId":"QTFCOC540002F", "startEpochMicrosec":1519837825682, "eventId":"QTFCOC540002F-reg", "nfcNamingCode":"5DU", "internalHeaderFields":{"collectorTimeStamp":"Fri, 04 27 2018 09:01:10 GMT"}, "eventType":"pnfRegistration", "priority":"Normal", "version":3, "reportingEntityName":"5GRAN_DU", "sequence":0, "domain":"other", "lastEpochMicrosec":1519837825682, "eventName":"pnfRegistration_5GDU", "sourceName":"5GRAN_DU", "nfNamingCode":"5GRAN"}, "otherFields": {"pnfLastServiceDate":1517206400, "pnfOamIpv6Address":"2001:0db8:85a3:0000:0000:8a2e:0370:7334", "pnfVendorName":"Nokia", "pnfModelNumber":"AJ02", "pnfFamily":"BBU", "pnfType":"AirScale", "otherFieldsVersion":1, "pnfOamIpv4Address":"", "pnfSoftwareVersion":"v4.5.0.1", "pnfSerialNumber":"QTFCOC540002F", "pnfManufactureDate":1516406400}}} - {"pnfName":"NOKQTFCOC540002G","ipv4":"10.16.123.234","ipv6":""} NOKQTFCOC540002G {"event": {"commonEventHeader": {"sourceId":"QTFCOC540002G", "startEpochMicrosec":1519837825682, "eventId":"QTFCOC540002G-reg", "nfcNamingCode":"5DU", "internalHeaderFields":{"collectorTimeStamp":"Fri, 04 27 2018 09:01:10 GMT"}, "eventType":"pnfRegistration", "priority":"Normal", "version":3, "reportingEntityName":"5GRAN_DU", "sequence":0, "domain":"other", "lastEpochMicrosec":1519837825682, "eventName":"pnfRegistration_5GDU", "sourceName":"5GRAN_DU", "nfNamingCode":"5GRAN"}, "otherFields": {"pnfLastServiceDate":1517206400, "pnfOamIpv6Address":"", "pnfVendorName":"Nokia", "pnfModelNumber":"AJ02", "pnfFamily":"BBU", "pnfType":"AirScale", "otherFieldsVersion":1, "pnfOamIpv4Address":"10.16.123.234", "pnfSoftwareVersion":"v4.5.0.1", "pnfSerialNumber":"QTFCOC540002G", "pnfManufactureDate":1516406400}}} - {"pnfName":"ERIQTFCOC5400000","ipv4":"10.16.123.23","ipv6":""} ERIQTFCOC5400000 {"event": {"commonEventHeader": {"sourceId":"QTFCOC5400000", "startEpochMicrosec":1519837825682, "eventId":"QTFCOC5400000-reg", "nfcNamingCode":"5DU", "internalHeaderFields":{"collectorTimeStamp":"Fri, 04 27 2018 09:01:10 GMT"}, "eventType":"pnfRegistration", "priority":"Normal", "version":3, "reportingEntityName":"5GRAN_DU", "sequence":0, "domain":"other", "lastEpochMicrosec":1519837825682, "eventName":"pnfRegistration_5GDU", "sourceName":"5GRAN_DU", "nfNamingCode":"5GRAN"}, "otherFields": {"pnfLastServiceDate":1517206400, "pnfOamIpv6Address":"", "pnfVendorName":"Ericsson", "pnfModelNumber":"AJ02", "pnfFamily":"BBU", "pnfType":"AirScale", "otherFieldsVersion":1, "pnfOamIpv4Address":"10.16.123.23", "pnfSoftwareVersion":"v4.5.0.1", "pnfSerialNumber":"QTFCOC5400000", "pnfManufactureDate":1516406400}}} - [Teardown] Stop prh - -Missing IPv4 and IPv6 - [Documentation] Test get event from DMaaP without IPv4 and IPv6 - [Tags] PRH no_IPv4 no_IPv6 - [Setup] Start prh - Missing IP {"event": {"commonEventHeader": {"sourceId":"QTFCOC540002E", "startEpochMicrosec":1519837825682, "eventId":"QTFCOC540002E-reg", "nfcNamingCode":"5DU", "internalHeaderFields":{"collectorTimeStamp":"Fri, 04 27 2018 09:01:10 GMT"}, "eventType":"pnfRegistration", "priority":"Normal", "version":3, "reportingEntityName":"5GRAN_DU", "sequence":0, "domain":"other", "lastEpochMicrosec":1519837825682, "eventName":"pnfRegistration_5GDU", "sourceName":"5GRAN_DU", "nfNamingCode":"5GRAN"}, "otherFields": {"pnfLastServiceDate":1517206400, "pnfOamIpv6Address":"", "pnfVendorName":"Nokia", "pnfModelNumber":"AJ02", "pnfFamily":"BBU", "pnfType":"AirScale", "otherFieldsVersion":1, "pnfOamIpv4Address":"", "pnfSoftwareVersion":"v4.5.0.1", "pnfSerialNumber":"QTFCOC540002E", "pnfManufactureDate":1516406400}}} - [Teardown] Stop prh - -Wrong AAI record - [Documentation] Wrong or missing record in AAI - [Tags] PRH AAI - [Setup] Start prh - Wrong AAI record {"event": {"commonEventHeader": {"sourceId":"QTFCOC540002E", "startEpochMicrosec":1519837825682, "eventId":"QTFCOC540002E-reg", "nfcNamingCode":"5DU", "internalHeaderFields":{"collectorTimeStamp":"Fri, 04 27 2018 09:01:10 GMT"}, "eventType":"pnfRegistration", "priority":"Normal", "version":3, "reportingEntityName":"5GRAN_DU", "sequence":0, "domain":"other", "lastEpochMicrosec":1519837825682, "eventName":"pnfRegistration_5GDU", "sourceName":"5GRAN_DU", "nfNamingCode":"5GRAN"}, "otherFields": {"pnfLastServiceDate":1517206400, "pnfOamIpv6Address":"2001:0db8:85a3:0000:0000:8a2e:0370:7334", "pnfVendorName":"Nokia", "pnfModelNumber":"AJ02", "pnfFamily":"BBU", "pnfType":"AirScale", "otherFieldsVersion":1, "pnfOamIpv4Address":"10.16.123.234", "pnfSoftwareVersion":"v4.5.0.1", "pnfSerialNumber":"QTFCOC540002E", "pnfManufactureDate":1516406400}}} - [Teardown] Stop prh - -*** Keywords *** -Wrong AAI record - [Arguments] ${event_in_dmaap} - [Timeout] 1m - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - Set get event in DMAAP ${event_in_dmaap} ${headers} - Set pnfs name in AAI wrong_aai_record - ${check}= check for log org.onap.dcaegen2.services.prh.exceptions.AAINotFoundException: Incorrect response code for continuation of tasks workflow - Should Be Equal As Strings ${check} True - -Missing IP - [Arguments] ${event_in_dmaap} - [Timeout] 1m - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - Set get event in DMAAP ${event_in_dmaap} ${headers} - ${check}= check for log org.onap.dcaegen2.services.prh.exceptions.DmaapNotFoundException: IPV4 and IPV6 are empty - Should Be Equal As Strings ${check} True - -Run Getting and Consuming - [Arguments] ${posted_event_to_dmaap} ${pnfs_name} ${event_in_dmaap} - [Timeout] 1m - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - Set pnfs name in AAI ${pnfs_name} - Set get event in DMAAP ${event_in_dmaap} ${headers} - : FOR ${Index} IN RANGE 1 30 - \ Create Session prh_ready ${DMAAP_SIM_URL} - \ ${resp}= Get Request prh_ready /events/pnfReady headers=${headers} - \ Exit For Loop If '${resp.text}' == '${posted_event_to_dmaap}' - \ Sleep 1s - Should Be Equal ${resp.text} ${posted_event_to_dmaap} - -Start prh - [Timeout] 1m - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - Create Session prh_start ${PRH_URL} - ${resp}= Get Request prh_start /start headers=${headers} - Should Be Equal ${resp.text} "PRH Service has been started!" - -Stop prh - [Timeout] 1m - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - Create Session prh_stop ${PRH_URL} - ${resp}= Get Request prh_stop /stopPrh headers=${headers} - Should Be Equal ${resp.text} "PRH Service has already been stopped!" - -Set pnfs name in AAI - [Arguments] ${pnfs_name} - [Timeout] 1 minute - ${headers}= Create Dictionary Accept=application/json Content-Type=text/html - Create Session set_pnfs_in_aai ${AAI_SIM_URL} - ${resp}= Put Request set_pnfs_in_aai /set_pnfs headers=${headers} data=${pnfs_name} - Should Be Equal As Strings ${resp.status_code} 200 - Log To Console ${resp.text} - -Set get event in DMAAP - [Arguments] ${event_in_dmaap} ${headers} - [Timeout] 1m - Create Session set_get_event ${DMAAP_SIM_URL} - ${resp}= Put Request set_get_event /set_get_event headers=${headers} data=${event_in_dmaap} - Should Be Equal As Strings ${resp.status_code} 200 - Log To Console ${resp.text} diff --git a/test/csit/tests/dcaegen2/prh_testcases/resources/PrhLibrary.py b/test/csit/tests/dcaegen2/prh_testcases/resources/PrhLibrary.py deleted file mode 100644 index f07f385f5..000000000 --- a/test/csit/tests/dcaegen2/prh_testcases/resources/PrhLibrary.py +++ /dev/null @@ -1,16 +0,0 @@ -import docker - -class PrhLibrary(object): - - def __init__(self): - pass - - def check_for_log(self, search_for): - client = docker.from_env() - container = client.containers.get('prh') - for line in container.logs(stream=True): - if search_for in line.strip(): - return True - else: - return False - \ No newline at end of file diff --git a/test/csit/tests/dcaegen2/prh_testcases/resources/docker-compose.yml b/test/csit/tests/dcaegen2/prh_testcases/resources/docker-compose.yml deleted file mode 100644 index e773b76a9..000000000 --- a/test/csit/tests/dcaegen2/prh_testcases/resources/docker-compose.yml +++ /dev/null @@ -1,44 +0,0 @@ -version: '3' -services: - prh: - image: nexus3.onap.org:10003/onap/org.onap.dcaegen2.services.prh.prh-app-server - command: > - --dmaap.dmaapConsumerConfiguration.dmaapPortNumber=2222 - --dmaap.dmaapProducerConfiguration.dmaapPortNumber=2222 - --aai.aaiClientConfiguration.aaiHostPortNumber=3333 - --aai.aaiClientConfiguration.aaiProtocol=http - entrypoint: - - java - - -Dspring.profiles.active=dev - - -Dlogging.level.org.onap.dcaegen2.services.prh=TRACE - - -jar - - /opt/prh-app-server.jar - ports: - - "8100:8100" - - "8433:8433" - container_name: prh - - dmaap_simulator: - build: - context: simulator - dockerfile: DMaaP_simulator - args: - - https_proxy=${HTTPS_PROXY} - ports: - - "2222:2222" - container_name: dmaap_simulator - depends_on: - - prh - - aai_simulator: - build: - context: simulator - dockerfile: AAI_simulator - args: - - https_proxy=${HTTPS_PROXY} - ports: - - "3333:3333" - container_name: aai_simulator - depends_on: - - prh - diff --git a/test/csit/tests/dcaegen2/prh_testcases/resources/simulator/AAI.py b/test/csit/tests/dcaegen2/prh_testcases/resources/simulator/AAI.py deleted file mode 100644 index 2c0b42dcd..000000000 --- a/test/csit/tests/dcaegen2/prh_testcases/resources/simulator/AAI.py +++ /dev/null @@ -1,59 +0,0 @@ -import BaseHTTPServer -import re -import sys - -from robot.api import logger - -pnfs = 'Empty' - -class AAIHandler(BaseHTTPServer.BaseHTTPRequestHandler): - def do_PUT(self): - if re.search('/set_pnfs', self.path): - global pnfs - content_length = int(self.headers['Content-Length']) - pnfs = self.rfile.read(content_length) - self.send_response(200) - self.send_header('Content-Type', 'application/json') - self.end_headers() - - return - - def do_PATCH(self): - pnfs_name = '/aai/v12/network/pnfs/pnf/' + pnfs - if re.search('wrong_aai_record', self.path): - self.send_response(400) - self.end_headers() - elif re.search(pnfs_name, self.path): - self.send_response(200) - self.end_headers() - - return - - def do_GET(self): - self.send_response(200) - self.send_header('Content-Type', 'application/json') - self.end_headers() - self.wfile.write('GET') - self.wfile.close() - - return - -def _main_ (HandlerClass = AAIHandler, - ServerClass = BaseHTTPServer.HTTPServer, protocol="HTTP/1.0"): - - if sys.argv[1:]: - port = int(sys.argv[1]) - else: - port = 3333 - - server_address = ('', port) - - HandlerClass.protocol_version = protocol - httpd = ServerClass(server_address, HandlerClass) - - sa = httpd.socket.getsockname() - print "Serving HTTP on", sa[0], "port", sa[1], "..." - httpd.serve_forever() - -if __name__ == '__main__': - _main_() diff --git a/test/csit/tests/dcaegen2/prh_testcases/resources/simulator/AAI_simulator b/test/csit/tests/dcaegen2/prh_testcases/resources/simulator/AAI_simulator deleted file mode 100644 index 2d96d8925..000000000 --- a/test/csit/tests/dcaegen2/prh_testcases/resources/simulator/AAI_simulator +++ /dev/null @@ -1,11 +0,0 @@ -FROM python:2 - -ENV https_proxy "$https_proxy" - -ADD AAI.py / - -RUN pip install robotframework - -EXPOSE 3333 - -CMD [ "python", "./AAI.py" ] diff --git a/test/csit/tests/dcaegen2/prh_testcases/resources/simulator/DMaaP.py b/test/csit/tests/dcaegen2/prh_testcases/resources/simulator/DMaaP.py deleted file mode 100644 index af716fd06..000000000 --- a/test/csit/tests/dcaegen2/prh_testcases/resources/simulator/DMaaP.py +++ /dev/null @@ -1,75 +0,0 @@ -import BaseHTTPServer -import re -import sys - -from robot.api import logger - -posted_event_from_prh = 'Empty' -received_event_to_get_method = 'Empty' - -class DMaaPHandler(BaseHTTPServer.BaseHTTPRequestHandler): - def do_PUT(self): - if re.search('/set_get_event', self.path): - global received_event_to_get_method - content_length = int(self.headers['Content-Length']) - received_event_to_get_method = self.rfile.read(content_length) - self.send_response(200) - self.send_header('Content-Type', 'application/json') - self.end_headers() - - return - - def do_POST(self): - if re.search('/events/pnfReady', self.path): - global posted_event_from_prh - content_length = int(self.headers['Content-Length']) - posted_event_from_prh = self.rfile.read(content_length) - self.send_response(200) - self.send_header('Content-Type', 'application/json') - self.end_headers() - - return - - def do_GET(self): - if re.search('/events/unauthenticated.SEC_OTHER_OUTPUT', self.path): - self.send_response(200) - self.send_header('Content-Type', 'application/json') - self.end_headers() - self.wfile.write(received_event_to_get_method) - self.wfile.close() - elif re.search('/events/pnfReady', self.path): - self.send_response(200) - self.send_header('Content-Type', 'application/json') - self.end_headers() - self.wfile.write(posted_event_from_prh) - global posted_event_from_prh - posted_event_from_prh = 'Empty' - self.wfile.close() - else: - self.send_response(200) - self.send_header('Content-Type', 'application/json') - self.end_headers() - self.wfile.write('GET else') - self.wfile.close() - - return - -def _main_ (HandlerClass = DMaaPHandler, - ServerClass = BaseHTTPServer.HTTPServer, protocol="HTTP/1.0"): - - if sys.argv[1:]: - port = int(sys.argv[1]) - else: - port = 2222 - - server_address = ('', port) - - HandlerClass.protocol_version = protocol - httpd = ServerClass(server_address, HandlerClass) - - sa = httpd.socket.getsockname() - print "Serving HTTP on", sa[0], "port", sa[1], "..." - httpd.serve_forever() - -if __name__ == '__main__': - _main_() diff --git a/test/csit/tests/dcaegen2/prh_testcases/resources/simulator/DMaaP_simulator b/test/csit/tests/dcaegen2/prh_testcases/resources/simulator/DMaaP_simulator deleted file mode 100644 index 4de65393d..000000000 --- a/test/csit/tests/dcaegen2/prh_testcases/resources/simulator/DMaaP_simulator +++ /dev/null @@ -1,11 +0,0 @@ -FROM python:2 - -ENV https_proxy "$https_proxy" - -ADD DMaaP.py / - -RUN pip install robotframework - -EXPOSE 2222 - -CMD [ "python", "./DMaaP.py" ] -- cgit 1.2.3-korg