replacing the usage of private RequestsiLibrary to system one 37/23537/1
authorPeter Gubka <pgubka@cisco.com>
Fri, 12 Jun 2015 09:36:28 +0000 (11:36 +0200)
committerDaniel Farrell <dfarrell@redhat.com>
Mon, 29 Jun 2015 21:38:43 +0000 (21:38 +0000)
tity tool used to correctly format the file

Change-Id: I6968172c14beb8c144acd5f3b94f2ae1ea84acc1
Signed-off-by: Peter Gubka <pgubka@cisco.com>
(cherry picked from commit 2038520177b9a28c72a60f868fa80538e01b11e1)

test/tools/OF_Test/robot_suites/998__Independent_OF_Tests_ovs/020__Flow_Data_Tests.txt

index cf658a4cbc929f29fb19e4cefd25414c10f03e6d..79427bb6bc51e326d6da8607c322cac31a9b145e 100644 (file)
@@ -1,5 +1,7 @@
 *** Settings ***
 Documentation     Test suite with independent flow tests
+Suite Setup       Init Phase    3
+Suite Teardown    Stop Phase
 Library           OperatingSystem
 Library           Collections
 Library           String
@@ -7,131 +9,147 @@ Library           XML
 Library           SSHLibrary
 Library           ../../../../csit/libraries/XmlComparator.py
 Variables         ../../../../csit/variables/Variables.py
-Library           ../../../../csit/libraries/RequestsLibrary.py
+Library           RequestsLibrary
 Library           ../../../../csit/libraries/Common.py
-Suite Setup       Init Phase    3
-Suite Teardown    Stop Phase
 
 *** Variables ***
-${XmlsDir}=       ${CURDIR}/../../../../csit/variables/xmls
-${switch_idx}=    1
-${switch_name}=   s${switch_idx}
+${XmlsDir}        ${CURDIR}/../../../../csit/variables/xmls
+${switch_idx}     1
+${switch_name}    s${switch_idx}
 
 *** Test Cases ***
 Barrier Field True
-      [Documentation]   Adding flow with barrier set to true
-      [Teardown]        Delete Flow
-      Init Flow Variables   f1.xml
-      ${data}=   Replace String     ${data}   <barrier>false</barrier>    <barrier>true</barrier>
-      Set Suite Variable    ${data}
-      Add Flow
-      Sleep    15s
-      Log Switch Flows
-      Check Config Flow         ${True}   ${data}
-      Check Operational Table   ${True}   ${data}
+    [Documentation]    Adding flow with barrier set to true
+    Init Flow Variables    f1.xml
+    ${data}=    Replace String    ${data}    <barrier>false</barrier>    <barrier>true</barrier>
+    Set Suite Variable    ${data}
+    Add Flow
+    Sleep    15s
+    Log Switch Flows
+    Check Config Flow    ${True}    ${data}
+    Check Operational Table    ${True}    ${data}
+    [Teardown]    Delete Flow
+
 Update With Delete And Add
-      [Documentation]   Updates a flow by changing priority which causes delete and add flow reaction
-      [Teardown]        Delete Flow
-      Init Flow Variables   f2.xml
-      Add Flow
-      Sleep    15s
-      Log Switch Flows
-      Check Config Flow         ${True}   ${data}
-      Check Operational Table   ${True}   ${data}
-      ${upddata}=   Replace String     ${data}   <priority>2</priority>    <priority>3</priority>
-      Set Suite Variable    ${upddata}
-      Update Flow
-      Sleep    30s
-      Log Switch Flows
-      Check Config Flow         ${True}   ${upddata}
-      Check Operational Table   ${True}   ${upddata}
+    [Documentation]    Updates a flow by changing priority which causes delete and add flow reaction
+    Init Flow Variables    f2.xml
+    Add Flow
+    Sleep    15s
+    Log Switch Flows
+    Check Config Flow    ${True}    ${data}
+    Check Operational Table    ${True}    ${data}
+    ${upddata}=    Replace String    ${data}    <priority>2</priority>    <priority>3</priority>
+    Set Suite Variable    ${upddata}
+    Update Flow
+    Sleep    30s
+    Log Switch Flows
+    Check Config Flow    ${True}    ${upddata}
+    Check Operational Table    ${True}    ${upddata}
+    [Teardown]    Delete Flow
 
 *** Keywords ***
