Fix netconf scale suite
[integration/test.git] / csit / suites / netconf / restperfclient / mdsal.robot
index 72e1714f5ea5c6870f3d66a1f11c795009929ff8..1932c928b13b7ae37adac2a1c86607e746309164 100644 (file)
@@ -20,30 +20,30 @@ Suite Setup       Setup_Everything
 Suite Teardown    Teardown_Everything
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
 Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_And_Start_Fast_Failing_If_Test_Failed
-Library           DateTime
 Library           RequestsLibrary
 Library           OperatingSystem
 Library           SSHLibrary    timeout=10s
 Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
-Resource          ${CURDIR}/../../../libraries/NetconfViaRestconf.robot
 Resource          ${CURDIR}/../../../libraries/NexusKeywords.robot
 Resource          ${CURDIR}/../../../libraries/RestPerfClient.robot
 Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
+Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
 Resource          ${CURDIR}/../../../libraries/Utils.robot
 Variables         ${CURDIR}/../../../variables/Variables.py
 
 *** Variables ***
 ${DIRECTORY_WITH_TEMPLATE_FOLDERS}    ${CURDIR}/../../../variables/netconf/RestPerfClient
-${REQUEST_COUNT}    65536
+${REQUEST_COUNT}    16384
+${device_type}    full-uri-device
+${test_device}    odl-mdsal-northbound-via-netconf-connector
 
 *** Test Cases ***
 Create_Test_Data_For_Direct_Access
     [Documentation]    Send some sample test data into the device and check that the request went OK.
-    NetconfViaRestconf.Post_Xml_Template_Folder_Via_Restconf    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}cars    {}
+    TemplatedRequests.Post_As_Xml_Templated    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}cars    {}
 
 Run_RestPerfClient_Directly_On_MDSAL
     [Documentation]    Deploy and execute restperfclient, asking it to send the specified amount of requests to the MDSAL via Restconf.
-    [Timeout]    ${DIRECT_MDSAL_TIMEOUT_FOR_TESTCASE}
     ${url}=    BuiltIn.Set_Variable    /restconf/config/car:cars
     RestPerfClient.Invoke_Restperfclient    ${DIRECT_MDSAL_TIMEOUT}    ${url}    testcase=direct
 
@@ -64,22 +64,21 @@ Cleanup_And_Collect_For_Direct_Access
     [Documentation]    Cleanup the test data produced by the direct MDSAL access.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     RestPerfClient.Collect_From_Restperfclient
-    NetconfViaRestconf.Delete_Xml_Template_Folder_Via_Restconf    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}cars-delete    {}
+    TemplatedRequests.Delete_Templated    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}cars-delete    {}
 
 Create_Test_Data_For_Connector_Access
     [Documentation]    Create the test data container again so it is ready for the netconf connector test.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    NetconfViaRestconf.Post_Xml_Template_Folder_Via_Restconf    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}cars    {}
+    TemplatedRequests.Post_As_Xml_Templated    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}cars    {}
 
 Configure_ODL_As_A_Device_On_Netconf
     [Documentation]    Configure ODL MDSAL Northbound as a Netconf device on a Netconf connector.
-    NetconfKeywords.Configure_Device_In_Netconf    odl-mdsal-northbound-via-netconf-connector    device_address=${ODL_SYSTEM_IP}    device_port=${ODL_NETCONF_MDSAL_PORT}    device_user=${ODL_NETCONF_USER}    device_password=${ODL_NETCONF_PASSWORD}
-    NetconfKeywords.Wait_Device_Connected    odl-mdsal-northbound-via-netconf-connector
+    NetconfKeywords.Configure_Device_In_Netconf    ${test_device}    device_type=${device_type}    device_address=${ODL_SYSTEM_IP}    device_port=${ODL_NETCONF_MDSAL_PORT}    device_user=${ODL_NETCONF_USER}    device_password=${ODL_NETCONF_PASSWORD}
+    NetconfKeywords.Wait_Device_Connected    ${test_device}
 
 Run_RestPerfClient_Through_Netconf_Connector
