SXP clustering: create virtual interface 34/75234/12
authorIvan Hrasko <ihrasko@cisco.com>
Thu, 16 Aug 2018 14:36:27 +0000 (16:36 +0200)
committerIvan Hrasko <ihrasko@cisco.com>
Tue, 21 Aug 2018 11:36:45 +0000 (11:36 +0000)
- create virtual interface used for assigning
cluster routing VIRTUAL_IP

Change-Id: I06851fca8beb9c541720a53233a699311d19d0ca
Signed-off-by: Ivan Hrasko <ihrasko@cisco.com>
csit/libraries/SxpClusterLib.robot
csit/suites/sxp/cluster-routing/010_Route_Switching.robot

index d97aa12238e83d26685c1449188cc0b96731864f..f6061c8718ceecabbe51b0df57e81366d7b542cf 100644 (file)
@@ -154,3 +154,17 @@ Shutdown Tools Node
     ${stdout} =    BuiltIn.Run Keyword And Return If    ${rc} == 0    Utils.Run Command On Remote System    ${ip_address}    sudo shutdown -P 0    ${user}
     ...    ${passwd}
     BuiltIn.Log    ${stdout}
+
+Create Virtual Interface Eth0
+    [Documentation]    Create virtual interface on all of the cluster nodes
+    : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
+    \    Utils.Run Command On Remote System    ${ODL_SYSTEM_${i+1}_IP}    sudo modprobe dummy    ${ODL_SYSTEM_USER}    ${ODL_SYSTEM_PASSWORD}
+    \    Utils.Run Command On Remote System    ${ODL_SYSTEM_${i+1}_IP}    sudo ip link set name eth0 dev dummy0    ${ODL_SYSTEM_USER}    ${ODL_SYSTEM_PASSWORD}
+    \    Utils.Run Command On Remote System And Log    ${ODL_SYSTEM_${i+1}_IP}    sudo ip link show    ${ODL_SYSTEM_USER}    ${ODL_SYSTEM_PASSWORD}
+
+Delete Virtual Interface Eth0
+    [Documentation]    Create virtual interface on all of the cluster nodes
+    : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
+    \    Utils.Run Command On Remote System    ${ODL_SYSTEM_${i+1}_IP}    sudo ip link delete eth0 type dummy    ${ODL_SYSTEM_USER}    ${ODL_SYSTEM_PASSWORD}
+    \    Utils.Run Command On Remote System    ${ODL_SYSTEM_${i+1}_IP}    sudo rmmod dummy    ${ODL_SYSTEM_USER}    ${ODL_SYSTEM_PASSWORD}
+    \    Utils.Run Command On Remote System And Log    ${ODL_SYSTEM_${i+1}_IP}    sudo ip link show    ${ODL_SYSTEM_USER}    ${ODL_SYSTEM_PASSWORD}
index 74abb6fe9e89c5bce8a73a4070a90ce6a4b15a03..6361a1c2b9d785eb6f1225e0e75663f3cffbc8df 100644 (file)
@@ -66,12 +66,14 @@ Setup Custom SXP Cluster Session
     SxpClusterLib.Setup SXP Cluster Session
     ${mac_addresses} =    SxpClusterLib.Map Followers To Mac Addresses
     BuiltIn.Set Suite Variable    ${MAC_ADDRESS_TABLE}    ${mac_addresses}
+    SxpClusterLib.Create Virtual Interface Eth0
 
 Clean Custom SXP Cluster Session
     [Documentation]    Cleans up resources generated by test
     ${controller_index} =    SxpClusterLib.Get Active Controller
     SxpLib.Clean Routing Configuration To Controller    controller${controller_index}
     SxpClusterLib.Clean SXP Cluster Session
+    SxpClusterLib.Delete Virtual Interface Eth0
 
 Isolate SXP Controller
     [Arguments]    ${controller_index}