Tidy updated test suites
[integration/test.git] / csit / libraries / VtnMaKeywordsLi.robot
index 07e26baae9d096d08516fe650746751b69e41f40..76a2a196a88df660dd77f7a821b7a3e1ce070a5e 100644 (file)
@@ -37,15 +37,17 @@ ${out_after_pathpolicy}    output:3
 
 *** Keywords ***
 Start SuiteVtnMa
+    [Arguments]    ${version_flag}=none
     [Documentation]    Start VTN Manager Init Test Suite
     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
     BuiltIn.Wait_Until_Keyword_Succeeds    30    3    Fetch vtn list
     Start Suite
+    Run Keyword If    '${version_flag}' == 'OF13'    Set Global Variable    ${OPENFLOW_VERSION}    OF13
+    ...    ELSE    Set Global Variable    ${OPENFLOW_VERSION}    OF10
 
 Stop SuiteVtnMa
     [Documentation]    Stop VTN Manager Test Suite
     Delete All Sessions
-    Stop Suite
 
 Start SuiteVtnMaTest
     [Documentation]    Start VTN Manager Test Suite
@@ -55,6 +57,11 @@ Stop SuiteVtnMaTest
     [Documentation]    Stop VTN Manager Test Suite
     Delete All Sessions
 
+Add Table Miss Flows
+    [Documentation]    Add Flow entried to handle table miss situation
+    Write    dpctl add-flow priority=0,actions=output:CONTROLLER -OOpenFlow13
+    Read Until    mininet>
+
 Fetch vtn list
     [Documentation]    Check if VTN Manager is up.
     ${resp}=    RequestsLibrary.Get Request    session    ${REST_CONTEXT_VTNS}
@@ -149,12 +156,12 @@ Verify flowEntryPathPolicy
 Start PathSuiteVtnMaTest
     [Documentation]    Start VTN Manager Test Suite and Mininet
     Start SuiteVtnMaTest
-    Start Mininet    ${MININET}    ${pathpolicy_topo_13}    ${custom}
+    Start Mininet    ${TOOLS_SYSTEM_IP}    ${pathpolicy_topo_13}    ${custom}
 
 Start PathSuiteVtnMaTestOF10
     [Documentation]    Start VTN Manager Test Suite and Mininet in Open Flow 10 Specification
     Start SuiteVtnMaTest
-    Start Mininet    ${MININET}    ${pathpolicy_topo_10}    ${custom}
+    Start Mininet    ${TOOLS_SYSTEM_IP}    ${pathpolicy_topo_10}    ${custom}
 
 Stop PathSuiteVtnMaTest
     [Documentation]    Cleanup/Shutdown work at the completion of all tests.
@@ -210,6 +217,7 @@ Add a vBridgeMacMapping
 Mininet Ping Should Succeed
     [Arguments]    ${host1}    ${host2}
     [Documentation]    Ping hosts to check connectivity
+    Run Keyword If    '${OPENFLOW_VERSION}' == 'OF13'    Add Table Miss Flows
     Write    ${host1} ping -c 1 ${host2}
     ${result}    Read Until    mininet>
     Should Contain    ${result}    64 bytes
@@ -217,6 +225,7 @@ Mininet Ping Should Succeed
 Mininet Ping Should Not Succeed
     [Arguments]    ${host1}    ${host2}
     [Documentation]    Ping hosts when there is no connectivity and check hosts is unreachable
+    Run Keyword If    '${OPENFLOW_VERSION}' == 'OF13'    Add Table Miss Flows
     Write    ${host1} ping -c 3 ${host2}
     ${result}    Read Until    mininet>
     Should Not Contain    ${result}    64 bytes
@@ -230,9 +239,9 @@ Delete a interface
 Start vlan_topo
     [Arguments]    ${OF}
     Clean Mininet System
-    ${mininet_conn_id1}=    Open Connection    ${MININET}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=30s
+    ${mininet_conn_id1}=    Open Connection    ${TOOLS_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=30s
     Set Suite Variable    ${mininet_conn_id1}
-    Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/${SSH_KEY}    any
+    Login With Public Key    ${TOOLS_SYSTEM_USER}    ${USER_HOME}/.ssh/${SSH_KEY}    any
     Execute Command    sudo ovs-vsctl set-manager ptcp:6644
     Put File    ${CURDIR}/${CREATE_VLAN_TOPOLOGY_FILE_PATH}
     Run Keyword If    '${OF}' == 'OF13'    Write    ${vlan_topo_13}