${starttime} is a local variable, so we need to pass it to "Save Setup Time"
[integration/test.git] / test / csit / suites / openflowplugin / Performance_Flow_Config / 070_Stats_Collection_100k_WithMininetRestart.robot
index 0fb05026efc80b1883018673542f73085fef2c39..ed1d1e565f7b78b1c25583edbdf3579c7750e138 100644 (file)
@@ -1,6 +1,6 @@
 *** Settings ***
 Documentation     Suite checks if StatMngr is able to collect flows correctly
-Suite Setup       Create Http Session
+Suite Setup       Create Http Session And Upload Files
 Suite Teardown    Delete Http Session And Store Plot Data
 Library           OperatingSystem
 Library           XML
@@ -20,8 +20,9 @@ ${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
+${getf_cmd}       sh ./get-total-found.sh
+${getr_cmd}       sh ./get-total-reported.sh
 ${iperiod}        1s
 ${imonitor}       600s
 ${ichange}        450s
@@ -43,18 +44,20 @@ Configure Flows
     ${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}
+    ${http204ok}=    Create List    ${204}
+    ${validation}=    Validate Responses    ${res}    ${http204ok}
     Should Be True    ${validation}
-    [Teardown]    Save Setup Time    setuptime
+    [Teardown]    Save Setup Time    setuptime    ${starttime}
 
 Wait Stats Collected
     [Documentation]    Waits till ${flnr} flows are initially collected
     Measure Setup Time    ${swnr}    ${flnr}    inittime
+    [Teardown]    Log Switch Details
 
 Stable State Monitoring
     [Documentation]    Inventory check if all ${flnr} flows are present for specified time frame
     Monitor Stable State    ${swnr}    ${flnr}
+    [Teardown]    Log Switch Details
 
 Stop Mininet
     [Documentation]    Disconnect/Stop mininet
@@ -71,6 +74,7 @@ Connect Mininet Again
 Check Flows Are Operational Again
     [Documentation]    All ${flnr} slows should be present in the operational datastore after mininet reconnection
     Measure Setup Time    ${swnr}    ${flnr}    restarttime
+    [Teardown]    Log Switch Details
 
 Deconfigure Flows
     [Documentation]    Flows deconfiguration
@@ -80,6 +84,7 @@ Deconfigure Flows
 Check No Flows In Operational Last
     [Documentation]    Operational datastore to be without any flows
     Inventory Change Reached    ${swnr}    0
+    [Teardown]    Log Switch Details
 
 Stop Mininet End
     Stop Switches
@@ -88,23 +93,27 @@ Stop Mininet End
 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
+    Open Connection    ${MININET}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=600
+    Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/${SSH_KEY}    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 Http Session And Upload Files
     Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+    Open Connection    ${MININET}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=600
+    Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/${SSH_KEY}    any
+    Put File    ${CURDIR}/../../../../tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/*    ./
+    Close Connection
 
 Stop Switches
     [Documentation]    Stops mininet
     Log    Stopping mininet
     Read
     Write    exit
-    Read Until    ${linux_prompt}
+    Read Until    ${DEFAULT_LINUX_PROMPT}
     Close Connection
 
 Delete Http Session And Store Plot Data
@@ -134,12 +143,11 @@ Measure Setup Time
     [Documentation]    This keyword is dedicated to save measured time for plotting
     ${starttime}=    Get Time    epoch
     Log    Starting stats collection at time ${starttime}
-    Set Suite Variable    ${starttime}
     Inventory Change Reached    ${rswitches}    ${rflows}
-    [Teardown]    Save Setup Time    ${note}
+    [Teardown]    Save Setup Time    ${note}    ${starttime}
 
 Save Setup Time
-    [Arguments]    ${note}
+    [Arguments]    ${note}    ${starttime}
     [Documentation]    Count the difference and stores it
     ${endtime}=    Get Time    epoch
     Log    Stats collection finished at time ${endtime}
@@ -160,3 +168,11 @@ Monitor Stable State
     [Arguments]    ${rswitches}    ${rflows}
     [Documentation]    This keywordwaits till inventory reaches required state
     Verify Keyword Does Not Fail Within Timeout    ${imonitor}    ${iperiod}    Check Flows Inventory    ${rswitches}    ${rflows}
+
+Log Switch Details
+    Write    ${getf_cmd}
+    ${log}=    Read Until    mininet>
+    Log    ${log}
+    Write    ${getr_cmd}
+    ${log}=    Read Until    mininet>
+    Log    ${log}