Fix NETCONF KWs to log less
[integration/test.git] / csit / suites / netconf / scale / max_devices.robot
index 4e8b5d92b1ee93d0698aaa06fe3b3c781fd707a6..8888c24f646a217d291e96c6d16a6f809d4a03ae 100644 (file)
@@ -1,13 +1,13 @@
 *** Settings ***
 Documentation     netconf-connector scaling test suite to find max connected devices
-...           
+...
 ...               Copyright (c) 2019 Lumina Networks, Inc. and others. All rights reserved.
-...           
+...
 ...               This program and the accompanying materials are made available under the
 ...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
 ...               and is available at http://www.eclipse.org/legal/epl-v10.html
-...           
-...           
+...
+...
 ...               Increasing numbers of netconf devices will be connected and cleaned up
 ...               while validating and profiling between each iteration.
 Suite Setup       Setup_Everything
@@ -15,8 +15,7 @@ Suite Teardown    Teardown_Everything
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
 Library           Collections
 Library           String
-Library           SSHLibrary    timeout=10s
-Resource          ../../../libraries/CheckJVMResource.robot
+Library           SSHLibrary    timeout=1000s
 Resource          ../../../libraries/KarafKeywords.robot
 Resource          ../../../libraries/NetconfKeywords.robot
 Resource          ../../../libraries/SetupUtils.robot
@@ -25,13 +24,13 @@ Resource          ../../../variables/Variables.robot
 
 *** Variables ***
 ${INIT_DEVICE_COUNT}    250
-${MAX_DEVICE_COUNT}    5000
-${DEVICE_INCREMENT}    250
+${MAX_DEVICE_COUNT}    100000
+${DEVICE_INCREMENT}    5000
 ${DEVICE_NAME_BASE}    netconf-scaling-device
 ${DEVICE_TYPE}    full-uri-device
 ${BASE_PORT}      17830
-${NUM_WORKERS}    10
-${TIMEOUT_FACTOR}    2
+${NUM_WORKERS}    500
+${TIMEOUT_FACTOR}    3
 ${MIN_CONNECT_TIMEOUT}    300
 ${DEVICES_RESULT_FILE}    devices.csv
 ${INSTALL_TESTTOOL}    True
@@ -48,33 +47,32 @@ Find Max Netconf Devices
     ${increment} =    BuiltIn.Convert to Integer    ${DEVICE_INCREMENT}
     ${schema_dir} =    Run Keyword If    "${SCHEMA_MODEL}" == "juniper"    Get Juniper Device Schemas
     ...    ELSE    Set Variable    none
-    Run Keyword And Ignore Error    CheckJVMResource.Get JVM Memory
+    ${INSTALL_TESTTOOL} =    Set Variable If    '${IS_KARAF_APPL}' == 'False'    False    True
+    ${TESTTOOL_EXECUTABLE} =    Set Variable If    '${IS_KARAF_APPL}' == 'False'    ${NETCONF_FILENAME}    ${EMPTY}
+    ${SCHEMAS} =    Set Variable If    '${IS_KARAF_APPL}' == 'False'    ${CURDIR}/../../../variables/netconf/CRUD/schemas    ${schema_dir}
     FOR    ${devices}    IN RANGE    ${start}    ${stop+1}    ${increment}
         ${timeout} =    BuiltIn.Evaluate    ${devices}*${TIMEOUT_FACTOR}
         ${timeout} =    Set Variable If    ${timeout} > ${MIN_CONNECT_TIMEOUT}    ${timeout}    ${MIN_CONNECT_TIMEOUT}
         Log To Console    Starting Iteration with ${devices} devices
-        Run Keyword If    "${INSTALL_TESTTOOL}"=="True"    NetconfKeywords.Install_And_Start_Testtool    debug=false    schemas=${schema_dir}    device-count=${devices}
-        ...    ELSE    NetconfKeywords.Start_Testtool    ${TESTTOOL_EXECUTABLE}    debug=false    schemas=${schema_dir}    device-count=${devices}
+        Run Keyword If    "${INSTALL_TESTTOOL}"=="True"    NetconfKeywords.Install_And_Start_Testtool    debug=false    schemas=${schema_dir}    device-count=${devices}    log_response=False
+        ...    ELSE    NetconfKeywords.Start_Testtool    ${TESTTOOL_EXECUTABLE}    debug=false    schemas=${SCHEMAS}    device-count=${devices}    log_response=False
         ${status}    ${result} =    Run Keyword And Ignore Error    NetconfKeywords.Perform_Operation_On_Each_Device    NetconfKeywords.Configure_Device    timeout=${timeout}
         Exit For Loop If    '${status}' == 'FAIL'
         ${status}    ${result} =    Run Keyword And Ignore Error    NetconfKeywords.Perform_Operation_On_Each_Device    NetconfKeywords.Wait_Connected    timeout=${timeout}    log_response=False
         Exit For Loop If    '${status}' == 'FAIL'
