summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/csit/plans/dcae-bulkpm/bulkpm-suite/assets/addSubscriber.json18
-rw-r--r--test/csit/plans/dcae-bulkpm/bulkpm-suite/assets/createFeed.json18
-rw-r--r--test/csit/plans/dcae-bulkpm/bulkpm-suite/setup.sh22
-rw-r--r--test/csit/plans/dcae-bulkpm/bulkpm-suite/teardown.sh22
-rw-r--r--test/csit/tests/dcae-bulkpm/testcases/assets/json_events/FileExistNotification.json21
-rw-r--r--test/csit/tests/dcae-bulkpm/testcases/e2e.robot19
6 files changed, 87 insertions, 33 deletions
diff --git a/test/csit/plans/dcae-bulkpm/bulkpm-suite/assets/addSubscriber.json b/test/csit/plans/dcae-bulkpm/bulkpm-suite/assets/addSubscriber.json
new file mode 100644
index 000000000..612c4626a
--- /dev/null
+++ b/test/csit/plans/dcae-bulkpm/bulkpm-suite/assets/addSubscriber.json
@@ -0,0 +1,18 @@
+{
+ "delivery":{
+ "url":"http://fileconsumer:7070",
+ "user":"LOGIN",
+ "password":"PASSWORD",
+ "use100":true
+ },
+ "follow_redirect":false,
+ "metadataOnly":false,
+ "suspend":false,
+ "groupid":0,
+ "links":{
+ "self": "https://dmaap-dr-prov/subscribe/1",
+ "log": "https://dmaap-dr-prov/feedlog/1",
+ "feed": "https://dmaap-dr-prov/feed/1"
+ },
+ "subscriber":"admin"
+ } \ No newline at end of file
diff --git a/test/csit/plans/dcae-bulkpm/bulkpm-suite/assets/createFeed.json b/test/csit/plans/dcae-bulkpm/bulkpm-suite/assets/createFeed.json
new file mode 100644
index 000000000..fdcc7eef6
--- /dev/null
+++ b/test/csit/plans/dcae-bulkpm/bulkpm-suite/assets/createFeed.json
@@ -0,0 +1,18 @@
+{
+ "name": "DefaultFeed",
+ "version": "m1.0",
+ "description": "Default feed",
+ "business_description": "Default Feed",
+ "suspend": false,
+ "deleted": false,
+ "changeowner": true,
+ "authorization": {
+ "classification": "unclassified",
+ "endpoint_addrs": [],
+ "endpoint_ids": [
+ {
+ "password": "dradmin",
+ "id": "dradmin"
+ }]
+ }
+ } \ No newline at end of file
diff --git a/test/csit/plans/dcae-bulkpm/bulkpm-suite/setup.sh b/test/csit/plans/dcae-bulkpm/bulkpm-suite/setup.sh
index c9f5318dd..24027e911 100644
--- a/test/csit/plans/dcae-bulkpm/bulkpm-suite/setup.sh
+++ b/test/csit/plans/dcae-bulkpm/bulkpm-suite/setup.sh
@@ -63,7 +63,8 @@ docker-compose up -d
docker kill datarouter-prov
docker kill datarouter-node
docker kill vescollector
-sed -i -e '/DMAAPHOST:/ s/:.*/: '$DMAAP_MR_IP'/' docker-compose.yml
+HOST_IP=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $NF}')
+sed -i -e '/DMAAPHOST:/ s/:.*/: '$HOST_IP'/' docker-compose.yml
MARIADB=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mariadb )
sed -i 's/172.100.0.2/'$MARIADB'/g' $WORKSPACE/archives/dmaapdr/datarouter/docker-compose/prov_data/provserver.properties
docker-compose up -d
@@ -90,10 +91,6 @@ DR_NODE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}
DR_SUBSCIBER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' subscriber-node)
DR_GATEWAY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' datarouter-prov)
-#Add the DR_NODE_IP to /etc/hosts
-echo "${DR_NODE_IP} dmaap-dr-node" >> /etc/hosts
-echo "${DR_PROV_IP} dmaap-dr-prov" >> /etc/hosts
-
echo DR_PROV_IP=${DR_PROV_IP}
echo DR_NODE_IP=${DR_NODE_IP}
echo DR_GATEWAY_IP=${DR_GATEWAY_IP}
@@ -110,16 +107,23 @@ DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPA
KAFKA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $KAFKA)
ZOOKEEPER_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $ZOOKEEPER)
VESC_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' vescollector)
+SFTP_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sftp)
export VESC_IP=${VESC_IP}
export HOST_IP=${HOST_IP}
export DMAAP_MR_IP=${DMAAP_MR_IP}
-echo "${DMAAP_MR_IP} dmaap-mr" >> /etc/hosts
-
#Pass any variables required by Robot test suites in ROBOT_VARIABLES
-ROBOT_VARIABLES="-v DR_PROV_IP:${DR_PROV_IP} -v DR_NODE_IP:${DR_NODE_IP} -v DMAAP_MR_IP:${DMAAP_MR_IP} -v VESC_IP:${VESC_IP}"
+ROBOT_VARIABLES="-v DR_PROV_IP:${DR_PROV_IP} -v DR_NODE_IP:${DR_NODE_IP} -v DMAAP_MR_IP:${DMAAP_MR_IP} -v VESC_IP:${VESC_IP} -v DR_SUBSCIBER_IP:${DR_SUBSCIBER_IP}"
pip install jsonschema uuid
# Wait container ready
-sleep 2 \ No newline at end of file
+sleep 2
+# Update the File Ready Notification with actual sftp ip address
+sed -i 's/sftpserver/'${SFTP_IP}'/g' $WORKSPACE/test/csit/tests/dcae-bulkpm/testcases/assets/json_events/FileExistNotification.json
+#Create default feed in data router.
+curl -v -X POST -H "Content-Type:application/vnd.att-dr.feed" -H "X-ATT-DR-ON-BEHALF-OF:dradmin" --data-ascii @$WORKSPACE/test/csit/plans/dcae-bulkpm/bulkpm-suite/assets/createFeed.json --post301 --location-trusted -k https://${DR_PROV_IP}:8443
+#create file consumer subscriber on data router.
+cp $WORKSPACE/test/csit/plans/dcae-bulkpm/bulkpm-suite/assets/addSubscriber.json /tmp/addSubscriber.json
+sed -i 's/fileconsumer/'${DR_SUBSCIBER_IP}'/g' /tmp/addSubscriber.json
+curl -v -X POST -H "Content-Type:application/vnd.att-dr.subscription" -H "X-ATT-DR-ON-BEHALF-OF:dradmin" --data-ascii @/tmp/addSubscriber.json --post301 --location-trusted -k https://${DR_PROV_IP}:8443/subscribe/1
diff --git a/test/csit/plans/dcae-bulkpm/bulkpm-suite/teardown.sh b/test/csit/plans/dcae-bulkpm/bulkpm-suite/teardown.sh
index e3035f0c1..e11616ed3 100644
--- a/test/csit/plans/dcae-bulkpm/bulkpm-suite/teardown.sh
+++ b/test/csit/plans/dcae-bulkpm/bulkpm-suite/teardown.sh
@@ -1,14 +1,12 @@
#!/bin/bash
echo "Starting teardown script"
-cd $WORKSPACE/test/csit/scripts
-./kill-instance.sh $DMAAP
-./kill-instance.sh $KAFKA
-./kill-instance.sh $ZOOKEEPER
-./kill-instance.sh vescollector
-./kill-instance.sh datarouter-node
-./kill-instance.sh datarouter-prov
-./kill-instance.sh subscriber-node
-./kill-instance.sh mariadb
-./kill-instance.sh dfc
-./kill-instance.sh sftp
-sudo sed -i '/dmaap/d' /etc/hosts \ No newline at end of file
+kill-instance.sh $DMAAP
+kill-instance.sh $KAFKA
+kill-instance.sh $ZOOKEEPER
+kill-instance.sh vescollector
+kill-instance.sh datarouter-node
+kill-instance.sh datarouter-prov
+kill-instance.sh subscriber-node
+kill-instance.sh mariadb
+kill-instance.sh dfc
+kill-instance.sh sftp \ No newline at end of file
diff --git a/test/csit/tests/dcae-bulkpm/testcases/assets/json_events/FileExistNotification.json b/test/csit/tests/dcae-bulkpm/testcases/assets/json_events/FileExistNotification.json
index 96068e39a..1cfc78a25 100644
--- a/test/csit/tests/dcae-bulkpm/testcases/assets/json_events/FileExistNotification.json
+++ b/test/csit/tests/dcae-bulkpm/testcases/assets/json_events/FileExistNotification.json
@@ -18,13 +18,16 @@
"changeIdentifier": "PM_MEAS_FILES",
"changeType": "FileReady",
"notificationFieldsVersion": "2.0",
- "additionalFields":
- {
- "location": "ftpes://192.168.0.101:22/ftp/rop/A20161224.1030-1045.bin.gz",
- "compression": "gzip",
- "fileformatType": "org.3GPP.32.435#measCollec",
- "fileFormatVersion": "V10"
- }
- }
+ "arrayOfNamedHashMap": [
+ { "name": "pm.xml.gz",
+ "hashMap":{
+ "location": "sftp://admin:admin@sftpserver:22/pm.xml.gz",
+ "compression": "gzip",
+ "fileFormatType": "org.3GPP.32.435#measCollec",
+ "fileFormatVersion": "V10"
+ }
+ }
+ ]
}
- } \ No newline at end of file
+}
+} \ No newline at end of file
diff --git a/test/csit/tests/dcae-bulkpm/testcases/e2e.robot b/test/csit/tests/dcae-bulkpm/testcases/e2e.robot
index 69c795341..210012cb6 100644
--- a/test/csit/tests/dcae-bulkpm/testcases/e2e.robot
+++ b/test/csit/tests/dcae-bulkpm/testcases/e2e.robot
@@ -3,6 +3,7 @@ Documentation Testing E2E VES,Dmaap,DFC,DR with File Ready event feed from xNF
Library RequestsLibrary
Library OperatingSystem
Library Collections
+Library Process
Resource resources/ves_keywords.robot
@@ -15,11 +16,13 @@ ${EVENT_DATA_FILE} %{WORKSPACE}/test/csit/tests/dcae-bulkp
${TARGETURL_TOPICS} http://${DMAAP_MR_IP}:3904/topics
${TARGETURL_SUBSCR} http://${DMAAP_MR_IP}:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT/OpenDcae-c12/C12?timeout=1000
+${CLI_EXEC_CLI} curl -k https://${DR_PROV_IP}:8443/internal/prov
+
*** Test Cases ***
Send VES File Ready Event to VES Collector
- [Tags] DCAE-VESC-R1
- [Documentation] Post single event and expect 200 Response
+ [Tags] Bulk_PM_E2E_01
+ [Documentation] Send VES File Ready Event
${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
${headers}= Create Header From String ${HEADER_STRING}
${resp}= Publish Event To VES Collector ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata}
@@ -27,7 +30,8 @@ Send VES File Ready Event to VES Collector
Should Be Equal As Strings ${resp.status_code} 202
Check VES Notification Topic is existing in Message Router
- [Documentation] Get the count of the Topics
+ [Tags] Bulk_PM_E2E_02
+ [Documentation] Get the VES Notification topic on message router
[Timeout] 1 minute
Sleep 10s
${resp}= GetCall ${TARGETURL_TOPICS}
@@ -38,3 +42,12 @@ Check VES Notification Topic is existing in Message Router
${ListLength}= Get Length ${topics}
log ${ListLength}
List Should Contain Value ${topics} unauthenticated.VES_NOTIFICATION_OUTPUT
+
+Verify Default Feed And File Consumer Subscription On Datarouter
+ [Tags] Bulk_PM_E2E_04
+ [Documentation] Verify Default Feed And File Consumer Subscription On Datarouter
+ ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI} shell=yes
+ Log ${cli_cmd_output.stdout}
+ Should Be Equal As Strings ${cli_cmd_output.rc} 0
+ Should Contain ${cli_cmd_output.stdout} https://dmaap-dr-prov/publish/1
+ Should Contain ${cli_cmd_output.stdout} http://${DR_SUBSCIBER_IP}:7070 \ No newline at end of file
s1">'Subcommands', dest='subcommand') # Bootstrap command parser parser_bootstrap = subparsers.add_parser('bootstrap', help='Bootstrap the system') parser_bootstrap.add_argument('--count', help='Instance count to bootstrap', type=int, metavar='INT', default=1) parser_bootstrap.add_argument('--urlves', help='URL of the VES collector', type=validate_url, metavar='URL', required=True) parser_bootstrap.add_argument('--ipfileserver', help='Visible IP of the file server (SFTP/FTPS) to be included in the VES event', type=validate_ip, metavar='IP', required=True) parser_bootstrap.add_argument('--typefileserver', help='Type of the file server (SFTP/FTPS) to be included in the VES event', type=str, choices=['sftp', 'ftps'], required=True) parser_bootstrap.add_argument('--ipstart', help='IP address range beginning', type=validate_ip, metavar='IP', required=True) # Start command parser parser_start = subparsers.add_parser('start', help='Start instances') parser_start.add_argument('--count', help='Instance count to start', type=int, metavar='INT', default=1) # Stop command parser parser_stop = subparsers.add_parser('stop', help='Stop instances') parser_stop.add_argument('--count', help='Instance count to stop', type=int, metavar='INT', default=1) # Trigger command parser parser_trigger = subparsers.add_parser('trigger', help='Trigger one single VES event from each simulator') parser_trigger.add_argument('--count', help='Instance count to trigger', type=int, metavar='INT', default=1) # Trigger-custom command parser parser_triggerstart = subparsers.add_parser('trigger-custom', help='Trigger one single VES event from specific simulators') parser_triggerstart.add_argument('--triggerstart', help='First simulator id to trigger', type=int, metavar='INT', required=True) parser_triggerstart.add_argument('--triggerend', help='Last simulator id to trigger', type=int, metavar='INT', required=True) # Status command parser parser_status = subparsers.add_parser('status', help='Status') parser_status.add_argument('--count', help='Instance count to show status for', type=int, metavar='INT', default=1) # Clean command parser subparsers.add_parser('clean', help='Clean work-dirs') # General options parser parser.add_argument('--verbose', help='Verbosity level', choices=['info', 'debug'], type=str, default='debug') return parser class MassPnfSim(): log_lvl = logging.INFO def __init__(self, args): self.args = args self.logger = logging.getLogger(__name__) self.logger.setLevel(self.log_lvl) def bootstrap(self): self.logger.info("Bootstrapping PNF instances") start_port = 2000 ftps_pasv_port_start = 8000 ftps_pasv_port_num_of_ports = 10 ftps_pasv_port_end = ftps_pasv_port_start + ftps_pasv_port_num_of_ports for i in range(self.args.count): self.logger.info(f"PNF simulator instance: {i}") # The IP ranges are in distance of 16 compared to each other. # This is matching the /28 subnet mask used in the dockerfile inside. instance_ip_offset = i * 16 ip_properties = [ 'subnet', 'gw', 'PnfSim', 'ftps', 'sftp' ] ip_offset = 0 ip = {} for prop in ip_properties: ip.update({prop: str(self.args.ipstart + ip_offset + instance_ip_offset)}) ip_offset += 1 self.logger.debug(f'Instance #{i} properties:\n {dumps(ip, indent=4)}') PortSftp = start_port + 1 PortFtps = start_port + 2 start_port += 2 foldername = f"pnf-sim-lw-{i}" completed = subprocess.run('mkdir ' + foldername, shell=True) self.logger.info(f'\tCreating folder: {completed.stdout}') completed = subprocess.run( 'cp -r pnf-sim-lightweight/* ' + foldername, shell=True) self.logger.info(f'\tCloning folder: {completed.stdout}') composercmd = " ".join([ "./simulator.sh compose", ip['gw'], ip['subnet'], str(i), self.args.urlves, ip['PnfSim'], str(self.args.ipfileserver), self.args.typefileserver, str(PortSftp), str(PortFtps), ip['ftps'], ip['sftp'], str(ftps_pasv_port_start), str(ftps_pasv_port_end) ]) self.logger.debug(f"Script cmdline: {composercmd}") completed = subprocess.run( 'set -x; cd ' + foldername + '; ' + composercmd, shell=True) self.logger.info(f'Cloning: {completed.stdout}') ftps_pasv_port_start += ftps_pasv_port_num_of_ports + 1 ftps_pasv_port_end += ftps_pasv_port_num_of_ports + 1 self.logger.info(f'Done setting up instance #{i}') completed = subprocess.run('set -x; cd pnf-sim-lightweight; ./simulator.sh build ', shell=True) self.logger.info(f"Build docker image: {completed.stdout}") def clean(self): completed = subprocess.run('rm -rf ./pnf-sim-lw-*', shell=True) self.logger.info(f'Deleting: {completed.stdout}') def start(self): for i in range(self.args.count): foldername = f"pnf-sim-lw-{i}" completed = subprocess.run( 'set -x ; cd ' + foldername + "; bash -x ./simulator.sh start", shell=True) self.logger.info(f'Starting: {completed.stdout}') time.sleep(5) def status(self): for i in range(self.args.count): foldername = f"pnf-sim-lw-{i}" completed = subprocess.run( 'cd ' + foldername + "; ./simulator.sh status", shell=True) self.logger.info(f'Status: {completed.stdout}') def stop(self): for i in range(self.args.count): foldername = f"pnf-sim-lw-{i}" completed = subprocess.run( 'cd ' + foldername + f"; ./simulator.sh stop {i}", shell=True) self.logger.info(f'Stopping: {completed.stdout}') def trigger(self): self.logger.info("Triggering VES sending:") for i in range(self.args.count): foldername = f"pnf-sim-lw-{i}" completed = subprocess.run( 'cd ' + foldername + "; ./simulator.sh trigger-simulator", shell=True) self.logger.info(f'Status: {completed.stdout}') def trigger_custom(self): self.logger.info("Triggering VES sending by a range of simulators:") for i in range(self.args.triggerstart, self.args.triggerend+1): foldername = f"pnf-sim-lw-{i}" self.logger.info(f"Instance being processed: {i}") completed = subprocess.run( 'cd ' + foldername + "; ./simulator.sh trigger-simulator", shell=True) self.logger.info(f'Status: {completed.stdout}')