Upgrade RF syntax for v3.2 compatibility
[integration/test.git] / csit / libraries / OpenStackOperations.robot
index ea9483181708cd5197bda9d9014e9277559ff877..4f23c8a25cede25bfe600c20e8dcd3ea6225edcf 100644 (file)
@@ -47,10 +47,11 @@ Create Multiple Networks
     [Arguments]    @{name_of_networks}
     [Documentation]    Create required number of networks and return a list of the resulting network ids
     ${net_list_ids} =    BuiltIn.Create List    @{EMPTY}
-    : FOR    ${net}    IN    @{name_of_networks}
-    \    ${output} =    OpenStackOperations.Create Network    ${net}
-    \    ${net_id} =    Get Regexp Matches    ${output}    ${REGEX_UUID}
-    \    Collections.Append To List    ${net_list_ids}    ${net_id}
+    FOR    ${net}    IN    @{name_of_networks}
+        ${output} =    OpenStackOperations.Create Network    ${net}
+        ${net_id} =    Get Regexp Matches    ${output}    ${REGEX_UUID}
+        Collections.Append To List    ${net_list_ids}    ${net_id}
+    END
     [Return]    @{net_list_ids}
 
 Update Network
@@ -90,13 +91,15 @@ Create Multiple Subnets
     [Documentation]    Create required number of subnets for previously created networks and return subnet id
     ${number_of_networks} =    BuiltIn.Get Length    ${network_names}
     @{subnet_id_list} =    BuiltIn.Create List    @{EMPTY}
-    : FOR    ${index}    IN RANGE    ${number_of_networks}
-    \    OpenStackOperations.Create SubNet    ${network_names[${index}]}    ${subnet_names[${index}]}    ${subnet_cidr[${index}]}
+    FOR    ${index}    IN RANGE    ${number_of_networks}
+        OpenStackOperations.Create SubNet    ${network_names[${index}]}    ${subnet_names[${index}]}    ${subnet_cidr[${index}]}
+    END
     ${sub_list} =    OpenStackOperations.List Subnets
-    : FOR    ${index}    IN RANGE    ${number_of_networks}
-    \    BuiltIn.Should Contain    ${sub_list}    ${subnet_names[${index}]}
-    \    ${subnet_id} =    OpenStackOperations.Get Subnet Id    ${subnet_names[${index}]}
-    \    Collections.Append To List    ${subnet_id_list}    ${subnet_id}
+    FOR    ${index}    IN RANGE    ${number_of_networks}
+        BuiltIn.Should Contain    ${sub_list}    ${subnet_names[${index}]}
+        ${subnet_id} =    OpenStackOperations.Get Subnet Id    ${subnet_names[${index}]}
+        Collections.Append To List    ${subnet_id_list}    ${subnet_id}
+    END
     [Return]    @{subnet_id_list}
 
 Update SubNet
@@ -158,16 +161,17 @@ Create And Associate Floating IPs
     [Arguments]    ${external_net}    @{vm_list}
     [Documentation]    Create and associate floating IPs to VMs with nova request
     ${ip_list} =    BuiltIn.Create List    @{EMPTY}
-    : FOR    ${vm}    IN    @{vm_list}
-    \    ${output} =    OpenStack CLI    openstack floating ip create ${external_net}
-    \    @{ip} =    String.Get Regexp Matches    ${output}    [0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}
-    \    ${ip_length} =    BuiltIn.Get Length    ${ip}
-    \    BuiltIn.Run Keyword If    ${ip_length}>0    Collections.Append To List    ${ip_list}    @{ip}[0]
-    \    ...    ELSE    Collections.Append To List    ${ip_list}    None
-    \    ${vm_ip} =    OpenStack CLI    openstack server show ${vm} | grep "addresses" | awk '{print $4}' | cut -d"=" -f 2
-    \    ${port_id} =    OpenStack CLI    openstack port list | grep "ip_address='${vm_ip}'" | awk '{print $2}' | cut -d"=" -f 2
-    \    ${output} =    BuiltIn.Run Keyword If    '${OPENSTACK_BRANCH}' == 'stable/rocky'    OpenStack CLI    openstack floating ip set --port ${port_id} @{ip}[0]
-    \    ...    ELSE    OpenStack CLI    openstack server add floating ip ${vm} @{ip}[0]
+    FOR    ${vm}    IN    @{vm_list}
+        ${output} =    OpenStack CLI    openstack floating ip create ${external_net}
+        @{ip} =    String.Get Regexp Matches    ${output}    [0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}
+        ${ip_length} =    BuiltIn.Get Length    ${ip}
+        BuiltIn.Run Keyword If    ${ip_length}>0    Collections.Append To List    ${ip_list}    @{ip}[0]
+        ...    ELSE    Collections.Append To List    ${ip_list}    None
+        ${vm_ip} =    OpenStack CLI    openstack server show ${vm} | grep "addresses" | awk '{print $4}' | cut -d"=" -f 2
+        ${port_id} =    OpenStack CLI    openstack port list | grep "ip_address='${vm_ip}'" | awk '{print $2}' | cut -d"=" -f 2
+        ${output} =    BuiltIn.Run Keyword If    '${OPENSTACK_BRANCH}' == 'stable/rocky'    OpenStack CLI    openstack floating ip set --port ${port_id} @{ip}[0]
+        ...    ELSE    OpenStack CLI    openstack server add floating ip ${vm} @{ip}[0]
+    END
     [Return]    ${ip_list}
 
 Remove Floating Ip From Vm