-        ${status}    ${result} =    Run Keyword And Ignore Error    Issue_Requests_On_Devices    ${TOOLS_SYSTEM_IP}    ${devices}
-        ...    ${NUM_WORKERS}
+        ${status}    ${result} =    Run Keyword And Ignore Error    Issue_Requests_On_Devices    ${TOOLS_SYSTEM_IP}    ${devices}    ${NUM_WORKERS}
         Exit For Loop If    '${status}' == 'FAIL'
         ${status}    ${result} =    Run Keyword And Ignore Error    NetconfKeywords.Perform_Operation_On_Each_Device    NetconfKeywords.Wait_Connected    timeout=${timeout}    log_response=False
         Exit For Loop If    '${status}' == 'FAIL'
-        ${status}    ${result} =    Run Keyword And Ignore Error    NetconfKeywords.Perform_Operation_On_Each_Device    NetconfKeywords.Deconfigure_Device    timeout=${timeout}
+        ${status}    ${result} =    Run Keyword And Ignore Error    NetconfKeywords.Perform_Operation_On_Each_Device    NetconfKeywords.Deconfigure_Device    timeout=${timeout}    log_response=False
         Exit For Loop If    '${status}' == 'FAIL'
         ${status}    ${result} =    Run Keyword And Ignore Error    NetconfKeywords.Perform_Operation_On_Each_Device    Check_Device_Deconfigured    timeout=${timeout}    log_response=False
         Exit For Loop If    '${status}' == 'FAIL'
         ${maximum_devices} =    Set Variable    ${devices}
-        Run Keyword And Ignore Error    CheckJVMResource.Get JVM Memory
         NetconfKeywords.Stop_Testtool
     END
     [Teardown]    Run Keywords    NetconfKeywords.Stop_Testtool
     ...    AND    Collect_Data_Points    ${maximum_devices}
-    ...    AND    Run Keyword And Ignore Error    CheckJVMResource.Get JVM Memory
 
 *** Keywords ***
 Collect_Data_Points
@@ -91,10 +89,12 @@ Issue_Requests_On_Devices
     SSHLibrary.Open_Connection    ${client_ip}
     SSHKeywords.Flexible_Mininet_Login
     SSHLibrary.Write    python getter.py --odladdress=${ODL_SYSTEM_IP} --count=${expected_count} --name=${device_name_base} --workers=${worker_count}
+    SSHLibrary.Read_Until    ${DEFAULT_LINUX_PROMPT_STRICT}
+    SSHLibrary.Write    python getter.py --odladdress=${ODL_SYSTEM_IP} --count=${expected_count} --name=${device_name_base} --workers=${worker_count}
     FOR    ${number}    IN RANGE    1    ${expected_count}+1
         Read_Python_Tool_Operation_Result    ${number}
     END
-    SSHLibrary.Read_Until_Prompt
+    SSHLibrary.Read_Until    ${DEFAULT_LINUX_PROMPT_STRICT}
     SSHLibrary.Close_Connection
     SSHKeywords.Restore Current SSH Connection From Index    ${current_ssh_connection.index}
 
@@ -129,8 +129,9 @@ Read_Python_Tool_Operation_Result
     ${ellapsed}=    Collections.Get_From_List    ${test}    3
     BuiltIn.Log    DATA REQUEST RESULT: Device=${number} StartTime=${start} StopTime=${stop} EllapsedTime=${ellapsed}
     ${data}=    Collections.Get_From_List    ${test}    4
-    ${expected}=    BuiltIn.Set_Variable    '<data xmlns="${ODL_NETCONF_NAMESPACE}"></data>'
-    BuiltIn.Should_Be_Equal_As_Strings    ${data}    ${expected}
+    ${expected}=    Run Keyword If    '${IS_KARAF_APPL}' == 'False'    BuiltIn.Set_Variable    '<data xmlns="${ODL_NETCONF_NAMESPACE}"/>'
+    ...    ELSE    BuiltIn.Set_Variable    '<data xmlns="${ODL_NETCONF_NAMESPACE}"></data>'
+    Should Be Equal As Strings    ${data}    ${expected}
 
 Check_Device_Deconfigured
     [Arguments]    ${current_name}    ${log_response}=True