-    [Documentation]    Ask RestPerfClient to send the requests to the MDSAL mapped via a netconf connector.
-    [Timeout]    ${NETCONF_CONNECTOR_MDSAL_TIMEOUT_FOR_TESTCASE}
-    ${url}=    BuiltIn.Set_Variable    /restconf/config/network-topology:network-topology/topology/topology-netconf/node/odl-mdsal-northbound-via-netconf-connector/yang-ext:mount/car:cars
+    [Documentation]    Ask RestPerfClient to send the requests to the MDSAL mapped via netconf topology device.
+    ${url}=    BuiltIn.Set_Variable    /restconf/config/network-topology:network-topology/topology/topology-netconf/node/${test_device}/yang-ext:mount/car:cars
     RestPerfClient.Invoke_Restperfclient    ${NETCONF_CONNECTOR_MDSAL_TIMEOUT}    ${url}    testcase=netconf-connector
 
 Check_For_Failed_Netconf_Connector_Requests
@@ -88,7 +87,6 @@ Check_For_Failed_Netconf_Connector_Requests
     ...    failure and failed requests. Failed requests are rejected because
     ...    we don't want to test performance of ODL rejecting our requests.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    ${restperfclientlog}=    RestPerfClient.Get_Current_Log_Name
     Set_Known_Bug_Id    5581
     ${result}=    RestPerfClient.Grep_Restperfclient_Log    thread timed out
     BuiltIn.Should_Be_Equal    '${result}'    ''
@@ -101,13 +99,13 @@ Check_For_Failed_Netconf_Connector_Requests
 Deconfigure_ODL_From_Netconf
     [Documentation]    Deconfigure the ODL MDSAL Northbound attached to a Netconf connector.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    NetconfKeywords.Remove_Device_From_Netconf    odl-mdsal-northbound-via-netconf-connector
+    NetconfKeywords.Remove_Device_From_Netconf    ${test_device}
 
 Cleanup_And_Collect_For_Connector_Access
     [Documentation]    Delete the test data produced by the Netconf connector MDSAL access.
     [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
     RestPerfClient.Collect_From_Restperfclient
-    NetconfViaRestconf.Delete_Xml_Template_Folder_Via_Restconf    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}cars-delete    {}
+    TemplatedRequests.Delete_Templated    ${DIRECTORY_WITH_TEMPLATE_FOLDERS}${/}cars-delete    {}
 
 *** Keywords ***
 Setup_Everything
@@ -116,18 +114,15 @@ Setup_Everything
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     NetconfKeywords.Setup_Netconf_Keywords
     RestPerfClient.Setup_Restperfclient
+    ${device_type}=    BuiltIn.Set_Variable_If    ${USE_NETCONF_CONNECTOR}==${True}    default    ${device_type}
+    BuiltIn.Set_Suite_Variable    ${device_type}
     # Calculate timeouts
     ${value}=    BuiltIn.Evaluate    ${REQUEST_COUNT}/50+10
     Utils.Set_User_Configurable_Variable_Default    DIRECT_MDSAL_TIMEOUT    ${value} s
-    ${value}=    DateTime.Add_Time_To_Time    ${DIRECT_MDSAL_TIMEOUT}    2m    result_format=compact
-    Utils.Set_User_Configurable_Variable_Default    DIRECT_MDSAL_TIMEOUT_FOR_TESTCASE    ${value}
-    ${value}=    BuiltIn.Evaluate    ${REQUEST_COUNT}/10+10
+    ${value}=    BuiltIn.Evaluate    ${REQUEST_COUNT}/10+20
     Utils.Set_User_Configurable_Variable_Default    NETCONF_CONNECTOR_MDSAL_TIMEOUT    ${value} s
-    ${value}=    DateTime.Add_Time_To_Time    ${NETCONF_CONNECTOR_MDSAL_TIMEOUT}    2m    result_format=compact
-    Utils.Set_User_Configurable_Variable_Default    NETCONF_CONNECTOR_MDSAL_TIMEOUT_FOR_TESTCASE    ${value}
 
 Teardown_Everything
     [Documentation]    Teardown the test infrastructure, perform cleanup and release all resources.
-    Teardown_Netconf_Via_Restconf
     RequestsLibrary.Delete_All_Sessions
     RestPerfClient.Teardown_Restperfclient