@@ -275,8 +279,9 @@ Create Vm Instances
     ..    ${max}=1
     ${image}    BuiltIn.Set Variable If    "${image}"=="${EMPTY}"    ${CIRROS_${OPENSTACK_BRANCH}}    ${image}
     ${net_id} =    OpenStackOperations.Get Net Id    ${net_name}
-    : FOR    ${vm}    IN    @{vm_instance_names}
-    \    ${output} =    OpenStack CLI    openstack server create --image ${image} --flavor ${flavor} --nic net-id=${net_id} ${vm} --security-group ${sg} --min ${min} --max ${max}
+    FOR    ${vm}    IN    @{vm_instance_names}
+        ${output} =    OpenStack CLI    openstack server create --image ${image} --flavor ${flavor} --nic net-id=${net_id} ${vm} --security-group ${sg} --min ${min} --max ${max}
+    END
 
 Create Vm Instance On Compute Node
     [Arguments]    ${net_name}    ${vm_name}    ${node_hostname}    ${image}=${EMPTY}    ${flavor}=m1.nano    ${sg}=default
@@ -397,19 +402,20 @@ Get VM IPs
     ...    TODO: there is a potential issue for a caller that passes in VMs belonging to different networks that
     ...    may have different dhcp server addresses. Not sure what TODO about that, but noting it here for reference.
     @{vm_ips}    BuiltIn.Create List    @{EMPTY}
-    : FOR    ${vm}    IN    @{vms}
-    \    OpenStackOperations.Poll VM Is ACTIVE    ${vm}
-    \    ${status}    ${ips_and_console_log}    BuiltIn.Run Keyword And Ignore Error    BuiltIn.Wait Until Keyword Succeeds    180s    15s
-    \    ...    OpenStackOperations.Get VM IP    true    ${vm}
-    \    # If there is trouble with Get VM IP, the status will be FAIL and the return value will be a string of what went
-    \    # wrong. We need to handle both the PASS and FAIL cases. In the FAIL case we know we wont have access to the
-    \    # console log, as it would not be returned; so we need to grab it again to log it. We also can append 'None' to
-    \    # the vm ip list if status is FAIL.
-    \    BuiltIn.Run Keyword If    "${status}" == "PASS"    BuiltIn.Log    ${ips_and_console_log[2]}
-    \    BuiltIn.Run Keyword If    "${status}" == "PASS"    Collections.Append To List    ${vm_ips}    ${ips_and_console_log[0]}
-    \    BuiltIn.Run Keyword If    "${status}" == "FAIL"    Collections.Append To List    ${vm_ips}    None
-    \    ${vm_console_output} =    BuiltIn.Run Keyword If    "${status}" == "FAIL"    OpenStack CLI    openstack console log show ${vm}
-    \    BuiltIn.Run Keyword If    "${status}" == "FAIL"    BuiltIn.Log    ${vm_console_output}
+    FOR    ${vm}    IN    @{vms}
+        OpenStackOperations.Poll VM Is ACTIVE    ${vm}
+        ${status}    ${ips_and_console_log}    BuiltIn.Run Keyword And Ignore Error    BuiltIn.Wait Until Keyword Succeeds    180s    15s
+        ...    OpenStackOperations.Get VM IP    true    ${vm}
+        # If there is trouble with Get VM IP, the status will be FAIL and the return value will be a string of what went
+        # wrong. We need to handle both the PASS and FAIL cases. In the FAIL case we know we wont have access to the
+        # console log, as it would not be returned; so we need to grab it again to log it. We also can append 'None' to
+        # the vm ip list if status is FAIL.
+        BuiltIn.Run Keyword If    "${status}" == "PASS"    BuiltIn.Log    ${ips_and_console_log[2]}
+        BuiltIn.Run Keyword If    "${status}" == "PASS"    Collections.Append To List    ${vm_ips}    ${ips_and_console_log[0]}
+        BuiltIn.Run Keyword If    "${status}" == "FAIL"    Collections.Append To List    ${vm_ips}    None
+        ${vm_console_output} =    BuiltIn.Run Keyword If    "${status}" == "FAIL"    OpenStack CLI    openstack console log show ${vm}
+        BuiltIn.Run Keyword If    "${status}" == "FAIL"    BuiltIn.Log    ${vm_console_output}
+    END
     OpenStackOperations.Copy DHCP Files From Control Node
     [Return]    @{vm_ips}    ${ips_and_console_log[1]}
 
