Netconf Scaling test for single threaded GET requests 88/28588/22
authorJozef Behran <jbehran@cisco.com>
Wed, 14 Oct 2015 10:31:29 +0000 (12:31 +0200)
committerJozef Behran <jbehran@cisco.com>
Thu, 26 Nov 2015 08:23:27 +0000 (09:23 +0100)
Then it mounts a number of devices, queries their data and
then unmounts them. Each of these steps is done one device
at a time.

Change-Id: I5d3fd4713a0a3e350299ceaddc27150f03962ed5
Signed-off-by: Jozef Behran <jbehran@cisco.com>
csit/libraries/NetconfKeywords.robot
csit/scriptplans/netconf-scale.txt [new file with mode: 0644]
csit/suites/netconf/scale/getsingle.robot [new file with mode: 0644]
csit/testplans/netconf-scale.txt [new file with mode: 0644]

index b06b4d26efc2e53b5cf9338221c62dd3744b037a..2e5e8d034c7e07387bae066ceb64647a3ae9a44b 100644 (file)
@@ -19,6 +19,8 @@ Resource          SSHKeywords.robot
 *** Variables ***
 ${DIRECTORY_WITH_DEVICE_TEMPLATES}    ${CURDIR}/../variables/netconf/device
 ${FIRST_TESTTOOL_PORT}    17830
+${BASE_NETCONF_DEVICE_PORT}    17830
+${DEVICE_NAME_BASE}    netconf-scaling-device
 
 *** Keywords ***
 Setup_NetconfKeywords
@@ -162,3 +164,16 @@ Stop_Testtool
     # "Interrupt_Program_And_Download_Its_Log" which will get an argument stating the name of
     # the log file to get.
     SSHLibrary.Get_File    testtool.log
