diff options
author | demskeq8 <alexander.dehn@highstreet-technologies.com> | 2021-07-21 09:37:41 +0200 |
---|---|---|
committer | demskeq8 <alexander.dehn@highstreet-technologies.com> | 2021-08-27 09:58:25 +0200 |
commit | 00960a3b25697ef06cdfd7534944f7e2cc2e6d06 (patch) | |
tree | e7e44ffdc2abf0c81dd159d1394652878258cd1a /csit/tests/sdnr/functional/devicemanager/_templates | |
parent | 4308ac023373157f4255088efba7cdb34115bff7 (diff) |
[SNDC-CSIT] Add tests for device manager
Integration tests for wt feature set
Issue-ID: SDNC-1584
Signed-off-by: demskeq8 <alexander.dehn@highstreet-technologies.com>
Change-Id: I21de1540a664684d55bdec1172112130cdc2902f
Former-commit-id: bdbf1ee7ae34887ca40dcc113d1065ce44da4a89
Diffstat (limited to 'csit/tests/sdnr/functional/devicemanager/_templates')
6 files changed, 839 insertions, 0 deletions
diff --git a/csit/tests/sdnr/functional/devicemanager/_templates/10_lifecycleNetconfSsh/devicemanagerlifecycle_netconf.robot b/csit/tests/sdnr/functional/devicemanager/_templates/10_lifecycleNetconfSsh/devicemanagerlifecycle_netconf.robot new file mode 100644 index 00000000..084c1556 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/_templates/10_lifecycleNetconfSsh/devicemanagerlifecycle_netconf.robot @@ -0,0 +1,401 @@ +*** Settings *** +Documentation devicemanager lifecycle via netconf only +... Verify network element connection +... Actions are triggered via server interface as used by ODLUX +... Status verifcation is done by dataprovider interface and restconf mdsal +... to detect asynchron connection status entries +Default Tags dm-lifecycle netconf ssh + +Library ConnectLibrary +Library SDNCBaseLibrary +Library SDNCDataProvider +Library SDNCRestconfLibrary +Library ConnectApp +Library FaultManagementApp +Library FaultManagementAppBackend +Library Collections +Library DateTime +Library utility + +Suite Setup global suite setup &{GLOBAL_SUITE_SETUP_CONFIG} +Suite Teardown global suite teardown + + +*** Variables *** +${DEVICE_TYPE} DEFINE_IN_INIT +${DEVICE_NAME} robot-${DEVICE_TYPE}-sim-lifecycle +${HOST} ${NETWORK_FUNCTIONS}[${DEVICE_TYPE}][NETCONF_HOST] +${PORT} ${NETWORK_FUNCTIONS}[${DEVICE_TYPE}][BASE_PORT] +${USERNAME} ${NETWORK_FUNCTIONS}[${DEVICE_TYPE}][USER] +${PASSWORD} ${NETWORK_FUNCTIONS}[${DEVICE_TYPE}][PASSWORD] +${HOST_NOK} 192.168.240.240 +${PORT_NOK} ${4711} +${USERNAME_NOK} wrong-username +${PASSWORD_NOK} wrong-password +${CORE_MODEL} Unsupported +${UNDEFINED} undefined +${DEVICE_TO_DELETE} devices + +# set log level https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html + + +*** Test Cases *** + +Add network element connection + [Documentation] Add network-function to device manager + ... verify correct detection of specific device manager + ... verify correct entries in connection log + [Tags] smoke + + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-ok + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Log To Console ${start_time} + ConnectApp.Add network element connection ${DEVICE_NAME_TEST} ${True} ${HOST} ${PORT} ${USERNAME} ${PASSWORD} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} Connected + SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} connected time_in_sec=${10} + Run Keyword And Continue On Failure ConnectApp.should_be_equal_network_element_connection_details ${DEVICE_NAME_TEST} + ... node-id=${DEVICE_NAME_TEST} + ... is-required=${True} + ... status=Connected + ... host=${HOST} + ... port=${PORT} + ... core-model-capability=${CORE_MODEL} + ... device-type=${DEVICE_TYPE_GUI} + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Connected 1 msg=wrong connection log entries for Connected state + Dictionary Should Contain Item ${conn_status_list_stats} Mounted 1 msg=wrong connection log entries for Mounted state + +Retrieve yang capabilities from network element + [Documentation] get yang capabilities from network element and compare with reference file + [Tags] smoke netconf yang + + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-ok + ${yang_capabilities} = get_yang_capabilities_as_list node_id=${DEVICE_NAME_TEST} + Log ${yang_capabilities} + ${is_yang_correct} = compare_yang_capability_list_to_file ${yang_capabilities} ${YANG_CAPABILITIES_FILE} + Should be True ${is_yang_correct} msg=Yang capabilities are different from expected list + +Remove network element connection + [Documentation] remove network element connection from device manager + ... verify if all ressources are removed + ... verify correct entries in connection log + [Tags] smoke + + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-ok + ConnectApp.Remove network element connection ${DEVICE_NAME_TEST} + Run Keyword And Continue On Failure ConnectApp.Should be equal connection status until time ${DEVICE_NAME_TEST} not existing + SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} not existing time_in_sec=${10} + + # Check connection status log entries + Sleep 6s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Dictionary Should Contain Item ${conn_status_list_stats} Unmounted 1 msg=wrong connection log entries for Unmounted state + +Add network element connection wrong port + [Tags] prio2 + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-port-nok + ConnectApp.Add network element connection ${DEVICE_NAME_TEST} ${True} ${HOST} ${PORT_NOK} ${USERNAME} ${PASSWORD} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} Connecting + SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} connecting time_in_sec=${10} + Run Keyword And Continue On Failure ConnectApp.should_be_equal_network_element_connection_details ${DEVICE_NAME_TEST} + ... node-id=${DEVICE_NAME_TEST} + ... is-required=${True} + ... status=Connecting + ... host=${HOST} + ... port=${PORT_NOK} + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Mounted 1 msg=wrong connection log entries for Mounted state + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Connected + Dictionary Should Not Contain Key ${conn_status_list_stats} Unmounted + +Remove network element connection wrong port + [Tags] prio2 + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-port-nok + ConnectApp.Remove network element connection ${DEVICE_NAME_TEST} + Run Keyword And Continue On Failure ConnectApp.Should be equal connection status until time ${DEVICE_NAME_TEST} not existing + SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} not existing time_in_sec=${10} + + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Unmounted 1 msg=wrong connection log entries for Unmounted state + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Connected + Dictionary Should Not Contain Key ${conn_status_list_stats} Mounted + +Add network element connection wrong ip + [Tags] prio2 + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-ip-nok + ConnectApp.Add network element connection ${DEVICE_NAME_TEST} ${True} ${HOST_NOK} ${PORT} ${USERNAME} ${PASSWORD} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} Connecting + Run Keyword And Continue On Failure SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} connecting time_in_sec=${10} + Run Keyword And Continue On Failure ConnectApp.should_be_equal_network_element_connection_details ${DEVICE_NAME_TEST} + ... node-id=${DEVICE_NAME_TEST} + ... is-required=${True} + ... status=Connecting + ... host=${HOST_NOK} + ... port=${PORT} + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Mounted 1 msg=wrong connection log entries for Mounted state + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Connected + Dictionary Should Not Contain Key ${conn_status_list_stats} Unmounted + +Remove network element connection wrong ip + [Tags] prio2 + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-ip-nok + ConnectApp.Remove network element connection ${DEVICE_NAME_TEST} + Run Keyword And Continue On Failure ConnectApp.Should be equal connection status until time ${DEVICE_NAME_TEST} not existing + Run Keyword And Continue On Failure SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} not existing time_in_sec=${10} + + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Unmounted 1 msg=wrong connection log entries for Unmounted state + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Connected + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Mounted + +Add network element connection and change is required to false + [Tags] prio2 + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-required + ConnectApp.Add network element connection ${DEVICE_NAME_TEST} ${True} ${HOST} ${PORT} ${USERNAME} ${PASSWORD} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} Connected + SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} connected time_in_sec=${10} + Run Keyword And Continue On Failure ConnectApp.should_be_equal_network_element_connection_details ${DEVICE_NAME_TEST} + ... node-id=${DEVICE_NAME_TEST} + ... is-required=${True} + + ConnectApp.edit network element connection ${DEVICE_NAME_TEST} ${False} + Run Keyword And Continue On Failure ConnectApp.should_be_equal_network_element_connection_details ${DEVICE_NAME_TEST} + ... node-id=${DEVICE_NAME_TEST} + ... is-required=${False} + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Connected 1 msg=wrong connection log entries for Connected state + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Mounted 1 msg=wrong connection log entries for Mounted state + +Edit network element connection: is required to true + [Tags] prio2 + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-required + ConnectApp.edit network element connection ${DEVICE_NAME_TEST} ${True} + Run Keyword And Continue On Failure ConnectApp.should_be_equal_network_element_connection_details ${DEVICE_NAME_TEST} + ... node-id=${DEVICE_NAME_TEST} + ... is-required=${True} + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Connected + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Mounted + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Unmounted + #Dictionary Should Not Contain Key ${conn_status_list_stats} Connecting + +Unmount network element + [Tags] prio2 + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-required + ConnectApp.unmount_network_element ${DEVICE_NAME_TEST} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} Disconnected + Run Keyword And Continue On Failure SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} not existing time_in_sec=${10} + + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Unmounted 1 msg=wrong connection log entries for Unmounted state + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Connected + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Mounted + #Dictionary Should Not Contain Key ${conn_status_list_stats} Connecting + + +Mount network element + [Tags] prio2 + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-required + ConnectApp.mount_network_element ${DEVICE_NAME_TEST} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} Connected + Run Keyword And Continue On Failure SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} connected time_in_sec=${10} + + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Connected 1 msg=wrong connection log entries for Connected state + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Mounted 1 msg=wrong connection log entries for Mounted state + +Remove network element connection + [Tags] prio2 + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-required + ConnectApp.remove network element connection ${DEVICE_NAME_TEST} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} not existing + Run Keyword And Continue On Failure SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} not existing time_in_sec=${10} + + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Unmounted 1 msg=wrong connection log entries for Unmounted state + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Connected + Run Keyword And Continue On Failure Dictionary Should Not Contain Key ${conn_status_list_stats} Mounted + #Dictionary Should Not Contain Key ${conn_status_list_stats} Connecting + +Remove unmounted network element connection + [Tags] prio2 + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Test Variable ${DEVICE_NAME_TEST} ${DEVICE_NAME}-required-true + ConnectApp.Add network element connection ${DEVICE_NAME_TEST} ${True} ${HOST} ${PORT} ${USERNAME} ${PASSWORD} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} Connected + Run Keyword And Continue On Failure SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} connected time_in_sec=${10} + + ConnectApp.unmount_network_element ${DEVICE_NAME_TEST} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} Disconnected + Run Keyword And Continue On Failure SDNCRestconfLibrary.should_be_equal_connection_status_until_time ${DEVICE_NAME_TEST} not existing time_in_sec=${10} + + ConnectApp.remove_network_element_connection ${DEVICE_NAME_TEST} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time ${DEVICE_NAME_TEST} not existing + + # Check connection status log entries + Sleep 1s reason=insert time gap to avoid time constrains + ${connection_status_list} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list} + ${connection_status_list_debug} = FaultManagementApp.get_connection_log_list node-id=${DEVICE_NAME_TEST} + Log ${connection_status_list_debug} + ${connection_status_list_debug_backend} = FaultManagementAppBackend.get_connection_log_list node-id=${DEVICE_NAME_TEST} + ... timestamp=>=${start_time} + Log ${connection_status_list_debug_backend} + ${conn_status_list_stats} = get_counts_from_list ${connection_status_list} status + Log Dictionary ${conn_status_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Mounted 1 msg=wrong connection log entries for Mounted state + Run Keyword And Continue On Failure Dictionary Should Contain Item ${conn_status_list_stats} Connected 1 msg=wrong connection log entries for Connected state + Run Keyword And Continue On Failure Dictionary Should Contain Key ${conn_status_list_stats} Unmounted msg=no connection log entries for Unmounted state + ConnectApp.Remove Network Element Connection ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + + diff --git a/csit/tests/sdnr/functional/devicemanager/_templates/20_pnfRegistration/pnfRegistration.robot b/csit/tests/sdnr/functional/devicemanager/_templates/20_pnfRegistration/pnfRegistration.robot new file mode 100644 index 00000000..3fadf223 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/_templates/20_pnfRegistration/pnfRegistration.robot @@ -0,0 +1,118 @@ +*** Settings *** +Documentation Set VES collector endpoint details in NTS manager +... VES endpooint Details and NTS manager information are stored in test environemnt variable file <environment> +... as dictionary NETWORK_FUNCTIONS = {}, VESCOLLECTOR ={} +... change number devices on command line with --variable DEVICE_TYPE:ORAN +... + +Library ConnectLibrary +Library String +Library SDNCBaseLibrary +Library SDNCRestconfLibrary +Library NTSimManagerNG +Library SDNCDataProvider +Library ConnectApp + +Suite Setup global suite setup &{GLOBAL_SUITE_SETUP_CONFIG} +Suite Teardown global suite teardown + + +*** Variables *** +${DEVICE_TYPE} DEFINE_IN_INIT +${SIM_COUNT} 1 +${CORE_MODEL} DEFINE_IN_INIT +${DEVICE_TYPE_GUI} DEFINE_IN_INIT +${PNF_REGISTRATION_TIMEOUT} 180 + + +*** Test Cases *** +Setup NTS function + [Tags] nts bringup + [Documentation] configure NTS manager to support restconf registration + Add Network Element Connection ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} ${True} + ... ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['IP']} ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['PORT']} + ... ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['USER']} ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['PASSWORD']} + ... Connected + SDNCRestconfLibrary.Should Be Equal Connection Status Until Time ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} Connected + +Start pnf ves registration from NTS function + [Tags] nts bringup + [Documentation] scales number of simulated devices per device type to '0' + ... set details for VES endpoint + ... scales number of simulated devices per device type + Stop Network Function Feature ${NETWORK_FUNCTIONS['O_RAN_FH']['NAME']} ves-pnf-registration + NTSimManagerNG.set_ves_endpoint_details_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + ... ves-endpoint-protocol=${VESCOLLECTOR}[SCHEME] + ... ves-endpoint-ip=${VESCOLLECTOR}[IP] + ... ves-endpoint-port=${VESCOLLECTOR}[PORT] + ... ves-endpoint-auth-method=${VESCOLLECTOR}[AUTHMETHOD] + ... ves-endpoint-username=${VESCOLLECTOR}[USERNAME] + ... ves-endpoint-password=${VESCOLLECTOR}[PASSWORD] + Start Network Function Feature ${NETWORK_FUNCTIONS['O_RAN_FH']['NAME']} ves-pnf-registration + NTSimManagerNG.set_ves_config_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + ... pnf-registration=${True} + sleep 10s reason=Wait before start network function +# Log console=True message=Wait some time ${PNF_REGISTRATION_TIMEOUT} till request sent by NTSim +# ConnectApp.should_be_equal_connection_status_until_time ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} Connected ${180} + + +Verify connection status SSH + [Tags] pnfregistration dm-lifecycle SSH + sleep 5s reason=Wait for processing of simulated device + @{pnf_list}= NTSimManagerNG.get_simulated_pnfs_nf ${DEVICE_TYPE} protocol=SSH + ${length} = Get Length ${pnf_list} + Should Not Be Equal As Integers ${length} 0 msg=No network functions created + + Log to console ${pnf_list} + FOR ${device} IN @{pnf_list} + ${node_id}= set variable ${device["node-id"]} + ${port}= set variable ${device["port"]} + Log console=True message=Verify connection status: ${node_id} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time + ... ${node_id} Connected ${PNF_REGISTRATION_TIMEOUT} + SDNCRestconfLibrary.Should Be Equal Connection Status Until Time ${node_id} connected ${5} + ConnectApp.should_be_equal_network_element_connection_details ${node_id} + ... node-id=${node_id} + ... is-required=${False} + ... status=Connected + ... port=${port} + ... core-model-capability=${CORE_MODEL} + ... device-type=${DEVICE_TYPE_GUI} + END + +Verify connection status TLS + [Tags] pnfregistration dm-lifecycle TLS + @{pnf_list}= NTSimManagerNG.get_simulated_pnfs_nf ${DEVICE_TYPE} protocol=TLS + Log to console ${pnf_list} + ${length} = Get Length ${pnf_list} + Should Not Be Equal As Integers ${length} 0 msg=No network functions created + + FOR ${device} IN @{pnf_list} + ${node_id}= set variable ${device["node-id"]} + ${port}= set variable ${device["port"]} + Log console=True message=Verify connection status: ${node_id} + Run Keyword And Continue On Failure ConnectApp.Should Be Equal connection status until time + ... ${node_id} Connected ${PNF_REGISTRATION_TIMEOUT} + SDNCRestconfLibrary.Should Be Equal Connection Status Until Time ${node_id} connected ${5} + ConnectApp.should_be_equal_network_element_connection_details ${node_id} + ... node-id=${node_id} + ... is-required=${False} + ... status=Connected + ... port=${port} + ... core-model-capability=${CORE_MODEL} + ... device-type=${DEVICE_TYPE_GUI} + END + +Remove all networkelement connections + [Documentation] Delete all network element connections, should not fail if the connection is not there + [Tags] restconf dm-lifecycle + Stop Network Function Feature ${NETWORK_FUNCTIONS['O_RAN_FH']['NAME']} ves-pnf-registration + @{pnf_list}= NTSimManagerNG.get_simulated_pnfs_nf ${DEVICE_TYPE} + FOR ${device} IN @{pnf_list} + ${node_id}= set variable ${device["node-id"]} + Run Keyword And Ignore Error ConnectApp.remove network element connection filtered validate=${True} node-id=${node_id} + END + NTSimManagerNG.set_ves_config_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + ... pnf-registration=${False} + ConnectApp.Remove Network Element Connection ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + diff --git a/csit/tests/sdnr/functional/devicemanager/_templates/21_alarmNotificationVES/alarmNotificationVes.robot b/csit/tests/sdnr/functional/devicemanager/_templates/21_alarmNotificationVES/alarmNotificationVes.robot new file mode 100644 index 00000000..068a6b89 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/_templates/21_alarmNotificationVES/alarmNotificationVes.robot @@ -0,0 +1,136 @@ +*** Settings *** +Documentation Connects NTSim of specific device type +... NTSim information are stored in test environment variable file <environment> +... as dictionary NETWORK_FUNCTIONS = {} +... change device type on command line with e.g. --variable DEVICE_TYPE:O_RAN_FH +... Enable alarms by setting fault-notification-delay-period and validate the alarms published by NTSim +... received by SDNR via VES use case +Default Tags fm ves + +Library ConnectLibrary +Library SDNCRestconfLibrary +Library SDNCBaseLibrary +Library ConnectApp +Library NTSimManagerNG +Library FaultManagementApp +Library FaultManagementAppBackend +Library utility +Library DateTime +Library Collections + +Suite Setup global suite setup &{GLOBAL_SUITE_SETUP_CONFIG} +Suite Teardown global suite teardown + + +*** Variables *** +${DEVICE_TYPE} _FILL_HERE_ +${FAULT_DELAY} 5 +${TIME_PERIOD_SEND_NOTIFY} 22s +${PROCESS_TIME_NOTIF} 30s +&{ALARM_SEVERITY_DEFAULT} Critical=${0} Major=${0} Minor=${0} Warning=${0} NonAlarmed=${0} + + +*** Test Cases *** +Setup NTS function + [Tags] nts bringup + [Documentation] add network function to trigger alarm notification via VES in next tests + Add Network Element Connection ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} ${True} + ... ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['IP']} ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['PORT']} + ... ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['USER']} ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['PASSWORD']} + ... Connected + SDNCRestconfLibrary.Should Be Equal Connection Status Until Time ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} Connected + +Set alarm notification + [Tags] smoke + NTSimManagerNG.clear_alarm_count ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + NTSimManagerNG.set_ves_config_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} faults-enabled=${True} + ${vesAlarmGenerated} = NTSimManagerNG.Get Alarm Count ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Global Variable ${start_time} + ${alarm_status_start} = FaultManagementApp.get_alarm_status + Set Global Variable ${alarm_status_start} + NTSimManagerNG.set_fault_delay_list_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} delay-period=${fault_delay} + Log Send notification every ${FAULT_DELAY} sec for ${TIME_PERIOD_SEND_NOTIFY} level=INFO html=False console=True repr=False + Sleep ${TIME_PERIOD_SEND_NOTIFY} + +UnSet alarm notification + [Documentation] stops alarm generation and create dictionary ${vesAlarmGenerated} + ... for further checks + [Tags] smoke + NTSimManagerNG.set_fault_delay_list_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} delay-period=${0} + #NTSimManagerNG.set_ves_config_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + #... faults-enabled=${False} + Log Wait ${PROCESS_TIME_NOTIF} to process notifications level=INFO html=False console=True repr=False + Sleep ${PROCESS_TIME_NOTIF} + # get generated alarms + ${vesAlarmGenerated} = NTSimManagerNG.Get Alarm Count ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + ${alarmsGenerated} = Get Dictionary Values ${vesAlarmGenerated} + Log ${alarmsGenerated} + ${numAlarmsGenerated} = evaluate sum(${alarmsGenerated}) + Log ${numAlarmsGenerated} + Should Not Be Equal As Integers ${numAlarmsGenerated} 0 msg=no alarm notifications generated + Set Global Variable ${vesAlarmGenerated} + + +Verify alarm log + [Documentation] NTSim sends alarm notification for all simulated devices + ... Verification is done for all simulated devices of the simulator + [Tags] smoke fm ves + + @{pnf_list}= NTSimManagerNG.get_simulated_pnfs_nf_as_node_id_list ${DEVICE_TYPE} + ${length} = Get Length ${pnf_list} + Should Not Be Equal As Integers ${length} 0 msg=No network functions created + Log to console ${pnf_list} + FOR ${device} IN @{pnf_list} + ${alarm_log_list_debug_backend} = FaultManagementAppBackend.get_alarm_log_list source-type=Ves + ... timestamp=>=${start_time} + ... node-id=${device} + Log ${alarm_log_list_debug_backend} + ${alarm_log_list} = FaultManagementApp.get_alarm_log_list source-type=Ves + ... timestamp=>=${start_time} + ... node-id=${device} + ${alarm_log_list_stats} = get_counts_from_list ${alarm_log_list} severity ${ALARM_SEVERITY_DEFAULT} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${alarm_log_list_stats} Critical ${vesAlarmGenerated}[critical] + Run Keyword And Continue On Failure Dictionary Should Contain Item ${alarm_log_list_stats} Major ${vesAlarmGenerated}[major] + Run Keyword And Continue On Failure Dictionary Should Contain Item ${alarm_log_list_stats} Minor ${vesAlarmGenerated}[minor] + Run Keyword And Continue On Failure Dictionary Should Contain Item ${alarm_log_list_stats} Warning ${vesAlarmGenerated}[warning] + Run Keyword And Continue On Failure Dictionary Should Contain Item ${alarm_log_list_stats} NonAlarmed ${vesAlarmGenerated}[normal] + END + +Verify current problem list + [Tags] smoke + ${alarm_log_list} = FaultManagementApp.get_alarm_log_list timestamp=>=${start_time} + ${current_problem_list_calculated}= FaultManagementApp.calculate_current_alarm_list ${alarm_log_list} + Log ${current_problem_list_calculated} + ${current_problem_list}= FaultManagementApp.get_current_problem_list timestamp=>=${start_time} + Log ${current_problem_list} + ${current_problem_list_debug}= FaultManagementApp.get_current_problem_list + Log ${current_problem_list_debug} + ${current_problem_list_debug_backend}= FaultManagementAppBackend.get_current_problem_list timestamp=>=${start_time} + Log ${current_problem_list_debug_backend} + ${current_problem_list_calculated_stats}= get_counts_from_list ${current_problem_list_calculated} severity ${ALARM_SEVERITY_DEFAULT} + ${current_problem_list_stats}= get_counts_from_list ${current_problem_list} severity ${ALARM_SEVERITY_DEFAULT} + Log Dictionary ${current_problem_list_calculated_stats} + Log Dictionary ${current_problem_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${current_problem_list_stats} Critical ${current_problem_list_calculated_stats}[Critical] + Run Keyword And Continue On Failure Dictionary Should Contain Item ${current_problem_list_stats} Major ${current_problem_list_calculated_stats}[Major] + Run Keyword And Continue On Failure Dictionary Should Contain Item ${current_problem_list_stats} Minor ${current_problem_list_calculated_stats}[Minor] + Run Keyword And Continue On Failure Dictionary Should Contain Item ${current_problem_list_stats} Warning ${current_problem_list_calculated_stats}[Warning] + +Verify alarm status bar + [Tags] smoke + Sleep 10s reason=wait update alarmstatus + ${alarm_status_end} = FaultManagementApp.get_alarm_status + Log Dictionary ${alarm_status_start} + Log Dictionary ${alarm_status_end} + Run Keyword And Continue On Failure Evaluate ${alarm_status_end}[criticals]-${alarm_status_start}[criticals] == ${vesAlarmGenerated}[critical] + Run Keyword And Continue On Failure Evaluate ${alarm_status_end}[majors]-${alarm_status_start}[majors] == ${vesAlarmGenerated}[major] + Run Keyword And Continue On Failure Evaluate ${alarm_status_end}[minors]-${alarm_status_start}[minors] == ${vesAlarmGenerated}[minor] + Run Keyword And Continue On Failure Evaluate ${alarm_status_end}[warnings]-${alarm_status_start}[warnings] == ${vesAlarmGenerated}[warning] + +Remove networkelement connection + ConnectApp.Remove network element connection ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + Run Keyword And Continue On Failure ConnectApp.Should be equal connection status until time ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} not existing + SDNCRestconfLibrary.Should Be Equal Connection Status Until Time ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} not existing diff --git a/csit/tests/sdnr/functional/devicemanager/_templates/22_alarmNotificationNETCONF/alarmNotificationNetconf.robot b/csit/tests/sdnr/functional/devicemanager/_templates/22_alarmNotificationNETCONF/alarmNotificationNetconf.robot new file mode 100644 index 00000000..df023c41 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/_templates/22_alarmNotificationNETCONF/alarmNotificationNetconf.robot @@ -0,0 +1,143 @@ +*** Settings *** +Documentation Connects NTSim of specific device type +... NTSim information are stored in test environment variable file <environment> +... as dictionary NETWORK_FUNCTIONS = {} +... change device type on command line with e.g. --variable DEVICE_TYPE:O_RAN_FH +... Enable alarms by setting fault-notification-delay-period and validate the alarms raised by NTS +... received by SDNR via netconf +Default Tags fm ves + +Library ConnectLibrary +Library SDNCBaseLibrary +Library SDNCRestconfLibrary +Library ConnectApp +Library NTSimManagerNG +Library FaultManagementApp +Library FaultManagementAppBackend +Library utility +Library DateTime +Library Collections + +Suite Setup global suite setup &{GLOBAL_SUITE_SETUP_CONFIG} +Suite Teardown global suite teardown + + +*** Variables *** +${DEVICE_TYPE} DEFINE_IN_INIT +${HOST} ${NETWORK_FUNCTIONS}[${DEVICE_TYPE}][NETCONF_HOST] +${PORT} ${NETWORK_FUNCTIONS}[${DEVICE_TYPE}][BASE_PORT] +${USERNAME} ${NETWORK_FUNCTIONS}[${DEVICE_TYPE}][USER] +${PASSWORD} ${NETWORK_FUNCTIONS}[${DEVICE_TYPE}][PASSWORD] +${HOST_NOK} 192.168.240.240 +${PORT_NOK} ${4711} +${USERNAME_NOK} wrong-username +${PASSWORD_NOK} wrong-password +${CORE_MODEL} Unsupported +${UNDEFINED} undefined +${FAULT_DELAY} 5 +${TIME_PERIOD_SEND_NOTIF} 22s +&{ALARM_SEVERITY_DEFAULT} Critical=${0} Major=${0} Minor=${0} Warning=${0} NonAlarmed=${0} + + +*** Test Cases *** +Setup NTS function + [Tags] nts bringup + [Documentation] configure NTS manager to support restconf registration + Add Network Element Connection ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} ${True} + ... ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['IP']} ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['PORT']} + ... ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['USER']} ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['PASSWORD']} + ... Connected + SDNCRestconfLibrary.Should Be Equal Connection Status Until Time ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} Connected + +Set alarm notification + [Tags] smoke + NTSimManagerNG.clear_alarm_count ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + NTSimManagerNG.Set Netconf Config Nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} faults-enabled=${True} + ${vesAlarmGenerated} = NTSimManagerNG.Get Alarm Count ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + Sleep 1s reason=insert time gap in log files + ${start_time} = Get Current Date time_zone=UTC result_format=%Y-%m-%dT%H:%M:%S.%f + Sleep 1s reason=insert time delay to account for time differences of container and host + Set Global Variable ${start_time} + ${current_problem_list}= FaultManagementApp.Get Current Problem List + Log ${current_problem_list} + ${alarm_status_start} = FaultManagementApp.get_alarm_status + Set Global Variable ${alarm_status_start} + NTSimManagerNG.set_fault_delay_list_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} delay-period=${fault_delay} + + Log Send notification every ${FAULT_DELAY} sec for ${TIME_PERIOD_SEND_NOTIF} level=INFO html=False console=True repr=False + Sleep ${TIME_PERIOD_SEND_NOTIF} + +UnSet alarm notification + [Documentation] stops alarm generation and create dictionary ${netconfAlarmGenerated} + ... for further checks + [Tags] smoke + ${netconfAlarmGenerated} = NTSimManagerNG.Get Alarm Count ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + NTSimManagerNG.set_fault_delay_list_nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} delay-period=${0} + NTSimManagerNG.Set Netconf Config Nf ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} faults-enabled=${False} + # get generated alarms + ${alarmsGenerated} = Get Dictionary Values ${netconfAlarmGenerated} + Log ${alarmsGenerated} + ${numAlarmsGenerated} = evaluate sum(${alarmsGenerated}) + Log ${numAlarmsGenerated} + Should Not Be Equal As Integers ${numAlarmsGenerated} 0 msg=no alarm notifications generated + Set Global Variable ${netconfAlarmGenerated} + + +Verify alarm log + [Tags] smoke + + ${alarm_log_list} = FaultManagementApp.get_alarm_log_list source-type=Netconf + ... timestamp=>=${start_time} + ... node-id=${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + ${alarm_log_list_stats} = get_counts_from_list ${alarm_log_list} severity ${ALARM_SEVERITY_DEFAULT} + Log Dictionary ${alarm_log_list_stats} + ${alarm_log_list_debug} = FaultManagementApp.get_alarm_log_list source-type=Netconf + Log ${alarm_log_list_debug} + ${alarm_log_list_debug_backend} = FaultManagementAppBackend.get_alarm_log_list source-type=Netconf + ... timestamp=>=${start_time} + Log ${alarm_log_list_debug_backend} + + Run Keyword And Continue On Failure Dictionary Should Contain Item ${alarm_log_list_stats} Critical ${netconfAlarmGenerated}[critical] + Run Keyword And Continue On Failure Dictionary Should Contain Item ${alarm_log_list_stats} Major ${netconfAlarmGenerated}[major] + Run Keyword And Continue On Failure Dictionary Should Contain Item ${alarm_log_list_stats} Minor ${netconfAlarmGenerated}[minor] + Run Keyword And Continue On Failure Dictionary Should Contain Item ${alarm_log_list_stats} Warning ${netconfAlarmGenerated}[warning] + Run Keyword And Continue On Failure Dictionary Should Contain Item ${alarm_log_list_stats} NonAlarmed ${netconfAlarmGenerated}[normal] + +Verify current problem list + [Tags] smoke + # fails immediatly if netconfAlarmGenerated is not set + Log ${netconfAlarmGenerated} + ${alarm_log_list} = FaultManagementApp.get_alarm_log_list timestamp=>=${start_time} + ${current_problem_list_calculated}= FaultManagementApp.calculate_current_alarm_list ${alarm_log_list} + Log ${current_problem_list_calculated} + ${current_problem_list}= FaultManagementApp.get_current_problem_list timestamp=>=${start_time} + Log ${current_problem_list} + ${current_problem_list_debug}= FaultManagementApp.get_current_problem_list + Log ${current_problem_list_debug} + ${current_problem_list_debug_backend}= FaultManagementAppBackend.get_current_problem_list timestamp=>=${start_time} + Log ${current_problem_list_debug_backend} + ${current_problem_list_calculated_stats} = get_counts_from_list ${current_problem_list_calculated} severity ${ALARM_SEVERITY_DEFAULT} + ${current_problem_list_stats} = get_counts_from_list ${current_problem_list} severity ${ALARM_SEVERITY_DEFAULT} + Log Dictionary ${current_problem_list_calculated_stats} + Log Dictionary ${current_problem_list_stats} + Run Keyword And Continue On Failure Dictionary Should Contain Item ${current_problem_list_stats} Critical ${current_problem_list_calculated_stats}[Critical] + Run Keyword And Continue On Failure Dictionary Should Contain Item ${current_problem_list_stats} Major ${current_problem_list_calculated_stats}[Major] + Run Keyword And Continue On Failure Dictionary Should Contain Item ${current_problem_list_stats} Minor ${current_problem_list_calculated_stats}[Minor] + Run Keyword And Continue On Failure Dictionary Should Contain Item ${current_problem_list_stats} Warning ${current_problem_list_calculated_stats}[Warning] + +Verify alarm status bar + [Tags] smoke + Sleep 10s reason=wait update alarmstatus + ${alarm_status_end} = FaultManagementApp.get_alarm_status + Log Dictionary ${alarm_status_start} + Log Dictionary ${alarm_status_end} + Run Keyword And Continue On Failure Evaluate ${alarm_status_end}[criticals]-${alarm_status_start}[criticals] == ${netconfAlarmGenerated}[critical] + Run Keyword And Continue On Failure Evaluate ${alarm_status_end}[majors]-${alarm_status_start}[majors] == ${netconfAlarmGenerated}[major] + Run Keyword And Continue On Failure Evaluate ${alarm_status_end}[minors]-${alarm_status_start}[minors] == ${netconfAlarmGenerated}[minor] + Run Keyword And Continue On Failure Evaluate ${alarm_status_end}[warnings]-${alarm_status_start}[warnings] == ${netconfAlarmGenerated}[warning] + +Remove networkelement connection + ConnectApp.Remove network element connection ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} + Run Keyword And Continue On Failure ConnectApp.Should be equal connection status until time ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} not existing + SDNCRestconfLibrary.Should Be Equal Connection Status Until Time ${NETWORK_FUNCTIONS['${DEVICE_TYPE}']['NAME']} not existing + diff --git a/csit/tests/sdnr/functional/devicemanager/_templates/90_resetSimulatedDevices/90_resetSimulatedDevices.robot b/csit/tests/sdnr/functional/devicemanager/_templates/90_resetSimulatedDevices/90_resetSimulatedDevices.robot new file mode 100644 index 00000000..e9db7405 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/_templates/90_resetSimulatedDevices/90_resetSimulatedDevices.robot @@ -0,0 +1,25 @@ +*** Settings *** +Documentation Set number of simulated devices of all device types +... NTS manager information are stored in test environemnt variable file <environment> +... as dictionary NTS_MANAGER = {} +... change number devices on command line with --variable SIM_COUNT:10 --variable DEVICE_TYPE:ORAN + +Library ConnectLibrary +Library SDNCBaseLibrary +Library NTSimManagerNG +Library ConnectApp + +Suite Setup global_suite_setup +Suite Teardown global suite teardown + + +*** Variables *** +${DEVICE_TYPE} DEFINE_IN_INIT +${SIM_COUNT} 0 + + +*** Test Cases *** +Reset simulated devices + [Tags] nts-manager bringup + [Documentation] scales number of simulated devices per device type + remove network element connection filtered node-id=* diff --git a/csit/tests/sdnr/functional/devicemanager/_templates/__init__.robot b/csit/tests/sdnr/functional/devicemanager/_templates/__init__.robot new file mode 100644 index 00000000..0011fbc5 --- /dev/null +++ b/csit/tests/sdnr/functional/devicemanager/_templates/__init__.robot @@ -0,0 +1,16 @@ +*** Settings *** +Documentation Test suite for _FILL_HERE_ devices +Suite Setup My Setup +Force Tags _FILL_HERE_ +#Library SomeLibrary + +*** Variables *** + + +*** Keywords *** +My Setup + Set Suite Variable ${DEVICE_TYPE} _FILL_HERE_ children=true + Set Suite Variable ${CORE_MODEL} _FILL_HERE_ children=true + Set Suite Variable ${DEVICE_TYPE_GUI} _FILL_HERE_ children=true + + |