@@ -441,25 +447,27 @@ Collect VM IPv6 SLAAC Addresses
     ...    Returns an empty list if no IPv6 addresses found or if SSH connection fails.
     ...    Otherwise, returns a list of IPv6 addresses.
     ${ipv6_list} =    BuiltIn.Create List    @{EMPTY}
-    : FOR    ${vm}    IN    @{vm_list}
-    \    ${output} =    OpenStack CLI    openstack server show ${vm} -f shell
-    \    ${pattern} =    String.Replace String    ${subnet}    ::/64    (:[a-f0-9]{,4}){,4}
-    \    @{vm_ipv6} =    String.Get Regexp Matches    ${output}    ${pattern}
-    \    ${vm_ip_length} =    BuiltIn.Get Length    ${vm_ipv6}[0]
-    \    ${ipv6_data_from_vm} =    BuiltIn.Run Keyword If    ${vm_ip_length}>0    OpenStackOperations.Execute Command on VM Instance    ${network}    ${vm_ipv6[0]}
-    \    ...    ip -6 a
-    \    @{ipv6} =    String.Get Regexp Matches    ${ipv6_data_from_vm}    ${pattern}
-    \    ${ipv6_addr_list_length}    BuiltIn.Get Length    @{ipv6}
-    \    BuiltIn.Run Keyword If    ${ipv6_addr_list_length}>0    Collections.Append To List    ${ipv6_list}    ${ipv6[0]}
-    \    ...    ELSE    Collections.Append To List    ${ipv6_list}    None
+    FOR    ${vm}    IN    @{vm_list}
+        ${output} =    OpenStack CLI    openstack server show ${vm} -f shell
+        ${pattern} =    String.Replace String    ${subnet}    ::/64    (:[a-f0-9]{,4}){,4}
+        @{vm_ipv6} =    String.Get Regexp Matches    ${output}    ${pattern}
+        ${vm_ip_length} =    BuiltIn.Get Length    ${vm_ipv6}[0]
+        ${ipv6_data_from_vm} =    BuiltIn.Run Keyword If    ${vm_ip_length}>0    OpenStackOperations.Execute Command on VM Instance    ${network}    ${vm_ipv6[0]}
+        ...    ip -6 a
+        @{ipv6} =    String.Get Regexp Matches    ${ipv6_data_from_vm}    ${pattern}
+        ${ipv6_addr_list_length}    BuiltIn.Get Length    @{ipv6}
+        BuiltIn.Run Keyword If    ${ipv6_addr_list_length}>0    Collections.Append To List    ${ipv6_list}    ${ipv6[0]}
+        ...    ELSE    Collections.Append To List    ${ipv6_list}    None
+    END
     [Return]    ${ipv6_list}
 
 View Vm Console
     [Arguments]    ${vm_instance_names}
     [Documentation]    View Console log of the created vm instances using nova show.
-    : FOR    ${vm}    IN    @{vm_instance_names}
-    \    ${output} =    OpenStack CLI    openstack server show ${vm}
-    \    ${output} =    OpenStack CLI    openstack console log show ${vm}
+    FOR    ${vm}    IN    @{vm_instance_names}
+        ${output} =    OpenStack CLI    openstack server show ${vm}
+        ${output} =    OpenStack CLI    openstack console log show ${vm}
+    END
 
 Ping Vm From DHCP Namespace
     [Arguments]    ${net_name}    ${vm_ip}
@@ -574,11 +582,12 @@ Test Operations From Vm Instance
     BuiltIn.Run Keyword If    ${rcode}    Utils.Write Commands Until Expected Prompt    route -A inet6    ${OS_SYSTEM_PROMPT}
     BuiltIn.Run Keyword If    ${rcode}    Utils.Write Commands Until Expected Prompt    arp -an    ${OS_SYSTEM_PROMPT}
     BuiltIn.Run Keyword If    ${rcode}    Utils.Write Commands Until Expected Prompt    ip -f inet6 neigh show    ${OS_SYSTEM_PROMPT}
