Ignore tunnel verify till odltool is fixed
[integration/test.git] / csit / libraries / OpenStackOperations.robot
index a1ca371ac6ffdbe3cb6e52688663dce5a6c8668e..a17c267a7a3ee1ccfa5562f583e1bb8d1823ab8c 100644 (file)
@@ -21,7 +21,8 @@ Resource          ../variables/netvirt/Variables.robot
 Variables         ../variables/netvirt/Modules.py
 
 *** Variables ***
-@{VALIDATION_KEYWORDS}    Verify Services    Verify Expected Default Tunnels    Verify Expected Default Tables On Nodes
+@{VALIDATION_KEYWORDS}    Verify Services
+#@{VALIDATION_KEYWORDS}    Verify Services    Verify Expected Default Tunnels    Verify Expected Default Tables On Nodes
 ${VALIDATION_FILE}    /tmp/validations.txt
 
 *** Keywords ***
@@ -1332,3 +1333,28 @@ Set Instance Quota For Project
     [Documentation]    Set quota for the created instances using the specific project id.
     ${output} =    OpenStack CLI    openstack quota set --instances ${num_instances} ${project_id}
     [Return]    ${output}
+
+Create Bgpvpn
+    [Arguments]    ${vpnname}    ${additional_args}=${EMPTY}
+    [Documentation]    Create Bgpvpn with neutron request.
+    ${output} =    OpenStack CLI    openstack bgpvpn create --name ${vpnname} ${additional_args}
+
+Get BgpVpn Id
+    [Arguments]    ${vpnName}
+    [Documentation]    Retrieve the bgpvpn id for the given bgpvpn name
+    ${output} =    OpenStack CLI    OperatingSystem.Run And Return Rc And Output    openstack bgpvpn show ${vpnName} | grep " ID" | awk '{print $4}'
+    ${splitted_output}=    String.Split String    ${output}    ${EMPTY}
+    ${vpn_id}=    Collections.Get from List    ${splitted_output}    0
+    [Return]    ${vpn_id}
+
+Configure_IP_On_Sub_Interface
+    [Arguments]    ${network_name}    ${ip}    ${vm_ip}    ${mask}    ${sub_interface_state}=${EMPTY}    ${interface}=eth0
+    ...    ${sub_interface_number}=1
+    [Documentation]    Keyword for configuring specified IP on specified interface and the corresponding specified sub interface
+    OpenStackOperations.Execute Command on VM Instance    ${network_name}    ${vm_ip}    sudo ifconfig ${interface}:${sub_interface_number} ${ip} netmask ${mask} ${sub_interface_state}
+
+Verify_IP_Configured_On_Sub_Interface
+    [Arguments]    ${network_name}    ${ip}    ${vm_ip}    ${interface}=eth0    ${sub_interface_number}=1
+    [Documentation]    Keyword for verifying specified IP on specified interface and the corresponding specified sub interface
+    ${resp} =    OpenStackOperations.Execute Command on VM Instance    ${network_name}    ${vm_ip}    sudo ifconfig ${interface}:${sub_interface_number}
+    BuiltIn.Should Contain    ${resp}    ${ip}