new robot to measure flow setup rate using add-flows-ds
authorPeter Gubka <pgubka@cisco.com>
Thu, 2 Jul 2015 12:38:47 +0000 (14:38 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 3 Jul 2015 13:06:29 +0000 (13:06 +0000)
- unifying performance suites and minor imrovements
- 090_BulkMaticConfigDsSetup_100k.robot - new robot
- 080_Rpc_100k_Flows_Configuration_Time_Measure.robot - adding rate to csv file
- 070_Stats_Collection_100k_WithMininetRestart.robot - adding rate to csv file
- new tesplan files

Change-Id: I1e812c8a21088907054128c328a83b08bea4bac7
Signed-off-by: Peter Gubka <pgubka@cisco.com>
test/csit/libraries/ScaleClient.py
test/csit/suites/openflowplugin/Performance_Flow_Config/070_Stats_Collection_100k_WithMininetRestart.robot
test/csit/suites/openflowplugin/Performance_Flow_Config/080_Rpc_100k_Flows_Configuration_Time_Measure.robot
test/csit/suites/openflowplugin/Performance_Flow_Config/090_BulkMaticConfigDsSetup_100k.robot [new file with mode: 0644]
test/csit/testplans/openflowplugin-bulk-matic-ds-daily-lithium-redesign.txt [new file with mode: 0644]
test/csit/testplans/openflowplugin-bulk-matic-ds-daily.txt [new file with mode: 0644]

index 68a7813606ba0f1b823094957983996e2928a649..d7ef8ec82893e75e365eb43c452ecabd4f1ab606 100644 (file)
@@ -137,7 +137,7 @@ def _get_notes(fldet=[]):
 def _randomize(spread, maxn):
     """Returns a randomized switch or table id"""
     if spread not in _spreads:
-        raise Exception('Spread method {0} not available'.format(spread))
+        raise Exception('Spread method {} not available'.format(spread))
     while True:
         if spread == 'gauss':
             ga = abs(random.gauss(0, 1))
@@ -676,3 +676,21 @@ def get_switches_count(controller=''):
     if switches is None:
         return 0
     return len(switches)
+
+
+def validate_responses(received, expected):
+    """Compares given response summary with expected results.
+
+    Args:
+        :param received: dictionary returned from operations_* and (de)configure_flows*
+                         of this library
+                         e.g. received = { 200:41 } - this means that we 41x receives response with status code 200
+
+        :param expected: list of expected http result codes
+                         e.g. expected=[200] - we expect only http status 200 to be present
+
+    Returns:
+        :returns True: if list of http statuses from received responses is the same as exxpected
+        :returns False: elseware
+    """
+    return True if received.keys() == expected else False
index ae33a76a1a30597672f1ae31e41945de88e70d54..0fb05026efc80b1883018673542f73085fef2c39 100644 (file)
@@ -3,9 +3,9 @@ Documentation     Suite checks if StatMngr is able to collect flows correctly
 Suite Setup       Create Http Session
 Suite Teardown    Delete Http Session And Store Plot Data
 Library           OperatingSystem
-Library           Collections
 Library           XML
 Library           SSHLibrary
+Library           Collections
 Variables         ../../../variables/Variables.py
 Library           RequestsLibrary
 Library           ../../../libraries/Common.py
@@ -16,6 +16,7 @@ Resource          ../../../libraries/WaitForFailure.robot
 ${swnr}           63
 ${flnr}           100000
 ${fpr}            25
+${nrthreads}      5
 ${swspread}       linear
 ${tabspread}      first
 @{cntls}          ${CONTROLLER}
@@ -25,6 +26,8 @@ ${iperiod}        1s
 ${imonitor}       600s
 ${ichange}        450s
 ${outfile}        flows_setup_time.csv
+${setupfile}      flows_install_rate.csv
+${setuptime}      0
 ${inittime}       0
 ${restarttime}    0
 
@@ -36,9 +39,14 @@ Configure Flows
     [Documentation]    Configuration of ${flnr} flows into config datastore
     ${flows}    ${notes}=    Generate New Flow Details    flows=${flnr}    switches=${swnr}    swspread=${swspread}    tabspread=${tabspread}
     Log    ${notes}
-    ${res}=    Configure Flows Bulk    flow_details=${flows}    controllers=@{cntls}    nrthreads=5    fpr=${fpr}
+    ${starttime}=    Get Time    epoch
+    ${res}=    Configure Flows Bulk    flow_details=${flows}    controllers=@{cntls}    nrthreads=${nrthreads}    fpr=${fpr}
     Log    ${res}
     Set Suite Variable    ${flows}
+    ${http204ok}=    Create List   ${204}
+    ${validation}=    Validate Responses   ${res}    ${http204ok}
+    Should Be True    ${validation}
+    [Teardown]    Save Setup Time    setuptime
 
 Wait Stats Collected
     [Documentation]    Waits till ${flnr} flows are initially collected
@@ -103,6 +111,9 @@ Delete Http Session And Store Plot Data
     Delete All Sessions
     Append To File    ${outfile}    InitCollectionTime,AfterMininetRestartCollectionTime\n
     Append To File    ${outfile}    ${inittime},${restarttime}\n
+    ${rate}=    Evaluate    (${flnr}/${setuptime})
+    Append To File    ${setupfile}    FlowsSetupRate,FlowsSetupTime\n
+    Append To File    ${setupfile}    ${rate},${setuptime}\n
 
 Are Switches Connected Topo
     [Documentation]    Checks wheather switches are connected to controller
@@ -135,9 +146,10 @@ Save Setup Time
     ${res}=    Evaluate    int(${endtime})-int(${starttime})
     ${inittime}=    Set Variable If    "${note}"=="inittime"    ${res}    ${inittime}
     ${restarttime}=    Set Variable If    "${note}"=="restarttime"    ${res}    ${restarttime}
+    ${setuptime}=    Set Variable If    "${note}"=="setuptime"    ${res}    ${setuptime}
     Set Suite Variable    ${inittime}
     Set Suite Variable    ${restarttime}
-    Log To Console    ${inittime} ${restarttime} ${res}
+    Set Suite Variable    ${setuptime}
 
 Inventory Change Reached
     [Arguments]    ${rswitches}    ${rflows}
index be3112b4147962dac3146f4bb2d3913aae98c700..90bfe1b4cd2c6a148507b1b8a01bd38e53055528 100644 (file)
@@ -1,16 +1,14 @@
 *** Settings ***
-Documentation     Suite checks if StatMngr is able to collect flows correctly
+Documentation     Suite to measure setup reate using add-flows-rpc operation
 Suite Setup       Create Http Session
 Suite Teardown    Delete Http Session And Store Plot Data
 Library           OperatingSystem
-Library           Collections
 Library           XML
 Library           SSHLibrary
 Variables         ../../../variables/Variables.py
 Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Library           ../../../libraries/ScaleClient.py
-Resource          ../../../libraries/WaitForFailure.robot
 
 *** Variables ***
 ${swnr}           63
@@ -23,7 +21,7 @@ ${tabspread}      first
 ${linux_prompt}    >
 ${start_cmd}      sudo mn --controller=remote,ip=${CONTROLLER} --topo linear,${swnr} --switch ovsk,protocols=OpenFlow13
 ${iperiod}        1s
-${ichange}        60s
+${ichange}        450s
 ${outfile}        flows_setup_time.csv
 ${setuptime}      0
 
@@ -32,15 +30,17 @@ Connect Mininet
     Connect Switches
 
 Configure Flows
-    [Documentation]   Setup of ${flnr} flows using rpc calls
-    [Teardown]         SaveSetupTime
+    [Documentation]    Setup of ${flnr} flows using rpc calls
     ${flows}    ${notes}=    Generate New Flow Details    flows=${flnr}    switches=${swnr}    swspread=${swspread}    tabspread=${tabspread}
     Log    ${notes}
     ${starttime}=    Get Time    epoch
     ${res}=    Operations Add Flows Rpc    flow_details=${flows}    controllers=@{cntls}    nrthreads=${nrthreads}    fpr=${fpr}
     Log    ${res}
     Set Suite Variable    ${flows}
-    Log To Console    ${res}
+    ${http200ok}=    Create List   ${200}
+    ${validation}=    Validate Responses   ${res}    ${http200ok}
+    Should Be True    ${validation}
+    [Teardown]    Save Setup Time
 
 Wait Stats Collected
     [Documentation]    Waits till ${flnr} flows are initially collected
@@ -50,6 +50,9 @@ Deconfigure Flows
     [Documentation]    Flows deconfiguration
     ${res}=    Operations Remove Flows Rpc    flow_details=${flows}    controllers=@{cntls}    nrthreads=${nrthreads}    fpr=${fpr}
     Log    ${res}
+    ${http200ok}=    Create List   ${200}
+    ${validation}=    Validate Responses   ${res}    ${http200ok}
+    Should Be True    ${validation}
 
 Check No Flows In Operational After Remove
     [Documentation]    No flows should be found after their removeal
@@ -83,8 +86,9 @@ Stop Switches
 
 Delete Http Session And Store Plot Data
     Delete All Sessions
-    Append To File    ${outfile}    FlowsSetupTime\n
-    Append To File    ${outfile}    ${setuptime}\n
+    ${rate}=    Evaluate    (${flnr}/${setuptime})
+    Append To File    ${outfile}    FlowsSetupRate,FlowsSetupTime\n
+    Append To File    ${outfile}    ${rate},${setuptime}\n
 
 Are Switches Connected Topo
     [Documentation]    Checks wheather switches are connected to controller
diff --git a/test/csit/suites/openflowplugin/Performance_Flow_Config/090_BulkMaticConfigDsSetup_100k.robot b/test/csit/suites/openflowplugin/Performance_Flow_Config/090_BulkMaticConfigDsSetup_100k.robot
new file mode 100644 (file)
index 0000000..6cd139f
--- /dev/null
@@ -0,0 +1,117 @@
+*** Settings ***
+Documentation     Suite to measure flow setup rate using operation add-flows-ds
+Suite Setup       Create Http Session
+Suite Teardown    Delete Http Session And Store Plot Data
+Library           OperatingSystem
+Library           XML
+Library           SSHLibrary
+Variables         ../../../variables/Variables.py
+Library           RequestsLibrary
+Library           ../../../libraries/Common.py
+Library           ../../../libraries/ScaleClient.py
+
+*** Variables ***
+${swnr}           63
+${flnr}           100000
+${fpr}            25
+${nrthreads}      5
+${swspread}       linear
+${tabspread}      first
+@{cntls}          ${CONTROLLER}
+${linux_prompt}    >
+${start_cmd}      sudo mn --controller=remote,ip=${CONTROLLER} --topo linear,${swnr} --switch ovsk,protocols=OpenFlow13
+${iperiod}        1s
+${ichange}        450s
+${outfile}        flows_setup_time.csv
+${setuptime}      0
+
+*** Test Cases ***
+Connect Mininet
+    Connect Switches
+
+Configure Flows
+    [Documentation]    Setup of ${flnr} flows using add-flows-ds operation
+    ${flows}    ${notes}=    Generate New Flow Details    flows=${flnr}    switches=${swnr}    swspread=${swspread}    tabspread=${tabspread}
+    Log    ${notes}
+    ${starttime}=    Get Time    epoch
+    ${res}=    Operations Add Flows Ds    flow_details=${flows}    controllers=@{cntls}    nrthreads=${nrthreads}    fpr=${fpr}
+    Log    ${res}
+    Set Suite Variable    ${flows}
+    ${http200ok}=    Create List   ${200}
+    ${validation}=    Validate Responses   ${res}    ${http200ok}
+    Should Be True    ${validation}
+    [Teardown]    SaveSetupTime
+
+Wait Stats Collected
+    [Documentation]    Waits till ${flnr} flows are initially collected
+    Inventory Change Reached    ${swnr}    ${flnr}
+
+Deconfigure Flows
+    [Documentation]    Flows deconfiguration
+    ${res}=    Operations Remove Flows Ds    flow_details=${flows}    controllers=@{cntls}    nrthreads=${nrthreads}    fpr=${fpr}
+    Log    ${res}
+    ${http200ok}=    Create List   ${200}
+    ${validation}=    Validate Responses   ${res}    ${http200ok}
+    Should Be True    ${validation}
+
+Check No Flows In Operational After Remove
+    [Documentation]    No flows should be found after their removeal
+    Inventory Change Reached    ${swnr}    0
+
+Stop Mininet End
+    Stop Switches
+
+*** Keywords ***
+Connect Switches
+    [Documentation]    Starts mininet with requested number of switches (${swnr})
+    Log    Starting mininet with ${swnr} switches
+    Open Connection    ${MININET}    prompt=${linux_prompt}    timeout=600
+    Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/id_rsa    any
+    Execute Command    sudo ovs-vsctl set-manager ptcp:6644
+    Execute Command    sudo mn -c
+    Write    ${start_cmd}
+    Read Until    mininet>
+    Wait Until Keyword Succeeds    10s    1s    Are Switches Connected Topo
+
+Create Http Session
+    Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+
+Stop Switches
+    [Documentation]    Stops mininet
+    Log    Stopping mininet
+    Read
+    Write    exit
+    Read Until    ${linux_prompt}
+    Close Connection
+
+Delete Http Session And Store Plot Data
+    Delete All Sessions
+    ${rate}=    Evaluate    (${flnr}/${setuptime})
+    Append To File    ${outfile}    FlowsSetupRate,FlowsSetupTime\n
+    Append To File    ${outfile}    ${rate},${setuptime}\n
+
+Are Switches Connected Topo
+    [Documentation]    Checks wheather switches are connected to controller
+    ${resp}=    Get    session    ${OPERATIONAL_TOPO_API}/topology/flow:1    headers=${ACCEPT_XML}
+    Log    ${resp.content}
+    ${count}=    Get Element Count    ${resp.content}    xpath=node
+    Should Be Equal As Numbers    ${count}    ${swnr}
+
+Check Flows Inventory
+    [Arguments]    ${rswitches}    ${rflows}
+    [Documentation]    Checks in inventory has required state
+    ${sw}    ${repf}    ${foundf}=    Flow Stats Collected    controller=${CONTROLLER}
+    Should Be Equal As Numbers    ${rswitches}    ${sw}
+    Should Be Equal As Numbers    ${rflows}    ${foundf}
+
+Save Setup Time
+    [Documentation]    Count the difference and stores it
+    ${endtime}=    Get Time    epoch
+    Log    Stats collection finished at time ${endtime}
+    ${setuptime}=    Evaluate    int(${endtime})-int(${starttime})
+    Set Suite Variable    ${setuptime}
+
+Inventory Change Reached
+    [Arguments]    ${rswitches}    ${rflows}
+    [Documentation]    This keywordwaits till inventory reaches required state
+    Wait Until Keyword Succeeds    ${ichange}    ${iperiod}    Check Flows Inventory    ${rswitches}    ${rflows}
diff --git a/test/csit/testplans/openflowplugin-bulk-matic-ds-daily-lithium-redesign.txt b/test/csit/testplans/openflowplugin-bulk-matic-ds-daily-lithium-redesign.txt
new file mode 100644 (file)
index 0000000..b59ccfe
--- /dev/null
@@ -0,0 +1,2 @@
+# Place the suites in run order:
+integration/test/csit/suites/openflowplugin/Performance_Flow_Config/090_BulkMaticConfigDsSetup_100k.robot
diff --git a/test/csit/testplans/openflowplugin-bulk-matic-ds-daily.txt b/test/csit/testplans/openflowplugin-bulk-matic-ds-daily.txt
new file mode 100644 (file)
index 0000000..b59ccfe
--- /dev/null
@@ -0,0 +1,2 @@
+# Place the suites in run order:
+integration/test/csit/suites/openflowplugin/Performance_Flow_Config/090_BulkMaticConfigDsSetup_100k.robot