-    : FOR    ${dest_ip}    IN    @{dest_ips}
-    \    ${string_empty} =    BuiltIn.Run Keyword And Return Status    Should Be Empty    ${dest_ip}
-    \    BuiltIn.Run Keyword If    ${string_empty}    Continue For Loop
-    \    BuiltIn.Run Keyword If    ${rcode} and "${ping_should_succeed}" == "True"    OpenStackOperations.Check Ping    ${dest_ip}    ttl=${ttl}    ping_tries=${ping_tries}
-    \    ...    ELSE    OpenStackOperations.Check No Ping    ${dest_ip}    ttl=${ttl}
+    FOR    ${dest_ip}    IN    @{dest_ips}
+        ${string_empty} =    BuiltIn.Run Keyword And Return Status    Should Be Empty    ${dest_ip}
+        BuiltIn.Run Keyword If    ${string_empty}    Continue For Loop
+        BuiltIn.Run Keyword If    ${rcode} and "${ping_should_succeed}" == "True"    OpenStackOperations.Check Ping    ${dest_ip}    ttl=${ttl}    ping_tries=${ping_tries}
+        ...    ELSE    OpenStackOperations.Check No Ping    ${dest_ip}    ttl=${ttl}
+    END
     ${ethertype} =    String.Get Regexp Matches    ${src_ip}    ${IP_REGEX}
     BuiltIn.Run Keyword If    ${rcode} and "${check_metadata}" and ${ethertype} == "True"    OpenStackOperations.Check Metadata Access
     [Teardown]    Exit From Vm Console    ${console}
@@ -604,8 +613,9 @@ Ping Other Instances
     [Arguments]    ${list_of_external_dst_ips}    ${console}=cirros
     [Documentation]    Check reachability with other network's instances.
     ${rcode} =    BuiltIn.Run Keyword And Return Status    OpenStackOperations.Check If Console Is VmInstance    ${console}
-    : FOR    ${dest_ip}    IN    @{list_of_external_dst_ips}
-    \    OpenStackOperations.Check Ping    ${dest_ip}
+    FOR    ${dest_ip}    IN    @{list_of_external_dst_ips}
+        OpenStackOperations.Check Ping    ${dest_ip}
+    END
 
 Create Router
     [Arguments]    ${router_name}
@@ -667,10 +677,11 @@ Get DumpFlows And Ovsconfig
     Utils.Write Commands Until Expected Prompt    arp -an    ${DEFAULT_LINUX_PROMPT_STRICT}
     ${nslist} =    Utils.Write Commands Until Expected Prompt    ip netns list | awk '{print $1}'    ${DEFAULT_LINUX_PROMPT_STRICT}
     @{lines}    Split To Lines    ${nslist}    end=-1
-    : FOR    ${line}    IN    @{lines}
-    \    Utils.Write Commands Until Expected Prompt    sudo ip netns exec ${line} ip -o link    ${DEFAULT_LINUX_PROMPT_STRICT}
-    \    Utils.Write Commands Until Expected Prompt    sudo ip netns exec ${line} ip -o addr    ${DEFAULT_LINUX_PROMPT_STRICT}
-    \    Utils.Write Commands Until Expected Prompt    sudo ip netns exec ${line} ip route    ${DEFAULT_LINUX_PROMPT_STRICT}
+    FOR    ${line}    IN    @{lines}
+        Utils.Write Commands Until Expected Prompt    sudo ip netns exec ${line} ip -o link    ${DEFAULT_LINUX_PROMPT_STRICT}
+        Utils.Write Commands Until Expected Prompt    sudo ip netns exec ${line} ip -o addr    ${DEFAULT_LINUX_PROMPT_STRICT}
+        Utils.Write Commands Until Expected Prompt    sudo ip netns exec ${line} ip route    ${DEFAULT_LINUX_PROMPT_STRICT}
+    END
     Utils.Write Commands Until Expected Prompt    sudo ovs-vsctl show    ${DEFAULT_LINUX_PROMPT_STRICT}
     Utils.Write Commands Until Expected Prompt    sudo ovs-vsctl list Open_vSwitch    ${DEFAULT_LINUX_PROMPT_STRICT}
     Utils.Write Commands Until Expected Prompt    sudo ovs-ofctl show ${INTEGRATION_BRIDGE} -OOpenFlow13    ${DEFAULT_LINUX_PROMPT_STRICT}
@@ -684,8 +695,9 @@ Get ControlNode Connection
 
 Get OvsDebugInfo
     [Documentation]    Get the OvsConfig and Flow entries from all Openstack nodes