-Init Phase   [Arguments]   ${swnr}
-      [Documentation]    Starts mininet with requested number of switches (${swnr})
-      Log    Starting mininet with ${swnr} switches
-      Open Connection   ${MININET}   prompt=>
-      Login With Public Key   ${MININET_USER}   ${USER_HOME}/.ssh/id_rsa   any
-      Set Client Configuration    timeout=600
-      Write   sudo ovs-vsctl set-manager ptcp:6644
-      Write   sudo mn -c
-      Read Until   >
-      Write    sudo mn --controller=remote,ip=${CONTROLLER} --topo linear,${swnr} --switch ovsk,protocols=OpenFlow13
-      Read Until   mininet>
-      Create Session   session   http://${CONTROLLER}:${PORT}   auth=${AUTH}   headers=${HEADERS_XML}
+Init Phase
+    [Arguments]    ${swnr}
+    [Documentation]    Starts mininet with requested number of switches (${swnr})
+    Log    Starting mininet with ${swnr} switches
+    Open Connection    ${MININET}    prompt=>
+    Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/id_rsa    any
+    Set Client Configuration    timeout=600
+    Write    sudo ovs-vsctl set-manager ptcp:6644
+    Write    sudo mn -c
+    Read Until    >
+    Write    sudo mn --controller=remote,ip=${CONTROLLER} --topo linear,${swnr} --switch ovsk,protocols=OpenFlow13
+    Read Until    mininet>
+    Create Session    session    http://${CONTROLLER}:${PORT}    auth=${AUTH}    headers=${HEADERS_XML}
+
 Stop Phase
-    [Documentation]    Stops mininet 
+    [Documentation]    Stops mininet
     Log    Stopping mininet
     Delete All Sessions
     Read
-    Write   exit
+    Write    exit
     Read Until    >
     Close Connection
     Delete All Sessions
-Init Flow Variables   [Arguments]   ${file}
-      ${data}=       OperatingSystem.Get File     ${XmlsDir}/${file}
-      ${xmlroot}=    Parse Xml    ${XmlsDir}/${file}
-      ${table_id}=   Get Element Text   ${xmlroot}   table_id
-      ${flow_id}=    Get Element Text   ${xmlroot}   id
-      ${flow_priority}=    Get Element Text   ${xmlroot}   priority
-      ${upddata}=    Get Data For Flow Put Update   ${data}
-      Set Suite Variable   ${table_id}
-      Set Suite Variable   ${flow_id}
-      Set Suite Variable   ${flow_priority}
-      Set Suite Variable   ${data}
-      Set Suite Variable   ${upddata}
-      Set Suite Variable   ${xmlroot}
-Check Config Flow   [Arguments]   ${expected}   ${expvalue}
-         ${presence_flow}   ${msg}=      Flow Presence Config Flow    ${expvalue}
-         ${msgf}=   Get Presence Failure Message    config    ${expected}    ${presence_flow}   ${msg}
-         Should Be Equal    ${expected}  ${presence_flow}   msg=${msgf}
-Flow Presence Config Flow  [Arguments]   ${expvalue}
-         ${headers}=      Create Dictionary   Accept   application/xml
-         ${resp}=   Get  session  /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}   headers=${headers}
-         Log  ${resp}
-         Log  ${resp.content}
-         Return From Keyword If   ${resp.status_code}!=200  ${False}   ${EMPTY}
-         ${pres}  ${msg}=  Is Flow Configured  ${expvalue}   ${resp.content}
-         Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-         Return From Keyword   ${pres}   ${msg}
-Check Operational Table  [Arguments]   ${expected}    ${expvalue}
-         ${presence_table}  ${msg}=  Flow Presence Operational Table   ${expvalue}
-         ${msgf}=   Get Presence Failure Message    operational    ${expected}    ${presence_table}   ${msg}
-         Should Be Equal  ${expected}  ${presence_table}  msg=${msgf}
-Flow Presence Operational Table   [Arguments]  ${expvalue}
-         ${headers}=      Create Dictionary   Accept   application/xml
-         ${resp}=   Get   session   /restconf/operational/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}    headers=${headers}
-         Log   ${resp}
-         Log   ${resp.content}
-         Return From Keyword If    ${resp.status_code}!=200   ${False}   ${EMPTY}
-         ${pres}   ${msg}=   Is Flow Operational2   ${expvalue}   ${resp.content}
-         Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-         Return From Keyword   ${pres}   ${msg}
+
+Init Flow Variables
+    [Arguments]    ${file}
+    ${data}=    OperatingSystem.Get File    ${XmlsDir}/${file}
+    ${xmlroot}=    Parse Xml    ${XmlsDir}/${file}
+    ${table_id}=    Get Element Text    ${xmlroot}    table_id
+    ${flow_id}=    Get Element Text    ${xmlroot}    id
+    ${flow_priority}=    Get Element Text    ${xmlroot}    priority
+    ${upddata}=    Get Data For Flow Put Update    ${data}
+    Set Suite Variable    ${table_id}
+    Set Suite Variable    ${flow_id}
+    Set Suite Variable    ${flow_priority}
+    Set Suite Variable    ${data}
+    Set Suite Variable    ${upddata}
+    Set Suite Variable    ${xmlroot}
+
+Check Config Flow
+    [Arguments]    ${expected}    ${expvalue}
+    ${presence_flow}    ${msg}=    Flow Presence Config Flow    ${expvalue}
+    ${msgf}=    Get Presence Failure Message    config    ${expected}    ${presence_flow}    ${msg}
+    Should Be Equal    ${expected}    ${presence_flow}    msg=${msgf}
+
+Flow Presence Config Flow
+    [Arguments]    ${expvalue}
+    ${headers}=    Create Dictionary    Accept    application/xml
+    ${resp}=    Get    session    /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}    headers=${headers}
+    Log    ${resp}
+    Log    ${resp.content}
+    Return From Keyword If    ${resp.status_code}!=200    ${False}    ${EMPTY}
+    ${pres}    ${msg}=    Is Flow Configured    ${expvalue}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Return From Keyword    ${pres}    ${msg}
+
+Check Operational Table
+    [Arguments]    ${expected}    ${expvalue}
+    ${presence_table}    ${msg}=    Flow Presence Operational Table    ${expvalue}
+    ${msgf}=    Get Presence Failure Message    operational    ${expected}    ${presence_table}    ${msg}
+    Should Be Equal    ${expected}    ${presence_table}    msg=${msgf}
+
+Flow Presence Operational Table
+    [Arguments]    ${expvalue}
+    ${headers}=    Create Dictionary    Accept    application/xml
+    ${resp}=    Get    session    /restconf/operational/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}    headers=${headers}
+    Log    ${resp}
+    Log    ${resp.content}
+    Return From Keyword If    ${resp.status_code}!=200    ${False}    ${EMPTY}
+    ${pres}    ${msg}=    Is Flow Operational2    ${expvalue}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Return From Keyword    ${pres}    ${msg}
+
 Add Flow
