From: Jozef Behran Date: Fri, 20 Nov 2015 09:00:38 +0000 (+0100) Subject: Tidied new and updated test suites X-Git-Tag: release/lithium-sr3~20 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=integration%2Ftest.git;a=commitdiff_plain;h=e2436962bb10950e28c242f324ed61a244bd2cd4 Tidied new and updated test suites Change-Id: I6aacfc2f9de2c18735912d238b49476a3a4cc262 Signed-off-by: Jozef Behran --- diff --git a/csit/libraries/GBP/ConnUtils.robot b/csit/libraries/GBP/ConnUtils.robot index 896516769e..8bd83ddc22 100755 --- a/csit/libraries/GBP/ConnUtils.robot +++ b/csit/libraries/GBP/ConnUtils.robot @@ -3,7 +3,7 @@ Library SSHLibrary Resource ../Utils.robot *** Variables *** -${VE_DIR} ${WORKSPACE}/GBPSFC_VE +${VE_DIR} ${WORKSPACE}/GBPSFC_VE *** Keywords *** Connect and Login @@ -15,7 +15,6 @@ Execute in VE [Arguments] ${cmd} ${virt_env_path}=${VE_DIR} ${timeout}=10s [Documentation] Wrapper method for executing commands in python virtual environment. Set Client Configuration timeout=${timeout} - ${stdout} ${stderr} ${rc} SSHLibrary.Execute Command source ${virt_env_path}/bin/activate;${cmd} - ... return_stderr=True return_stdout=True return_rc=True + ${stdout} ${stderr} ${rc} SSHLibrary.Execute Command source ${virt_env_path}/bin/activate;${cmd} return_stderr=True return_stdout=True + ... return_rc=True [Return] ${stdout} ${stderr} ${rc} - diff --git a/csit/libraries/GBP/DockerUtils.robot b/csit/libraries/GBP/DockerUtils.robot index 56b34feb1b..dc96e77d8e 100755 --- a/csit/libraries/GBP/DockerUtils.robot +++ b/csit/libraries/GBP/DockerUtils.robot @@ -5,81 +5,67 @@ Resource ../Utils.robot *** Variables *** *** Keywords *** - Ping from Docker [Arguments] ${docker_name} ${dest_address} ${count}=1 [Documentation] Sends ICMP requests from docker container to remote address. - ${output} ${rc} SSHLibrary.Execute Command - ... docker exec ${docker_name} ping ${dest_address} -c ${count} >/dev/null 2>&1 && echo success - ... return_stdout=True return_stderr=False return_rc=True + ${output} ${rc} SSHLibrary.Execute Command docker exec ${docker_name} ping ${dest_address} -c ${count} >/dev/null 2>&1 && echo success return_stdout=True return_stderr=False return_rc=True Should Contain ${output} success - Should Be Equal As Numbers ${rc} 0 + Should Be Equal As Numbers ${rc} 0 Start Endless Ping from Docker [Arguments] ${docker_name} ${dest_address} [Documentation] Starts endless ICMP pinging from docker container to remote address. Ping from Docker ${docker_name} ${dest_address} - SSHLibrary.Execute Command docker exec -d ${docker_name} ping ${dest_address} Start HTTP Service on Docker [Arguments] ${docker_name} ${service_port}=80 ${timeout}=20s [Documentation] Starts SimpleHTTPServer on docker container. Service port should be idle. - ${stdout} SSHLibrary.Execute Command docker exec ${docker_name} ps aux | grep 'SimpleHTTPServer ${service_port}' - ... return_stdout=True return_stderr=False return_rc=False + ${stdout} SSHLibrary.Execute Command docker exec ${docker_name} ps aux | grep 'SimpleHTTPServer ${service_port}' return_stdout=True return_stderr=False return_rc=False Should Be Empty ${stdout} SSHLibrary.Write docker exec ${docker_name} python -m SimpleHTTPServer ${service_port} & - Wait Until Keyword Succeeds 2 min 5 sec Test Port On Docker ${docker_name} ${service_port} + Wait Until Keyword Succeeds 2 min 5 sec Test Port On Docker ${docker_name} ${service_port} Stop HTTP Service on Docker [Arguments] ${docker_name} ${service_port}=80 [Documentation] Stops SimpleHTTPServer on docker container. Service port should not be idle. - ${stdout} SSHLibrary.Execute Command - ... docker exec ${docker_name} ps aux | grep 'SimpleHTTPServer ${service_port}' | awk '{print $2}' - ... return_stdout=True return_stderr=False return_rc=False + ${stdout} SSHLibrary.Execute Command docker exec ${docker_name} ps aux | grep 'SimpleHTTPServer ${service_port}' | awk '{print $2}' return_stdout=True return_stderr=False return_rc=False Should Not Be Empty ${stdout} - ${stdout} SSHLibrary.Execute Command docker exec ${docker_name} kill ${stdout} - ... return_stdout=True return_stderr=False return_rc=False + ${stdout} SSHLibrary.Execute Command docker exec ${docker_name} kill ${stdout} return_stdout=True return_stderr=False return_rc=False Curl from Docker [Arguments] ${docker_name} ${dest_address} ${service_port}=80 ${connect_timeout}=2 ${retry}=3x ${retry_after}=1s [Documentation] Sends HTTP request to remote server. Endless curl should not be running. - ${output} SSHLibrary.Execute Command docker exec ${docker_name} ls | grep curl_running - ... return_stdout=True return_stderr=False return_rc=False + ${output} SSHLibrary.Execute Command docker exec ${docker_name} ls | grep curl_running return_stdout=True return_stderr=False return_rc=False Should Be Empty ${output} Wait Until Keyword Succeeds ${retry} ${retry_after} Execute Curl ${docker_name} ${dest_address} ${service_port} Start Endless Curl from Docker - [Arguments] ${docker_name} ${dest_address} ${service_port} ${retry_after}=1s ${retry}=5 ${timeout}=20s ${sleep}=1 + [Arguments] ${docker_name} ${dest_address} ${service_port} ${retry_after}=1s ${retry}=5 ${timeout}=20s + ... ${sleep}=1 [Documentation] Starts endless curl from docker container. Only one endless curl can be running on docker container. - ${output} SSHLibrary.Execute Command docker exec ${docker_name} ls | grep curl_running - ... return_stdout=True return_stderr=False return_rc=False + ${output} SSHLibrary.Execute Command docker exec ${docker_name} ls | grep curl_running return_stdout=True return_stderr=False return_rc=False Should Be Empty ${output} - ${output} SSHLibrary.Execute Command docker exec ${docker_name} touch curl_running && echo success - ... return_stdout=True return_stderr=False return_rc=False + ${output} SSHLibrary.Execute Command docker exec ${docker_name} touch curl_running && echo success return_stdout=True return_stderr=False return_rc=False Should Contain ${output} success - Wait Until Keyword Succeeds ${retry} ${retry_after} Execute Curl - ... ${docker_name} ${dest_address} ${service_port} endless="TRUE" sleep=${sleep} + Wait Until Keyword Succeeds ${retry} ${retry_after} Execute Curl ${docker_name} ${dest_address} ${service_port} + ... endless="TRUE" sleep=${sleep} Stop Endless Curl from Docker [Arguments] ${docker_name} [Documentation] Stops endless curl from docker container. Endless curl should be running before stopping it. - ${output} SSHLibrary.Execute Command docker exec ${docker_name} ls | grep curl_running - ... return_stdout=True return_stderr=False return_rc=False + ${output} SSHLibrary.Execute Command docker exec ${docker_name} ls | grep curl_running return_stdout=True return_stderr=False return_rc=False Should Not Be Empty ${output} - ${output} SSHLibrary.Execute Command docker exec ${docker_name} rm curl_running && echo success - ... return_stdout=True return_stderr=False return_rc=False + ${output} SSHLibrary.Execute Command docker exec ${docker_name} rm curl_running && echo success return_stdout=True return_stderr=False return_rc=False Should Contain ${output} success Stop Endless Ping from Docker to Address [Arguments] ${docker_name} ${dest_address} [Documentation] Stops endless ping from docker to remote address. Endless ping session should be running before stopping it. - - ${output} SSHLibrary.Execute Command docker exec ${docker_name} ps aux | grep 'ping ${dest_address}' | grep -v grep | awk '{print $2}' - ... return_stdout=True return_stderr=False return_rc=False + ${output} SSHLibrary.Execute Command docker exec ${docker_name} ps aux | grep 'ping ${dest_address}' | grep -v grep | awk '{print $2}' return_stdout=True return_stderr=False return_rc=False Should Not Be Empty ${output} SSHLibrary.Execute Command docker exec ${docker_name} kill ${output} - ${output} SSHLibrary.Execute Command docker exec ${docker_name} ps aux | grep 'ping ${dest_address}' | grep -v grep | awk '{print $2}' + ${output} SSHLibrary.Execute Command docker exec ${docker_name} ps aux | grep 'ping ${dest_address}' | grep -v grep | awk '{print $2}' Should Be Empty ${output} Test Port On Docker @@ -93,10 +79,5 @@ Execute Curl [Documentation] Executes curl or curl loop for caller methods based on given parameters. ${output} SSHLibrary.Execute Command docker exec ${docker_name} curl ${dest_address}:${service_port} >/dev/null 2>&1 && echo success Should Contain ${output} success - Run Keyword If ${endless} == "TRUE" - ... SSHLibrary.Execute Command - ... docker exec -d ${docker_name} /bin/sh -c "while [ -f curl_running ]; do curl ${dest_address}:${service_port} ; sleep ${sleep}; done" + Run Keyword If ${endless} == "TRUE" SSHLibrary.Execute Command docker exec -d ${docker_name} /bin/sh -c "while [ -f curl_running ]; do curl ${dest_address}:${service_port} ; sleep ${sleep}; done" Log ${output} - - - diff --git a/csit/libraries/GBP/OpenFlowUtils.robot b/csit/libraries/GBP/OpenFlowUtils.robot index a72fe10efe..721e3b697a 100644 --- a/csit/libraries/GBP/OpenFlowUtils.robot +++ b/csit/libraries/GBP/OpenFlowUtils.robot @@ -32,7 +32,6 @@ Inspect Service Function ${flow} Find Flow in DPCTL Output ${matches} ${actions} [Return] ${flow} - Inspect Service Function Forwarder [Arguments] ${in_port} ${out_port} ${outer_src_ip} ${outer_dst_ip} ${eth_type} ${inner_src_ip} ... ${inner_dst_ip} ${next_hop_ip} ${nsp} ${nsi} ${proto}=${EMPTY} @@ -56,8 +55,8 @@ Inspect Service Function Forwarder [Return] ${flow} Inspect Classifier Outbound - [Arguments] ${in_port} ${out_port} ${eth_type} ${inner_src_ip} ${inner_dst_ip} - ... ${next_hop_ip}=${EMPTY} ${nsi}=${EMPTY} ${proto}=${EMPTY} ${src_port}=${EMPTY} ${dst_port}=${EMPTY} + [Arguments] ${in_port} ${out_port} ${eth_type} ${inner_src_ip} ${inner_dst_ip} ${next_hop_ip}=${EMPTY} + ... ${nsi}=${EMPTY} ${proto}=${EMPTY} ${src_port}=${EMPTY} ${dst_port}=${EMPTY} [Documentation] Inspects outbound traffic of a classifier. Traffic source should be located on the classifier. ... If traffic destination is located on the same VM, do not specify neither of next_hop_ip and nsi. ... If traffic destination is located on different VM and the traffic is not forwarded into a chain, specify @@ -69,44 +68,35 @@ Inspect Classifier Outbound Append In Port Check ${matches} ${in_port} Append Ether-Type Check ${matches} ${eth_type} Run Keyword If "${proto}" != "${EMPTY}" Append Proto Check ${matches} ${proto} - Run Keyword If "${src_port}"!="${EMPTY}" or "${dst_port}"!="${EMPTY}" - ... Append L4 Check ${matches} src_port=${src_port} dst_port=${dst_port} + Run Keyword If "${src_port}"!="${EMPTY}" or "${dst_port}"!="${EMPTY}" Append L4 Check ${matches} src_port=${src_port} dst_port=${dst_port} Append Out Port Check ${actions} ${out_port} Append Inner IPs Check ${actions} ${inner_src_ip} ${inner_dst_ip} - Run Keyword If "${next_hop_ip}"!="${EMPTY}" - ... Run Keywords - ... Append Tunnel Set Check ${actions} AND - ... Append Outer IPs Check ${actions} dst_ip=${next_hop_ip} + Run Keyword If "${next_hop_ip}"!="${EMPTY}" Run Keywords Append Tunnel Set Check ${actions} + ... AND Append Outer IPs Check ${actions} dst_ip=${next_hop_ip} ... ELSE Append Tunnel Not Set Check ${actions} - Run Keyword If "${nsi}"!="${EMPTY}" - ... Append NSI Check ${actions} 255 + Run Keyword If "${nsi}"!="${EMPTY}" Append NSI Check ${actions} 255 ${flow} Find Flow in DPCTL Output ${matches} ${actions} [Return] ${flow} Inspect Classifier Inbound + [Arguments] ${in_port} ${out_port} ${eth_type} ${inner_src_ip} ${inner_dst_ip} ${outer_src_ip} + ... ${outer_dst_ip} ${nsp}=${EMPTY} ${nsi}=${EMPTY} ${proto}=${EMPTY} ${src_port}=${EMPTY} ${dst_port}=${EMPTY} [Documentation] Inspects inbound traffic of a classifier. Traffic destination should be located on the classifier. ... If traffic source is located on different VM and the traffic comes out of a chain, specify nsi and nsp values. ... If traffic source is located on different VM and the traffic does not comes out of a chain, do not specify ... neither of nsi and nsp values. - [Arguments] ${in_port} ${out_port} ${eth_type} ${inner_src_ip} ${inner_dst_ip} - ... ${outer_src_ip} ${outer_dst_ip} ${nsp}=${EMPTY} ${nsi}=${EMPTY} ${proto}=${EMPTY} ${src_port}=${EMPTY} ${dst_port}=${EMPTY} @{matches} Create List @{actions} Create List Append In Port Check ${matches} ${in_port} Append Ether-Type Check ${matches} ${eth_type} Append Outer IPs Check ${matches} src_ip=${outer_src_ip} dst_ip=${outer_dst_ip} Append Inner IPs Check ${matches} ${inner_src_ip} ${inner_dst_ip} - Run Keyword If "${src_port}"!="${EMPTY}" or "${dst_port}"!="${EMPTY}" - ... Append L4 Check ${matches} src_port=${src_port} dst_port=${dst_port} + Run Keyword If "${src_port}"!="${EMPTY}" or "${dst_port}"!="${EMPTY}" Append L4 Check ${matches} src_port=${src_port} dst_port=${dst_port} Append Tunnel Set Check ${matches} - Run Keyword If "${nsi}"!="${EMPTY}" and "${nsp}"!="${EMPTY}" - ... Run Keywords - ... Append NSI Check ${matches} ${nsi} AND - ... Append NSP Check ${matches} ${nsp} - Run Keyword If "${proto}" != "${EMPTY}" - ... Run Keywords - ... Append Proto Check ${matches} ${proto} AND - ... Append Proto Check ${actions} ${proto} + Run Keyword If "${nsi}"!="${EMPTY}" and "${nsp}"!="${EMPTY}" Run Keywords Append NSI Check ${matches} ${nsi} + ... AND Append NSP Check ${matches} ${nsp} + Run Keyword If "${proto}" != "${EMPTY}" Run Keywords Append Proto Check ${matches} ${proto} + ... AND Append Proto Check ${actions} ${proto} Append Out Port Check ${actions} ${out_port} Append Inner IPs Check ${actions} ${inner_src_ip} ${inner_dst_ip} ${flow} Find Flow in DPCTL Output ${matches} ${actions} @@ -119,17 +109,16 @@ Find Flow in DPCTL Output ... done by calling 'Check Match' keyword. If no match is found for any of the flows, caller test case ... will be failed. ${output} SSHLibrary.Execute Command sudo ovs-dpctl dump-flows - Log ${output} + Log ${output} @{lines} Split To Lines ${output} ${match_result} Set Variable ${action_result} Set Variable - :FOR ${line} IN @{lines} + : FOR ${line} IN @{lines} \ ${match} Get Matches Part ${line} \ ${action} Get Actions Part ${line} \ ${match_result} Check Match ${match} @{flow_match_criteria} \ ${action_result} Check Match ${action} @{flow_action_criteria} - \ Run Keyword If "${match_result}" == "TRUE" and "${action_result}" == "TRUE" - \ ... Return From Keyword ${line} + \ Run Keyword If "${match_result}" == "TRUE" and "${action_result}" == "TRUE" Return From Keyword ${line} Log ${flow_match_criteria} Log ${flow_action_criteria} Fail Flow not found! @@ -151,16 +140,15 @@ Check Match [Arguments] ${string} @{match_criteria} [Documentation] Applies 'grep' on the string argument for each criterion. ${conditions} Set Variable - :FOR ${criterio} IN @{match_criteria} - \ ${grep_criterio} Catenate | grep ${criterio} - \ ${conditions} Catenate ${conditions} ${grep_criterio} + : FOR ${criterio} IN @{match_criteria} + \ ${grep_criterio} Catenate | grep ${criterio} + \ ${conditions} Catenate ${conditions} ${grep_criterio} \ ${debug_output} OperatingSystem.Run echo "${string}" ${conditions} \ Log ${debug_output} \ Run Keyword If "${debug_output}" == "${EMPTY}" Log ${criterio} ${output} OperatingSystem.Run echo "${string}" ${conditions} Log ${output} - Run Keyword If "${output}" == "${EMPTY}" - ... Return From Keyword FALSE + Run Keyword If "${output}" == "${EMPTY}" Return From Keyword FALSE ... ELSE Return From Keyword TRUE Append Proto Check @@ -171,32 +159,24 @@ Append Proto Check Append Inner MAC Check [Arguments] ${list} ${src_addr}=${EMPTY} ${dst_addr}=${EMPTY} [Documentation] Returns encapsulated MAC addresses part of flow can be captured with 'ovs-dpctl dump-flows'. - Run Keyword If "${src_addr}" != "${EMPTY}" and "${dst_addr}" != "${EMPTY}" - ... Append To List ${list} "eth(src=${src_addr},dst=${dst_addr})" - ... ELSE IF "${src_addr}" != "${EMPTY}" - ... Append To List ${list} "eth(src=${src_addr},dst=.*)" - ... ELSE IF "${dst_addr}" != "${EMPTY}" - ... Append To List ${list} "eth(src=.*,dst=${dst_addr})" + Run Keyword If "${src_addr}" != "${EMPTY}" and "${dst_addr}" != "${EMPTY}" Append To List ${list} "eth(src=${src_addr},dst=${dst_addr})" + ... ELSE IF "${src_addr}" != "${EMPTY}" Append To List ${list} "eth(src=${src_addr},dst=.*)" + ... ELSE IF "${dst_addr}" != "${EMPTY}" Append To List ${list} "eth(src=.*,dst=${dst_addr})" ... ELSE Fail Specify at liest src or dest IP! Append Inner IPs Check [Arguments] ${list} ${src_ip}=${EMPTY} ${dst_ip}=${EMPTY} [Documentation] Returns encapsulated IP addresses part of flow can be captured with 'ovs-dpctl dump-flows'. - Run Keyword If "${src_ip}" != "${EMPTY}" and "${dst_ip}" != "${EMPTY}" - ... Append To List ${list} "ipv4(src=${src_ip},dst=${dst_ip}" - ... ELSE IF "${src_ip}" != "${EMPTY}" - ... Append To List ${list} "ipv4(src=${src_ip},dst=.*" - ... ELSE IF "${dst_ip}" != "${EMPTY}" - ... Append To List ${list} "ipv4(src=.*,dst=${dst_ip}" + Run Keyword If "${src_ip}" != "${EMPTY}" and "${dst_ip}" != "${EMPTY}" Append To List ${list} "ipv4(src=${src_ip},dst=${dst_ip}" + ... ELSE IF "${src_ip}" != "${EMPTY}" Append To List ${list} "ipv4(src=${src_ip},dst=.*" + ... ELSE IF "${dst_ip}" != "${EMPTY}" Append To List ${list} "ipv4(src=.*,dst=${dst_ip}" ... ELSE Fail Specify at liest src or dest IP! Append Outer IPs Check [Arguments] ${list} ${src_ip}=${EMPTY} ${dst_ip}=${EMPTY} [Documentation] Returns packet IP addresses part of flow can be captured with 'ovs-dpctl dump-flows'. - Run Keyword If "${src_ip}" != "${EMPTY}" - ... Append To List ${list} src=${src_ip} - ... ELSE IF "${dst_ip}" != "${EMPTY}" - ... Append To List ${list} dst=${dst_ip} + Run Keyword If "${src_ip}" != "${EMPTY}" Append To List ${list} src=${src_ip} + ... ELSE IF "${dst_ip}" != "${EMPTY}" Append To List ${list} dst=${dst_ip} ... ELSE Fail Specify at liest src or dest IP! Append In Port Check @@ -212,10 +192,8 @@ Append Out Port Check Append L4 Check [Arguments] ${list} ${src_port}=${EMPTY} ${dst_port}=${EMPTY} [Documentation] Returns L4 port part of flow can be captured with 'ovs-dpctl dump-flows'. - Run Keyword If "${src_port}" != "${EMPTY}" - ... Append To List ${list} src=${src_port} - ... ELSE IF "${dst_port}" != "${EMPTY}" - ... Append To List ${list} dst=${dst_port} + Run Keyword If "${src_port}" != "${EMPTY}" Append To List ${list} src=${src_port} + ... ELSE IF "${dst_port}" != "${EMPTY}" Append To List ${list} dst=${dst_port} ... ELSE Fail Specify at liest src or dest port! Append NSI Check @@ -265,18 +243,16 @@ Manager and Switch Connected Should Contain x Times ${output} is_connected: true 2 Wait For Flows On Switch - [Arguments] ${switch_ip} ${switch_name} - [Documentation] Counts flows on switch, fails if 0 - ConnUtils.Connect and Login ${switch_ip} + [Arguments] ${switch_ip} ${switch_name} + [Documentation] Counts flows on switch, fails if 0 + ConnUtils.Connect and Login ${switch_ip} # check for OVS errors first - ${stdout} ${stderr} SSHLibrary.Execute Command sudo ovs-ofctl dump-flows ${switch_name} -OOpenFlow13 - ... return_stderr=True - Run Keyword If "${stderr}" != "${EMPTY}" Fatal Error ${stderr} - - Wait Until Keyword Succeeds 120s 20s Count Flows On Switch ${switch_name} + ${stdout} ${stderr} SSHLibrary.Execute Command sudo ovs-ofctl dump-flows ${switch_name} -OOpenFlow13 return_stderr=True + Run Keyword If "${stderr}" != "${EMPTY}" Fatal Error ${stderr} + Wait Until Keyword Succeeds 120s 20s Count Flows On Switch ${switch_name} SSHLibrary.Close Connection Count Flows On Switch - [Arguments] ${switch_name} - ${out} SSHLibrary.Execute Command printf "%d" $(($(sudo ovs-ofctl dump-flows ${switch_name} -OOpenFlow13 | wc -l)-1)) - Should Be True ${out}>0 \ No newline at end of file + [Arguments] ${switch_name} + ${out} SSHLibrary.Execute Command printf "%d" $(($(sudo ovs-ofctl dump-flows ${switch_name} -OOpenFlow13 | wc -l)-1)) + Should Be True ${out}>0 diff --git a/csit/libraries/GBP/RestconfUtils.robot b/csit/libraries/GBP/RestconfUtils.robot index a1e41abeae..535c698eed 100644 --- a/csit/libraries/GBP/RestconfUtils.robot +++ b/csit/libraries/GBP/RestconfUtils.robot @@ -7,8 +7,8 @@ Variables ../../variables/Variables.py Resource ../Utils.robot *** Variables *** -${ENDPOINT_UNREG_PATH} ${GBP_UNREGEP_API} -${ENDPOINTS_OPER_PATH} /restconf/operational/endpoint:endpoints +${ENDPOINT_UNREG_PATH} ${GBP_UNREGEP_API} +${ENDPOINTS_OPER_PATH} /restconf/operational/endpoint:endpoints *** Keywords *** Unregister Endpoints @@ -31,14 +31,14 @@ Unregister L2Endpoints [Documentation] Unregister Endpoints L2Endpoints from ODL : FOR ${endpoint} IN @{l2_eps} \ ${l2_data} = Create L2 Endpoint JSON Data ${endpoint} - \ Post Elements To URI ${ENDPOINT_UNREG_PATH} ${l2_data} + \ Post Elements To URI ${ENDPOINT_UNREG_PATH} ${l2_data} Unregister L3Endpoints [Arguments] ${l3_eps} [Documentation] Unregister Endpoints L3Endpoints from ODL : FOR ${endpoint} IN @{l3_eps} \ ${l3_data} = Create L3 Endpoint JSON Data ${endpoint} - \ Post Elements To URI ${ENDPOINT_UNREG_PATH} ${l3_data} + \ Post Elements To URI ${ENDPOINT_UNREG_PATH} ${l3_data} Create L2 Endpoint JSON Data [Arguments] ${endpoint} diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/GBP_3node.robot b/csit/suites/groupbasedpolicy/GBP/3-node/GBP_3node.robot index abb220ea40..afd4309b8d 100755 --- a/csit/suites/groupbasedpolicy/GBP/3-node/GBP_3node.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/GBP_3node.robot @@ -5,26 +5,20 @@ Resource ../../../../libraries/Utils.robot Resource ../../../../libraries/GBP/ConnUtils.robot Variables ../../../../variables/Variables.py - *** Keywords *** - Setup Node [Arguments] ${GBP} ${suite_dir} ${sw_index} ${timeout}=10s ConnUtils.Connect and Login ${GBP} timeout=${timeout} SSHLibrary.Put File ${suite_dir}/init_scripts/* ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER}/ mode=0755 - ${stdout} ${stderr} ${rc} Execute in VE python ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER}/infrastructure_launch.py ${CONTROLLER} ${sw_index} - ... timeout=${timeout} + ${stdout} ${stderr} ${rc} Execute in VE python ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER}/infrastructure_launch.py ${CONTROLLER} ${sw_index} timeout=${timeout} Should Be Equal As Numbers ${rc} 0 SSHLibrary.Close Connection Teardown Node [Arguments] ${GBP} ${suite_dir} ${timeout}=3s ConnUtils.Connect and Login ${GBP} timeout=${timeout} - ${stderr} SSHLibrary.Execute Command rm ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER}/infrastructure_config.py - ... return_stderr=True return_stdout=False + ${stderr} SSHLibrary.Execute Command rm ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER}/infrastructure_config.py return_stderr=True return_stdout=False Should Be Empty ${stderr} - ${stderr} SSHLibrary.Execute Command ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER}/clean-demo.sh - ... return_stderr=True return_stdout=False + ${stderr} SSHLibrary.Execute Command ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER}/clean-demo.sh return_stderr=True return_stdout=False Should Be Empty ${stderr} SSHLibrary.Close Connection - diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/Variables.robot b/csit/suites/groupbasedpolicy/GBP/3-node/Variables.robot index d6a18524ce..45716c940f 100755 --- a/csit/suites/groupbasedpolicy/GBP/3-node/Variables.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/Variables.robot @@ -1,49 +1,43 @@ *** Settings *** -Documentation Global variables for GBPSFC 6-node topology +Documentation Global variables for GBPSFC 6-node topology Variables ../../../../variables/Variables.py *** Variables *** -${VM_HOME_FOLDER} = ${WORKSPACE} -${VM_SCRIPTS_FOLDER} = scripts -${ODL} = ${ODL_SYSTEM_IP} -${GBP1} = ${TOOLS_SYSTEM_IP} -${GBP2} = ${TOOLS_SYSTEM_2_IP} -${GBP3} = ${TOOLS_SYSTEM_3_IP} -@{GBPs} = ${GBP1} ${GBP2} ${GBP3} - -${GBP_TENANT1_ID} f5c7d344-d1c7-4208-8531-2c2693657e12 -${GBP_TENANT2_ID} 25c7d344-d1c7-4208-8531-2c2693657e12 -${TENANT1_PATH} ${GBP_TENANTS_API}/tenant/${GBP_TENANT1_ID} -${TENANT2_PATH} ${GBP_TENANTS_API}/tenant/${GBP_TENANT2_ID} -${TUNNELS_PATH} ${CONFIG_NODES_API} -${ENDPOINT_REG_PATH} ${GBP_REGEP_API} -${ENDPOINT_UNREG_PATH} ${GBP_UNREGEP_API} -${ENDPOINTS_OPER_PATH} /restconf/operational/endpoint:endpoints -${OF_OVERLAY_CONFIG_PATH} /restconf/config/ofoverlay:of-overlay-config -${TENANT1_FILE} ${CURDIR}/../../../../variables/gbp/3node/tenant1.json -${TENANT2_FILE} ${CURDIR}/../../../../variables/gbp/3node/tenant2.json -${TUNNELS_FILE} ${CURDIR}/../../../../variables/gbp/3node/tunnels.json -${ENDPOINTS_GBP1_DIR} ${CURDIR}/../../../../variables/gbp/3node/demo-gbp1 -${ENDPOINTS_GBP2_DIR} ${CURDIR}/../../../../variables/gbp/3node/demo-gbp2 +${VM_HOME_FOLDER} ${WORKSPACE} +${VM_SCRIPTS_FOLDER} scripts +${ODL} ${ODL_SYSTEM_IP} +${GBP1} ${TOOLS_SYSTEM_IP} +${GBP2} ${TOOLS_SYSTEM_2_IP} +${GBP3} ${TOOLS_SYSTEM_3_IP} +@{GBPs} ${GBP1} ${GBP2} ${GBP3} +${GBP_TENANT1_ID} f5c7d344-d1c7-4208-8531-2c2693657e12 +${GBP_TENANT2_ID} 25c7d344-d1c7-4208-8531-2c2693657e12 +${TENANT1_PATH} ${GBP_TENANTS_API}/tenant/${GBP_TENANT1_ID} +${TENANT2_PATH} ${GBP_TENANTS_API}/tenant/${GBP_TENANT2_ID} +${TUNNELS_PATH} ${CONFIG_NODES_API} +${ENDPOINT_REG_PATH} ${GBP_REGEP_API} +${ENDPOINT_UNREG_PATH} ${GBP_UNREGEP_API} +${ENDPOINTS_OPER_PATH} /restconf/operational/endpoint:endpoints +${OF_OVERLAY_CONFIG_PATH} /restconf/config/ofoverlay:of-overlay-config +${TENANT1_FILE} ${CURDIR}/../../../../variables/gbp/3node/tenant1.json +${TENANT2_FILE} ${CURDIR}/../../../../variables/gbp/3node/tenant2.json +${TUNNELS_FILE} ${CURDIR}/../../../../variables/gbp/3node/tunnels.json +${ENDPOINTS_GBP1_DIR} ${CURDIR}/../../../../variables/gbp/3node/demo-gbp1 +${ENDPOINTS_GBP2_DIR} ${CURDIR}/../../../../variables/gbp/3node/demo-gbp2 *** Keywords *** Set Test Variables - [Documentation] Sets variables used in 3node test cases. - [Arguments] ${client_switch_ip} ${client_docker} ${client_ip} ${client_mac} - ... ${same_webserver_docker} ${same_webserver_ip} ${same_webserver_mac} - ... ${diff_webserver_switch_ip} ${diff_webserver_docker} ${diff_webserver_ip} - ... ${diff_webserver_mac} + [Arguments] ${client_switch_ip} ${client_docker} ${client_ip} ${client_mac} ${same_webserver_docker} ${same_webserver_ip} + ... ${same_webserver_mac} ${diff_webserver_switch_ip} ${diff_webserver_docker} ${diff_webserver_ip} ${diff_webserver_mac} + [Documentation] Sets variables used in 3node test cases. Set Global Variable ${CLIENT_SWITCH_IP} ${client_switch_ip} - Set Global Variable ${CLIENT_DOCKER} ${client_docker} - Set Global Variable ${CLIENT_IP} ${client_ip} - Set Global Variable ${CLIENT_MAC} ${client_mac} - + Set Global Variable ${CLIENT_DOCKER} ${client_docker} + Set Global Variable ${CLIENT_IP} ${client_ip} + Set Global Variable ${CLIENT_MAC} ${client_mac} Set Global Variable ${SAME_WEBSERVER_DOCKER} ${same_webserver_docker} - Set Global Variable ${SAME_WEBSERVER_IP} ${same_webserver_ip} - Set Global Variable ${SAME_WEBSERVER_MAC} ${same_webserver_mac} - - Set Global Variable ${DIFF_WEBSERVER_SWITCH_IP} ${diff_webserver_switch_ip} - Set Global Variable ${DIFF_WEBSERVER_DOCKER} ${diff_webserver_docker} - Set Global Variable ${DIFF_WEBSERVER_IP} ${diff_webserver_ip} - Set Global Variable ${DIFF_WEBSERVER_MAC} ${diff_webserver_mac} - + Set Global Variable ${SAME_WEBSERVER_IP} ${same_webserver_ip} + Set Global Variable ${SAME_WEBSERVER_MAC} ${same_webserver_mac} + Set Global Variable ${DIFF_WEBSERVER_SWITCH_IP} ${diff_webserver_switch_ip} + Set Global Variable ${DIFF_WEBSERVER_DOCKER} ${diff_webserver_docker} + Set Global Variable ${DIFF_WEBSERVER_IP} ${diff_webserver_ip} + Set Global Variable ${DIFF_WEBSERVER_MAC} ${diff_webserver_mac} diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/__init__.robot b/csit/suites/groupbasedpolicy/GBP/3-node/__init__.robot index a8a880eb88..b93e232f97 100755 --- a/csit/suites/groupbasedpolicy/GBP/3-node/__init__.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/__init__.robot @@ -9,19 +9,16 @@ Resource ../../../../libraries/GBP/ConnUtils.robot Variables ../../../../variables/Variables.py Resource Variables.robot - *** Variables *** -${timeout} = 10s - +${timeout} 10s *** Keywords *** Setup Everything Log start_suite_in_3_node Create Session session http://${ODL}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} - Wait Until Keyword Succeeds 10x 30 s Get Data From URI - ... session ${OF_OVERLAY_CONFIG_PATH} headers=${headers} + Wait Until Keyword Succeeds 10x 30 s Get Data From URI session ${OF_OVERLAY_CONFIG_PATH} headers=${headers} Delete All Sessions - :FOR ${GBP} IN @{GBPs} + : FOR ${GBP} IN @{GBPs} \ ConnUtils.Connect and Login ${GBP} timeout=${timeout} \ ${stderr} SSHLibrary.Execute Command virtualenv --system-site-packages ${VE_DIR} return_stdout=False return_stderr=True return_rc=False \ Should Be Empty ${stderr} @@ -32,7 +29,7 @@ Setup Everything Teardown Everything Log stop_suite_in_3_node - :FOR ${GBP} IN @{GBPs} + : FOR ${GBP} IN @{GBPs} \ ConnUtils.Connect and Login ${GBP} timeout=${timeout} \ SSHLibrary.Execute Command sudo rm -rf ${VM_SCRIPTS_FOLDER} \ SSHLibrary.Close Connection diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/000_setup.robot b/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/000_setup.robot index 6bbdd70589..8d3c392cf9 100755 --- a/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/000_setup.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/000_setup.robot @@ -7,14 +7,12 @@ Variables ../../../../../variables/Variables.py Resource ../Variables.robot Resource ../GBP_3node.robot - *** Variables *** -${timeout} = 10s - +${timeout} 10s *** Test Cases *** Setup Suite Log Setup suite in gbp1 - GBP_3node.Setup Node ${GBP1} ${CURDIR} 0 timeout=${timeout} - GBP_3node.Setup Node ${GBP2} ${CURDIR} 1 timeout=${timeout} - GBP_3node.Setup Node ${GBP3} ${CURDIR} 2 timeout=${timeout} + GBP_3node.Setup Node ${GBP1} ${CURDIR} 0 timeout=${timeout} + GBP_3node.Setup Node ${GBP2} ${CURDIR} 1 timeout=${timeout} + GBP_3node.Setup Node ${GBP3} ${CURDIR} 2 timeout=${timeout} diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/001_set_odl.robot b/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/001_set_odl.robot index 20a4e57931..fea2008905 100644 --- a/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/001_set_odl.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/001_set_odl.robot @@ -1,8 +1,8 @@ *** Settings *** Documentation Test suite for GBP Tenants, Operates functions from Restconf APIs. -Default Tags single-tenant setup single-tenant-setup Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} Suite Teardown Delete All Sessions +Default Tags single-tenant setup single-tenant-setup Library RequestsLibrary Library OperatingSystem Variables ../../../../../variables/Variables.py @@ -15,16 +15,16 @@ Resource ../Variables.robot Put Tunnels [Documentation] Send tunnel augmentation to ODL ${json_to_edit} OperatingSystem.Get File ${TUNNELS_FILE} - ${edited_json} Replace String ${json_to_edit} _CLASSIFIER1 ${GBP1} - ${edited_json} Replace String ${edited_json} _CLASSIFIER2 ${GBP2} - ${edited_json} Replace String ${edited_json} _CLASSIFIER3 ${GBP3} + ${edited_json} Replace String ${json_to_edit} _CLASSIFIER1 ${GBP1} + ${edited_json} Replace String ${edited_json} _CLASSIFIER2 ${GBP2} + ${edited_json} Replace String ${edited_json} _CLASSIFIER3 ${GBP3} ${resp} RequestsLibrary.Put Request session ${TUNNELS_PATH} ${edited_json} ${HEADERS} Should Be Equal As Strings ${resp.status_code} 200 Register Endpoints [Documentation] Endpoints registration - @{endpoint_files} = OperatingSystem.List Files In Directory ${ENDPOINTS_GBP1_DIR} vethl*.*json absolute - :FOR ${endpoint_file} IN @{endpoint_files} + @{endpoint_files} = OperatingSystem.List Files In Directory ${ENDPOINTS_GBP1_DIR} vethl*.*json absolute + : FOR ${endpoint_file} IN @{endpoint_files} \ Post Elements To URI From File ${ENDPOINT_REG_PATH} ${endpoint_file} Put Tenant diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/002_wait_flows.robot b/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/002_wait_flows.robot index 41b0e94982..7172ab668f 100755 --- a/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/002_wait_flows.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/002_wait_flows.robot @@ -7,18 +7,15 @@ Resource ../../../../../libraries/GBP/OpenFlowUtils.robot Variables ../../../../../variables/Variables.py Resource ../Variables.robot - *** Variables *** -${timeout} = 10s - +${timeout} 10s *** Testcases *** - Wait For Flows Sleep 30s - ${passed} = Run Keyword And Return Status OpenFlowUtils.Wait For Flows On Switch ${GBP1} sw1 + ${passed} = Run Keyword And Return Status OpenFlowUtils.Wait For Flows On Switch ${GBP1} sw1 Run Keyword Unless ${passed} Fatal Error Flows not created on sw1! - ${passed} = Run Keyword And Return Status OpenFlowUtils.Wait For Flows On Switch ${GBP2} sw2 + ${passed} = Run Keyword And Return Status OpenFlowUtils.Wait For Flows On Switch ${GBP2} sw2 Run Keyword Unless ${passed} Fatal Error Flows not created on sw2! - ${passed} = Run Keyword And Return Status OpenFlowUtils.Wait For Flows On Switch ${GBP3} sw3 + ${passed} = Run Keyword And Return Status OpenFlowUtils.Wait For Flows On Switch ${GBP3} sw3 Run Keyword Unless ${passed} Fatal Error Flows not created on sw3! diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/010_icmp.robot b/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/010_icmp.robot index 7fb7f87f49..75c545d423 100644 --- a/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/010_icmp.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/010_icmp.robot @@ -1,5 +1,7 @@ *** Settings *** Documentation Tests for ICMP flow +Suite Setup Set Test Variables client_switch_ip=${GBP1} client_docker=h35_2 client_ip=10.0.35.2 client_mac=00:00:00:00:35:02 same_webserver_docker=h36_4 same_webserver_ip=10.0.36.4 +... same_webserver_mac=00:00:00:00:36:04 diff_webserver_switch_ip=${GBP3} diff_webserver_docker=h36_3 diff_webserver_ip=10.0.36.3 diff_webserver_mac=00:00:00:00:36:03 Default Tags single-tenant icmp single-tenant-main Library SSHLibrary Resource ../../../../../libraries/Utils.robot @@ -8,73 +10,56 @@ Resource ../../../../../libraries/GBP/DockerUtils.robot Resource ../../../../../libraries/GBP/OpenFlowUtils.robot Variables ../../../../../variables/Variables.py Resource ../Variables.robot -Suite Setup Set Test Variables client_switch_ip=${GBP1} client_docker=h35_2 client_ip=10.0.35.2 - ... client_mac=00:00:00:00:35:02 same_webserver_docker=h36_4 same_webserver_ip=10.0.36.4 - ... same_webserver_mac=00:00:00:00:36:04 diff_webserver_switch_ip=${GBP3} - ... diff_webserver_docker=h36_3 diff_webserver_ip=10.0.36.3 - ... diff_webserver_mac=00:00:00:00:36:03 - *** Variables *** -${timeout} = 10s - +${timeout} 10s *** Testcases *** - Same switch, ping once from h35_2 to h36_4 - [Documentation] Ping between endpoints located on the same switch "sw1". + [Documentation] Ping between endpoints located on the same switch "sw1". ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Ping From Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} SSHLibrary.Close Connection Same switch, start endless ping from h35_2 to h36_4 - [Documentation] Start endless ping from h35_2 to h36_4 so that icmp traffic + [Documentation] Start endless ping from h35_2 to h36_4 so that icmp traffic ... can be inspected. ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Start Endless Ping from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} SSHLibrary.Close Connection Same switch, ICMP request ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of ICMP request from h35_2 to h36_4 + [Documentation] Assert matches and actions on megaflow of ICMP request from h35_2 to h36_4 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append In Port Check ${matches} 4 + Append In Port Check ${matches} 4 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${CLIENT_IP} ${SAME_WEBSERVER_IP} - Append Proto Check ${matches} 1 - + Append Proto Check ${matches} 1 Append Inner MAC Check ${actions} dst_addr=${SAME_WEBSERVER_MAC} Append Inner IPs Check ${actions} ${CLIENT_IP} ${SAME_WEBSERVER_IP} - Append Proto Check ${actions} 1 - Append Out Port Check ${actions} 6 - + Append Proto Check ${actions} 1 + Append Out Port Check ${actions} 6 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Same switch, ICMP reply ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of ICMP reply from h36_4 to h35_2 + [Documentation] Assert matches and actions on megaflow of ICMP reply from h36_4 to h35_2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - Set Suite Variable @{matches} @{EMPTY} Set Suite Variable @{actions} @{EMPTY} - - Append In Port Check ${matches} 6 + Append In Port Check ${matches} 6 Append Inner MAC Check ${matches} src_addr=${SAME_WEBSERVER_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${SAME_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${matches} 1 - + Append Proto Check ${matches} 1 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC} Append Inner IPs Check ${actions} ${SAME_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${actions} 1 - Append Out Port Check ${actions} 4 - + Append Proto Check ${actions} 1 + Append Out Port Check ${actions} 4 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Same switch, stop endless ping from h35_2 to h36_4 @@ -83,108 +68,91 @@ Same switch, stop endless ping from h35_2 to h36_4 DockerUtils.Stop Endless Ping from Docker to Address ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} SSHLibrary.Close Connection - Different switches, ping once from h35_2 to h36_3 - [Documentation] Different switches (sw1 -> sw3) + [Documentation] Different switches (sw1 -> sw3) ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Ping From Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP} SSHLibrary.Close Connection Different switches, start endless ping from h35_2 to h36_3 - [Documentation] Starting icmp session for traffic inspection between endpoints located + [Documentation] Starting icmp session for traffic inspection between endpoints located ... on different switches. ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Start Endless Ping from Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP} SSHLibrary.Close Connection Different switches, ICMP request ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of ICMP request from h35_2 to h36_3 + [Documentation] Assert matches and actions on megaflow of ICMP request from h35_2 to h36_3 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append In Port Check ${matches} 4 + Append In Port Check ${matches} 4 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${matches} 1 - - Append Tunnel Set Check ${actions} + Append Proto Check ${matches} 1 + Append Tunnel Set Check ${actions} Append Inner MAC Check ${actions} dst_addr=${DIFF_WEBSERVER_MAC} Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${actions} 1 - Append Out Port Check ${actions} 3 - + Append Proto Check ${actions} 1 + Append Out Port Check ${actions} 3 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Different switches, ICMP request ovs-dpctl output check on sw3 - [Documentation] Assert matches and actions on megaflow of ICMP request from h35_2 to h36_3 + [Documentation] Assert matches and actions on megaflow of ICMP request from h35_2 to h36_3 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append Tunnel Set Check ${matches} + Append Tunnel Set Check ${matches} Append Outer IPs Check ${matches} src_ip=${CLIENT_SWITCH_IP} Append Outer IPs Check ${matches} dst_ip=${DIFF_WEBSERVER_SWITCH_IP} - Append In Port Check ${matches} 3 + Append In Port Check ${matches} 3 Append Inner MAC Check ${matches} dst_addr=${DIFF_WEBSERVER_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${matches} 1 - + Append Proto Check ${matches} 1 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${actions} 1 - Append Out Port Check ${actions} 5 - + Append Proto Check ${actions} 1 + Append Out Port Check ${actions} 5 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Different switches, ICMP reply ovs-dpctl output check on sw3 - [Documentation] assert matches and actions on megaflow of ICMP reply from h36_3 to h35_2 + [Documentation] assert matches and actions on megaflow of ICMP reply from h36_3 to h35_2 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append In Port Check ${matches} 5 + Append In Port Check ${matches} 5 Append Inner MAC Check ${matches} src_addr=${DIFF_WEBSERVER_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${matches} 1 - - Append Tunnel Set Check ${actions} + Append Proto Check ${matches} 1 + Append Tunnel Set Check ${actions} Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC} Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${actions} 1 - Append Out Port Check ${actions} 3 - + Append Proto Check ${actions} 1 + Append Out Port Check ${actions} 3 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Different switches, ICMP reply ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of ICMP reply from h36_3 to h35_2 + [Documentation] Assert matches and actions on megaflow of ICMP reply from h36_3 to h35_2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append Tunnel Set Check ${matches} + Append Tunnel Set Check ${matches} Append Outer IPs Check ${matches} src_ip=${DIFF_WEBSERVER_SWITCH_IP} Append Outer IPs Check ${matches} dst_ip=${CLIENT_SWITCH_IP} - Append In Port Check ${matches} 3 + Append In Port Check ${matches} 3 Append Inner MAC Check ${matches} dst_addr=${CLIENT_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${matches} 1 - + Append Proto Check ${matches} 1 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${actions} 1 - Append Out Port Check ${actions} 4 - + Append Proto Check ${actions} 1 + Append Out Port Check ${actions} 4 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Different switches, stop endless ping from h35_2 to h36_3 diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/020_http.robot b/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/020_http.robot index 31cb559233..71b8dd6f72 100644 --- a/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/020_http.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/020_http.robot @@ -1,5 +1,7 @@ *** Settings *** Documentation Tests for HTTP flow +Suite Setup Set Test Variables client_switch_ip=${GBP1} client_docker=h35_2 client_ip=10.0.35.2 client_mac=00:00:00:00:35:02 same_webserver_docker=h36_4 same_webserver_ip=10.0.36.4 +... same_webserver_mac=00:00:00:00:36:04 diff_webserver_switch_ip=${GBP3} diff_webserver_docker=h36_3 diff_webserver_ip=10.0.36.3 diff_webserver_mac=00:00:00:00:36:03 Default Tags single-tenant http single-tenant-main Library SSHLibrary Resource ../../../../../libraries/Utils.robot @@ -8,23 +10,15 @@ Resource ../../../../../libraries/GBP/DockerUtils.robot Resource ../../../../../libraries/GBP/OpenFlowUtils.robot Variables ../../../../../variables/Variables.py Resource ../Variables.robot -Suite Setup Set Test Variables client_switch_ip=${GBP1} client_docker=h35_2 client_ip=10.0.35.2 - ... client_mac=00:00:00:00:35:02 same_webserver_docker=h36_4 same_webserver_ip=10.0.36.4 - ... same_webserver_mac=00:00:00:00:36:04 diff_webserver_switch_ip=${GBP3} - ... diff_webserver_docker=h36_3 diff_webserver_ip=10.0.36.3 - ... diff_webserver_mac=00:00:00:00:36:03 - *** Variables *** -${timeout} = 10s +${timeout} 10s *** Testcases *** - -# Same subnet tests are not supported by current topology configuration; -# clients and webservers are put in two different subnets - Same switch, start SimpleHttpServer on h36_4 - [Documentation] Same Switch (sw1) + [Documentation] Same Switch (sw1) + # Same subnet tests are not supported by current topology configuration; + # clients and webservers are put in two different subnets ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Start HTTP Service on Docker ${SAME_WEBSERVER_DOCKER} 80 SSHLibrary.Close Connection @@ -42,45 +36,37 @@ Same switch, start endless curl from h35_2 to h36_4 SSHLibrary.Close Connection Same switch, HTTP request ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of HTTP request from h35_2 to h36_4 + [Documentation] Assert matches and actions on megaflow of HTTP request from h35_2 to h36_4 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append In Port Check ${matches} 4 + Append In Port Check ${matches} 4 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${CLIENT_IP} ${SAME_WEBSERVER_IP} - Append Proto Check ${matches} 6 - + Append Proto Check ${matches} 6 Append Inner MAC Check ${actions} dst_addr=${SAME_WEBSERVER_MAC} Append Inner IPs Check ${actions} ${CLIENT_IP} ${SAME_WEBSERVER_IP} - Append Proto Check ${actions} 6 - Append Out Port Check ${actions} 6 - + Append Proto Check ${actions} 6 + Append Out Port Check ${actions} 6 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Same switch, HTTP reply ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of HTTP reply from h36_4 to h35_2 + [Documentation] Assert matches and actions on megaflow of HTTP reply from h36_4 to h35_2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append In Port Check ${matches} 6 + Append In Port Check ${matches} 6 Append Inner MAC Check ${matches} src_addr=${SAME_WEBSERVER_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${SAME_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${matches} 6 - + Append Proto Check ${matches} 6 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC} Append Inner IPs Check ${actions} ${SAME_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${actions} 6 - Append Out Port Check ${actions} 4 - + Append Proto Check ${actions} 6 + Append Out Port Check ${actions} 4 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Same switch, stop endless curl from h35_2 to h36_4 @@ -96,7 +82,7 @@ Same switch, stop SimpleHttpServer on h36_4 SSHLibrary.Close Connection Different switches, start SimpleHttpServer on h36_3 - [Documentation] Different switches (sw1 -> sw3) + [Documentation] Different switches (sw1 -> sw3) ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout} DockerUtils.Start HTTP Service on Docker ${DIFF_WEBSERVER_DOCKER} 80 SSHLibrary.Close Connection @@ -114,95 +100,77 @@ Different switches, start endless curl from h35_2 to h36_3 SSHLibrary.Close Connection Different switches, HTTP request ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of HTTP request from h35_2 to h36_3 + [Documentation] Assert matches and actions on megaflow of HTTP request from h35_2 to h36_3 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - - Append In Port Check ${matches} 4 + Append In Port Check ${matches} 4 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${matches} 6 - - Append Tunnel Set Check ${actions} + Append Proto Check ${matches} 6 + Append Tunnel Set Check ${actions} Append Inner MAC Check ${actions} dst_addr=${DIFF_WEBSERVER_MAC} Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${actions} 6 - Append Out Port Check ${actions} 3 - + Append Proto Check ${actions} 6 + Append Out Port Check ${actions} 3 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Different switches, HTTP request ovs-dpctl output check on sw3 - [Documentation] Assert matches and actions on megaflow of HTTP request from h35_2 to h36_3 + [Documentation] Assert matches and actions on megaflow of HTTP request from h35_2 to h36_3 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append Tunnel Set Check ${matches} + Append Tunnel Set Check ${matches} Append Outer IPs Check ${matches} src_ip=${CLIENT_SWITCH_IP} Append Outer IPs Check ${matches} dst_ip=${DIFF_WEBSERVER_SWITCH_IP} - Append In Port Check ${matches} 3 + Append In Port Check ${matches} 3 Append Inner MAC Check ${matches} dst_addr=${DIFF_WEBSERVER_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${matches} 6 - + Append Proto Check ${matches} 6 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${actions} 6 - Append Out Port Check ${actions} 5 - + Append Proto Check ${actions} 6 + Append Out Port Check ${actions} 5 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Different switches, HTTP reply ovs-dpctl output check on sw3 - [Documentation] Assert matches and actions on megaflow of HTTP reply from h36_3 to h35_2 + [Documentation] Assert matches and actions on megaflow of HTTP reply from h36_3 to h35_2 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - - Append In Port Check ${matches} 5 + Append In Port Check ${matches} 5 Append Inner MAC Check ${matches} src_addr=${DIFF_WEBSERVER_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${matches} 6 - - Append Tunnel Set Check ${actions} + Append Proto Check ${matches} 6 + Append Tunnel Set Check ${actions} Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC} Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${actions} 6 - Append Out Port Check ${actions} 3 - + Append Proto Check ${actions} 6 + Append Out Port Check ${actions} 3 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Different switches, HTTP reply ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of HTTP request from h36_3 to h35_2 + [Documentation] Assert matches and actions on megaflow of HTTP request from h36_3 to h35_2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append Tunnel Set Check ${matches} + Append Tunnel Set Check ${matches} Append Outer IPs Check ${matches} src_ip=${DIFF_WEBSERVER_SWITCH_IP} Append Outer IPs Check ${matches} dst_ip=${CLIENT_SWITCH_IP} - Append In Port Check ${matches} 3 + Append In Port Check ${matches} 3 Append Inner MAC Check ${matches} dst_addr=${CLIENT_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${matches} 6 - + Append Proto Check ${matches} 6 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${actions} 6 - Append Out Port Check ${actions} 4 - + Append Proto Check ${actions} 6 + Append Out Port Check ${actions} 4 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Different switches, stop endless curl from h35_2 to h36_3 diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/998_clean_odl.robot b/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/998_clean_odl.robot index e2188e1fde..6787c6b171 100644 --- a/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/998_clean_odl.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/998_clean_odl.robot @@ -1,8 +1,8 @@ *** Settings *** Documentation Test suite for cleaning up / unregister infrastructure constructs like endpoints for demo-asymmetric-chain -Default Tags single-tenant teardown single-tenant-teardown Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} Suite Teardown Delete All Sessions +Default Tags single-tenant teardown single-tenant-teardown Library RequestsLibrary Library OperatingSystem Library json @@ -11,11 +11,9 @@ Resource ../../../../../libraries/Utils.robot Resource ../../../../../libraries/GBP/RestconfUtils.robot Resource ../Variables.robot - *** Variables *** *** Test Cases *** - Delete Tenant [Documentation] Delete Tenants from ODL Remove All Elements At URI ${TENANT1_PATH} diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/999_teardown.robot b/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/999_teardown.robot index 32befd1e8c..787df6b029 100755 --- a/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/999_teardown.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/999_teardown.robot @@ -7,13 +7,11 @@ Variables ../../../../../variables/Variables.py Resource ../Variables.robot Resource ../GBP_3node.robot - *** Variables *** -${timeout} = 10s - +${timeout} 10s *** Test Cases *** Teardown Suite Log Teardown suite in gbp1 - :FOR ${GBP} IN @{GBPs} + : FOR ${GBP} IN @{GBPs} \ GBP_3node.Teardown Node ${GBP} ${CURDIR} timeout=${timeout} diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/000_setup.robot b/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/000_setup.robot index 9d7b4b084b..59d4c2069b 100755 --- a/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/000_setup.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/000_setup.robot @@ -7,14 +7,12 @@ Variables ../../../../../variables/Variables.py Resource ../Variables.robot Resource ../GBP_3node.robot - *** Variables *** -${timeout} = 10s - +${timeout} 10s *** Test Cases *** Setup Suite Log Setup suite in gbp2-multitenant - GBP_3node.Setup Node ${GBP1} ${CURDIR} 0 timeout=${timeout} - GBP_3node.Setup Node ${GBP2} ${CURDIR} 1 timeout=${timeout} - GBP_3node.Setup Node ${GBP3} ${CURDIR} 2 timeout=${timeout} + GBP_3node.Setup Node ${GBP1} ${CURDIR} 0 timeout=${timeout} + GBP_3node.Setup Node ${GBP2} ${CURDIR} 1 timeout=${timeout} + GBP_3node.Setup Node ${GBP3} ${CURDIR} 2 timeout=${timeout} diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/001_set_odl.robot b/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/001_set_odl.robot index c38add9db4..3ec1c83b2e 100644 --- a/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/001_set_odl.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/001_set_odl.robot @@ -1,8 +1,8 @@ *** Settings *** Documentation Test suite for GBP Tenants, Operates functions from Restconf APIs. -Default Tags multi-tenant setup multi-tenant-setup Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} Suite Teardown Delete All Sessions +Default Tags multi-tenant setup multi-tenant-setup Library RequestsLibrary Library OperatingSystem Variables ../../../../../variables/Variables.py @@ -15,16 +15,16 @@ Resource ../Variables.robot Put Tunnels [Documentation] Send tunnel augmentation to ODL ${json_to_edit} OperatingSystem.Get File ${TUNNELS_FILE} - ${edited_json} Replace String ${json_to_edit} _CLASSIFIER1 ${GBP1} - ${edited_json} Replace String ${edited_json} _CLASSIFIER2 ${GBP2} - ${edited_json} Replace String ${edited_json} _CLASSIFIER3 ${GBP3} + ${edited_json} Replace String ${json_to_edit} _CLASSIFIER1 ${GBP1} + ${edited_json} Replace String ${edited_json} _CLASSIFIER2 ${GBP2} + ${edited_json} Replace String ${edited_json} _CLASSIFIER3 ${GBP3} ${resp} RequestsLibrary.Put Request session ${TUNNELS_PATH} ${edited_json} ${HEADERS} Should Be Equal As Strings ${resp.status_code} 200 Register Endpoints [Documentation] Endpoints registration - @{endpoint_files} = OperatingSystem.List Files In Directory ${ENDPOINTS_GBP2_DIR} vethl*.*json absolute - :FOR ${endpoint_file} IN @{endpoint_files} + @{endpoint_files} = OperatingSystem.List Files In Directory ${ENDPOINTS_GBP2_DIR} vethl*.*json absolute + : FOR ${endpoint_file} IN @{endpoint_files} \ Post Elements To URI From File ${ENDPOINT_REG_PATH} ${endpoint_file} Put Tenants diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/002_wait_flows.robot b/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/002_wait_flows.robot index c0c57e3939..8bf2a797e6 100755 --- a/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/002_wait_flows.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/002_wait_flows.robot @@ -7,18 +7,15 @@ Resource ../../../../../libraries/GBP/OpenFlowUtils.robot Variables ../../../../../variables/Variables.py Resource ../Variables.robot - *** Variables *** -${timeout} = 10s - +${timeout} 10s *** Testcases *** - Wait For Flows Sleep 30s - ${passed} = Run Keyword And Return Status OpenFlowUtils.Wait For Flows On Switch ${GBP1} sw1 + ${passed} = Run Keyword And Return Status OpenFlowUtils.Wait For Flows On Switch ${GBP1} sw1 Run Keyword Unless ${passed} Fatal Error Flows not created on sw1! - ${passed} = Run Keyword And Return Status OpenFlowUtils.Wait For Flows On Switch ${GBP2} sw2 + ${passed} = Run Keyword And Return Status OpenFlowUtils.Wait For Flows On Switch ${GBP2} sw2 Run Keyword Unless ${passed} Fatal Error Flows not created on sw2! - ${passed} = Run Keyword And Return Status OpenFlowUtils.Wait For Flows On Switch ${GBP3} sw3 + ${passed} = Run Keyword And Return Status OpenFlowUtils.Wait For Flows On Switch ${GBP3} sw3 Run Keyword Unless ${passed} Fatal Error Flows not created on sw3! diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/010_icmp.robot b/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/010_icmp.robot index f4f51913b1..7cde00b369 100644 --- a/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/010_icmp.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/010_icmp.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Tests for ICMP flow -Force Tags multi-tenant icmp multi-tenant-main +Force Tags multi-tenant icmp multi-tenant-main Library SSHLibrary Resource ../../../../../libraries/Utils.robot Resource ../../../../../libraries/GBP/ConnUtils.robot @@ -10,377 +10,320 @@ Variables ../../../../../variables/Variables.py Resource ../Variables.robot *** Variables *** -${timeout} = 10s - +${timeout} 10s *** Testcases *** Setting Variables For Tenant 1 [Documentation] Setting variables for tenant 1 related test cases. - Set Test Variables client_switch_ip=${GBP1} client_docker=h35_2 client_ip=10.0.35.2 - ... client_mac=00:00:00:00:35:02 same_webserver_docker=h36_3 same_webserver_ip=10.0.36.3 - ... same_webserver_mac=00:00:00:00:36:03 diff_webserver_switch_ip=${GBP3} - ... diff_webserver_docker=h36_2 diff_webserver_ip=10.0.36.2 - ... diff_webserver_mac=00:00:00:00:36:02 + Set Test Variables client_switch_ip=${GBP1} client_docker=h35_2 client_ip=10.0.35.2 client_mac=00:00:00:00:35:02 same_webserver_docker=h36_3 same_webserver_ip=10.0.36.3 + ... same_webserver_mac=00:00:00:00:36:03 diff_webserver_switch_ip=${GBP3} diff_webserver_docker=h36_2 diff_webserver_ip=10.0.36.2 diff_webserver_mac=00:00:00:00:36:02 Tenant 1 Same switch, ping once from h35_2 to h36_3 + [Documentation] Ping between endpoints located on the same switch "sw1". [Tags] tenant1 - [Documentation] Ping between endpoints located on the same switch "sw1". ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Ping From Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} SSHLibrary.Close Connection Tenant 1 Same switch, start endless ping from h35_2 to h36_3 - [Tags] tenant1 - [Documentation] Start endless ping from h35_2 to h36_4 so that icmp traffic + [Documentation] Start endless ping from h35_2 to h36_4 so that icmp traffic ... can be inspected. + [Tags] tenant1 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Start Endless Ping from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} SSHLibrary.Close Connection Tenant 1 Same switch, ICMP request ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of ICMP request from h35_2 to h36_3 + [Documentation] Assert matches and actions on megaflow of ICMP request from h35_2 to h36_3 [Tags] tenant1 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append In Port Check ${matches} 4 + Append In Port Check ${matches} 4 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${CLIENT_IP} ${SAME_WEBSERVER_IP} - Append Proto Check ${matches} 1 - + Append Proto Check ${matches} 1 Append Inner MAC Check ${actions} dst_addr=${SAME_WEBSERVER_MAC} Append Inner IPs Check ${actions} ${CLIENT_IP} ${SAME_WEBSERVER_IP} - Append Proto Check ${actions} 1 - Append Out Port Check ${actions} 7 - + Append Proto Check ${actions} 1 + Append Out Port Check ${actions} 7 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 1 Same switch, ICMP reply ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of ICMP reply from h36_3 to h35_2. + [Documentation] Assert matches and actions on megaflow of ICMP reply from h36_3 to h35_2. [Tags] tenant1 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append In Port Check ${matches} 7 + Append In Port Check ${matches} 7 Append Inner MAC Check ${matches} src_addr=${SAME_WEBSERVER_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${SAME_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${matches} 1 - + Append Proto Check ${matches} 1 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC} Append Inner IPs Check ${actions} ${SAME_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${actions} 1 - Append Out Port Check ${actions} 4 - + Append Proto Check ${actions} 1 + Append Out Port Check ${actions} 4 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 1 Same switch, stop endless ping from h35_2 to h36_3 - [Tags] tenant1 [Documentation] Stops endless pinging from h35_8 to h36_6 when traffic inspection finishes. + [Tags] tenant1 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Stop Endless Ping from Docker to Address ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} SSHLibrary.Close Connection - Tenant 1 Different switches, ping once from h35_2 to h36_2 - [Documentation] Different switches (sw1 -> sw3) + [Documentation] Different switches (sw1 -> sw3) [Tags] tenant1 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Ping From Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP} SSHLibrary.Close Connection Tenant 1 Different switches, start endless ping from h35_2 to h36_2 - [Documentation] Different switches (sw1 -> sw3) + [Documentation] Different switches (sw1 -> sw3) [Tags] tenant1 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Start Endless Ping from Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP} SSHLibrary.Close Connection Tenant 1 Different switches, ICMP request ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of ICMP request from h35_2 to h36_2 + [Documentation] Assert matches and actions on megaflow of ICMP request from h35_2 to h36_2 [Tags] tenant1 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append In Port Check ${matches} 4 + Append In Port Check ${matches} 4 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${matches} 1 - - Append Tunnel Set Check ${actions} + Append Proto Check ${matches} 1 + Append Tunnel Set Check ${actions} Append Inner MAC Check ${actions} dst_addr=${DIFF_WEBSERVER_MAC} Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${actions} 1 - Append Out Port Check ${actions} 3 - + Append Proto Check ${actions} 1 + Append Out Port Check ${actions} 3 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 1 Different switches, ICMP request ovs-dpctl output check on sw3 - [Documentation] Assert matches and actions on megaflow of ICMP request from h35_2 to h36_2 + [Documentation] Assert matches and actions on megaflow of ICMP request from h35_2 to h36_2 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append Tunnel Set Check ${matches} + Append Tunnel Set Check ${matches} Append Outer IPs Check ${matches} src_ip=${CLIENT_SWITCH_IP} Append Outer IPs Check ${matches} dst_ip=${DIFF_WEBSERVER_SWITCH_IP} - Append In Port Check ${matches} 3 + Append In Port Check ${matches} 3 Append Inner MAC Check ${matches} dst_addr=${DIFF_WEBSERVER_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${matches} 1 - + Append Proto Check ${matches} 1 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${actions} 1 - Append Out Port Check ${actions} 6 - + Append Proto Check ${actions} 1 + Append Out Port Check ${actions} 6 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 1 Different switches, ICMP reply ovs-dpctl output check on sw3 - [Documentation] Assert matches and actions on megaflow of ICMP request from h36_2 to h35_2 + [Documentation] Assert matches and actions on megaflow of ICMP request from h36_2 to h35_2 [Tags] tenant1 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append In Port Check ${matches} 6 + Append In Port Check ${matches} 6 Append Inner MAC Check ${matches} src_addr=${DIFF_WEBSERVER_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${matches} 1 - - Append Tunnel Set Check ${actions} + Append Proto Check ${matches} 1 + Append Tunnel Set Check ${actions} Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC} Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${actions} 1 - Append Out Port Check ${actions} 3 - + Append Proto Check ${actions} 1 + Append Out Port Check ${actions} 3 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 1 Different switches, ICMP reply ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of ICMP reply from h36_2 to h35_2 + [Documentation] Assert matches and actions on megaflow of ICMP reply from h36_2 to h35_2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append Tunnel Set Check ${matches} + Append Tunnel Set Check ${matches} Append Outer IPs Check ${matches} src_ip=${DIFF_WEBSERVER_SWITCH_IP} Append Outer IPs Check ${matches} dst_ip=${CLIENT_SWITCH_IP} - Append In Port Check ${matches} 3 + Append In Port Check ${matches} 3 Append Inner MAC Check ${matches} dst_addr=${CLIENT_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${matches} 1 - + Append Proto Check ${matches} 1 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${actions} 1 - Append Out Port Check ${actions} 4 - + Append Proto Check ${actions} 1 + Append Out Port Check ${actions} 4 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 1 Different switches, stop endless ping from h35_2 to h36_2 - [Tags] tenant1 [Documentation] Stops endless pinging from h35_2 to h36_2 when traffic inspection finishes. + [Tags] tenant1 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Stop Endless Ping from Docker to Address ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP} SSHLibrary.Close Connection Setting Variables For Tenant 2 [Documentation] Setting variables for tenant 2 related test cases. - Set Test Variables client_switch_ip=${GBP1} client_docker=h35_8 client_ip=10.0.35.8 - ... client_mac=00:00:00:00:35:08 same_webserver_docker=h36_6 same_webserver_ip=10.0.36.6 - ... same_webserver_mac=00:00:00:00:36:06 diff_webserver_switch_ip=${GBP2} - ... diff_webserver_docker=h36_7 diff_webserver_ip=10.0.36.7 - ... diff_webserver_mac=00:00:00:00:36:07 + Set Test Variables client_switch_ip=${GBP1} client_docker=h35_8 client_ip=10.0.35.8 client_mac=00:00:00:00:35:08 same_webserver_docker=h36_6 same_webserver_ip=10.0.36.6 + ... same_webserver_mac=00:00:00:00:36:06 diff_webserver_switch_ip=${GBP2} diff_webserver_docker=h36_7 diff_webserver_ip=10.0.36.7 diff_webserver_mac=00:00:00:00:36:07 Tenant 2 Same switch, ping once from h35_8 to h36_6 - [Documentation] Same switch (sw1) + [Documentation] Same switch (sw1) [Tags] tenant2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Ping From Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} SSHLibrary.Close Connection Tenant 2 Same switch, start endless ping from h35_8 to h36_6 - [Tags] tenant2 [Documentation] Starting icmp between hosts on the same switch so that ... traffic can be inspected. + [Tags] tenant2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Start Endless Ping from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} SSHLibrary.Close Connection Tenant 2 Same switch, ICMP request ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of ICMP request from h35_8 to h36_6 + [Documentation] Assert matches and actions on megaflow of ICMP request from h35_8 to h36_6 [Tags] tenant2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append In Port Check ${matches} 6 + Append In Port Check ${matches} 6 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${CLIENT_IP} ${SAME_WEBSERVER_IP} - Append Proto Check ${matches} 1 - + Append Proto Check ${matches} 1 Append Inner MAC Check ${actions} dst_addr=${SAME_WEBSERVER_MAC} Append Inner IPs Check ${actions} ${CLIENT_IP} ${SAME_WEBSERVER_IP} - Append Proto Check ${actions} 1 - Append Out Port Check ${actions} 8 - + Append Proto Check ${actions} 1 + Append Out Port Check ${actions} 8 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 2 Same switch, ICMP reply ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of ICMP reply from h35_8 to h36_6 + [Documentation] Assert matches and actions on megaflow of ICMP reply from h35_8 to h36_6 [Tags] tenant2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append In Port Check ${matches} 8 + Append In Port Check ${matches} 8 Append Inner MAC Check ${matches} src_addr=${SAME_WEBSERVER_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${SAME_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${matches} 1 - + Append Proto Check ${matches} 1 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC} Append Inner IPs Check ${actions} ${SAME_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${actions} 1 - Append Out Port Check ${actions} 6 - + Append Proto Check ${actions} 1 + Append Out Port Check ${actions} 6 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 2 Same switch, stop endless ping from h35_8 to h36_6 - [Tags] tenant2 [Documentation] Stops endless pinging from h35_8 to h36_6 when traffic inspection finishes. + [Tags] tenant2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Stop Endless Ping from Docker to Address ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} SSHLibrary.Close Connection - Tenant 2 Different switches, ping once from h35_8 to h36_7 - [Documentation] Different switches (sw1 -> sw3) + [Documentation] Different switches (sw1 -> sw3) [Tags] tenant2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Ping From Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP} SSHLibrary.Close Connection Tenant 2 Different switches, start endless ping from h35_8 to h36_7 - [Documentation] Different switches (sw1 -> sw3) + [Documentation] Different switches (sw1 -> sw3) [Tags] tenant2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Start Endless Ping from Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP} SSHLibrary.Close Connection Tenant 2 Different switches, ICMP request ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of ICMP request from h35_8 to h36_7 + [Documentation] Assert matches and actions on megaflow of ICMP request from h35_8 to h36_7 [Tags] tenant2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append In Port Check ${matches} 6 + Append In Port Check ${matches} 6 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${matches} 1 - - Append Tunnel Set Check ${actions} + Append Proto Check ${matches} 1 + Append Tunnel Set Check ${actions} Append Inner MAC Check ${actions} dst_addr=${DIFF_WEBSERVER_MAC} Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${actions} 1 - Append Out Port Check ${actions} 3 - + Append Proto Check ${actions} 1 + Append Out Port Check ${actions} 3 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 2 Different switches, ICMP request ovs-dpctl output check on sw3 - [Documentation] Assert matches and actions on megaflow of ICMP request from h35_8 to h36_7 + [Documentation] Assert matches and actions on megaflow of ICMP request from h35_8 to h36_7 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append Tunnel Set Check ${matches} + Append Tunnel Set Check ${matches} Append Outer IPs Check ${matches} src_ip=${CLIENT_SWITCH_IP} Append Outer IPs Check ${matches} dst_ip=${DIFF_WEBSERVER_SWITCH_IP} - Append In Port Check ${matches} 3 + Append In Port Check ${matches} 3 Append Inner MAC Check ${matches} dst_addr=${DIFF_WEBSERVER_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${matches} 1 - + Append Proto Check ${matches} 1 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${actions} 1 - Append Out Port Check ${actions} 8 - + Append Proto Check ${actions} 1 + Append Out Port Check ${actions} 8 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 2 Different switches, ICMP reply ovs-dpctl output check on sw3 - [Documentation] Assert matches and actions on megaflow of ICMP request from h36_7 to h35_8 + [Documentation] Assert matches and actions on megaflow of ICMP request from h36_7 to h35_8 [Tags] tenant2 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append In Port Check ${matches} 8 + Append In Port Check ${matches} 8 Append Inner MAC Check ${matches} src_addr=${DIFF_WEBSERVER_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${matches} 1 - - Append Tunnel Set Check ${actions} + Append Proto Check ${matches} 1 + Append Tunnel Set Check ${actions} Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC} Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${actions} 1 - Append Out Port Check ${actions} 3 - + Append Proto Check ${actions} 1 + Append Out Port Check ${actions} 3 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 2 Different switches, ICMP reply ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of ICMP reply from h36_7 to h35_8 + [Documentation] Assert matches and actions on megaflow of ICMP reply from h36_7 to h35_8 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append Tunnel Set Check ${matches} + Append Tunnel Set Check ${matches} Append Outer IPs Check ${matches} src_ip=${DIFF_WEBSERVER_SWITCH_IP} Append Outer IPs Check ${matches} dst_ip=${CLIENT_SWITCH_IP} - Append In Port Check ${matches} 3 + Append In Port Check ${matches} 3 Append Inner MAC Check ${matches} dst_addr=${CLIENT_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${matches} 1 - + Append Proto Check ${matches} 1 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${actions} 1 - Append Out Port Check ${actions} 6 - + Append Proto Check ${actions} 1 + Append Out Port Check ${actions} 6 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 2 Different switches, stop endless ping from h35_8 to h36_7 diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/020_http.robot b/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/020_http.robot index 35c2686261..cf707a78c8 100644 --- a/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/020_http.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/020_http.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Tests for HTTP flow -Force Tags multi-tenant http multi-tenant-main +Force Tags multi-tenant http multi-tenant-main Library SSHLibrary Resource ../../../../../libraries/Utils.robot Resource ../../../../../libraries/GBP/ConnUtils.robot @@ -10,112 +10,98 @@ Variables ../../../../../variables/Variables.py Resource ../Variables.robot *** Variables *** -${timeout} = 10s +${timeout} 10s *** Testcases *** - -# Same subnet tests are not supported by current topology configuration; -# clients and webservers are put in two different subnets - Setting Variables for Tenant 1 [Documentation] Setting variables for test cases related to tenant 1. - Set Test Variables client_switch_ip=${GBP1} client_docker=h35_2 client_ip=10.0.35.2 - ... client_mac=00:00:00:00:35:02 same_webserver_docker=h36_3 same_webserver_ip=10.0.36.3 - ... same_webserver_mac=00:00:00:00:36:03 diff_webserver_switch_ip=${GBP3} - ... diff_webserver_docker=h36_2 diff_webserver_ip=10.0.36.2 - ... diff_webserver_mac=00:00:00:00:36:02 + # Same subnet tests are not supported by current topology configuration; + # clients and webservers are put in two different subnets + Set Test Variables client_switch_ip=${GBP1} client_docker=h35_2 client_ip=10.0.35.2 client_mac=00:00:00:00:35:02 same_webserver_docker=h36_3 same_webserver_ip=10.0.36.3 + ... same_webserver_mac=00:00:00:00:36:03 diff_webserver_switch_ip=${GBP3} diff_webserver_docker=h36_2 diff_webserver_ip=10.0.36.2 diff_webserver_mac=00:00:00:00:36:02 Tenant 1 Same switch, start SimpleHttpServer on h36_3 - [Documentation] Same Switch (sw1) + [Documentation] Same Switch (sw1) [Tags] tenant1 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Start HTTP Service on Docker ${SAME_WEBSERVER_DOCKER} 80 SSHLibrary.Close Connection Tenant 1 Same switch, curl once from h35_2 to h36_3 - [Tags] tenant1 [Documentation] Test HTTP req/rest session between docker located on the same switch. + [Tags] tenant1 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Curl from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} 80 SSHLibrary.Close Connection Tenant 1 Same switch, start endless curl from h35_2 to h36_3 - [Tags] tenant1 [Documentation] Init of endless HTTP session between endpoints so that ... HTTP traffic can be inspected. + [Tags] tenant1 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Start Endless Curl from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} 80 SSHLibrary.Close Connection Tenant 1 Same switch, HTTP request ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of HTTP request from h35_2 to h36_3 + [Documentation] Assert matches and actions on megaflow of HTTP request from h35_2 to h36_3 [Tags] tenant1 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append In Port Check ${matches} 4 + Append In Port Check ${matches} 4 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${CLIENT_IP} ${SAME_WEBSERVER_IP} - Append Proto Check ${matches} 6 - + Append Proto Check ${matches} 6 Append Inner MAC Check ${actions} dst_addr=${SAME_WEBSERVER_MAC} Append Inner IPs Check ${actions} ${CLIENT_IP} ${SAME_WEBSERVER_IP} - Append Proto Check ${actions} 6 - Append Out Port Check ${actions} 7 - + Append Proto Check ${actions} 6 + Append Out Port Check ${actions} 7 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 1 Same switch, HTTP reply ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of HTTP request from h36_3 to h35_2 + [Documentation] Assert matches and actions on megaflow of HTTP request from h36_3 to h35_2 [Tags] tenant1 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append In Port Check ${matches} 7 + Append In Port Check ${matches} 7 Append Inner MAC Check ${matches} src_addr=${SAME_WEBSERVER_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${SAME_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${matches} 6 - + Append Proto Check ${matches} 6 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC} Append Inner IPs Check ${actions} ${SAME_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${actions} 6 - Append Out Port Check ${actions} 4 - + Append Proto Check ${actions} 6 + Append Out Port Check ${actions} 4 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 1 Same switch, stop endless curl from h35_2 to h36_3 - [Tags] tenant1 [Documentation] Stopping endless HTTP session after traffic inspection is done. + [Tags] tenant1 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Stop Endless Curl from Docker ${CLIENT_DOCKER} SSHLibrary.Close Connection Tenant 1 Same switch, stop SimpleHttpServer on h36_3 - [Tags] tenant1 [Documentation] Stoping HTTP service on docker container. + [Tags] tenant1 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Stop HTTP Service on Docker ${SAME_WEBSERVER_DOCKER} SSHLibrary.Close Connection - Tenant 1 Different switches, start SimpleHttpServer on h36_2 - [Documentation] Different switches (sw1 -> sw3) + [Documentation] Different switches (sw1 -> sw3) [Tags] tenant1 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout} DockerUtils.Start HTTP Service on Docker ${DIFF_WEBSERVER_DOCKER} 80 SSHLibrary.Close Connection Tenant 1 Different switches, curl once from h35_2 to h36_2 - [Tags] tenant1 [Documentation] Test HTTP req/resp between endpoints located on different switches. + [Tags] tenant1 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Curl from Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP} 80 SSHLibrary.Close Connection @@ -127,331 +113,283 @@ Tenant 1 Different switches, start endless curl from h35_2 to h36_2 SSHLibrary.Close Connection Tenant 1 Different switches, HTTP request ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of HTTP request from h35_2 to h36_2 + [Documentation] Assert matches and actions on megaflow of HTTP request from h35_2 to h36_2 [Tags] tenant1 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - - Append In Port Check ${matches} 4 + Append In Port Check ${matches} 4 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${matches} 6 - - Append Tunnel Set Check ${actions} + Append Proto Check ${matches} 6 + Append Tunnel Set Check ${actions} Append Inner MAC Check ${actions} dst_addr=${DIFF_WEBSERVER_MAC} Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${actions} 6 - Append Out Port Check ${actions} 3 - + Append Proto Check ${actions} 6 + Append Out Port Check ${actions} 3 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 1 Different switches, HTTP request ovs-dpctl output check on sw3 - [Documentation] Assert matches and actions on megaflow of HTTP request from h35_2 to h36_2 + [Documentation] Assert matches and actions on megaflow of HTTP request from h35_2 to h36_2 [Tags] tenant1 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append Tunnel Set Check ${matches} + Append Tunnel Set Check ${matches} Append Outer IPs Check ${matches} src_ip=${CLIENT_SWITCH_IP} Append Outer IPs Check ${matches} dst_ip=${DIFF_WEBSERVER_SWITCH_IP} - Append In Port Check ${matches} 3 + Append In Port Check ${matches} 3 Append Inner MAC Check ${matches} dst_addr=${DIFF_WEBSERVER_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${matches} 6 - + Append Proto Check ${matches} 6 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${actions} 6 - Append Out Port Check ${actions} 6 - + Append Proto Check ${actions} 6 + Append Out Port Check ${actions} 6 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 1 Different switches, HTTP reply ovs-dpctl output check on sw3 - [Documentation] Assert matches and actions on megaflow of HTTP request from h36_2 to h35_2 + [Documentation] Assert matches and actions on megaflow of HTTP request from h36_2 to h35_2 [Tags] tenant1 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - - Append In Port Check ${matches} 6 + Append In Port Check ${matches} 6 Append Inner MAC Check ${matches} src_addr=${DIFF_WEBSERVER_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${matches} 6 - - Append Tunnel Set Check ${actions} + Append Proto Check ${matches} 6 + Append Tunnel Set Check ${actions} Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC} Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${actions} 6 - Append Out Port Check ${actions} 3 - + Append Proto Check ${actions} 6 + Append Out Port Check ${actions} 3 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 1 Different switches, HTTP reply ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of HTTP request from h36_2 to h35_2 + [Documentation] Assert matches and actions on megaflow of HTTP request from h36_2 to h35_2 [Tags] tenant1 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append Tunnel Set Check ${matches} + Append Tunnel Set Check ${matches} Append Outer IPs Check ${matches} src_ip=${DIFF_WEBSERVER_SWITCH_IP} Append Outer IPs Check ${matches} dst_ip=${CLIENT_SWITCH_IP} - Append In Port Check ${matches} 3 + Append In Port Check ${matches} 3 Append Inner MAC Check ${matches} dst_addr=${CLIENT_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${matches} 6 - + Append Proto Check ${matches} 6 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${actions} 6 - Append Out Port Check ${actions} 4 - + Append Proto Check ${actions} 6 + Append Out Port Check ${actions} 4 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 1 Different switches, stop endless curl from h35_2 to h36_2 - [Tags] tenant1 [Documentation] Stopping endless HTTP session when traffic inspection finishes. + [Tags] tenant1 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Stop Endless Curl from Docker ${CLIENT_DOCKER} SSHLibrary.Close Connection Tenant 1 Different switches, stop SimpleHttpServer on h36_2 - [Tags] tenant1 [Documentation] Terminating HTTP service on docker container. + [Tags] tenant1 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout} DockerUtils.Stop HTTP Service on Docker ${DIFF_WEBSERVER_DOCKER} SSHLibrary.Close Connection - Setting Variables For Tenant 2 [Documentation] Setting variables for test cases related to tenant 1. - Set Test Variables client_switch_ip=${GBP1} client_docker=h35_8 client_ip=10.0.35.8 - ... client_mac=00:00:00:00:35:08 same_webserver_docker=h36_6 same_webserver_ip=10.0.36.6 - ... same_webserver_mac=00:00:00:00:36:06 diff_webserver_switch_ip=${GBP2} - ... diff_webserver_docker=h36_7 diff_webserver_ip=10.0.36.7 - ... diff_webserver_mac=00:00:00:00:36:07 + Set Test Variables client_switch_ip=${GBP1} client_docker=h35_8 client_ip=10.0.35.8 client_mac=00:00:00:00:35:08 same_webserver_docker=h36_6 same_webserver_ip=10.0.36.6 + ... same_webserver_mac=00:00:00:00:36:06 diff_webserver_switch_ip=${GBP2} diff_webserver_docker=h36_7 diff_webserver_ip=10.0.36.7 diff_webserver_mac=00:00:00:00:36:07 Tenant 2 Same switch, start SimpleHttpServer on h36_6 - [Documentation] Same Switch (sw1) + [Documentation] Same Switch (sw1) [Tags] tenant2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Start HTTP Service on Docker ${SAME_WEBSERVER_DOCKER} 80 SSHLibrary.Close Connection Tenant 2 Same switch, curl once from h35_8 to h36_6 - [Tags] tenant1 [Documentation] Test HTTP req/resp between endpoints on the same switch. + [Tags] tenant1 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Curl from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} 80 SSHLibrary.Close Connection Tenant 2 Same switch, start endless curl from h35_8 to h36_6 - [Tags] tenant2 [Documentation] Init if endless HTTP Session between endpoints on the same switch. + [Tags] tenant2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Start Endless Curl from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} 80 SSHLibrary.Close Connection Tenant 2 Same switch, HTTP request ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of HTTP request from h35_8 to h36_6 + [Documentation] Assert matches and actions on megaflow of HTTP request from h35_8 to h36_6 [Tags] tenant2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append In Port Check ${matches} 6 + Append In Port Check ${matches} 6 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${CLIENT_IP} ${SAME_WEBSERVER_IP} - Append Proto Check ${matches} 6 - + Append Proto Check ${matches} 6 Append Inner MAC Check ${actions} dst_addr=${SAME_WEBSERVER_MAC} Append Inner IPs Check ${actions} ${CLIENT_IP} ${SAME_WEBSERVER_IP} - Append Proto Check ${actions} 6 - Append Out Port Check ${actions} 8 - + Append Proto Check ${actions} 6 + Append Out Port Check ${actions} 8 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 2 Same switch, HTTP reply ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of HTTP request from h36_6 to h35_8 + [Documentation] Assert matches and actions on megaflow of HTTP request from h36_6 to h35_8 [Tags] tenant2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append In Port Check ${matches} 8 + Append In Port Check ${matches} 8 Append Inner MAC Check ${matches} src_addr=${SAME_WEBSERVER_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${SAME_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${matches} 6 - + Append Proto Check ${matches} 6 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC} Append Inner IPs Check ${actions} ${SAME_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${actions} 6 - Append Out Port Check ${actions} 6 - + Append Proto Check ${actions} 6 + Append Out Port Check ${actions} 6 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 2 Same switch, stop endless curl from h35_8 to h36_6 - [Tags] tenant2 [Documentation] Terminating endless HTTP session after traffic inspection is done. + [Tags] tenant2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Stop Endless Curl from Docker ${CLIENT_DOCKER} SSHLibrary.Close Connection Tenant 2 Same switch, stop SimpleHttpServer on h36_6 - [Tags] tenant2 [Documentation] Stoping HTTP service on serving docker container. + [Tags] tenant2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Stop HTTP Service on Docker ${SAME_WEBSERVER_DOCKER} SSHLibrary.Close Connection Tenant 2 Different switches, start SimpleHttpServer on h36_7 - [Documentation] Different switches (sw1 -> sw3) + [Documentation] Different switches (sw1 -> sw3) [Tags] tenant2 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout} DockerUtils.Start HTTP Service on Docker ${DIFF_WEBSERVER_DOCKER} 80 SSHLibrary.Close Connection Tenant 2 Different switches, curl once from h35_8 to h36_7 - [Tags] tenant2 [Documentation] Test HTTP req/resp between endpoints located on different switches. + [Tags] tenant2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Curl from Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP} 80 SSHLibrary.Close Connection Tenant 2 Different switches, start endless curl from h35_8 to h36_7 - [Tags] tenant2 [Documentation] Starting endless HTTP session so that the traffic can be inspected. + [Tags] tenant2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Start Endless Curl from Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP} 80 SSHLibrary.Close Connection Tenant 2 Different switches, HTTP request ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of HTTP request from h35_8 to h36_7 + [Documentation] Assert matches and actions on megaflow of HTTP request from h35_8 to h36_7 [Tags] tenant2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - - Append In Port Check ${matches} 6 + Append In Port Check ${matches} 6 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${matches} 6 - - Append Tunnel Set Check ${actions} + Append Proto Check ${matches} 6 + Append Tunnel Set Check ${actions} Append Inner MAC Check ${actions} dst_addr=${DIFF_WEBSERVER_MAC} Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${actions} 6 - Append Out Port Check ${actions} 3 - + Append Proto Check ${actions} 6 + Append Out Port Check ${actions} 3 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 2 Different switches, HTTP request ovs-dpctl output check on sw3 - [Documentation] Assert matches and actions on megaflow of HTTP request from h35_8 to h36_7 + [Documentation] Assert matches and actions on megaflow of HTTP request from h35_8 to h36_7 [Tags] tenant1 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append Tunnel Set Check ${matches} + Append Tunnel Set Check ${matches} Append Outer IPs Check ${matches} src_ip=${CLIENT_SWITCH_IP} Append Outer IPs Check ${matches} dst_ip=${DIFF_WEBSERVER_SWITCH_IP} - Append In Port Check ${matches} 3 + Append In Port Check ${matches} 3 Append Inner MAC Check ${matches} dst_addr=${DIFF_WEBSERVER_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${matches} 6 - + Append Proto Check ${matches} 6 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP} - Append Proto Check ${actions} 6 - Append Out Port Check ${actions} 8 - + Append Proto Check ${actions} 6 + Append Out Port Check ${actions} 8 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 2 Different switches, HTTP reply ovs-dpctl output check on sw3 - [Documentation] Assert matches and actions on megaflow of HTTP request from h36_7 to h35_8 + [Documentation] Assert matches and actions on megaflow of HTTP request from h36_7 to h35_8 [Tags] tenant2 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - - Append In Port Check ${matches} 8 + Append In Port Check ${matches} 8 Append Inner MAC Check ${matches} src_addr=${DIFF_WEBSERVER_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${matches} 6 - - Append Tunnel Set Check ${actions} + Append Proto Check ${matches} 6 + Append Tunnel Set Check ${actions} Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC} Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${actions} 6 - Append Out Port Check ${actions} 3 - + Append Proto Check ${actions} 6 + Append Out Port Check ${actions} 3 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 2 Different switches, HTTP reply ovs-dpctl output check on sw1 - [Documentation] Assert matches and actions on megaflow of HTTP reply from h36_7 to h35_8 + [Documentation] Assert matches and actions on megaflow of HTTP reply from h36_7 to h35_8 [Tags] tenant2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} - @{matches} Create List @{actions} Create List - Append Tunnel Set Check ${matches} + Append Tunnel Set Check ${matches} Append Outer IPs Check ${matches} src_ip=${DIFF_WEBSERVER_SWITCH_IP} Append Outer IPs Check ${matches} dst_ip=${CLIENT_SWITCH_IP} - Append In Port Check ${matches} 3 + Append In Port Check ${matches} 3 Append Inner MAC Check ${matches} dst_addr=${CLIENT_MAC} - Append Ether-Type Check ${matches} 0x0800 + Append Ether-Type Check ${matches} 0x0800 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${matches} 6 - + Append Proto Check ${matches} 6 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP} - Append Proto Check ${actions} 6 - Append Out Port Check ${actions} 6 - + Append Proto Check ${actions} 6 + Append Out Port Check ${actions} 6 ${output} Find Flow in DPCTL Output ${matches} ${actions} - SSHLibrary.Close Connection Tenant 2 Different switches, stop endless curl from h35_8 to h36_7 - [Tags] tenant2 [Documentation] Terminanting endless HTTP session after traffic inspection ... finishes. + [Tags] tenant2 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout} DockerUtils.Stop Endless Curl from Docker ${CLIENT_DOCKER} SSHLibrary.Close Connection Tenant 2 Different switches, stop SimpleHttpServer on h36_7 - [Tags] tenant2 [Documentation] Stopping HTTP service on docker container. + [Tags] tenant2 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout} DockerUtils.Stop HTTP Service on Docker ${DIFF_WEBSERVER_DOCKER} SSHLibrary.Close Connection diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/998_clean_odl.robot b/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/998_clean_odl.robot index bbd7dba370..54ad3ef314 100644 --- a/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/998_clean_odl.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/998_clean_odl.robot @@ -1,8 +1,8 @@ *** Settings *** Documentation Test suite for cleaning up / unregister infrastructure constructs like endpoints for demo-asymmetric-chain -Default Tags multi-tenant teardown multi-tenant-teardown Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} Suite Teardown Delete All Sessions +Default Tags multi-tenant teardown multi-tenant-teardown Library RequestsLibrary Library OperatingSystem Library json @@ -11,11 +11,9 @@ Resource ../../../../../libraries/Utils.robot Resource ../../../../../libraries/GBP/RestconfUtils.robot Resource ../Variables.robot - *** Variables *** *** Test Cases *** - Delete Tenants [Documentation] Delete Tenants from ODL Remove All Elements At URI ${TENANT1_PATH} diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/999_teardown.robot b/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/999_teardown.robot index 52dab7a43c..f9c8d0ebca 100755 --- a/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/999_teardown.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/999_teardown.robot @@ -7,13 +7,11 @@ Variables ../../../../../variables/Variables.py Resource ../Variables.robot Resource ../GBP_3node.robot - *** Variables *** -${timeout} = 10s - +${timeout} 10s *** Test Cases *** Teardown Suite Log Teardown suite in gbp1 - :FOR ${GBP} IN @{GBPs} + : FOR ${GBP} IN @{GBPs} \ GBP_3node.Teardown Node ${GBP} ${CURDIR} timeout=${timeout}