-    : FOR    ${conn_id}    IN    @{OS_ALL_CONN_IDS}
-    \    OpenStackOperations.Get DumpFlows And Ovsconfig    ${conn_id}
+    FOR    ${conn_id}    IN    @{OS_ALL_CONN_IDS}
+        OpenStackOperations.Get DumpFlows And Ovsconfig    ${conn_id}
+    END
 
 Get Test Teardown Debugs
     [Arguments]    ${test_name}=${SUITE_NAME}.${TEST_NAME}    ${fail}=${FAIL_ON_EXCEPTIONS}
@@ -693,8 +705,9 @@ Get Test Teardown Debugs
     OpenStackOperations.Get OvsDebugInfo
     BuiltIn.Run Keyword And Ignore Error    DataModels.Get Model Dump    ${HA_PROXY_IP}    ${netvirt_data_models}
     KarafKeywords.Fail If Exceptions Found During Test    ${test_name}    fail=${fail}
-    : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
-    \    BuiltIn.Run Keyword And Ignore Error    Issue_Command_On_Karaf_Console    trace:transactions    ${ODL_SYSTEM_${i+1}_IP}
+    FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
+        BuiltIn.Run Keyword And Ignore Error    Issue_Command_On_Karaf_Console    trace:transactions    ${ODL_SYSTEM_${i+1}_IP}
+    END
 
 Get Suite Debugs
     Get Test Teardown Debugs    test_name=${SUITE_NAME}    fail=False
@@ -708,9 +721,10 @@ Show Debugs
     [Documentation]    Run these commands for debugging, it can list state of VM instances and ip information in control node
     OpenStackOperations.Get ControlNode Connection
     ${output} =    DevstackUtils.Write Commands Until Prompt And Log    sudo ip netns list
-    : FOR    ${index}    IN    @{vm_indices}
-    \    ${rc}    ${output} =    OperatingSystem.Run And Return Rc And Output    nova show ${index}
-    \    BuiltIn.Log    ${output}
+    FOR    ${index}    IN    @{vm_indices}
+        ${rc}    ${output} =    OperatingSystem.Run And Return Rc And Output    nova show ${index}
+        BuiltIn.Log    ${output}
+    END
     OpenStackOperations.List Nova VMs
     OpenStackOperations.List Routers
     OpenStackOperations.List Networks
@@ -802,8 +816,9 @@ Delete All Security Group Rules
     [Documentation]    Delete all security rules from a specified security group
     ${sg_rules_output} =    OpenStack CLI    openstack security group rule list ${sg_name} -cID -fvalue
     @{sg_rules} =    String.Split String    ${sg_rules_output}    \n
-    : FOR    ${rule}    IN    @{sg_rules}
-    \    ${output} =    OpenStack CLI    openstack security group rule delete ${rule}
+    FOR    ${rule}    IN    @{sg_rules}
+        ${output} =    OpenStack CLI    openstack security group rule delete ${rule}
+    END
 
 Create Allow All SecurityGroup
     [Arguments]    ${sg_name}    ${ether_type}=IPv4    ${dual}=False
@@ -839,9 +854,10 @@ Get Ports MacAddr
     [Arguments]    ${ports}
     [Documentation]    Retrieve the port MacAddr for the given list of port name and return the MAC address list.
     ${macs}    BuiltIn.Create List
-    : FOR    ${port}    IN    @{ports}
-    \    ${mac} =    OpenStackOperations.Get Port Mac    ${port}
-    \    Collections.Append To List    ${macs}    ${mac}
+    FOR    ${port}    IN    @{ports}
+        ${mac} =    OpenStackOperations.Get Port Mac    ${port}
+        Collections.Append To List    ${macs}    ${mac}
+    END
     [Return]    ${macs}
 
 Get Port Ip
@@ -1075,33 +1091,40 @@ Wait For Routes To Propogate
     [Arguments]    ${networks}    ${subnets}
     [Documentation]    Check propagated routes
     OpenStackOperations.Get ControlNode Connection
