Fix Netconf scaling suites not reporting test cases to karaf.log
[integration/test.git] / csit / suites / netconf / scale / getsingle.robot
1 *** Settings ***
2 Documentation     netconf-connector scaling test suite (single-threaded GET requests).
3 ...
4 ...               Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
5 ...
6 ...               This program and the accompanying materials are made available under the
7 ...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
8 ...               and is available at http://www.eclipse.org/legal/epl-v10.html
9 ...
10 ...
11 ...               Performs scaling tests:
12 ...               - Configuring devices one by one.
13 ...               - Sending requests for configuration data.
14 ...               - Deconfiguring devices one by one.
15 Suite Setup       Setup_Everything
16 Suite Teardown    Teardown_Everything
17 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
18 Library           RequestsLibrary
19 Library           SSHLibrary    timeout=10s
20 Resource          ${CURDIR}/../../../libraries/KarafKeywords.robot
21 Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
22 Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
23 Resource          ${CURDIR}/../../../libraries/Utils.robot
24 Variables         ${CURDIR}/../../../variables/Variables.py
25
26 *** Variables ***
27 ${DEVICE_COUNT}    500
28
29 *** Test Cases ***
30 Start_Test_Tool
31     [Documentation]    Deploy and start test tool, then wait for all its devices to become online.
32     NetconfKeywords.Install_And_Start_Testtool    device-count=${DEVICE_COUNT}    mdsal=false
33
34 Configure_Devices_Onto_Netconf
35     [Documentation]    Make requests to configure the testtool devices.
36     [Tags]    critical
37     ${timeout}=    BuiltIn.Evaluate    ${DEVICE_COUNT}*10
38     NetconfKeywords.Perform_Operation_On_Each_Device    Configure_Device    timeout=${timeout}
39
40 Get_Data_From_Devices
41     [Documentation]    Ask testtool devices for data.
42     ${timeout}=    BuiltIn.Evaluate    ${DEVICE_COUNT}*2
43     NetconfKeywords.Perform_Operation_On_Each_Device    Check_Device_Data    timeout=${timeout}
44
45 Deconfigure_Devices_From_Netconf
46     [Documentation]    Make requests to deconfigure the testtool devices.
47     [Tags]    critical
48     ${timeout}=    BuiltIn.Evaluate    ${DEVICE_COUNT}*10
49     NetconfKeywords.Perform_Operation_On_Each_Device    Deconfigure_Device    timeout=${timeout}
50     [Teardown]    Report_Failure_Due_To_Bug    4547
51
52 *** Keywords ***
53 Setup_Everything
54     [Documentation]    Setup everything needed for the test cases.
55     # Setup resources used by the suite.
56     RequestsLibrary.Create_Session    config    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${CONFIG_API}    auth=${AUTH}
57     RequestsLibrary.Create_Session    operational    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${OPERATIONAL_API}    auth=${AUTH}
58     SSHLibrary.Set_Default_Configuration    prompt=${TOOLS_SYSTEM_PROMPT}
59     SetupUtils.Setup_Utils_For_Setup_And_Teardown
60     NetconfKeywords.Setup_Netconf_Keywords
61     KarafKeywords.Configure_Timeout_For_Karaf_Console    120s
62
63 Teardown_Everything
64     [Documentation]    Teardown the test infrastructure, perform cleanup and release all resources.
65     Teardown_Netconf_Via_Restconf
66     RequestsLibrary.Delete_All_Sessions
67     NetconfKeywords.Stop_Testtool
68
69 Configure_Device
70     [Arguments]    ${current_name}
71     [Documentation]    Operation for configuring the device in the Netconf subsystem and connecting to it.
72     KarafKeywords.Log_Message_To_Controller_Karaf    Connecting device ${current_name}
73     NetconfKeywords.Configure_Device_In_Netconf    ${current_name}    device_port=${current_port}
74     KarafKeywords.Log_Message_To_Controller_Karaf    Waiting for device ${current_name} to connect
75     NetconfKeywords.Wait_Device_Connected    ${current_name}    period=0.5s
76     KarafKeywords.Log_Message_To_Controller_Karaf    Device ${current_name} connected
77
78 Check_Device_Data
79     [Arguments]    ${current_name}
80     [Documentation]    Opration for getting the configuration data of the device and checking that it matches what is expected.
81     KarafKeywords.Log_Message_To_Controller_Karaf    Getting data from device ${current_name}
82     ${data}=    Utils.Get_Data_From_URI    config    network-topology:network-topology/topology/topology-netconf/node/${current_name}/yang-ext:mount    headers=${ACCEPT_XML}
83     KarafKeywords.Log_Message_To_Controller_Karaf    Got data from device ${current_name}
84     BuiltIn.Should_Be_Equal    ${data}    <data xmlns="${ODL_NETCONF_NAMESPACE}"></data>
85
86 Deconfigure_Device
87     [Arguments]    ${current_name}
88     [Documentation]    Operation for deconfiguring the device from Netconf.
89     KarafKeywords.Log_Message_To_Controller_Karaf    Removing device ${current_name}
90     NetconfKeywords.Remove_Device_From_Netconf    ${current_name}
91     KarafKeywords.Log_Message_To_Controller_Karaf    Waiting for device ${current_name} to disappear
92     NetconfKeywords.Wait_Device_Fully_Removed    ${current_name}    period=0.5s    timeout=120s
93     KarafKeywords.Log_Message_To_Controller_Karaf    Device ${current_name} removed