Add Tap Device to the bridge in OVS
[integration/test.git] / csit / libraries / ClusterOvsdb.robot
index 6601b0868b6431e6588a17eab11ee1980798d9f4..3edb4c3df5530ff8206c5382e4f289554bc4be6a 100644 (file)
@@ -41,7 +41,7 @@ Create Sample Bridge Manually And Verify
     ${dictionary_operational}=    Create Dictionary    br-s1=5
     ${dictionary_config}=    Create Dictionary    br-s1=0
     Wait Until Keyword Succeeds    5s    1s    ClusterKeywords.Check Item Occurrence At URI In Cluster    ${controller_index_list}    ${dictionary_config}    ${CONFIG_TOPO_API}
-    Wait Until Keyword Succeeds    10s    2s    ClusterKeywords.Check Item Occurrence At URI In Cluster    ${controller_index_list}    ${dictionary_operational}    ${OPERATIONAL_TOPO_API}
+    Wait Until Keyword Succeeds    5s    1s    ClusterKeywords.Check Item Occurrence At URI In Cluster    ${controller_index_list}    ${dictionary_operational}    ${OPERATIONAL_TOPO_API}
 
 Add Sample Port To The Manual Bridge And Verify
     [Arguments]    ${controller_index_list}
@@ -52,6 +52,22 @@ Add Sample Port To The Manual Bridge And Verify
     Wait Until Keyword Succeeds    5s    1s    ClusterKeywords.Check Item Occurrence At URI In Cluster    ${controller_index_list}    ${dictionary_config}    ${CONFIG_TOPO_API}
     Wait Until Keyword Succeeds    5s    1s    ClusterKeywords.Check Item Occurrence At URI In Cluster    ${controller_index_list}    ${dictionary_operational}    ${OPERATIONAL_TOPO_API}
 
+Create Sample Tap Device
+    [Documentation]    Create Tap Device  vport1 and vport2 to add to the bridge br-s1 using OVS command.
+    Utils.Run Command On Mininet    ${TOOLS_SYSTEM_IP}    ip tuntap add mode tap vport1
+    Utils.Run Command On Mininet    ${TOOLS_SYSTEM_IP}    ip tuntap add mode tap vport2
+    Utils.Run Command On Mininet    ${TOOLS_SYSTEM_IP}    ifconfig vport1 up
+    Utils.Run Command On Mininet    ${TOOLS_SYSTEM_IP}    ifconfig vport2 up
+
+Add Sample Tap Device To The Manual Bridge And Verify
+    [Arguments]    ${controller_index_list}
+    [Documentation]    Add Tap Device  vport1 and vport2 to br-s1 using OVS command and verify it gets added in all instances in ${controller_index_list}.
+    Utils.Run Command On Mininet    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-port br-s1 vport1 -- add-port br-s1 vport2
+    ${dictionary_operational}=    Create Dictionary    vport1=2    vport2=2
+    ${dictionary_config}=    Create Dictionary    vport1=0    vport2=0
+    Wait Until Keyword Succeeds    5s    1s    ClusterKeywords.Check Item Occurrence At URI In Cluster    ${controller_index_list}    ${dictionary_config}    ${CONFIG_TOPO_API}
+    Wait Until Keyword Succeeds    5s    1s    ClusterKeywords.Check Item Occurrence At URI In Cluster    ${controller_index_list}    ${dictionary_operational}    ${OPERATIONAL_TOPO_API}
+
 Delete Sample Bridge Manually And Verify
     [Arguments]    ${controller_index_list}
     [Documentation]    Delete bridge br-s1 using OVS command and verify it gets applied in all instances in ${controller_index_list}.
@@ -75,7 +91,7 @@ Create Sample Bridge And Verify
     ${dictionary}=    Create Dictionary    ${TOOLS_SYSTEM_IP1}=1    ${OVSDBPORT}=4    ${BRIDGE}=1
     Wait Until Keyword Succeeds    20s    1s    ClusterKeywords.Put And Check At URI In Cluster    ${controller_index_list}    ${controller_index}    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE}
     ...    ${body}
-    Wait Until Keyword Succeeds    5s    1s    ClusterKeywords.Check Item Occurrence At URI In Cluster    ${controller_index_list}    ${dictionary}    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}
+    Wait Until Keyword Succeeds    20s    2s    ClusterKeywords.Check Item Occurrence At URI In Cluster    ${controller_index_list}    ${dictionary}    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}
 
 Create Sample Port And Verify
     [Arguments]    ${controller_index_list}    ${controller_index}