-    : FOR    ${INDEX}    IN RANGE    0    1
-    \    ${net_id} =    OpenStackOperations.Get Net Id    @{networks}[${INDEX}]
-    \    ${is_ipv6} =    String.Get Regexp Matches    @{subnets}[${INDEX}]    ${IP6_REGEX}
-    \    ${length} =    BuiltIn.Get Length    ${is_ipv6}
-    \    ${cmd} =    BuiltIn.Set Variable If    ${length} == 0    ip route    ip -6 route
-    \    ${output} =    Utils.Write Commands Until Expected Prompt    sudo ip netns exec qdhcp-${net_id} ${cmd}    ${DEFAULT_LINUX_PROMPT_STRICT}
-    \    BuiltIn.Should Contain    ${output}    @{subnets}[${INDEX}]
+    FOR    ${INDEX}    IN RANGE    0    1
+        ${net_id} =    OpenStackOperations.Get Net Id    @{networks}[${INDEX}]
+        ${is_ipv6} =    String.Get Regexp Matches    @{subnets}[${INDEX}]    ${IP6_REGEX}
+        ${length} =    BuiltIn.Get Length    ${is_ipv6}
+        ${cmd} =    BuiltIn.Set Variable If    ${length} == 0    ip route    ip -6 route
+        ${output} =    Utils.Write Commands Until Expected Prompt    sudo ip netns exec qdhcp-${net_id} ${cmd}    ${DEFAULT_LINUX_PROMPT_STRICT}
+        BuiltIn.Should Contain    ${output}    @{subnets}[${INDEX}]
+    END
 
 Neutron Cleanup
     [Arguments]    ${vms}=@{EMPTY}    ${networks}=@{EMPTY}    ${subnets}=@{EMPTY}    ${ports}=@{EMPTY}    ${sgs}=@{EMPTY}
-    : FOR    ${vm}    IN    @{vms}
-    \    BuiltIn.Run Keyword And Ignore Error    Delete Vm Instance    ${vm}
-    : FOR    ${port}    IN    @{ports}
-    \    BuiltIn.Run Keyword And Ignore Error    Delete Port    ${port}
-    : FOR    ${subnet}    IN    @{subnets}
-    \    BuiltIn.Run Keyword And Ignore Error    Delete SubNet    ${subnet}
-    : FOR    ${network}    IN    @{networks}
-    \    BuiltIn.Run Keyword And Ignore Error    Delete Network    ${network}
-    : FOR    ${sg}    IN    @{sgs}
-    \    BuiltIn.Run Keyword And Ignore Error    Delete SecurityGroup    ${sg}
+    FOR    ${vm}    IN    @{vms}
+        BuiltIn.Run Keyword And Ignore Error    Delete Vm Instance    ${vm}
+    END
+    FOR    ${port}    IN    @{ports}
+        BuiltIn.Run Keyword And Ignore Error    Delete Port    ${port}
+    END
+    FOR    ${subnet}    IN    @{subnets}
+        BuiltIn.Run Keyword And Ignore Error    Delete SubNet    ${subnet}
+    END
+    FOR    ${network}    IN    @{networks}
+        BuiltIn.Run Keyword And Ignore Error    Delete Network    ${network}
+    END
+    FOR    ${sg}    IN    @{sgs}
+        BuiltIn.Run Keyword And Ignore Error    Delete SecurityGroup    ${sg}
+    END
 
 OpenStack List All
     [Documentation]    Get a list of different OpenStack resources that might be in use.
     @{modules} =    BuiltIn.Create List    server    port    network    subnet    security group
     ...    security group rule    floating ip    router
-    : FOR    ${module}    IN    @{modules}
-    \    ${output} =    OpenStack CLI    openstack ${module} list
+    FOR    ${module}    IN    @{modules}
+        ${output} =    OpenStack CLI    openstack ${module} list
+    END
 
 OpenStack CLI Get List
     [Arguments]    ${cmd}
@@ -1132,35 +1155,42 @@ OpenStack Cleanup All
     [Documentation]    Cleanup all Openstack resources with best effort. The keyword will query for all resources
     ...    in use and then attempt to delete them. Errors are ignored to allow the cleanup to continue.
     @{fips} =    OpenStack CLI Get List    openstack floating ip list -f json
-    : FOR    ${fip}    IN    @{fips}
-    \    BuiltIn.Run Keyword And Ignore Error    Delete Floating IP    ${fip['ID']}
+    FOR    ${fip}    IN    @{fips}
+        BuiltIn.Run Keyword And Ignore Error    Delete Floating IP    ${fip['ID']}
+    END
     @{vms} =    OpenStack CLI Get List    openstack server list -f json
-    : FOR    ${vm}    IN    @{vms}
-    \    OpenStack CLI    openstack server show ${vm['ID']}
-    \    BuiltIn.Run Keyword And Ignore Error    Delete Vm Instance    ${vm['ID']}
+    FOR    ${vm}    IN    @{vms}
+        OpenStack CLI    openstack server show ${vm['ID']}
+        BuiltIn.Run Keyword And Ignore Error    Delete Vm Instance    ${vm['ID']}
+    END
     @{routers} =    OpenStack CLI Get List    openstack router list -f json
-    : FOR    ${router}    IN    @{routers}
-    \    BuiltIn.Run Keyword And Ignore Error    Cleanup Router    ${router['ID']}
+    FOR    ${router}    IN    @{routers}
+        BuiltIn.Run Keyword And Ignore Error    Cleanup Router    ${router['ID']}
+    END
     @{ports} =    OpenStack CLI Get List    openstack port list -f json
