aboutsummaryrefslogtreecommitdiffstats
path: root/test/csit/tests
diff options
context:
space:
mode:
Diffstat (limited to 'test/csit/tests')
-rw-r--r--test/csit/tests/clamp/UIs/03__Verify_UI_Models.robot2
-rw-r--r--test/csit/tests/clamp/UIs/04__Submit_deploy_chain_Holmes.robot4
-rw-r--r--test/csit/tests/clamp/UIs/05__Submit_deploy_chain_TCA.robot4
-rw-r--r--test/csit/tests/dcaegen2/prh_testcases/__init__.robot0
-rw-r--r--test/csit/tests/dcaegen2/prh_testcases/prh_tests.robot65
-rw-r--r--test/csit/tests/dcaegen2/prh_testcases/resources/docker-compose.yml44
-rw-r--r--test/csit/tests/dcaegen2/prh_testcases/resources/simulator/AAI.py56
-rw-r--r--test/csit/tests/dcaegen2/prh_testcases/resources/simulator/AAI_simulator11
-rw-r--r--test/csit/tests/dcaegen2/prh_testcases/resources/simulator/DMaaP.py75
-rw-r--r--test/csit/tests/dcaegen2/prh_testcases/resources/simulator/DMaaP_simulator11
10 files changed, 267 insertions, 5 deletions
diff --git a/test/csit/tests/clamp/UIs/03__Verify_UI_Models.robot b/test/csit/tests/clamp/UIs/03__Verify_UI_Models.robot
index a9cb78749..8bbf7c85e 100644
--- a/test/csit/tests/clamp/UIs/03__Verify_UI_Models.robot
+++ b/test/csit/tests/clamp/UIs/03__Verify_UI_Models.robot
@@ -21,7 +21,7 @@ Verify HolmesModel1
Should Contain Match ${resp} *migrate*
Should Contain Match ${resp} *240*
Should Contain Match ${resp} *390*
- Should Contain Match ${resp} *correlational Logic1*
+ Should Contain Match ${resp} *Logic1*
Should Contain Match ${resp} *config Policy Name1*
Verify TCAModel1
diff --git a/test/csit/tests/clamp/UIs/04__Submit_deploy_chain_Holmes.robot b/test/csit/tests/clamp/UIs/04__Submit_deploy_chain_Holmes.robot
index f400156d1..32b4ce7ec 100644
--- a/test/csit/tests/clamp/UIs/04__Submit_deploy_chain_Holmes.robot
+++ b/test/csit/tests/clamp/UIs/04__Submit_deploy_chain_Holmes.robot
@@ -78,8 +78,8 @@ Deploy Holmes CL
Click Element xpath=//*[@id="navbar"]/ul/li[2]/a
Wait Until Element Is Visible locator=Deploy timeout=60
Click Element locator=Deploy
- Wait Until Element Is Visible xpath=//*[@id="deployProperties"] timeout=60
- Input Text xpath=//*[@id="deployProperties"] text={}
+# Wait Until Element Is Visible xpath=//*[@id="deployProperties"] timeout=60
+# Input Text xpath=//*[@id="deployProperties"] text={}
Click Button locator=Deploy
Click Button locator=Yes
Wait Until Element Is Visible xpath=//*[@id="alert_message_"] timeout=60
diff --git a/test/csit/tests/clamp/UIs/05__Submit_deploy_chain_TCA.robot b/test/csit/tests/clamp/UIs/05__Submit_deploy_chain_TCA.robot
index 34c1a71ef..db72f3bbd 100644
--- a/test/csit/tests/clamp/UIs/05__Submit_deploy_chain_TCA.robot
+++ b/test/csit/tests/clamp/UIs/05__Submit_deploy_chain_TCA.robot
@@ -78,8 +78,8 @@ Deploy TCA CL
Click Element xpath=//*[@id="navbar"]/ul/li[2]/a
Wait Until Element Is Visible locator=Deploy timeout=60
Click Element locator=Deploy
- Wait Until Element Is Visible xpath=//*[@id="deployProperties"] timeout=60
- Input Text xpath=//*[@id="deployProperties"] text={}
+# Wait Until Element Is Visible xpath=//*[@id="deployProperties"] timeout=60
+# Input Text xpath=//*[@id="deployProperties"] text={}
Click Button locator=Deploy
Click Button locator=Yes
Wait Until Element Is Visible xpath=//*[@id="alert_message_"] timeout=60
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
--- /dev/null
+++ b/test/csit/tests/dcaegen2/prh_testcases/__init__.robot
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..764a879a3
--- /dev/null
+++ b/test/csit/tests/dcaegen2/prh_testcases/prh_tests.robot
@@ -0,0 +1,65 @@
+*** Settings ***
+Library RequestsLibrary
+
+*** 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
+ [Timeout]
+ {"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
+
+*** Keywords ***
+Run Getting and Consuming
+ [Arguments] ${posted_event_to_dmaap} ${pnfs_name} ${event_in_dmaap}
+ [Timeout] 1 minutes
+ ${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] 1 minute
+ ${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] 1 minute
+ ${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] 1 minute
+ 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/docker-compose.yml b/test/csit/tests/dcaegen2/prh_testcases/resources/docker-compose.yml
new file mode 100644
index 000000000..e27d84516
--- /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
+ \ No newline at end of file
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..f9d0ee07b
--- /dev/null
+++ b/test/csit/tests/dcaegen2/prh_testcases/resources/simulator/AAI.py
@@ -0,0 +1,56 @@
+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(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" ]