From 5f9f3ccf917d91e2af7f29a467a451d6274912a7 Mon Sep 17 00:00:00 2001 From: demskeq8 Date: Mon, 4 Sep 2023 17:59:57 +0200 Subject: [CSIT] update SDNR tests for mariaDB based sdnrdb update SDNC test image deploy sdnc-web-image for sdnr test setup add healthcheck add basic odlux tests Issue-ID: SDNC-1820 Change-Id: Ib89d097f301bfe4803bf3006549bee9a78fb6c19 Signed-off-by: demskeq8 --- csit/plans/sdnr/setup.sh | 8 ++-- csit/plans/sdnr/testdata/localhost.py | 14 +++--- csit/plans/sdnr/testplan.txt | 3 +- csit/run-csit.sh | 4 +- .../docker-compose-single-sdnr-web.override.yaml | 19 -------- csit/scripts/sdnr/docker-compose/wait-for-sdnc.sh | 30 ++++++++++++ .../tests/sdnr/healthcheck/20_healthcheckSUT.robot | 10 ++-- .../odlux/50_side_bar_elements_ODLUX_check.robot | 53 ++++++++++++++++++++++ .../onfcore14-basic-odlux/10_lifecycleNetconfSsh | 1 + .../22_alarmNotificationNETCONF | 1 + .../onfcore14-basic-odlux/90_resetSimulatedDevices | 1 + .../odlux/onfcore14-basic-odlux/__init__.robot | 20 ++++++++ .../onfcore14-basic-odlux/yangCapabilities.txt | 51 +++++++++++++++++++++ 13 files changed, 181 insertions(+), 34 deletions(-) create mode 100755 csit/scripts/sdnr/docker-compose/wait-for-sdnc.sh create mode 100644 csit/tests/sdnr/odlux/50_side_bar_elements_ODLUX_check.robot create mode 120000 csit/tests/sdnr/odlux/onfcore14-basic-odlux/10_lifecycleNetconfSsh create mode 120000 csit/tests/sdnr/odlux/onfcore14-basic-odlux/22_alarmNotificationNETCONF create mode 120000 csit/tests/sdnr/odlux/onfcore14-basic-odlux/90_resetSimulatedDevices create mode 100644 csit/tests/sdnr/odlux/onfcore14-basic-odlux/__init__.robot create mode 100644 csit/tests/sdnr/odlux/onfcore14-basic-odlux/yangCapabilities.txt (limited to 'csit') diff --git a/csit/plans/sdnr/setup.sh b/csit/plans/sdnr/setup.sh index 8de39cda..94e367be 100755 --- a/csit/plans/sdnr/setup.sh +++ b/csit/plans/sdnr/setup.sh @@ -34,7 +34,7 @@ echo "Start plan sdnr" source ${WORKSPACE}/scripts/sdnr/sdnr-launch.sh onap_dependent_components_launch nts_networkfunctions_launch ${WORKSPACE}/plans/sdnr/testdata/nts-networkfunctions.csv -sdnr_launch +sdnr_web_launch ## environment for SDNC/R specific robot test runs ## Ready state will be checked every SDNC_READY_RETRY_PERIOD seconds @@ -46,6 +46,8 @@ sdnr_launch #SDNC_RELEASE_WITHOUT_ROBOT=true #Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="--variablefile=${WORKSPACE}/plans/sdnr/testdata/localhost.py" -ROBOT_IMAGE="hightec/sdnc-test-lib:v0.11.0" +ROBOT_DEBUG_LEVEL=DEBUG # INFO or DEBUG + +ROBOT_VARIABLES="--variablefile=${WORKSPACE}/plans/sdnr/testdata/localhost.py -L ${ROBOT_DEBUG_LEVEL}" +ROBOT_IMAGE="hightec/sdnc-test-lib:v0.12.0" diff --git a/csit/plans/sdnr/testdata/localhost.py b/csit/plans/sdnr/testdata/localhost.py index c74d3f1a..5e0d4a79 100644 --- a/csit/plans/sdnr/testdata/localhost.py +++ b/csit/plans/sdnr/testdata/localhost.py @@ -8,20 +8,22 @@ ## Access SDNR cluster SDNR_PROTOCOL = "http://" SDNR_HOST = "127.0.0.1" -SDNR_PORT = "8181" +SDNR_PORT = "8282" SDNR_USER = "admin" #SDNR_PASSWORD = "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U" SDNR_PASSWORD = "admin" WEBSOCKET_PORT = "8182" +RELEASE_VERSION="argon" # expected opendaylight version + # for odlux gui testing WEBDRIVER_PATH = "/usr/local/bin/chromedriver" -# Access to elastic search SDNRDB -SDNRDB = {'PROTOCOL': 'http', 'IP': '127.0.0.1', 'PORT': '8181', 'USE_API_GATEWAY': True, 'USE_SSL': False, - 'VERIFY_CERTS': False} -# elastic DB to store statistic datas -ELASTIC_LOG_DB = SDNRDB +# sdnrdb is based on mariaDB + +USE_MARIA_DB=True +MARIADB = {'IP': SDNR_HOST, 'PORT': 3306} + RESTCONF_TIMEOUT = '90 s' # Restconf response time longer than VALID_RESPONSE_TIME in s will be notified as warning in the robot logs VALID_RESPONSE_TIME = 5 diff --git a/csit/plans/sdnr/testplan.txt b/csit/plans/sdnr/testplan.txt index c8c1d4dc..4c07c7fb 100644 --- a/csit/plans/sdnr/testplan.txt +++ b/csit/plans/sdnr/testplan.txt @@ -4,5 +4,6 @@ ## To skip sdnr robot test suite ## set in .setup.sh SDNC_RELEASE_WITHOUT_ROBOT=true -# sdnr/healthcheck +sdnr/healthcheck sdnr/functional +sdnr/odlux diff --git a/csit/run-csit.sh b/csit/run-csit.sh index ba3fb9a9..7021f0f9 100755 --- a/csit/run-csit.sh +++ b/csit/run-csit.sh @@ -211,7 +211,7 @@ if [[ -z $SDNC_RELEASE_WITHOUT_ROBOT ]] ; then docker run --rm --net="host" \ --env-file ${WORKSPACE}/sdnc-csit-robot.env \ -v ${WORKSPACE}:${WORKSPACE} -v ${WORKDIR}:${WORKDIR} $ROBOT_IMAGE \ - python3 -B -m robot.run -N ${TESTPLAN} -v WORKSPACE:/tmp --outputdir ${WORKDIR} ${ROBOT_VARIABLES} ${TESTOPTIONS} ${SUITES} + python3 -B -m robot -N ${TESTPLAN} -v WORKSPACE:/tmp --outputdir ${WORKDIR} ${ROBOT_VARIABLES} ${TESTOPTIONS} ${SUITES} fi else echo "[INFO] Skip Robot test suite, because SDNC is not in ready state" @@ -223,7 +223,7 @@ else echo "[WARNING] Dummy Robot test suite is executed, job remains ok. " docker run --rm --net="host" \ -v ${WORKSPACE}:${WORKSPACE} -v ${WORKDIR}:${WORKDIR} $ROBOT_IMAGE \ - python3 -B -m robot.run -N ${TESTPLAN} -v WORKSPACE:/tmp --outputdir ${WORKDIR} ${ROBOT_VARIABLES} ${TESTOPTIONS} ${WORKSPACE}/tests/sdnr/debug/10_dummy.robot + python3 -B -m robot -N ${TESTPLAN} -v WORKSPACE:/tmp --outputdir ${WORKDIR} ${ROBOT_VARIABLES} ${TESTOPTIONS} ${WORKSPACE}/tests/sdnr/debug/10_dummy.robot true fi RESULT=$? diff --git a/csit/scripts/sdnr/docker-compose/docker-compose-single-sdnr-web.override.yaml b/csit/scripts/sdnr/docker-compose/docker-compose-single-sdnr-web.override.yaml index 5f3e8819..0f547e8f 100644 --- a/csit/scripts/sdnr/docker-compose/docker-compose-single-sdnr-web.override.yaml +++ b/csit/scripts/sdnr/docker-compose/docker-compose-single-sdnr-web.override.yaml @@ -3,22 +3,6 @@ services: sdnr: environment: - SDNRDM="true" - topology-api: - image: ${TOPOLOGY_DOCKER_REPO}/${TOPOLOGY_DOCKER_IMAGE_NAME}:${TOPOLOGY_DOCKER_IMAGE_TAG} - container_name: topology-api - ports: - - "3001:3001" - environment: - - AUTH_ENABLED=${AUTH_ENABLED} - - AUTH_HOST_URL=${IDENTITY_PROVIDER_URL} - # - AUTH_CONFIG_FILE - - PROVIDERS=${TOPOLOGY_PROVIDERS} - - LOAD_PACKAGES=${LOAD_PACKAGES} - depends_on: - - sdnr - networks: - integration: - ipv4_address: ${TOPOLOGY_IP} sdnr-web: image: ${NEXUS_DOCKER_WEB_IMAGE_NAME}:${NEXUS_DOCKER_IMAGE_TAG} container_name: sdnr-web @@ -30,10 +14,7 @@ services: - SDNRPROTOCOL=HTTP - SDNRHOST=sdnr - SDNRPORT=${SDNRPORT} - - TOPOURL=${TOPOURL} - - TILEURL=${TILEURL} depends_on: - - topology-api - sdnr command: ["/wait-for-sdnc.sh", "sdnr:${SDNRPORT}/ready", "/opt/bitnami/nginx/sbin/run.sh"] volumes: diff --git a/csit/scripts/sdnr/docker-compose/wait-for-sdnc.sh b/csit/scripts/sdnr/docker-compose/wait-for-sdnc.sh new file mode 100755 index 00000000..26302622 --- /dev/null +++ b/csit/scripts/sdnr/docker-compose/wait-for-sdnc.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# wait-for-sdnc.sh +# ******************************************************************************* +# * ============LICENSE_START======================================================================== +# * Copyright (C) 2023 highstreet technologies GmbH Intellectual Property. All rights reserved. +# * ================================================================================================= +# * 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. +# * ============LICENSE_END========================================================================== +set -e + +url="$1" +shift +cmd="$@" + +while [ "$(curl -s -o /dev/null -w ''%{http_code}'' $url)" != "200" ]; do + >&2 echo "sdnc is not ready - sleeping" + sleep 1 +done + +>&2 echo "sdnc is up - executing command" +exec $cmd + diff --git a/csit/tests/sdnr/healthcheck/20_healthcheckSUT.robot b/csit/tests/sdnr/healthcheck/20_healthcheckSUT.robot index 2d29c9f0..7eee7ad7 100644 --- a/csit/tests/sdnr/healthcheck/20_healthcheckSUT.robot +++ b/csit/tests/sdnr/healthcheck/20_healthcheckSUT.robot @@ -3,7 +3,7 @@ Documentation healthcheck of system under test: sdnc server, sdnrdb are availab Library ConnectLibrary Library SDNCBaseLibrary Library Collections -Library ElasticSearchLibrary +Library SDNRDBLib Library ConnectApp Library RequestsLibrary @@ -12,7 +12,6 @@ Suite Teardown global suite teardown *** Variables *** &{headers} Content-Type=application/json Authorization=Basic - *** Test Cases *** Test Is SDNR Node Available ${server_status}= Server Is Ready @@ -25,7 +24,7 @@ Test Is SDNRDB Available Test Is SDNRDB Initialized ${res}= Check Aliases - Log ${res} level=INFO html=False console=False repr=False + Log ${res} level=INFO Test Is VES Collector available # curl -k -u sample1:sample1 https://172.40.0.1:8443 @@ -42,3 +41,8 @@ Test Is VES Collector available Should Be Equal As Strings ${resp.status_code} 200 RequestsLibrary.Delete All Sessions +Test Version Info Contains Correct release + ${VERSION_INFO_DICT}= get_version_info_as_dict + ${release}= Get From Dictionary ${VERSION_INFO_DICT["""version-info"""]} Opendaylight-release + Should Contain ${release} ${RELEASE_VERSION} + diff --git a/csit/tests/sdnr/odlux/50_side_bar_elements_ODLUX_check.robot b/csit/tests/sdnr/odlux/50_side_bar_elements_ODLUX_check.robot new file mode 100644 index 00000000..7b3116bd --- /dev/null +++ b/csit/tests/sdnr/odlux/50_side_bar_elements_ODLUX_check.robot @@ -0,0 +1,53 @@ +*** Settings *** +Documentation Test to verify the existence and functionality of the ODLUX Side-Bar Elements. + ... Opens ODLUX and clicks on each Side-Bar Element (Data-driven), given in the SIDE_BAR_ELEMENT + ... column. Once clicking on the Side-Bar Element has been successful, a clickable web-element + ... given by the locator in the CHECK_CLICKABLE_BUTTON_VALUE column, will be checked for existence. + ... The web-element's By strategy to find the element, given by the CHECK_CLICKABLE_BUTTON_BY column, + ... (either Xpath or CSS_SELECTOR) has to be provided and is depended on the variable locator. + ... The test will Pass if both the Side-Bar Element and the clickable web-element exist, else Fail. +Library UILib +Library Collections + +Test Template Check Side Bar Elements + +*** Variables *** +${MAKE_SCREENSHOTS} ${True} +${ELEMENT_COUNT} ${0} + +*** Test Cases *** SIDE_BAR_ELEMENT CHECK_WEBELEMENT_BY CHECK_WEBELEMENT_VALUE CLICK_ON_WEB_ELEMET +Check if Side Bar Element Home exists Home CSS_SELECTOR ODLUX_WELCOME_TO_ODLUX_LABEL False +Check if Side Bar Element Connect exists Connect CSS_SELECTOR ODLUX_NETWORK_ELEMENTS_LIST_TAB_LABEL False +Check if Side Bar Element Fault exists Fault CSS_SELECTOR ODLUX_CURRENT_ALARMS_TABLE_LABEL False +Check if Side Bar Element Maintenance exists Maintenance CSS_SELECTOR ODLUX_MAINTENANCE_TABLE_FILTER_LIST_BUTTON_LABEL False +Check if Side Bar Element Configuration exists Configuration CSS_SELECTOR ODLUX_TABLE_FILTER_LIST_BUTTON_LABEL False +Check if Side Bar Element Performance exists Performance CSS_SELECTOR ODLUX_PERFORMANCE_TABLE_FILTER_LIST_BUTTON_LABEL False +Check if Side Bar Element Inventory exists Inventory CSS_SELECTOR ODLUX_INVENTORY_TABLE_LABEL False +Check if Side Bar Element Event_Log exists Event_Log CSS_SELECTOR ODLUX_EVENT_LOG_TABLE_FILTER_LIST_BUTTON_LABEL False +Check if Side Bar Element Help exists Help CSS_SELECTOR ODLUX_HELP_AND_FAQ_LABEL False +Check if Side Bar Element About exists About CSS_SELECTOR ODLUX_ABOUT_COPY_TO_CLIPBOARD_LABEL False + +Sidebar Elements Count + [Template] Check Side Bar Elements Count + ${ELEMENT_COUNT} + +*** Keywords *** +Check Side Bar Elements + [Arguments] ${side_bar_element} ${check_webelement_by} ${check_webelement_value} ${click_on_web_element} + ${ELEMENT_COUNT}= Set Variable ${${ELEMENT_COUNT}+${1}} + Set Suite Variable ${ELEMENT_COUNT} + Refresh Current Browser Tab + Log ${side_bar_element} + UILib.Click On Site Bar Element side_bar_element=${side_bar_element} + ${is_exist}= Check If Web Element Exists by=${check_webelement_by} value=${check_webelement_value} + ... click_on_web_element=${click_on_web_element} + Should Be True ${is_exist} + +Check Sidebar Elements Count + [Arguments] ${elements_count} + ${sidebar_elements}= Get All Sidebar Elements + Log ${sidebar_elements} + ${current_sidebar_elements_count}= Get Length ${sidebar_elements} + Should Be Equal As Integers ${elements_count} ${current_sidebar_elements_count} + + diff --git a/csit/tests/sdnr/odlux/onfcore14-basic-odlux/10_lifecycleNetconfSsh b/csit/tests/sdnr/odlux/onfcore14-basic-odlux/10_lifecycleNetconfSsh new file mode 120000 index 00000000..fe272974 --- /dev/null +++ b/csit/tests/sdnr/odlux/onfcore14-basic-odlux/10_lifecycleNetconfSsh @@ -0,0 +1 @@ +../../functional/devicemanager/_templates/10_lifecycleNetconfSsh \ No newline at end of file diff --git a/csit/tests/sdnr/odlux/onfcore14-basic-odlux/22_alarmNotificationNETCONF b/csit/tests/sdnr/odlux/onfcore14-basic-odlux/22_alarmNotificationNETCONF new file mode 120000 index 00000000..4a3946f9 --- /dev/null +++ b/csit/tests/sdnr/odlux/onfcore14-basic-odlux/22_alarmNotificationNETCONF @@ -0,0 +1 @@ +../../functional/devicemanager/_templates/22_alarmNotificationNETCONF \ No newline at end of file diff --git a/csit/tests/sdnr/odlux/onfcore14-basic-odlux/90_resetSimulatedDevices b/csit/tests/sdnr/odlux/onfcore14-basic-odlux/90_resetSimulatedDevices new file mode 120000 index 00000000..423c96aa --- /dev/null +++ b/csit/tests/sdnr/odlux/onfcore14-basic-odlux/90_resetSimulatedDevices @@ -0,0 +1 @@ +../../functional/devicemanager/_templates/90_resetSimulatedDevices/ \ No newline at end of file diff --git a/csit/tests/sdnr/odlux/onfcore14-basic-odlux/__init__.robot b/csit/tests/sdnr/odlux/onfcore14-basic-odlux/__init__.robot new file mode 100644 index 00000000..15e6f2ef --- /dev/null +++ b/csit/tests/sdnr/odlux/onfcore14-basic-odlux/__init__.robot @@ -0,0 +1,20 @@ +*** Settings *** +Documentation Test suite for onf core 1.4 devices via odlux +Suite Setup My Setup +Force Tags onf-core-14 +Library OperatingSystem + +*** Variables *** + + +*** Keywords *** +My Setup + Set Suite Variable ${USE_SELENIUM} ${True} + Set Suite Variable ${DEVICE_TYPE} ONF_CORE_1_4 children=true + Set Suite Variable ${CORE_MODEL} 2019-11-27 children=true + Set Suite Variable ${DEVICE_TYPE_GUI} Wireless children=true + ${yang_file} = Get File ${CURDIR}/yangCapabilities.txt + Set Suite Variable ${YANG_CAPABILITIES_FILE} ${yang_file} children=true + Set Suite Variable ${IS_SUPERVISION_ALARM} ${True} + + diff --git a/csit/tests/sdnr/odlux/onfcore14-basic-odlux/yangCapabilities.txt b/csit/tests/sdnr/odlux/onfcore14-basic-odlux/yangCapabilities.txt new file mode 100644 index 00000000..ddc11cca --- /dev/null +++ b/csit/tests/sdnr/odlux/onfcore14-basic-odlux/yangCapabilities.txt @@ -0,0 +1,51 @@ +[["ethernet-container-2-0", "2020-01-21"], + ["ietf-crypto-types", "2019-07-02"], + ["ietf-netconf-notifications", "2012-02-06"], + ["ietf-yang-types", "2013-07-15"], + ["vlan-fd-1-0", "2021-01-05"], + ["ietf-tcp-server", "2019-07-02"], + ["yang", "2017-02-20"], + ["notifications", "2008-07-14"], + ["iana-crypt-hash", "2014-08-06"], + ["ietf-origin", "2018-02-14"], + ["wred-profile-1-0", "2020-01-24"], + ["ietf-netconf-monitoring", "2010-10-04"], + ["ietf-tls-common", "2019-07-02"], + ["ietf-netconf-server", "2019-07-02"], + ["mac-fd-1-0", "2020-08-26"], + ["wire-interface-2-0", "2020-01-23"], + ["ietf-ssh-common", "2019-07-02"], + ["qos-profile-1-0", "2020-01-24"], + ["mac-interface-1-0", "2020-01-23"], + ["ietf-ssh-server", "2019-07-02"], + ["ietf-netconf-with-defaults", "2011-06-01"], + ["ietf-tls-server", "2019-07-02"], + ["ietf-tcp-client", "2019-07-02"], + ["onap-system", "2020-10-26"], + ["l-3vpn-profile-1-0", "2020-01-27"], + ["ietf-netconf", "2013-09-29"], + ["nts-common", "2021-06-08"], + ["mac-fc-1-0", "2020-08-26"], + ["ltp-augment-1-0", "2020-07-30"], + ["ietf-keystore", "2019-07-02"], + ["co-channel-profile-1-0", "2020-01-27"], + ["vlan-interface-1-0", "2021-01-04"], + ["ietf-yang-library", "2019-01-04"], + ["ietf-netconf-acm", "2018-02-14"], + ["ietf-x509-cert-to-name", "2014-12-10"], + ["ietf-tcp-common", "2019-07-02"], + ["tdm-container-2-0", "2020-01-23"], + ["vlan-fc-1-0", "2021-01-05"], + ["ietf-truststore", "2019-07-02"], + ["pure-ethernet-structure-2-0", "2020-01-22"], + ["ietf-system", "2014-08-06"], + ["core-model-1-4", "2019-11-27"], + ["hybrid-mw-structure-2-0", "2020-01-22"], + ["air-interface-2-0", "2020-01-21"], + ["ietf-yang-metadata", "2016-08-05"], + ["ietf-datastores", "2018-02-14"], + ["nc-notifications", "2008-07-14"], + ["ietf-netconf-nmda", "2019-01-07"], + ["ip-interface-1-0", "2020-01-24"], + ["ietf-inet-types", "2013-07-15"], + ["nts-network-function", "2021-06-18"]] \ No newline at end of file -- cgit 1.2.3-korg