+
+NetconfKeywords__Perform_Operation_With_Checking_On_Next_Device
+    [Arguments]    ${operation}
+    ${number}=    BuiltIn.Evaluate    ${current_port}-${BASE_NETCONF_DEVICE_PORT}+1
+    BuiltIn.Wait_Until_Keyword_Succeeds    10s    1s    NetconfKeywords.Check_Device_Up_And_Running    ${number}
+    BuiltIn.Run_Keyword    ${operation}    ${DEVICE_NAME_BASE}-${number}
+    ${next}=    BuiltIn.Evaluate    ${current_port}+1
+    BuiltIn.Set_Suite_Variable    ${current_port}    ${next}
+
+Perform_Operation_On_Each_Device
+    [Arguments]    ${operation}    ${count}=${DEVICE_COUNT}
+    BuiltIn.Set_Suite_Variable    ${current_port}    ${BASE_NETCONF_DEVICE_PORT}
+    BuiltIn.Repeat_Keyword    ${count} times    NetconfKeywords__Perform_Operation_With_Checking_On_Next_Device    ${operation}
diff --git a/csit/scriptplans/netconf-scale.txt b/csit/scriptplans/netconf-scale.txt
new file mode 100644 (file)
index 0000000..9632f78
--- /dev/null
@@ -0,0 +1,8 @@
+# Copyright (c) 2015 Cisco Systems, 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
+
+# Place the suites in run order:
+integration/test/csit/scripts/controllermem_6g.sh
diff --git a/csit/suites/netconf/scale/getsingle.robot b/csit/suites/netconf/scale/getsingle.robot
new file mode 100644 (file)
index 0000000..b3812d5
--- /dev/null
@@ -0,0 +1,90 @@
+*** Settings ***
+Documentation     netconf-connector scaling test suite (single-threaded GET requests).
+...
+...               Copyright (c) 2015 Cisco Systems, 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
+...
+...
+...               Performs scaling tests:
+...               - Configuring devices one by one.
+...               - Sending requests for configuration data.
+...               - Deconfiguring devices one by one.
+Suite Setup       Setup_Everything
+Suite Teardown    Teardown_Everything
+Library           RequestsLibrary
+Library           SSHLibrary    timeout=10s
+Resource          ${CURDIR}/../../../libraries/KarafKeywords.robot
+Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
+Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource          ${CURDIR}/../../../libraries/Utils.robot
+Variables         ${CURDIR}/../../../variables/Variables.py
+
+*** Variables ***
+${DEVICE_COUNT}    500
+${memory_usage_leeway}    16    # in MB
+
+*** Test Cases ***
+Configure_Devices_Onto_Netconf
+    [Documentation]    Make requests to configure the testtool devices.
+    [Tags]    critical
+    NetconfKeywords.Perform_Operation_On_Each_Device    Configure_Device
+
+Get_Data_From_Devices
+    [Documentation]    Ask testtool devices for data.
+    NetconfKeywords.Perform_Operation_On_Each_Device    Check_Device_Data
+
+Deconfigure_Devices_From_Netconf
+    [Documentation]    Make requests to deconfigure the testtool devices.
+    [Tags]    critical
+    NetconfKeywords.Perform_Operation_On_Each_Device    Deconfigure_Device
+    [Teardown]    Report_Failure_Due_To_Bug    4547
+
+*** Keywords ***
+Setup_Everything
+    [Documentation]    Setup everything needed for the test cases.
+    # Setup resources used by the suite.
+    RequestsLibrary.Create_Session    config    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${CONFIG_API}    auth=${AUTH}
+    RequestsLibrary.Create_Session    operational    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${OPERATIONAL_API}    auth=${AUTH}
+    SSHLibrary.Set_Default_Configuration    prompt=${TOOLS_SYSTEM_PROMPT}
+    SetupUtils.Setup_Utils_For_Setup_And_Teardown
+    NetconfKeywords.Setup_Netconf_Keywords
+    # Connect to the tools machine
+    SSHLibrary.Open_Connection    ${TOOLS_SYSTEM_IP}
+    Utils.Flexible_Mininet_Login
+    # Deploy testtool on it
+    NetconfKeywords.Install_And_Start_Testtool    device-count=${DEVICE_COUNT}
+
+Teardown_Everything
+    [Documentation]    Teardown the test infrastructure, perform cleanup and release all resources.
+    Teardown_Netconf_Via_Restconf
+    RequestsLibrary.Delete_All_Sessions
+    NetconfKeywords.Stop_Testtool
+
+Configure_Device
+    [Arguments]    ${current_name}
+    [Documentation]    Operation for configuring the device in the Netconf subsystem and connecting to it.
+    KarafKeywords.Log_Message_To_Controller_Karaf    Connecting device ${current_name}
+    NetconfKeywords.Configure_Device_In_Netconf    ${current_name}    device_port=${current_port}
+    KarafKeywords.Log_Message_To_Controller_Karaf    Waiting for device ${current_name} to connect
+    NetconfKeywords.Wait_Device_Connected    ${current_name}    period=0.5s
+    KarafKeywords.Log_Message_To_Controller_Karaf    Device ${current_name} connected
+
+Check_Device_Data
+    [Arguments]    ${current_name}
+    [Documentation]    Opration for getting the configuration data of the device and checking that it matches what is expected.
+    KarafKeywords.Log_Message_To_Controller_Karaf    Getting data from device ${current_name}
+    ${data}=    Utils.Get_Data_From_URI    config    network-topology:network-topology/topology/topology-netconf/node/${current_name}/yang-ext:mount    headers=${ACCEPT_XML}
+    KarafKeywords.Log_Message_To_Controller_Karaf    Got data from device ${current_name}
+    BuiltIn.Should_Be_Equal    ${data}    <data xmlns="${ODL_NETCONF_NAMESPACE}"></data>
+
+Deconfigure_Device
+    [Arguments]    ${current_name}
+    [Documentation]    Operation for deconfiguring the device from Netconf.
+    KarafKeywords.Log_Message_To_Controller_Karaf    Removing device ${current_name}
+    NetconfKeywords.Remove_Device_From_Netconf    ${current_name}
+    KarafKeywords.Log_Message_To_Controller_Karaf    Waiting for device ${current_name} to disappear
+    NetconfKeywords.Wait_Device_Fully_Removed    ${current_name}    period=0.5s
+    KarafKeywords.Log_Message_To_Controller_Karaf    Device ${current_name} removed
diff --git a/csit/testplans/netconf-scale.txt b/csit/testplans/netconf-scale.txt
new file mode 100644 (file)
index 0000000..7fd4109
--- /dev/null
@@ -0,0 +1,9 @@
+# Copyright (c) 2015 Cisco Systems, 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
+
+# Place the suites in run order:
+integration/test/csit/suites/netconf/ready
+integration/test/csit/suites/netconf/scale/getsingle.robot