diff options
Diffstat (limited to 'test/csit/tests')
20 files changed, 434 insertions, 163 deletions
diff --git a/test/csit/tests/clamp/UIs/01__Create_Holmes_model.robot b/test/csit/tests/clamp/UIs/01__Create_Holmes_model.robot index 305044cb0..e8b1429d0 100644 --- a/test/csit/tests/clamp/UIs/01__Create_Holmes_model.robot +++ b/test/csit/tests/clamp/UIs/01__Create_Holmes_model.robot @@ -60,6 +60,7 @@ Set Properties for HolmesModel1 Select From List By Label id=vf vFirewall 0 Select From List By Label id=actionSet VNF Select From List By Label id=location Data Center 2 Data Center 3 + Input Text locator=deployParameters text={} Click Button locator=Save Set Policy Box properties for HolmesModel1 diff --git a/test/csit/tests/clamp/UIs/02__Create_TCA_model.robot b/test/csit/tests/clamp/UIs/02__Create_TCA_model.robot index 0dc0a8abb..bdc537eab 100644 --- a/test/csit/tests/clamp/UIs/02__Create_TCA_model.robot +++ b/test/csit/tests/clamp/UIs/02__Create_TCA_model.robot @@ -53,6 +53,7 @@ Set Properties for TCAModel1 Select From List By Label id=vf vLoadBalancer 0 Select From List By Label id=actionSet VNF Select From List By Label id=location Data Center 1 Data Center 3 + Input Text locator=deployParameters text={} Click Button locator=Save Set Policy Box properties for TCAModel1 diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/XnfSimulatorLibrary.py b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/XnfSimulatorLibrary.py index d85eb4dee..b2466d7ca 100644 --- a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/XnfSimulatorLibrary.py +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/XnfSimulatorLibrary.py @@ -8,9 +8,12 @@ from time import sleep XNF_SIMULATOR_NAME = "xNF Simulator" SIMULATOR_IMAGE_NAME = "onap/org.onap.dcaegen2.collectors.hv-ves.hv-collector-xnf-simulator" SIMULATOR_IMAGE_FULL_NAME = os.getenv("DOCKER_REGISTRY") + "/" + SIMULATOR_IMAGE_NAME + ":latest" -certificates_dir_path = os.getenv("WORKSPACE") + "/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/ssl/" +WORKSPACE_ENV = os.getenv("WORKSPACE") +certificates_dir_path = WORKSPACE_ENV + "/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/ssl/" +collector_certs_lookup_dir = "/etc/ves-hv/" ONE_SECOND_IN_NANOS = 10 ** 9 + class XnfSimulatorLibrary: def start_xnf_simulators(self, list_of_ports, valid_certs=True): @@ -36,48 +39,43 @@ class XnfSimulatorLibrary: simulators_addresses = [] for port in list_of_ports: container = self.run_simulator(dockerClient, port, - "/etc/ves-hv/" + cert_name_prefix + "client.crt", - "/etc/ves-hv/" + cert_name_prefix + "client.key", - "/etc/ves-hv/" + cert_name_prefix + "trust.crt" + collector_certs_lookup_dir + cert_name_prefix + "client.crt", + collector_certs_lookup_dir + cert_name_prefix + "client.key", + collector_certs_lookup_dir + cert_name_prefix + "trust.crt" ) - self.copy_required_certificates_into_simulator(container) logger.info("Started container: " + container.name + " " + container.id) simulators_addresses.append(container.name + ":" + port) return simulators_addresses def run_simulator(self, dockerClient, port, client_crt_path, client_key_path, client_trust_store): + xNF_startup_command = ["--listen-port", port, + "--ves-host", "ves-hv-collector", + "--ves-port", "6061", + "--cert-file", client_crt_path, + "--private-key-file", client_key_path, + "--trust-cert-file", client_trust_store] + xNF_healthcheck_command = { + "interval": 5 * ONE_SECOND_IN_NANOS, + "timeout": 3 * ONE_SECOND_IN_NANOS, + "retries": 1, + "test": ["CMD", "curl", "--request", "GET", + "--fail", "--silent", "--show-error", + "localhost:" + port + "/healthcheck"] + } + logger.info("Startup command: " + str(xNF_startup_command)) + logger.info("Healthcheck command: " + str(xNF_healthcheck_command)) return dockerClient.containers.run(SIMULATOR_IMAGE_FULL_NAME, - command=["--listen-port", port, - "--ves-host", "ves-hv-collector", - "--ves-port", "6061", - "--cert-file", client_crt_path, - "--private-key-file", client_key_path, - "--trust-cert-file", client_trust_store - ], - healthcheck={ - "interval": 5 * ONE_SECOND_IN_NANOS, - "timeout": 3 * ONE_SECOND_IN_NANOS, - "retries": 1, - "test": ["CMD", "curl", "--request", "GET", - "--fail", "--silent", "--show-error", - "localhost:" + port + "/healthcheck"] - }, + command=xNF_startup_command, + healthcheck=xNF_healthcheck_command, detach=True, network="ves-hv-default", ports={port + "/tcp": port}, + volumes=self.container_volumes(), name="ves-hv-collector-xnf-simulator" + port) - def copy_required_certificates_into_simulator(self, container): - container.exec_run("mkdir -p /etc/ves-hv") - copy_to_container(container.id, [ - certificates_dir_path + "client.crt", - certificates_dir_path + "client.key", - certificates_dir_path + "trust.crt", - certificates_dir_path + "invalid_client.crt", - certificates_dir_path + "invalid_client.key", - certificates_dir_path + "invalid_trust.crt", - ]) + def container_volumes(self): + return {certificates_dir_path: {"bind": collector_certs_lookup_dir, "mode": 'rw'}} def assert_containers_startup_was_successful(self, dockerClient): checks_amount = 6 @@ -95,11 +93,15 @@ class XnfSimulatorLibrary: container_health = container.attrs['State']['Health']['Status'] return container_health == 'healthy' and container.status == 'running' - def stop_and_remove_all_xnf_simulators(self): + def stop_and_remove_all_xnf_simulators(self, suite_name): dockerClient = docker.from_env() for container in self.get_simulators_list(dockerClient): logger.info("Stopping and removing container: " + container.id) - logger.debug(container.logs()) + log_filename = WORKSPACE_ENV + "/archives/containers_logs/" + \ + suite_name.split(".")[-1] + "_" + container.name + ".log" + file = open(log_filename, "w+") + file.write(container.logs()) + file.close() container.stop() container.remove() dockerClient.close() diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/hv-ves.robot b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/message-routing.robot index 482b698fe..6153afa0a 100644 --- a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/hv-ves.robot +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/message-routing.robot @@ -1,19 +1,28 @@ *** Settings *** -Library DcaeAppSimulatorLibrary +Library DcaeAppSimulatorLibrary Library XnfSimulatorLibrary Library VesHvContainersUtilsLibrary Library Collections +Resource resources/common-keywords.robot + Suite Setup Message Routing Suite Setup Suite Teardown VES-HV Collector Suite Teardown Test Teardown VES-HV Collector Test Shutdown +*** Keywords *** +Message Routing Suite Setup + Log Started Suite: VES-HV Message Routing + ${XNF_PORTS_LIST}= Create List 7000 + Configure Valid xNF Simulators On Ports ${XNF_PORTS_LIST} + Log Suite setup finished + *** Test Cases *** Correct Messages Routing [Documentation] VES-HV Collector should route all valid messages to topics specified in configuration ... and do not change message payload generated in XNF simulator - ${SIMULATORS_LIST}= Get xNF Simulators 1 + ${SIMULATORS_LIST}= Get Valid xNF Simulators 1 Send Messages From xNF Simulators ${SIMULATORS_LIST} ${XNF_FIXED_PAYLOAD_REQUEST} Wait until keyword succeeds 60 sec 5 sec @@ -24,7 +33,7 @@ Correct Messages Routing Too big payload message handling [Documentation] VES-HV Collector should interrupt the stream when encountered message with too big payload - ${SIMULATORS_LIST}= Get xNF Simulators 1 + ${SIMULATORS_LIST}= Get Valid xNF Simulators 1 Send Messages From xNF Simulators ${SIMULATORS_LIST} ${XNF_TOO_BIG_PAYLOAD_REQUEST} Wait until keyword succeeds 60 sec 5 sec @@ -34,7 +43,7 @@ Too big payload message handling Invalid wire frame message handling [Documentation] VES-HV Collector should skip messages with invalid wire frame - ${SIMULATORS_LIST}= Get xNF Simulators 1 + ${SIMULATORS_LIST}= Get Valid xNF Simulators 1 Send Messages From xNF Simulators ${SIMULATORS_LIST} ${XNF_INVALID_WIRE_FRAME_REQUEST} Wait until keyword succeeds 60 sec 5 sec @@ -45,7 +54,7 @@ Invalid wire frame message handling Invalid GPB data message handling [Documentation] VES-HV Collector should skip messages with invalid GPB data - ${SIMULATORS_LIST}= Get xNF Simulators 1 + ${SIMULATORS_LIST}= Get Valid xNF Simulators 1 Send Messages From xNF Simulators ${SIMULATORS_LIST} ${XNF_INVALID_GPB_DATA_REQUEST} Wait until keyword succeeds 60 sec 5 sec @@ -56,47 +65,13 @@ Invalid GPB data message handling Unsupported domain message handling [Documentation] VES-HV Collector should skip messages with unsupported domain - ${SIMULATORS_LIST}= Get xNF Simulators 1 + ${SIMULATORS_LIST}= Get Valid xNF Simulators 1 Send Messages From xNF Simulators ${SIMULATORS_LIST} ${XNF_UNSUPPORTED_DOMAIN_REQUEST} Wait until keyword succeeds 60 sec 5 sec ... Assert Dcae App Consumed ${DCAE_APP_API_MESSAGES_COUNT_URL} ${AMOUNT_50000} Assert Dcae App Consumed Proper Messages ${DCAE_APP_API_MESSAGES_VALIDATION_URL} ${DCAE_UNSUPPORTED_DOMAIN_REQUEST} -*** Keywords *** -Message Routing Suite Setup - Log Started Suite: VES-HV Message Routing - ${XNF_PORTS_LIST}= Create List 7000 - Configure xNF Simulators On Ports ${XNF_PORTS_LIST} - Log Suite setup finished - -Configure xNF Simulators On Ports - [Arguments] ${XNF_PORTS_LIST} - ${XNF_SIMULATORS_ADDRESSES}= Start Xnf Simulators ${XNF_PORTS_LIST} True - Set Suite Variable ${XNF_SIMULATORS_ADDRESSES} - - -Get xNF Simulators - [Arguments] ${AMOUNT} - ${SIMULATORS}= Get Slice From List ${XNF_SIMULATORS_ADDRESSES} 0 ${AMOUNT} - [Return] ${SIMULATORS} - - -Send Messages From xNF Simulators - [Arguments] ${XNF_HOSTS_LIST} ${MESSAGE_FILEPATH} - :FOR ${HOST} IN @{XNF_HOSTS_LIST} - \ ${XNF_SIM_API_ACCESS}= Get xNF Sim Api Access Url ${HTTP_METHOD_URL} ${HOST} - \ ${XNF_SIM_API_URL}= Catenate SEPARATOR= ${XNF_SIM_API_ACCESS} ${XNF_SIM_API_PATH} - \ Send messages ${XNF_SIM_API_URL} ${MESSAGE_FILEPATH} - - -VES-HV Collector Test Shutdown - Reset DCAE App Simulator ${DCAE_APP_API_MESSAGE_RESET_URL} - - -VES-HV Collector Suite Teardown - Stop And Remove All Xnf Simulators - *** Variables *** ${HTTP_METHOD_URL} http:// diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/common-keywords.robot b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/common-keywords.robot index 345118657..bc03de232 100644 --- a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/common-keywords.robot +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/resources/common-keywords.robot @@ -6,13 +6,13 @@ Library Collections *** Keywords *** Configure Valid xNF Simulators On Ports [Arguments] ${XNF_PORTS_LIST} - ${VALID_XNF_SIMULATORS_ADDRESSES}= Start Xnf Simulators ${XNF_PORTS_LIST} True + ${VALID_XNF_SIMULATORS_ADDRESSES}= Start Xnf Simulators ${XNF_PORTS_LIST} ${true} Set Suite Variable ${VALID_XNF_SIMULATORS_ADDRESSES} Configure Invalid xNF Simulators On Ports [Arguments] ${XNF_PORTS_LIST} - ${INVALID_XNF_SIMULATORS_ADDRESSES}= Start Xnf Simulators ${XNF_PORTS_LIST} False + ${INVALID_XNF_SIMULATORS_ADDRESSES}= Start Xnf Simulators ${XNF_PORTS_LIST} ${false} Set Suite Variable ${INVALID_XNF_SIMULATORS_ADDRESSES} @@ -41,7 +41,7 @@ VES-HV Collector Test Shutdown VES-HV Collector Suite Teardown - Stop And Remove All Xnf Simulators + Stop And Remove All Xnf Simulators ${SUITE NAME} *** Variables *** ${HTTP_METHOD_URL} http:// diff --git a/test/csit/tests/dcaegen2/prh-testcases/__init__.robot b/test/csit/tests/dcaegen2/prh-testcases/__init__.robot index e69de29bb..f13ba6df8 100644 --- a/test/csit/tests/dcaegen2/prh-testcases/__init__.robot +++ b/test/csit/tests/dcaegen2/prh-testcases/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Documentation Integration - PRH suite
\ No newline at end of file diff --git a/test/csit/tests/dcaegen2/prh-testcases/prh_tests.robot b/test/csit/tests/dcaegen2/prh-testcases/prh_tests.robot index b7013c4a2..5150a4b35 100644 --- a/test/csit/tests/dcaegen2/prh-testcases/prh_tests.robot +++ b/test/csit/tests/dcaegen2/prh-testcases/prh_tests.robot @@ -10,7 +10,7 @@ Resource resources/prh_library.robot ${DMAAP_SIMULATOR_URL} http://${DMAAP_SIMULATOR} ${AAI_SIMULATOR_URL} http://${AAI_SIMULATOR} ${PRH_URL} http://${PRH} -${EVENT_WITH_ALL_VALID_REQUIRED_FIELDS} {"event": {"otherFields": {"pnfVendorName":"Nokia", "pnfSerialNumber":"QTFCOC540002E", "pnfOamIpv4Address":"10.16.123.234", "pnfOamIpv6Address":"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}}} +${EVENT_WITH_ALL_VALID_REQUIRED_FIELDS} {"event": {"commonEventHeader": {"sourceName":"NOK6061ZW1"}, "pnfRegistrationFields": {"oamV4IpAddress":"10.16.123.234", "oamV6IpAddress":"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}}} ${Not_json_format} "" *** Test Cases *** @@ -19,28 +19,18 @@ Valid DMaaP event can be converted to PNF_READY notification [Tags] PRH Valid event [Template] Valid event processing ${EVENT_WITH_ALL_VALID_REQUIRED_FIELDS} - {"event": {"otherFields": {"pnfVendorName":"Nokia", "pnfSerialNumber":"QTFCOC540002G", "pnfOamIpv4Address":"10.16.123.234", "pnfOamIpv6Address":""}}} - {"event": {"otherFields": {"pnfVendorName":"Nokia", "pnfSerialNumber":"QTFCOC540002F", "pnfOamIpv4Address":"", "pnfOamIpv6Address":"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}}} - {"event": {"otherFields": {"pnfVendorName":"Ericsson", "pnfSerialNumber":"QTFCOC5400000", "pnfOamIpv4Address":"", "pnfOamIpv6Address":"2001:0db8:85b3:0000:0000:8a2e:0370:7334"}}} + {"event": {"commonEventHeader": {"sourceName":"NOK6061ZW2"}, "pnfRegistrationFields": {"oamV4IpAddress":"10.17.123.234", "oamV6IpAddress":""}}} + {"event": {"commonEventHeader": {"sourceName":"ERI6061ZW3"}, "pnfRegistrationFields": {"oamV4IpAddress":"", "oamV6IpAddress":"2001:0db8:85a3:0000:0000:8b2e:0370:7334"}}} Invalid DMaaP event cannot be converted to PNF_READY notification [Documentation] PRH get invalid event from DMaaP with missing required fields - PRH does not produce PNF_READY notification [Tags] PRH Invalid event [Template] Invalid event processing - {"event": {"otherFields": {"pnfVendorName":"Nokia", "pnfSerialNumber":"QTFCOC540002E", "pnfOamIpv4Address":"", "pnfOamIpv6Address":""}}} - {"event": {"otherFields": {"pnfVendorName":"Nokia", "pnfSerialNumber":"", "pnfOamIpv4Address":"10.16.123.234", "pnfOamIpv6Address":"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}}} - {"event": {"otherFields": {"pnfVendorName":"Nokia", "pnfSerialNumber":"", "pnfOamIpv4Address":"10.16.123.234", "pnfOamIpv6Address":""}}} - {"event": {"otherFields": {"pnfVendorName":"Nokia", "pnfSerialNumber":"", "pnfOamIpv4Address":"", "pnfOamIpv6Address":"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}}} - {"event": {"otherFields": {"pnfVendorName":"Nokia", "pnfSerialNumber":"", "pnfOamIpv4Address":"", "pnfOamIpv6Address":""}}} - {"event": {"otherFields": {"pnfVendorName":"", "pnfSerialNumber":"QTFCOC540002E", "pnfOamIpv4Address":"10.16.123.234", "pnfOamIpv6Address":"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}}} - {"event": {"otherFields": {"pnfVendorName":"", "pnfSerialNumber":"QTFCOC540002E", "pnfOamIpv4Address":"10.16.123.234", "pnfOamIpv6Address":""}}} - {"event": {"otherFields": {"pnfVendorName":"", "pnfSerialNumber":"QTFCOC540002E", "pnfOamIpv4Address":"", "pnfOamIpv6Address":"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}}} - {"event": {"otherFields": {"pnfVendorName":"", "pnfSerialNumber":"QTFCOC540002E", "pnfOamIpv4Address":"", "pnfOamIpv6Address":""}}} - {"event": {"otherFields": {"pnfVendorName":"", "pnfSerialNumber":"", "pnfOamIpv4Address":"10.16.123.234", "pnfOamIpv6Address":"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}}} - {"event": {"otherFields": {"pnfVendorName":"", "pnfSerialNumber":"", "pnfOamIpv4Address":"10.16.123.234", "pnfOamIpv6Address":""}}} - {"event": {"otherFields": {"pnfVendorName":"", "pnfSerialNumber":"", "pnfOamIpv4Address":"", "pnfOamIpv6Address":"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}}} - {"event": {"otherFields": {"pnfVendorName":"", "pnfSerialNumber":"", "pnfOamIpv4Address":"", "pnfOamIpv6Address":""}}} - ${Not_json_format} + {"event": {"commonEventHeader": {"sourceName":"NOK6061ZW4"}, "pnfRegistrationFields": {"oamV4IpAddress":"", "oamV6IpAddress":""}}} + {"event": {"commonEventHeader": {"sourceName":""}, "pnfRegistrationFields": {"oamV4IpAddress":"10.18.123.234", "oamV6IpAddress":"2001:0db8:85a3:0000:0000:8a2a:0370:7334"}}} + {"event": {"commonEventHeader": {"sourceName":""}, "pnfRegistrationFields": {"oamV4IpAddress":"10.17.163.234", "oamV6IpAddress":""}}} + {"event": {"commonEventHeader": {"sourceName":""}, "pnfRegistrationFields": {"oamV4IpAddress":"", "oamV6IpAddress":"2001:0db8:85a3:0000:0000:8b2f:0370:7334"}}} + {"event": {"commonEventHeader": {"sourceName":""}, "pnfRegistrationFields": {"oamV4IpAddress":"", "oamV6IpAddress":""}}} Get valid event from DMaaP and record in AAI does not exist [Documentation] PRH get valid event from DMaaP with all required fields and in AAI record doesn't exist - PRH does not produce PNF_READY notification @@ -48,7 +38,13 @@ Get valid event from DMaaP and record in AAI does not exist [Timeout] 30s Set PNF name in AAI wrong_aai_record Set event in DMaaP ${EVENT_WITH_ALL_VALID_REQUIRED_FIELDS} - Wait Until Keyword Succeeds 100x 300ms Check PRH log org.onap.dcaegen2.services.prh.exceptions.AAINotFoundException: Incorrect response code for continuation of tasks workflow + Wait Until Keyword Succeeds 100x 300ms Check PRH log java.io.IOException: Connection closed prematurely + +Event in DMaaP is not JSON format + [Documentation] PRH get not JSON format event from DMaaP - PRH does not produce PNF_READY notification + [Tags] PRH + Set event in DMaaP ${Not_json_format} + Wait Until Keyword Succeeds 100x 300ms Check PRH log |java.lang.IllegalStateException: Not a JSON Array: Get valid event from DMaaP and AAI is not responding [Documentation] PRH get valid event from DMaaP with all required fields and AAI is not responding - PRH does not produce PNF_READY notification @@ -56,4 +52,4 @@ Get valid event from DMaaP and AAI is not responding [Timeout] 180s Stop AAI Set event in DMaaP ${EVENT_WITH_ALL_VALID_REQUIRED_FIELDS} - Wait Until Keyword Succeeds 100x 300ms Check PRH log java.net.NoRouteToHostException: Host is unreachable (Host unreachable) + Wait Until Keyword Succeeds 100x 300ms Check PRH log java.net.UnknownHostException: aai diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py b/test/csit/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py index ac3fba46e..c2a8b78a2 100644 --- a/test/csit/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py +++ b/test/csit/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py @@ -21,16 +21,18 @@ class PrhLibrary(object): @staticmethod def create_pnf_ready_notification(json_file): json_to_python = json.loads(json_file) - ipv4 = json_to_python["event"]["otherFields"]["pnfOamIpv4Address"] - ipv6 = json_to_python["event"]["otherFields"]["pnfOamIpv6Address"] - pnf_name = _create_pnf_name(json_file) - str_json = '{"pnf-name":"' + pnf_name + '","ipaddress-v4-oam":"' + ipv4 + '","ipaddress-v6-oam":"' + ipv6 + '"}' + ipv4 = json_to_python["event"]["pnfRegistrationFields"]["oamV4IpAddress"] + ipv6 = json_to_python["event"]["pnfRegistrationFields"]["oamV6IpAddress"] + header = json_to_python["event"]["commonEventHeader"]["sourceName"] + str_json = '{"sourceName":"' + header + '","ipaddress-v4-oam":"' + ipv4 + '","ipaddress-v6-oam":"' + ipv6 + '"}' python_to_json = json.dumps(str_json) return python_to_json.replace("\\", "")[1:-1] @staticmethod def create_pnf_name(json_file): - return _create_pnf_name(json_file) + json_to_python = json.loads(json_file) + header = json_to_python["event"]["commonEventHeader"]["sourceName"] + return header @staticmethod def stop_aai(): @@ -38,9 +40,7 @@ class PrhLibrary(object): container = client.containers.get('aai_simulator') container.stop() - -def _create_pnf_name(json_file): - json_to_python = json.loads(json_file) - vendor = json_to_python["event"]["otherFields"]["pnfVendorName"] - serial_number = json_to_python["event"]["otherFields"]["pnfSerialNumber"] - return vendor[:3].upper() + serial_number + def create_invalid_notification(self, json_file): + return self.create_pnf_ready_notification(json_file).replace("\":", "\": ")\ + .replace("ipaddress-v4-oam", "oamV4IpAddress").replace("ipaddress-v6-oam", "oamV6IpAddress")\ + .replace("}", "\\\\n}") diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/docker-compose.yml b/test/csit/tests/dcaegen2/prh-testcases/resources/docker-compose.yml index b1f84fda2..67921e8e0 100644 --- a/test/csit/tests/dcaegen2/prh-testcases/resources/docker-compose.yml +++ b/test/csit/tests/dcaegen2/prh-testcases/resources/docker-compose.yml @@ -1,12 +1,15 @@ version: '3' services: prh: - image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.prh.prh-app-server + image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.prh.prh-app-server:latest command: > - --dmaap.dmaapConsumerConfiguration.dmaapPortNumber=2222 - --dmaap.dmaapProducerConfiguration.dmaapPortNumber=2222 - --aai.aaiClientConfiguration.aaiHostPortNumber=3333 - --aai.aaiClientConfiguration.aaiProtocol=http + --dmaap.dmaapConsumerConfiguration.dmaapHostName=dmaap + --dmaap.dmaapConsumerConfiguration.dmaapPortNumber=2222 + --dmaap.dmaapProducerConfiguration.dmaapHostName=dmaap + --dmaap.dmaapProducerConfiguration.dmaapPortNumber=2222 + --aai.aaiClientConfiguration.aaiHostPortNumber=3333 + --aai.aaiClientConfiguration.aaiHost=aai + --aai.aaiClientConfiguration.aaiProtocol=http entrypoint: - java - -Dspring.profiles.active=dev @@ -18,10 +21,10 @@ services: - "8433:8433" container_name: prh depends_on: - - dmaap_simulator - - aai_simulator + - dmaap + - aai - dmaap_simulator: + dmaap: build: context: simulator dockerfile: DMaaP_simulator @@ -29,7 +32,7 @@ services: - "2222:2222" container_name: dmaap_simulator - aai_simulator: + aai: build: context: simulator dockerfile: AAI_simulator diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/prh_library.robot b/test/csit/tests/dcaegen2/prh-testcases/resources/prh_library.robot index 10bc26c18..fa8c0d052 100644 --- a/test/csit/tests/dcaegen2/prh-testcases/resources/prh_library.robot +++ b/test/csit/tests/dcaegen2/prh-testcases/resources/prh_library.robot @@ -1,6 +1,7 @@ *** Settings *** Library RequestsLibrary Library Collections +Library PrhLibrary.py *** Keywords *** Create header @@ -17,8 +18,10 @@ Invalid event processing [Arguments] ${input_invalid_event_in_dmaap} [Timeout] 30s Set event in DMaaP ${input_invalid_event_in_dmaap} - Wait Until Keyword Succeeds 100x 100ms Check PRH log INFO 1 --- [pool-2-thread-1] o.o.d.s.prh.tasks.DmaapConsumerTaskImpl \ : Consumed model from DmaaP: ${input_invalid_event_in_dmaap} - + ${invalid_notification}= Create invalid notification ${input_invalid_event_in_dmaap} + ${notification}= Catenate SEPARATOR= \\\\n |org.onap.dcaegen2.services.prh.exceptions.DmaapNotFoundException: Incorrect json, consumerDmaapModel can not be created: ${invalid_notification} + Wait Until Keyword Succeeds 100x 100ms Check PRH log ${notification} + Valid event processing [Arguments] ${input_valid_event_in_dmaap} [Timeout] 30s diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py index e70d8d30f..c57903c30 100644 --- a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py +++ b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py @@ -7,6 +7,7 @@ pnfs = 'Empty' class AAIHandler(BaseHTTPRequestHandler): + def do_PUT(self): if re.search('/set_pnfs', self.path): global pnfs diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI_simulator b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI_simulator index 013cd0a65..89a266ebe 100644 --- a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI_simulator +++ b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI_simulator @@ -1,4 +1,12 @@ -FROM python:3 +FROM alpine:3.8 + +RUN apk add --no-cache python3 && \ + python3 -m ensurepip && \ + rm -r /usr/lib/python*/ensurepip && \ + pip3 install --upgrade pip setuptools && \ + if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \ + if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi && \ + rm -r /root/.cache ADD 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 index 210378421..96e22a141 100644 --- a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py +++ b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py @@ -8,6 +8,7 @@ received_event_to_get_method = 'Empty' class DMaaPHandler(BaseHTTPRequestHandler): + def do_PUT(self): if re.search('/set_get_event', self.path): global received_event_to_get_method @@ -27,7 +28,7 @@ class DMaaPHandler(BaseHTTPRequestHandler): return def do_GET(self): - if re.search('/events/unauthenticated.SEC_OTHER_OUTPUT/OpenDcae-c12/c12', self.path): + if re.search('/events/unauthenticated.VES_PNFREG_OUTPUT/OpenDcae-c12/c12', self.path): _header_200_and_json(self) self.wfile.write(received_event_to_get_method) elif re.search('/events/pnfReady', self.path): diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP_simulator b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP_simulator index cf4160c89..9cf21dc92 100644 --- a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP_simulator +++ b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP_simulator @@ -1,4 +1,12 @@ -FROM python:3 +FROM alpine:3.8 + +RUN apk add --no-cache python3 && \ + python3 -m ensurepip && \ + rm -r /usr/lib/python*/ensurepip && \ + pip3 install --upgrade pip setuptools && \ + if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \ + if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi && \ + rm -r /root/.cache ADD DMaaP.py / diff --git a/test/csit/tests/dmaap-buscontroller/with_dr/orig b/test/csit/tests/dmaap-buscontroller/with_dr/orig new file mode 100755 index 000000000..fcac20263 --- /dev/null +++ b/test/csit/tests/dmaap-buscontroller/with_dr/orig @@ -0,0 +1,116 @@ +*** Settings *** +Library OperatingSystem +Library RequestsLibrary +Library requests +Library Collections +Library String + +*** Variables *** +${TARGET_URL} https://${DR_PROV_IP}:8443 +${TARGET_URL_FEED} https://${DR_PROV_IP}:8443/feed/1 +${TARGET_URL_SUBSCRIBE} https://${DR_PROV_IP}:8443/subscribe/1 +${TARGET_URL_SUBSCRIPTION} https://${DR_PROV_IP}:8443/subs/1 +${TARGET_URL_PUBLISH} https://${DR_NODE_IP}:8443/publish/1/csit_test +${CREATE_FEED_DATA} {"name": "CSIT_Test", "version": "m1.0", "description": "CSIT_Test", "business_description": "CSIT_Test", "suspend": false, "deleted": false, "changeowner": true, "authorization": {"classification": "unclassified", "endpoint_addrs": [], "endpoint_ids": [{"password": "rs873m", "id": "rs873m"}]}} +${UPDATE_FEED_DATA} {"name": "CSIT_Test", "version": "m1.0", "description": "UPDATED-CSIT_Test", "business_description": "CSIT_Test", "suspend": true, "deleted": false, "changeowner": true, "authorization": {"classification": "unclassified", "endpoint_addrs": [], "endpoint_ids": [{"password": "rs873m", "id": "rs873m"}]}} +${SUBSCRIBE_DATA} {"delivery":{ "url":"https://${DR_PROV_IP}:8080/", "user":"rs873m", "password":"rs873m", "use100":true}, "metadataOnly":false, "suspend":false, "groupid":29, "subscriber":"sg481n"} +${UPDATE_SUBSCRIPTION_DATA} {"delivery":{ "url":"https://${DR_PROV_IP}:8080/", "user":"sg481n", "password":"sg481n", "use100":true}, "metadataOnly":false, "suspend":true, "groupid":29, "subscriber":"sg481n"} +${FEED_CONTENT_TYPE} application/vnd.att-dr.feed +${SUBSCRIBE_CONTENT_TYPE} application/vnd.att-dr.subscription +${PUBLISH_FEED_CONTENT_TYPE} application/octet-stream + +*** Test Cases *** +Run Feed Creation + [Documentation] Feed Creation + [Timeout] 1 minute + ${resp}= PostCall ${TARGET_URL} ${CREATE_FEED_DATA} ${FEED_CONTENT_TYPE} rs873m + log ${TARGET_URL} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 201 + log 'JSON Response Code:'${resp} + +Run Subscribe to Feed + [Documentation] Subscribe to Feed + [Timeout] 1 minute + ${resp}= PostCall ${TARGET_URL_SUBSCRIBE} ${SUBSCRIBE_DATA} ${SUBSCRIBE_CONTENT_TYPE} sg481n + log ${TARGET_URL_SUBSCRIBE} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 201 + log 'JSON Response Code:'${resp} + +Run Publish Feed + [Documentation] Publish to Feed + [Timeout] 1 minute + Sleep 10s Behaviour was noticed where feed was not created in time for publish to be sent + ${resp}= PutCall ${TARGET_URL_PUBLISH} ${CREATE_FEED_DATA} ${PUBLISH_FEED_CONTENT_TYPE} rs873m + log ${TARGET_URL_PUBLISH} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 204 + log 'JSON Response Code:'${resp} + +Run Update Subscription + [Documentation] Update Subscription to suspend and change delivery credentials + [Timeout] 1 minute + ${resp}= PutCall ${TARGET_URL_SUBSCRIPTION} ${UPDATE_SUBSCRIPTION_DATA} ${SUBSCRIBE_CONTENT_TYPE} sg481n + log ${TARGET_URL_SUBSCRIPTION} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + log 'JSON Response Code:'${resp} + ${resp}= GetCall ${TARGET_URL_SUBSCRIPTION} ${SUBSCRIBE_CONTENT_TYPE} sg481n + log ${resp.text} + Should Contain ${resp.text} "password":"sg481n","user":"sg481n" + log 'JSON Response Code:'${resp} + +Run Update Feed + [Documentation] Update Feed description and suspend + [Timeout] 1 minute + ${resp}= PutCall ${TARGET_URL_FEED} ${UPDATE_FEED_DATA} ${FEED_CONTENT_TYPE} rs873m + log ${TARGET_URL_FEED} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + log 'JSON Response Code:'${resp} + ${resp}= GetCall ${TARGET_URL_FEED} ${FEED_CONTENT_TYPE} rs873m + log ${resp.text} + Should Contain ${resp.text} "UPDATED-CSIT_Test" + log 'JSON Response Code:'${resp} + +Run Delete Subscription + [Documentation] Delete Subscription + [Timeout] 1 minute + ${resp}= DeleteCall ${TARGET_URL_SUBSCRIPTION} sg481n + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 204 + log 'JSON Response Code:'${resp} + +Run Delete Feed + [Documentation] Delete Feed + [Timeout] 1 minute + ${resp}= DeleteCall ${TARGET_URL_FEED} rs873m + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 204 + log 'JSON Response Code:'${resp} + +*** Keywords *** +PostCall + [Arguments] ${url} ${data} ${content_type} ${user} + ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} + ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests + [Return] ${resp} + +PutCall + [Arguments] ${url} ${data} ${content_type} ${user} + ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} Authorization=Basic cnM4NzNtOnJzODczbQ== + ${resp}= Evaluate requests.put('${url}',data='${data}', headers=${headers},verify=False) requests + [Return] ${resp} + +GetCall + [Arguments] ${url} ${content_type} ${user} + ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} + ${resp}= Evaluate requests.get('${url}', headers=${headers},verify=False) requests + [Return] ${resp} + +DeleteCall + [Arguments] ${url} ${user} + ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} + ${resp}= Evaluate requests.delete('${url}', headers=${headers},verify=False) requests + [Return] ${resp} diff --git a/test/csit/tests/dmaap-buscontroller/with_dr/test1.robot b/test/csit/tests/dmaap-buscontroller/with_dr/test1.robot new file mode 100644 index 000000000..a3aef42b8 --- /dev/null +++ b/test/csit/tests/dmaap-buscontroller/with_dr/test1.robot @@ -0,0 +1,143 @@ +*** Settings *** +Resource ../../common.robot +Library Collections +Library json +Library OperatingSystem +Library RequestsLibrary +Library HttpLibrary.HTTP +Library String + + +*** Variables *** +${MESSAGE} Hello, world! +${DBC_URI} webapi +${DBC_URL} http://${DMAAPBC_IP}:8080/${DBC_URI} +${LOC} csit-sanfrancisco +${PUB_CORE} "dcaeLocationName": "${LOC}", "clientRole": "org.onap.dmaap.client.pub", "action": [ "pub", "view" ] +${SUB_CORE} "dcaeLocationName": "${LOC}", "clientRole": "org.onap.dmaap.client.sub", "action": [ "sub", "view" ] +${PUB} { ${PUB_CORE} } +${SUB} { ${SUB_CORE} } +${FEED1_DATA} { "feedName":"feed1", "feedVersion": "csit", "feedDescription":"generated for CSIT", "owner":"dgl", "asprClassification": "unclassified" } +${FEED2_DATA} { "feedName":"feed2", "feedVersion": "csit", "feedDescription":"generated for CSIT", "owner":"dgl", "asprClassification": "unclassified" } +${PUB2_DATA} { "dcaeLocationName": "${LOC}", "username": "pub2", "userpwd": "topSecret123", "feedId": "2" } +${SUB2_DATA} { "dcaeLocationName": "${LOC}", "username": "sub2", "userpwd": "someSecret123", "deliveryURL": "https://${DMAAPBC_IP}:8443/webapi/noURI", "feedId": "2" } +${TOPIC2_DATA} { "topicName":"singleMRtopic2", "topicDescription":"generated for CSIT", "owner":"dgl", "clients": [ ${PUB}, ${SUB}] } +${TOPIC3_DATA} { "topicName":"singleMRtopic3", "topicDescription":"generated for CSIT", "owner":"dgl"} +#${PUB3_DATA} { "fqtn": "${TOPIC_NS}.singleMRtopic3", ${PUB_CORE} } +#${SUB3_DATA} { "fqtn": "${TOPIC_NS}.singleMRtopic3", ${SUB_CORE} } + + + +*** Test Cases *** +Url Test + [Documentation] Check if www.onap.org can be reached + Create Session sanity http://onap.readthedocs.io + ${resp}= Get Request sanity / + Should Be Equal As Integers ${resp.status_code} 200 + +(DMAAP-441c1) + [Documentation] Create Feed w no clients POST ${DBC_URI}/feeds endpoint + ${resp}= PostCall ${DBC_URL}/feeds ${FEED1_DATA} + Should Be Equal As Integers ${resp.status_code} 200 + +(DMAAP-441c2) + [Documentation] Create Feed w clients POST ${DBC_URI}/feeds endpoint + ${resp}= PostCall ${DBC_URL}/feeds ${FEED2_DATA} + Should Be Equal As Integers ${resp.status_code} 200 + +(DMAAP-441c3) + [Documentation] Add Publisher to existing feed + ${resp}= PostCall ${DBC_URL}/dr_pubs ${PUB2_DATA} + Should Be Equal As Integers ${resp.status_code} 201 + ${tmp}= Get Json Value ${resp.text} /pubId + ${tmp}= Remove String ${tmp} \" + Set Suite Variable ${pubId} ${tmp} + +(DMAAP-441c4) + [Documentation] Add Subscriber to existing feed + ${resp}= PostCall ${DBC_URL}/dr_subs ${SUB2_DATA} + Should Be Equal As Integers ${resp.status_code} 201 + ${tmp}= Get Json Value ${resp.text} /subId + ${tmp}= Remove String ${tmp} \" + Set Suite Variable ${subId} ${tmp} + +(DMAAP-443) + [Documentation] List existing feeds + Create Session get ${DBC_URL} + ${resp}= Get Request get /feeds + Should Be Equal As Integers ${resp.status_code} 200 + +(DMAAP-444) + [Documentation] Delete existing subscriber + ${resp}= DelCall ${DBC_URL}/dr_subs/${subId} + Should Be Equal As Integers ${resp.status_code} 204 + +(DMAAP-445) + [Documentation] Delete existing publisher + ${resp}= DelCall ${DBC_URL}/dr_pubs/${pubId} + Should Be Equal As Integers ${resp.status_code} 204 + +#(DMAAP-294) +# [Documentation] Create Topic w pub and sub clients POST ${DBC_URI}/topics endpoint +# ${resp}= PostCall ${DBC_URL}/topics ${TOPIC2_DATA} +# Should Be Equal As Integers ${resp.status_code} 201 +# +#(DMAAP-295) +# [Documentation] Create Topic w no clients and then add a client POST ${DBC_URI}/mr_clients endpoint +# ${resp}= PostCall ${DBC_URL}/topics ${TOPIC3_DATA} +# Should Be Equal As Integers ${resp.status_code} 201 +# ${resp}= PostCall ${DBC_URL}/mr_clients ${PUB3_DATA} +# Should Be Equal As Integers ${resp.status_code} 200 +# ${resp}= PostCall ${DBC_URL}/mr_clients ${SUB3_DATA} +# Should Be Equal As Integers ${resp.status_code} 200 +# +#(DMAAP-297) +# [Documentation] Query for all topics and specific topic +# Create Session get ${DBC_URL} +# ${resp}= Get Request get /topics +# Should Be Equal As Integers ${resp.status_code} 200 +# ${resp}= Get Request get /topics/${TOPIC_NS}.singleMRtopic3 +# Should Be Equal As Integers ${resp.status_code} 200 +# +#(DMAAP-301) +# [Documentation] Delete a subscriber +# Create Session get ${DBC_URL} +# ${resp}= Get Request get /topics/${TOPIC_NS}.singleMRtopic3 +# Should Be Equal As Integers ${resp.status_code} 200 +# ${tmp}= Get Json Value ${resp.text} /clients/1/mrClientId +# ${clientId}= Remove String ${tmp} \" +# ${resp}= DelCall ${DBC_URL}/mr_clients/${clientId} +# Should Be Equal As Integers ${resp.status_code} 204 +# +#(DMAAP-302) +# [Documentation] Delete a publisher +# Create Session get ${DBC_URL} +# ${resp}= Get Request get /topics/${TOPIC_NS}.singleMRtopic3 +# Should Be Equal As Integers ${resp.status_code} 200 +# ${tmp}= Get Json Value ${resp.text} /clients/0/mrClientId +# ${clientId}= Remove String ${tmp} \" +# ${resp}= DelCall ${DBC_URL}/mr_clients/${clientId} +# Should Be Equal As Integers ${resp.status_code} 204 + + +*** Keywords *** +CheckDir + [Arguments] ${path} + Directory Should Exist ${path} + +CheckUrl + [Arguments] ${session} ${path} ${expect} + ${resp}= Get Request ${session} ${path} + Should Be Equal As Integers ${resp.status_code} ${expect} + +PostCall + [Arguments] ${url} ${data} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests + [Return] ${resp} + +DelCall + [Arguments] ${url} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Evaluate requests.delete('${url}', headers=${headers},verify=False) requests + [Return] ${resp} diff --git a/test/csit/tests/music/music-suite/music-test.robot b/test/csit/tests/music/music-suite/music-test.robot index 9f8e435c8..9fc937e49 100644 --- a/test/csit/tests/music/music-suite/music-test.robot +++ b/test/csit/tests/music/music-suite/music-test.robot @@ -5,6 +5,9 @@ Library json *** Variables *** ${MESSAGE} {"ping": "ok"} +${BASIC} Basic +${AUTHVALUE} bXVzaWM6bXVzaWM= +${Authorization} ${BASIC} ${AUTHVALUE} #global variables ${generatedAID} @@ -60,7 +63,7 @@ Music AddOnBoarding [Documentation] It sends a REST POST request to Music to Onboard a new application Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} ${data}= Get Binary File ${CURDIR}${/}data${/}onboard.json - &{headers}= Create Dictionary ns=lb7254 userId=music password=music Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} Content-Type=application/json Accept=application/json ${resp}= Post Request musicaas /MUSIC/rest/v2/admin/onboardAppWithMusic data=${data} headers=${headers} Log To Console ********************* Log To Console response = ${resp} @@ -75,7 +78,7 @@ Music CreateKeyspace [Documentation] It sends a REST POST request to Music to create a new keyspace in Cassandra Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} ${data}= Get Binary File ${CURDIR}${/}data${/}createkeyspace.json - &{headers}= Create Dictionary ns=lb7254 userId=music password=music aid=${generatedAID} Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} aid=${generatedAID} Content-Type=application/json Accept=application/json ${resp}= Post Request musicaas /MUSIC/rest/v2/keyspaces/MusicOnapKeyspace data=${data} headers=${headers} Log To Console ********************* Log To Console response = ${resp} @@ -86,7 +89,7 @@ Music CreateTable [Documentation] It sends a REST POST request to Music to create a new Table in Cassandra Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} ${data}= Get Binary File ${CURDIR}${/}data${/}createtable.json - &{headers}= Create Dictionary ns=lb7254 userId=music password=music aid=${generatedAID} Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} aid=${generatedAID} Content-Type=application/json Accept=application/json ${resp}= Post Request musicaas /MUSIC/rest/v2/keyspaces/MusicOnapKeyspace/tables/MusicOnapTable data=${data} headers=${headers} Log To Console ********************* Log To Console response = ${resp} @@ -97,7 +100,7 @@ Music InsertRow [Documentation] It sends a REST POST request to Music to create a new row in Cassandra Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} ${data}= Get Binary File ${CURDIR}${/}data${/}insertrow_eventual.json - &{headers}= Create Dictionary ns=lb7254 userId=music password=music aid=${generatedAID} Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} aid=${generatedAID} Content-Type=application/json Accept=application/json ${resp}= Post Request musicaas /MUSIC/rest/v2/keyspaces/MusicOnapKeyspace/tables/MusicOnapTable/rows/?row=emp1 data=${data} headers=${headers} Log To Console ********************* Log To Console response = ${resp} @@ -107,7 +110,7 @@ Music InsertRow Music ReadRowJustInserted [Documentation] It sends a REST GET request to Music to Read the row just inserted in Cassandra Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} - &{headers}= Create Dictionary ns=lb7254 userId=music password=music aid=${generatedAID} Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} aid=${generatedAID} Content-Type=application/json Accept=application/json ${resp}= Get Request musicaas /MUSIC/rest/v2/keyspaces/MusicOnapKeyspace/tables/MusicOnapTable/rows?name=emp1 headers=${headers} Log To Console ********************* Log To Console response = ${resp} @@ -118,7 +121,7 @@ Music UpdateRowInAtomicWay [Documentation] It sends a REST PUT request to Music to create a new row in Cassandra Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} ${data}= Get Binary File ${CURDIR}${/}data${/}updaterow_atomic.json - &{headers}= Create Dictionary ns=lb7254 userId=music password=music aid=${generatedAID} Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} aid=${generatedAID} Content-Type=application/json Accept=application/json ${resp}= Put Request musicaas /MUSIC/rest/v2/keyspaces/MusicOnapKeyspace/tables/MusicOnapTable/rows?name=emp1 data=${data} headers=${headers} Log To Console ********************* Log To Console response = ${resp} @@ -128,7 +131,7 @@ Music UpdateRowInAtomicWay Music ReadRowAfterUpdate [Documentation] It sends a REST GET request to Music to Read the row just inserted in Cassandra Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} - &{headers}= Create Dictionary ns=lb7254 userId=music password=music aid=${generatedAID} Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} aid=${generatedAID} Content-Type=application/json Accept=application/json ${resp}= Get Request musicaas /MUSIC/rest/v2/keyspaces/MusicOnapKeyspace/tables/MusicOnapTable/rows?name=emp1 headers=${headers} Log To Console ********************* Log To Console response = ${resp} @@ -139,7 +142,7 @@ Music DeleteRow [Documentation] It sends a REST DELETE request to Music to delete a row in Cassandra Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} ${data}= Get Binary File ${CURDIR}${/}data${/}deleterow_eventual.json - &{headers}= Create Dictionary ns=lb7254 userId=music password=music aid=${generatedAID} Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} aid=${generatedAID} Content-Type=application/json Accept=application/json ${resp}= Delete Request musicaas /MUSIC/rest/v2/keyspaces/MusicOnapKeyspace/tables/MusicOnapTable/rows?name=emp1 data=${data} headers=${headers} Log To Console ********************* Log To Console response = ${resp} @@ -150,7 +153,7 @@ Music DropTable [Documentation] It sends a REST Delete request to Music to drop one existing Table in Cassandra Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} ${data}= Get Binary File ${CURDIR}${/}data${/}droptable.json - &{headers}= Create Dictionary ns=lb7254 userId=music password=music aid=${generatedAID} Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} aid=${generatedAID} Content-Type=application/json Accept=application/json ${resp}= Delete Request musicaas /MUSIC/rest/v2/keyspaces/MusicOnapKeyspace/tables/MusicOnapTable data=${data} headers=${headers} Log To Console ********************* Log To Console response = ${resp} @@ -161,7 +164,7 @@ Music DropKeyspace [Documentation] It sends a REST DELETE request to Music to drop one existing keyspace in Cassandra Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} ${data}= Get Binary File ${CURDIR}${/}data${/}dropkeyspace.json - &{headers}= Create Dictionary ns=lb7254 userId=music password=music aid=${generatedAID} Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} aid=${generatedAID} Content-Type=application/json Accept=application/json ${resp}= Delete Request musicaas /MUSIC/rest/v2/keyspaces/MusicOnapKeyspace data=${data} headers=${headers} Log To Console ********************* Log To Console response = ${resp} @@ -173,7 +176,7 @@ Music DeleteOnBoarding [Documentation] It sends a REST DELETE request to Music to remove a previosly onboarded application Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} ${data}= Get Binary File ${CURDIR}${/}data${/}onboard.json - &{headers}= Create Dictionary ns=lb7254 userId=music password=music aid=${generatedAID} Content-Type=application/json Accept=application/json + &{headers}= Create Dictionary ns=lb7254 Authorization=${Authorization} aid=${generatedAID} Content-Type=application/json Accept=application/json ${resp}= Delete Request musicaas /MUSIC/rest/v2/admin/onboardAppWithMusic data=${data} headers=${headers} Log To Console ********************* Log To Console response = ${resp} diff --git a/test/csit/tests/policy/suite1/global_properties.robot b/test/csit/tests/policy/suite1/global_properties.robot index f406bbf3d..911fdaff9 100644 --- a/test/csit/tests/policy/suite1/global_properties.robot +++ b/test/csit/tests/policy/suite1/global_properties.robot @@ -22,9 +22,9 @@ ${GLOBAL_AAI_CLOUD_OWNER} Rackspace ${GLOBAL_BUILD_NUMBER} 31 ${GLOBAL_VM_PRIVATE_KEY} ${EXECDIR}/robot/assets/keys/robot_ssh_private_key.pvt # policy info - everything is from the private oam network (also called ecomp private network) -${GLOBAL_POLICY_SERVER_URL} http://%{PDP_IP}:8081 +${GLOBAL_POLICY_SERVER_URL} https://%{PDP_IP}:8081 ${GLOBAL_POLICY_AUTH} dGVzdHBkcDphbHBoYTEyMw== ${GLOBAL_POLICY_CLIENTAUTH} cHl0aG9uOnRlc3Q= ${GLOBAL_POLICY_HEALTHCHECK_URL} http://%{POLICY_IP}:6969 ${GLOBAL_POLICY_USERNAME} healthcheck -${GLOBAL_POLICY_PASSWORD} zb!XztG34
\ No newline at end of file +${GLOBAL_POLICY_PASSWORD} zb!XztG34 diff --git a/test/csit/tests/vfc/nfvo-wfengine/workflow.robot b/test/csit/tests/vfc/nfvo-wfengine/workflow.robot index c9dbe6c46..8039ae177 100644 --- a/test/csit/tests/vfc/nfvo-wfengine/workflow.robot +++ b/test/csit/tests/vfc/nfvo-wfengine/workflow.robot @@ -80,34 +80,34 @@ UnDeploy BPMN File Testt On MgrService ${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} +# 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} +# 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} +# 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} diff --git a/test/csit/tests/vid/resources/simulators/SDC_simulator b/test/csit/tests/vid/resources/simulators/SDC_simulator index ec67e9fec..c099787dc 100644 --- a/test/csit/tests/vid/resources/simulators/SDC_simulator +++ b/test/csit/tests/vid/resources/simulators/SDC_simulator @@ -1,4 +1,12 @@ -FROM python:3 +FROM alpine:latest + +RUN apk add --no-cache python3 && \ + python3 -m ensurepip && \ + rm -r /usr/lib/python*/ensurepip && \ + pip3 install --upgrade pip setuptools && \ + if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \ + if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi && \ + rm -r /root/.cache ADD SDC.py / |