-    : FOR    ${port}    IN    @{ports}
-    \    BuiltIn.Run Keyword And Ignore Error    Delete Port    ${port['ID']}
+    FOR    ${port}    IN    @{ports}
+        BuiltIn.Run Keyword And Ignore Error    Delete Port    ${port['ID']}
+    END
     @{networks} =    OpenStack CLI Get List    openstack network list -f json
-    : FOR    ${network}    IN    @{networks}
-    \    BuiltIn.Run Keyword And Ignore Error    Delete Subnet    ${network['Subnets']}
-    \    BuiltIn.Run Keyword And Ignore Error    Delete Network    ${network['ID']}
+    FOR    ${network}    IN    @{networks}
+        BuiltIn.Run Keyword And Ignore Error    Delete Subnet    ${network['Subnets']}
+        BuiltIn.Run Keyword And Ignore Error    Delete Network    ${network['ID']}
+    END
     @{security_groups} =    OpenStack CLI Get List    openstack security group list -f json
-    : FOR    ${security_group}    IN    @{security_groups}
-    \    BuiltIn.Run Keyword If    "${security_group['Name']}" != "default"    BuiltIn.Run Keyword And Ignore Error    Delete SecurityGroup    ${security_group['ID']}
+    FOR    ${security_group}    IN    @{security_groups}
+        BuiltIn.Run Keyword If    "${security_group['Name']}" != "default"    BuiltIn.Run Keyword And Ignore Error    Delete SecurityGroup    ${security_group['ID']}
+    END
     OpenStack List All
 
 Cleanup Router
     [Arguments]    ${id}
     [Documentation]    Delete a router, but first remove any interfaces or gateways so that the delete will be successful.
     @{ports} =    OpenStack CLI Get List    openstack port list --router ${id} -f json --long
-    : FOR    ${port}    IN    @{ports}
-    \    ${subnet_id} =    OpenStackOperations.Get Match    ${port['Fixed IP Addresses']}    ${REGEX_UUID}    0
-    \    BuiltIn.Run Keyword If    "${port['Device Owner']}" == "network:router_gateway"    BuiltIn.Run Keyword And Ignore Error    Remove Gateway    ${id}
-    \    BuiltIn.Run Keyword If    "${port['Device Owner']}" == "network:router_interface"    BuiltIn.Run Keyword And Ignore Error    Remove Interface    ${id}    ${subnet_id}
+    FOR    ${port}    IN    @{ports}
+        ${subnet_id} =    OpenStackOperations.Get Match    ${port['Fixed IP Addresses']}    ${REGEX_UUID}    0
+        BuiltIn.Run Keyword If    "${port['Device Owner']}" == "network:router_gateway"    BuiltIn.Run Keyword And Ignore Error    Remove Gateway    ${id}
+        BuiltIn.Run Keyword If    "${port['Device Owner']}" == "network:router_interface"    BuiltIn.Run Keyword And Ignore Error    Remove Interface    ${id}    ${subnet_id}
+    END
     BuiltIn.Run Keyword And Ignore Error    Delete Router    ${id}
 
 OpenStack Suite Setup
@@ -1186,18 +1216,20 @@ OpenStack Suite Teardown
     OpenStack Cleanup All
     OpenStackOperations.Stop Packet Capture On Nodes    ${tcpdump_port_6653_conn_ids}
     SSHLibrary.Close All Connections
-    : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
-    \    KarafKeywords.Issue Command On Karaf Console    threads --list | wc -l    ${ODL_SYSTEM_${i+1}_IP}
+    FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
+        KarafKeywords.Issue Command On Karaf Console    threads --list | wc -l    ${ODL_SYSTEM_${i+1}_IP}
+    END
 
 Validate Deployment
     [Documentation]    Validate the deployment. Examples to validate are verifying default table
     ...    flows are installed and that the tunnel mesh has been built correctly.
     Write To Validate File    ----------------------------------------\n${SUITE_NAME}\n
-    : FOR    ${keyword}    IN    @{VALIDATION_KEYWORDS}
-    \    ${status} =    Builtin.Run Keyword And Return Status    ${keyword}
-    \    BuiltIn.Run Keyword If    "${status}" == "FAIL" or "${status}" == "False"    BuiltIn.Run Keywords    Write To Validate File    Failed: ${keyword}
-    \    ...    AND    BuiltIn.Fail
-    \    ...    ELSE    Write To Validate File    Passed: ${keyword}
+    FOR    ${keyword}    IN    @{VALIDATION_KEYWORDS}
+        ${status} =    Builtin.Run Keyword And Return Status    ${keyword}
+        BuiltIn.Run Keyword If    "${status}" == "FAIL" or "${status}" == "False"    BuiltIn.Run Keywords    Write To Validate File    Failed: ${keyword}
+        ...    AND    BuiltIn.Fail
+        ...    ELSE    Write To Validate File    Passed: ${keyword}
+    END
 
 Write To Validate File
     [Arguments]    ${msg}