-      Log             ${data}
-      ${resp}=        Post    session   /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}   data=${data}
-      Log             ${resp.content}
-      ${msg}=  Set Variable   Adding flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
-      Should Be Equal As Strings   ${resp.status_code}   204   msg=${msg}
+    Log    ${data}
+    ${resp}=    Post    session    /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}    data=${data}
+    Log    ${resp.content}
+    ${msg}=    Set Variable    Adding flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    Should Be Equal As Strings    ${resp.status_code}    204    msg=${msg}
+
 Update Flow
-       Log          ${upddata}
-       ${resp}=     Putxml    session  /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}  data=${upddata}
-       Log             ${resp.content}
-       ${msg}=  Set Variable   Updating flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
-       Should Be Equal As Strings  ${resp.status_code}   200    msg=${msg}
+    Log    ${upddata}
+    ${resp}=    Put    session    /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}    data=${upddata}
+    Log    ${resp.content}
+    ${msg}=    Set Variable    Updating flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
+
 Delete Flow
-      ${resp}=  Delete   session   /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
-      Log             ${resp.content}
-      ${msg}=  Set Variable  Delete flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
-      Should Be Equal As Strings   ${resp.status_code}   200   msg=${msg}
-Get Presence Failure Message   [Arguments]   ${ds}   ${expected}   ${presence}  ${diffmsg}
-         Return From Keyword If   '''${diffmsg}'''!='${EMPTY}'  Flow found in ${ds} data store but: ${diffmsg}
-         ${msgf}=   Set Variable If   ${expected}==${True}   The flow is expected in ${ds} data store, but   The flow is not expected in ${ds} data store, but
-         ${msgp}=   Set Variable If   ${presence}==${True}   it is present.   it is not present.
-         Return From Keyword   ${msgf} ${msgp}
-Log Switch Flows
-        Write    dpctl dump-flows -O OpenFlow13
-        Sleep  1s
-        ${switchouput}    Read
-        Log     ${switchouput}
+    ${resp}=    Delete    session    /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
+    Log    ${resp.content}
+    ${msg}=    Set Variable    Delete flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
 
+Get Presence Failure Message
+    [Arguments]    ${ds}    ${expected}    ${presence}    ${diffmsg}
+    Return From Keyword If    '''${diffmsg}'''!='${EMPTY}'    Flow found in ${ds} data store but: ${diffmsg}
+    ${msgf}=    Set Variable If    ${expected}==${True}    The flow is expected in ${ds} data store, but    The flow is not expected in ${ds} data store, but
+    ${msgp}=    Set Variable If    ${presence}==${True}    it is present.    it is not present.
+    Return From Keyword    ${msgf} ${msgp}
+
+Log Switch Flows
+    Write    dpctl dump-flows -O OpenFlow13
+    Sleep    1s
+    ${switchouput}    Read
+    Log    ${switchouput}