@@ -1217,20 +1249,23 @@ Copy DHCP Files From Control Node
 
 Is Feature Installed
     [Arguments]    ${features}=none
-    : FOR    ${feature}    IN    @{features}
-    \    ${status}    ${output}    BuiltIn.Run Keyword And Ignore Error    BuiltIn.Should Contain    ${CONTROLLERFEATURES}    ${feature}
-    \    Return From Keyword If    "${status}" == "PASS"    True
+    FOR    ${feature}    IN    @{features}
+        ${status}    ${output}    BuiltIn.Run Keyword And Ignore Error    BuiltIn.Should Contain    ${CONTROLLERFEATURES}    ${feature}
+        Return From Keyword If    "${status}" == "PASS"    True
+    END
     [Return]    False
 
 Add OVS Logging On All OpenStack Nodes
     [Documentation]    Add higher levels of OVS logging to all the OpenStack nodes
-    : FOR    ${conn_id}    IN    @{OS_ALL_CONN_IDS}
-    \    OVSDB.Add OVS Logging    ${conn_id}
+    FOR    ${conn_id}    IN    @{OS_ALL_CONN_IDS}
+        OVSDB.Add OVS Logging    ${conn_id}
+    END
 
 Reset OVS Logging On All OpenStack Nodes
     [Documentation]    Reset the OVS logging to all the OpenStack nodes
-    : FOR    ${conn_id}    IN    @{OS_ALL_CONN_IDS}
-    \    OVSDB.Reset OVS Logging    ${conn_id}
+    FOR    ${conn_id}    IN    @{OS_ALL_CONN_IDS}
+        OVSDB.Reset OVS Logging    ${conn_id}
+    END
 
 Start Packet Capture On Nodes
     [Arguments]    ${tag}    ${filter}    @{ips}
@@ -1310,10 +1345,11 @@ Verify Expected Default Tables On Nodes
     ${resp} =    RequestsLibrary.Get Request    session    ${CONFIG_NODES_API}
     Utils.Log Content    ${resp.content}
     ${failed_node_list} =    BuiltIn.Create List
-    : FOR    ${node_ip}    IN    @{node_ips}
-    \    ${failed_table_list} =    Verify Expected Default Tables    ${node_ip}
-    \    ${failed_table_list_size} =    BuiltIn.Get Length    ${failed_table_list}
-    \    BuiltIn.Run Keyword If    ${failed_table_list_size} > 0    Collections.Append To List    ${failed_node_list}    ${node_ip}
+    FOR    ${node_ip}    IN    @{node_ips}
+        ${failed_table_list} =    Verify Expected Default Tables    ${node_ip}
+        ${failed_table_list_size} =    BuiltIn.Get Length    ${failed_table_list}
+        BuiltIn.Run Keyword If    ${failed_table_list_size} > 0    Collections.Append To List    ${failed_node_list}    ${node_ip}
+    END
     Builtin.Should Be Empty    ${failed_node_list}
 
 Verify Expected Default Tables
@@ -1322,9 +1358,10 @@ Verify Expected Default Tables
     ${flow_dump} =    Utils.Run Command On Remote System    ${ovs_ip}    sudo ovs-ofctl dump-flows ${INTEGRATION_BRIDGE} -OOpenFlow13
     BuiltIn.Log    ${flow_dump}
     ${failed_table_list} =    BuiltIn.Create List
-    : FOR    ${table}    IN    @{DEFAULT_FLOW_TABLES}
-    \    ${rc} =    Builtin.Run Keyword And Return Status    Builtin.Should Not Match Regexp    ${flow_dump}    .*table=${table}.*priority=0
-    \    BuiltIn.Run Keyword If    ${rc}    Collections.Append To List    ${failed_table_list}    ${table}
+    FOR    ${table}    IN    @{DEFAULT_FLOW_TABLES}
+        ${rc} =    Builtin.Run Keyword And Return Status    Builtin.Should Not Match Regexp    ${flow_dump}    .*table=${table}.*priority=0
+        BuiltIn.Run Keyword If    ${rc}    Collections.Append To List    ${failed_table_list}    ${table}
+    END
     [Return]    ${failed_table_list}
 
 Get Project Id