From: Tomas Cechvala Date: Tue, 16 Feb 2016 14:13:39 +0000 (+0100) Subject: Adding test cases for GBP-SFC integration demo X-Git-Tag: release/beryllium-sr1~94 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=integration%2Ftest.git;a=commitdiff_plain;h=18dca374846b169c4852f0a7ea33046487a2207f Adding test cases for GBP-SFC integration demo Symmetric test scenario. Change-Id: I5b6487246d5da2904f585db4d6e80ca806eda294 Signed-off-by: Tomas Cechvala --- diff --git a/csit/libraries/Utils.robot b/csit/libraries/Utils.robot index 0d6f09ec2b..038989d445 100644 --- a/csit/libraries/Utils.robot +++ b/csit/libraries/Utils.robot @@ -336,6 +336,21 @@ Add Elements To URI From File ${resp} RequestsLibrary.Put Request session ${dest_uri} data=${body} headers=${headers} Should Be Equal As Strings ${resp.status_code} 200 +Add Elements To URI From File And Verify + [Arguments] ${dest_uri} ${data_file} ${headers}=${headers} + ${body} OperatingSystem.Get File ${data_file} + ${resp} RequestsLibrary.Put Request session ${dest_uri} data=${body} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + ${resp} RequestsLibrary.Get Request session ${dest_uri} + Should Not Be Equal ${resp.status_code} 404 + +Add Elements To URI And Verify + [Arguments] ${dest_uri} ${data_file} ${headers}=${headers} + ${resp} RequestsLibrary.Put Request session ${dest_uri} ${data_file} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + ${resp} RequestsLibrary.Get Request session ${dest_uri} + Should Not Be Equal ${resp.status_code} 404 + Post Elements To URI From File [Arguments] ${dest_uri} ${data_file} ${headers}=${headers} ${body} OperatingSystem.Get File ${data_file} diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/000_setup.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/000_setup.robot new file mode 100644 index 0000000000..7f08c82414 --- /dev/null +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/000_setup.robot @@ -0,0 +1,7 @@ +*** Settings *** +Resource ../Variables.robot +Resource ../GBPSFC_6node.robot + +*** Test Cases *** +Initialize Nodes + Setup Nodes ${GBPSFCs} ${CURDIR}/init_scripts diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/005_wait_for_connections.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/005_wait_for_connections.robot new file mode 100644 index 0000000000..b76169e37b --- /dev/null +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/005_wait_for_connections.robot @@ -0,0 +1,19 @@ +*** Settings *** +Documentation Waiting for manager and switch connections. +Library SSHLibrary +Resource ../../../../../libraries/GBP/ConnUtils.robot +Resource ../../../../../libraries/GBP/OpenFlowUtils.robot +Resource ../Variables.robot +Resource ../Connections.robot +Suite Setup Start Connections +Suite Teardown Close Connections + +*** Testcases *** + +Wait For Manager Connected on GBPSFC2 + Switch Connection GPSFC2_CONNECTION + Wait Until Keyword Succeeds 2 min 3s Manager is Connected + +Wait For Manager Connected on GBPSFC4 + Switch Connection GPSFC4_CONNECTION + Wait Until Keyword Succeeds 4x 5s Manager is Connected diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/010_set_odl.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/010_set_odl.robot new file mode 100644 index 0000000000..ea59ffbfe6 --- /dev/null +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/010_set_odl.robot @@ -0,0 +1,67 @@ +*** Settings *** +Documentation Test suite for setting up infrastructure for demo-symmetric-chain +Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} +Suite Teardown Delete All Sessions +Library RequestsLibrary +Library OperatingSystem +Variables ../../../../../variables/Variables.py +Resource ../../../../../libraries/Utils.robot +Resource ../Variables.robot +Resource ../../../../../libraries/GBP/OpenFlowUtils.robot + +*** Test Cases *** +Put Service Functions + [Documentation] Register Service Functions to ODL + ${json_to_edit} OperatingSystem.Get File ${SF_FILE} + ${edited_json} Replace String ${json_to_edit} _SF1 ${GBPSFC3} + ${edited_json} Replace String ${edited_json} _SF2 ${GBPSFC5} + Add Elements To URI And Verify ${SF_PATH} ${edited_json} ${HEADERS_YANG_JSON} + +Put Service Function Forwarders + [Documentation] Register Service Function Forwarders to ODL + ${json_to_edit} OperatingSystem.Get File ${SFF_FILE} + ${edited_json} Replace String ${json_to_edit} _SFF1 ${GBPSFC2} + ${edited_json} Replace String ${edited_json} _SFF2 ${GBPSFC4} + Add Elements To URI And Verify ${SFF_PATH} ${edited_json} ${HEADERS_YANG_JSON} + + +Wait For Manager and Switch Connected on GBPSFC2 + [Documentation] Making sure that manager is connected for further processing. + SSHLibrary.Open Connection ${GBPSFC2} + Utils.Flexible Mininet Login + Wait Until Keyword Succeeds 2min 3s Manager and Switch Connected sw_name=sw2 + SSHLibrary.Close Connection + +Wait For Manager and Switch Connected on GBPSFC4 + [Documentation] Making sure that manager is connected for further processing. + SSHLibrary.Open Connection ${GBPSFC4} + Utils.Flexible Mininet Login + Wait Until Keyword Succeeds 2min 3s Manager and Switch Connected sw_name=sw4 + SSHLibrary.Close Connection + +Put Service Function Chains + [Documentation] Register Service Function Chains to ODL + Add Elements To URI From File And Verify ${SFC_PATH} ${SFC_SYMM_FILE} ${HEADERS_YANG_JSON} + +Put Service Function Paths + [Documentation] Register Service Function Paths to ODL + Add Elements To URI From File And Verify ${SFP_PATH} ${SFP_SYMM_FILE} ${HEADERS_YANG_JSON} + +Put Tunnels + [Documentation] Send tunnel augmentation to ODL + ${json_to_edit} OperatingSystem.Get File ${TUNNELS_FILE} + ${edited_json} Replace String ${json_to_edit} _CLASSIFIER1 ${GBPSFC1} + ${edited_json} Replace String ${edited_json} _CLASSIFIER2 ${GBPSFC6} + Add Elements To URI And Verify ${TUNNELS_PATH} ${edited_json} ${HEADERS_YANG_JSON} + +Put Tenant + [Documentation] Send Tenant Data to ODL + Add Elements To URI From File And Verify ${TENANT_PATH} ${TENANT_SYMM_FILE} ${HEADERS_YANG_JSON} + +Register Endpoints + [Documentation] Endpoints registration + @{endpoint_files} = OperatingSystem.List Files In Directory ${ENDPOINTS_SYMM_DIR} vethl*.*json absolute + :FOR ${endpoint_file} IN @{endpoint_files} + \ Post Elements To URI From File ${ENDPOINT_REG_PATH} ${endpoint_file} ${HEADERS_YANG_JSON} + ${resp} RequestsLibrary.Get Request session ${ENDPOINTS_OPER_PATH} + Log ${resp.content} \ No newline at end of file diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/015_wait_for_flows.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/015_wait_for_flows.robot new file mode 100644 index 0000000000..6011f49384 --- /dev/null +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/015_wait_for_flows.robot @@ -0,0 +1,45 @@ +*** Settings *** +Documentation Documentation Waiting for flows to appear on switches. +Library SSHLibrary +Resource ../../../../../libraries/Utils.robot +Resource ../../../../../libraries/GBP/ConnUtils.robot +Resource ../../../../../libraries/GBP/DockerUtils.robot +Resource ../../../../../libraries/GBP/OpenFlowUtils.robot +Variables ../../../../../variables/Variables.py +Resource ../Variables.robot +Resource ../Connections.robot +Suite Setup Start Connections +Suite Teardown Close Connections + +*** Testcases *** + +Wait For Flows on GBPSFC1 + [Documentation] Waiting for flows to appear on OVS switch. + Switch Connection GPSFC1_CONNECTION + Wait For Flows On Switch ${GBPSFC1} sw1 + +Wait For Flows on GBPSFC2 + [Documentation] Waiting for flows to appear on OVS switch. + Switch Connection GPSFC2_CONNECTION + Wait For Flows On Switch ${GBPSFC2} sw2 + +Wait For Flows on GBPSFC3 + [Documentation] Waiting for flows to appear on OVS switch. + Switch Connection GPSFC3_CONNECTION + Wait For Flows On Switch ${GBPSFC3} sw3 + +Wait For Flows on GBPSFC4 + [Documentation] Waiting for flows to appear on OVS switch. + Switch Connection GPSFC4_CONNECTION + Wait For Flows On Switch ${GBPSFC4} sw4 + +Wait For Flows on GBPSFC5 + [Documentation] Waiting for flows to appear on OVS switch. + Switch Connection GPSFC5_CONNECTION + Wait For Flows On Switch ${GBPSFC5} sw5 + +Wait For Flows on GBPSFC6 + [Documentation] Waiting for flows to appear on OVS switch. + Switch Connection GPSFC6_CONNECTION + Wait For Flows On Switch ${GBPSFC6} sw6 + diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/031_track_icmp_h35_2_h36_2.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/031_track_icmp_h35_2_h36_2.robot new file mode 100644 index 0000000000..c9aafcc711 --- /dev/null +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/031_track_icmp_h35_2_h36_2.robot @@ -0,0 +1,43 @@ +*** Settings *** +Documentation Deep icmp traffic inspection. +... Nodes are located on the same VM in different subnets and are members of the same EPG. +Library SSHLibrary +Resource ../../../../../libraries/GBP/OpenFlowUtils.robot +Resource ../Variables.robot +Resource ../Connections.robot +Suite Setup Start Connections +Suite Teardown Close Connections + +*** Variables *** + +*** Testcases *** + +Ping Once from h35_2 to h36_2 + [Documentation] Test icmp request. + Set Test Variables client_name=h35_2 client_ip=10.0.35.2 server_name=h36_2 server_ip=10.0.36.2 + ... ether_type=0x0800 proto=1 + Switch Connection GPSFC1_CONNECTION + Ping from Docker ${CLIENT_NAME} ${SERVER_IP} + +Start Endless Ping from h35_2 to h36_2 + [Documentation] Starting of endless pinging for traffic inspection. + Start Endless Ping from Docker ${CLIENT_NAME} ${SERVER_IP} + +Find ICMP Req from h35_2 to h36_2 on GBPSFC6 + [Documentation] Inspecting icmp req on GBPSFC1. + Switch Connection GPSFC1_CONNECTION + ${flow} Inspect Classifier Outbound in_port=4 out_port=6 eth_type=${ETHER_TYPE} inner_src_ip=${CLIENT_IP} + ... inner_dst_ip=${SERVER_IP} proto=${PROTO} + +Find ICMP Resp from h36_2 to h35_2 on GBPSFC6 + [Documentation] Inspecting icmp resp on GBPSFC1. + Switch Connection GPSFC1_CONNECTION + ${flow} Inspect Classifier Outbound in_port=6 out_port=4 eth_type=${ETHER_TYPE} inner_src_ip=${SERVER_IP} + ... inner_dst_ip=${CLIENT_IP} proto=${PROTO} + +Stop Endless Ping from h35_2 to h36_2 + [Documentation] Stoping of endless pinging after traffic inspection finishes. + Switch Connection GPSFC1_CONNECTION + Stop Endless Ping from Docker to Address ${CLIENT_NAME} ${SERVER_IP} + + diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/032_track_icmp_h35_2_h35_3.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/032_track_icmp_h35_2_h35_3.robot new file mode 100644 index 0000000000..8722c8e2ea --- /dev/null +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/032_track_icmp_h35_2_h35_3.robot @@ -0,0 +1,43 @@ +*** Settings *** +Documentation Deep icmp traffic inspection. +... Nodes are located on the same VM in the same subnet and are members of the same EPG. +Library SSHLibrary +Resource ../../../../../libraries/GBP/OpenFlowUtils.robot +Resource ../Variables.robot +Resource ../Connections.robot +Suite Setup Start Connections +Suite Teardown Close Connections + +*** Variables *** + +*** Testcases *** + +Ping Once from h35_2 to h35_3 + [Documentation] Test icmp request. + Set Test Variables client_name=h35_2 client_ip=10.0.35.2 server_name=h35_3 server_ip=10.0.35.3 + ... ether_type=0x0800 proto=1 + Switch Connection GPSFC1_CONNECTION + Ping from Docker ${CLIENT_NAME} ${SERVER_IP} + +Start Endless Ping from h35_2 to h35_3 + [Documentation] Starting of endless pinging for traffic inspection. + Start Endless Ping from Docker ${CLIENT_NAME} ${SERVER_IP} + +Find ICMP Req from h35_2 to h35_3 on GBPSFC6 + [Documentation] Inspecting icmp req on GBPSFC1. + Switch Connection GPSFC1_CONNECTION + ${flow} Inspect Classifier Outbound in_port=4 out_port=5 eth_type=${ETHER_TYPE} inner_src_ip=${CLIENT_IP} + ... inner_dst_ip=${SERVER_IP} proto=${PROTO} + +Find ICMP Resp from h35_3 to h35_2 on GBPSFC6 + [Documentation] Inspecting icmp resp on GBPSFC1. + Switch Connection GPSFC1_CONNECTION + ${flow} Inspect Classifier Outbound in_port=5 out_port=4 eth_type=${ETHER_TYPE} inner_src_ip=${SERVER_IP} + ... inner_dst_ip=${CLIENT_IP} proto=${PROTO} + +Stop Endless Ping from h35_2 to h35_3 + [Documentation] Stoping of endless pinging after traffic inspection finishes. + Switch Connection GPSFC1_CONNECTION + Stop Endless Ping from Docker to Address ${CLIENT_NAME} ${SERVER_IP} + + diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/033_track_icmp_h35_4_h36_4.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/033_track_icmp_h35_4_h36_4.robot new file mode 100644 index 0000000000..5e35a18981 --- /dev/null +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/033_track_icmp_h35_4_h36_4.robot @@ -0,0 +1,43 @@ +*** Settings *** +Documentation Deep icmp traffic inspection. +... Nodes are located on the same VM, in different subnets and are members of the same EPG. +Library SSHLibrary +Resource ../../../../../libraries/GBP/OpenFlowUtils.robot +Resource ../Variables.robot +Resource ../Connections.robot +Suite Setup Start Connections +Suite Teardown Close Connections + +*** Variables *** + +*** Testcases *** + +Ping from h36_4 to h35_4 + [Documentation] Test icmp request. + Set Test Variables client_name=h36_4 client_ip=10.0.36.4 server_name=h35_4 server_ip=10.0.35.4 + ... ether_type=0x0800 proto=1 + Switch Connection GPSFC6_CONNECTION + Ping from Docker ${CLIENT_NAME} ${SERVER_IP} + +Start Endless Ping from h36_4 to h35_4 + [Documentation] Starting of endless pinging for traffic inspection. + Start Endless Ping from Docker ${CLIENT_NAME} ${SERVER_IP} + +Find ICMP Req from h36_4 to h35_4 on GBPSFC6 + [Documentation] Inspecting icmp req on GBPSFC6. + Switch Connection GPSFC6_CONNECTION + ${flow} Inspect Classifier Outbound in_port=6 out_port=4 eth_type=0x0800 inner_src_ip=${CLIENT_IP} + ... inner_dst_ip=${SERVER_IP} proto=${PROTO} + +Find ICMP Resp from h35_4 to h36_4 on GBPSFC6 + [Documentation] Inspecting icmp resp on GBPSFC6. + Switch Connection GPSFC6_CONNECTION + ${flow} Inspect Classifier Outbound in_port=4 out_port=6 eth_type=0x0800 inner_src_ip=${SERVER_IP} + ... inner_dst_ip=${CLIENT_IP} proto=${PROTO} + +Stop Endless Ping from h36_4 to h35_4 + [Documentation] Stoping of endless pinging after traffic inspection finishes. + Switch Connection GPSFC6_CONNECTION + Stop Endless Ping from Docker to Address ${CLIENT_NAME} ${SERVER_IP} + + diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/034_track_icmp_h36_5_h35_2.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/034_track_icmp_h36_5_h35_2.robot new file mode 100644 index 0000000000..74b64122f2 --- /dev/null +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/034_track_icmp_h36_5_h35_2.robot @@ -0,0 +1,55 @@ +*** Settings *** +Documentation Deep icmp traffic inspection. +... Nodes are located on different VMs in different subnets and are members of different EPGs. +Library SSHLibrary +Resource ../../../../../libraries/GBP/OpenFlowUtils.robot +Resource ../Variables.robot +Resource ../Connections.robot +Suite Setup Start Connections +Suite Teardown Close Connections + +*** Variables *** + +*** Testcases *** + +Ping from h36_5 to h35_2 + [Documentation] Test icmp request. + Set Test Variables client_name=h36_5 client_ip=10.0.36.5 server_name=h35_2 server_ip=10.0.35.2 + ... ether_type=0x0800 proto=1 vxlan_port=3 + Switch Connection GPSFC6_CONNECTION + Ping from Docker ${CLIENT_NAME} ${SERVER_IP} + +Start Endless Ping from h36_5 to h35_2 + [Documentation] Starting of endless pinging for traffic inspection. + Start Endless Ping from Docker ${CLIENT_NAME} ${SERVER_IP} + +Find ICMP Req from h36_5 to h35_2 on GBPSFC6 + [Documentation] Inspecting icmp req on GBPSFC6. + Switch Connection GPSFC6_CONNECTION + ${flow} Inspect Classifier Outbound in_port=7 out_port=${VXLAN_PORT} eth_type=${ETHER_TYPE} inner_src_ip=${CLIENT_IP} + ... inner_dst_ip=${SERVER_IP} next_hop_ip=${GBPSFC1} proto=${PROTO} + +Find ICMP Req from h36_5 to h35_2 on GBPSFC1 + [Documentation] Inspecting icmp req on GBPSFC1. + Switch Connection GPSFC1_CONNECTION + Inspect Classifier Inbound in_port=${VXLAN_PORT} out_port=4 eth_type=${ETHER_TYPE} inner_src_ip=${CLIENT_IP} inner_dst_ip=${SERVER_IP} + ... outer_src_ip=${GBPSFC6} outer_dst_ip=${GBPSFC1} proto=${PROTO} + +Find ICMP Resp from h35_2 to h36_5 on GBPSFC1 + [Documentation] Inspecting icmp resp on GBPSFC1. + Switch Connection GPSFC1_CONNECTION + ${flow} Inspect Classifier Outbound in_port=4 out_port=${VXLAN_PORT} eth_type=${ETHER_TYPE} inner_src_ip=${SERVER_IP} + ... inner_dst_ip=${CLIENT_IP} next_hop_ip=${GBPSFC6} proto=${PROTO} + +Find ICMP Resp from h35_2 to h36_5 on GBPSFC6 + [Documentation] Inspecting icmp resp on GBPSFC6. + Switch Connection GPSFC6_CONNECTION + Inspect Classifier Inbound in_port=${VXLAN_PORT} out_port=7 eth_type=${ETHER_TYPE} inner_src_ip=${SERVER_IP} inner_dst_ip=${CLIENT_IP} + ... outer_src_ip=${GBPSFC1} outer_dst_ip=${GBPSFC6} proto=${PROTO} + +Stop Endless Ping from h36_5 to h35_2 + [Documentation] Stoping of endless pinging after traffic inspection finishes. + Switch Connection GPSFC6_CONNECTION + Stop Endless Ping from Docker to Address ${CLIENT_NAME} ${SERVER_IP} + + diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/035_track_curl_h35_2_h36_2.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/035_track_curl_h35_2_h36_2.robot new file mode 100644 index 0000000000..41cfbe63e1 --- /dev/null +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/035_track_curl_h35_2_h36_2.robot @@ -0,0 +1,142 @@ +*** Settings *** +Documentation Deep inspection of HTTP traffic on symmetric chain. +... Nodes are located on the same VM. +Library SSHLibrary +Resource ../../../../../libraries/GBP/OpenFlowUtils.robot +Resource ../Variables.robot +Resource ../Connections.robot +Suite Setup Start Connections +Suite Teardown Close Connections + +*** Variables *** + +*** Testcases *** + +Start HTTP on h36_2 on Port 80 + [Documentation] Starting HTTP service on docker container. + Set Test Variables client_name=h35_2 client_ip=10.0.35.2 server_name=h36_2 server_ip=10.0.36.2 + ... service_port=80 ether_type=0x0800 proto=6 vxlan_gpe_port=2 + Switch Connection GPSFC1_CONNECTION + Start HTTP Service on Docker ${SERVER_NAME} ${SERVICE_PORT} + +Curl h36_2 from h35_2 + [Documentation] Test HTTP request from a docker container to serving docker container. + Curl from Docker ${CLIENT_NAME} ${SERVER_IP} service_port=${SERVICE_PORT} + +Start Endless Curl on h35_2 on port 80 + [Documentation] Starting endless HTTP session for traffic inspection. + Start Endless Curl from Docker ${CLIENT_NAME} ${SERVER_IP} ${SERVICE_PORT} sleep=1 + +On GBPSFC1 Send HTTP req h35_2-h36_2 to GBPSFC2 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC1_CONNECTION + ${flow} Inspect Classifier Outbound in_port=4 out_port=${VXLAN_GPE_PORT} eth_type=${ETHER_TYPE} inner_src_ip=${CLIENT_IP} + ... inner_dst_ip=${SERVER_IP} next_hop_ip=${GBPSFC2} nsi=255 proto=${PROTO} dst_port=${SERVICE_PORT} + ${nsp_35_2-nsp_36_2} GET NSP Value From Flow ${flow} + Set Global Variable ${NSP_path1} ${nsp_35_2-nsp_36_2} + +On GBPSFC2 Send HTTP req h35_2-h36_2 to GBPSFC3 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC2_CONNECTION + Inspect Service Function Forwarder in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC1} outer_dst_ip=${GBPSFC2} eth_type=${ETHER_TYPE} + ... inner_src_ip=${CLIENT_IP} inner_dst_ip=${SERVER_IP} next_hop_ip=${GBPSFC3} nsp=${NSP_path1} nsi=255 proto=${PROTO} + +On GBPSFC3 Send HTTP req h35_2-h36_2 to GBPSFC2 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC3_CONNECTION + Inspect Service Function in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC2} outer_dst_ip=${GBPSFC3} eth_type=${ETHER_TYPE} + ... inner_src_ip=${CLIENT_IP} inner_dst_ip=${SERVER_IP} next_hop_ip=${GBPSFC2} nsp=${NSP_path1} received_nsi=255 + +On GBPSFC2 Send HTTP req h35_2-h36_2 to GBPSFC4 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC2_CONNECTION + Inspect Service Function Forwarder in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC3} outer_dst_ip=${GBPSFC2} eth_type=${ETHER_TYPE} + ... inner_src_ip=${CLIENT_IP} inner_dst_ip=${SERVER_IP} next_hop_ip=${GBPSFC4} nsp=${NSP_path1} nsi=254 proto=${PROTO} + +On GBPSFC4 Send HTTP req h35_2-h36_2 to GBPSFC5 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC4_CONNECTION + Inspect Service Function Forwarder in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC2} outer_dst_ip=${GBPSFC4} eth_type=${ETHER_TYPE} + ... inner_src_ip=${CLIENT_IP} inner_dst_ip=${SERVER_IP} next_hop_ip=${GBPSFC5} nsp=${NSP_path1} nsi=254 proto=${PROTO} + +On GBPSFC5 Send HTTP req h35_2-h36_2 to GBPSFC4 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC5_CONNECTION + Inspect Service Function in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC4} outer_dst_ip=${GBPSFC5} eth_type=${ETHER_TYPE} + ... inner_src_ip=${CLIENT_IP} inner_dst_ip=${SERVER_IP} next_hop_ip=${GBPSFC4} nsp=${NSP_path1} received_nsi=254 + +On GBPSFC4 Send HTTP req h35_2-h36_2 to GBPSFC1 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC4_CONNECTION + Inspect Service Function Forwarder in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC5} outer_dst_ip=${GBPSFC4} eth_type=${ETHER_TYPE} + ... inner_src_ip=${CLIENT_IP} inner_dst_ip=${SERVER_IP} next_hop_ip=${GBPSFC1} nsp=${NSP_path1} nsi=253 proto=${PROTO} + +On GBPSFC1 Send HTTP req h35_2-h36_2 to h36_2 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC1_CONNECTION + Inspect Classifier Inbound in_port=${VXLAN_GPE_PORT} out_port=6 eth_type=${ETHER_TYPE} inner_src_ip=${CLIENT_IP} inner_dst_ip=${SERVER_IP} + ... outer_src_ip=${GBPSFC4} outer_dst_ip=${GBPSFC1} nsp=${NSP_path1} nsi=253 proto=${PROTO} + +On GBPSFC1 Send HTTP resp h36_2-h35_2 to GBPSFC4 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC1_CONNECTION + ${flow} Inspect Classifier Outbound in_port=6 out_port=${VXLAN_GPE_PORT} eth_type=${ETHER_TYPE} inner_src_ip=${SERVER_IP} + ... inner_dst_ip=${CLIENT_IP} next_hop_ip=${GBPSFC4} nsi=255 proto=${PROTO} src_port=${SERVICE_PORT} + ${nsp_36_2-nsp_35_2} GET NSP Value From Flow ${flow} + Set Global Variable ${NSP_path2} ${nsp_36_2-nsp_35_2} + +On GBPSFC4 Send HTTP resp h36_2-h35_2 to GBPSFC5 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC4_CONNECTION + Inspect Service Function Forwarder in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC1} outer_dst_ip=${GBPSFC4} eth_type=${ETHER_TYPE} + ... inner_src_ip=${SERVER_IP} inner_dst_ip=${CLIENT_IP} next_hop_ip=${GBPSFC5} nsp=${NSP_path2} nsi=255 proto=${PROTO} + +On GBPSFC5 Send HTTP resp h36_2-h35_2 to GBPSFC4 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC5_CONNECTION + Inspect Service Function in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC4} outer_dst_ip=${GBPSFC5} eth_type=${ETHER_TYPE} + ... inner_src_ip=${SERVER_IP} inner_dst_ip=${CLIENT_IP} next_hop_ip=${GBPSFC4} nsp=${NSP_path2} received_nsi=255 + +On GBPSFC4 Send HTTP resp h36_2-h35_2 to GBPSFC2 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC4_CONNECTION + Inspect Service Function Forwarder in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC5} outer_dst_ip=${GBPSFC4} eth_type=${ETHER_TYPE} + ... inner_src_ip=${SERVER_IP} inner_dst_ip=${CLIENT_IP} next_hop_ip=${GBPSFC2} nsp=${NSP_path2} nsi=254 proto=${PROTO} + +On GBPSFC2 Send HTTP resp h36_2-h35_2 to GBPSFC3 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC2_CONNECTION + Inspect Service Function Forwarder in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC4} outer_dst_ip=${GBPSFC2} eth_type=${ETHER_TYPE} + ... inner_src_ip=${SERVER_IP} inner_dst_ip=${CLIENT_IP} next_hop_ip=${GBPSFC3} nsp=${NSP_path2} nsi=254 proto=${PROTO} + +On GBPSFC3 Send HTTP resp h36_2-h35_2 to GBPSFC2 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC3_CONNECTION + Inspect Service Function in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC2} outer_dst_ip=${GBPSFC3} eth_type=${ETHER_TYPE} + ... inner_src_ip=${SERVER_IP} inner_dst_ip=${CLIENT_IP} next_hop_ip=${GBPSFC2} nsp=${NSP_path2} received_nsi=254 + +On GBPSFC2 Send HTTP resp h36_2-h35_2 to GBPSFC1 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC2_CONNECTION + Inspect Service Function Forwarder in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC3} outer_dst_ip=${GBPSFC2} eth_type=${ETHER_TYPE} + ... inner_src_ip=${SERVER_IP} inner_dst_ip=${CLIENT_IP} next_hop_ip=${GBPSFC1} nsp=${NSP_path2} nsi=253 proto=${PROTO} + +On GBPSFC1 Send HTTP resp h36_2-h35_2 to h35_2 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC1_CONNECTION + Inspect Classifier Inbound in_port=${VXLAN_GPE_PORT} out_port=4 eth_type=${ETHER_TYPE} inner_src_ip=${SERVER_IP} inner_dst_ip=${CLIENT_IP} + ... outer_src_ip=${GBPSFC2} outer_dst_ip=${GBPSFC1} nsp=${NSP_path2} nsi=253 proto=${PROTO} + +Compare NSPs + [Documentation] Verifying that different paths were taken. + Should Not Be Equal As Numbers ${NSP_path1} ${NSP_path2} + +Stop Endless Curl on h35_2 on port 80 + [Documentation] Stopping endless HTTP session after traffic inspection finishes. + Switch Connection GPSFC1_CONNECTION + Stop Endless Curl from Docker ${CLIENT_NAME} + +Stop HTTP on h36_2 on Port 80 + [Documentation] Stopping HTTP service on the docker container. + Stop HTTP Service on Docker ${SERVER_NAME} + diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/036_track_curl_h35_3_h36_4.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/036_track_curl_h35_3_h36_4.robot new file mode 100644 index 0000000000..f4b9e8478a --- /dev/null +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/036_track_curl_h35_3_h36_4.robot @@ -0,0 +1,144 @@ +*** Settings *** +Documentation Deep inspection of HTTP traffic on symmetric chain. +... Nodes are located on different VMs. +Library SSHLibrary +Resource ../../../../../libraries/GBP/OpenFlowUtils.robot +Resource ../Variables.robot +Resource ../Connections.robot +Suite Setup Start Connections +Suite Teardown Close Connections + +*** Variables *** + +*** Testcases *** + +Start HTTP on h36_4 on Port 80 + [Documentation] Starting HTTP service on docker container. + Set Test Variables client_name=h35_3 client_ip=10.0.35.3 server_name=h36_4 server_ip=10.0.36.4 + ... service_port=80 ether_type=0x0800 proto=6 vxlan_gpe_port=2 + Switch Connection GPSFC6_CONNECTION + Start HTTP Service on Docker ${SERVER_NAME} ${SERVICE_PORT} + +Curl h36_4 from h35_3 + [Documentation] Test HTTP request from a docker container to serving docker container. + Switch Connection GPSFC1_CONNECTION + Curl from Docker ${CLIENT_NAME} ${SERVER_IP} service_port=${SERVICE_PORT} + +Start Endless Curl on h35_3 on port 80 + [Documentation] Starting endless HTTP session for traffic inspection. + Start Endless Curl from Docker ${CLIENT_NAME} ${SERVER_IP} ${SERVICE_PORT} sleep=1 + +On GBPSFC1 Send HTTP req h35_3-h36_4 to GBPSFC2 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC1_CONNECTION + ${flow} Inspect Classifier Outbound in_port=5 out_port=${VXLAN_GPE_PORT} eth_type=${ETHER_TYPE} inner_src_ip=${CLIENT_IP} + ... inner_dst_ip=${SERVER_IP} next_hop_ip=${GBPSFC2} nsi=255 proto=${PROTO} dst_port=${SERVICE_PORT} + ${nsp_35_3-nsp_36_4} GET NSP Value From Flow ${flow} + Set Global Variable ${NSP_path1} ${nsp_35_3-nsp_36_4} + +On GBPSFC2 Send HTTP req h35_3-h36_4 to GBPSFC3 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC2_CONNECTION + Inspect Service Function Forwarder in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC1} outer_dst_ip=${GBPSFC2} eth_type=${ETHER_TYPE} + ... inner_src_ip=${CLIENT_IP} inner_dst_ip=${SERVER_IP} next_hop_ip=${GBPSFC3} nsp=${NSP_path1} nsi=255 proto=${PROTO} + +On GBPSFC3 Send HTTP req h35_3-h36_4 to GBPSFC2 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC3_CONNECTION + Inspect Service Function in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC2} outer_dst_ip=${GBPSFC3} eth_type=${ETHER_TYPE} + ... inner_src_ip=${CLIENT_IP} inner_dst_ip=${SERVER_IP} next_hop_ip=${GBPSFC2} nsp=${NSP_path1} received_nsi=255 + +On GBPSFC2 Send HTTP req h35_3-h36_4 to GBPSFC4 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC2_CONNECTION + Inspect Service Function Forwarder in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC3} outer_dst_ip=${GBPSFC2} eth_type=${ETHER_TYPE} + ... inner_src_ip=${CLIENT_IP} inner_dst_ip=${SERVER_IP} next_hop_ip=${GBPSFC4} nsp=${NSP_path1} nsi=254 proto=${PROTO} + +On GBPSFC4 Send HTTP req h35_3-h36_4 to GBPSFC5 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC4_CONNECTION + Inspect Service Function Forwarder in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC2} outer_dst_ip=${GBPSFC4} eth_type=${ETHER_TYPE} + ... inner_src_ip=${CLIENT_IP} inner_dst_ip=${SERVER_IP} next_hop_ip=${GBPSFC5} nsp=${NSP_path1} nsi=254 proto=${PROTO} + +On GBPSFC5 Send HTTP req h35_3-h36_4 to GBPSFC4 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC5_CONNECTION + Inspect Service Function in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC4} outer_dst_ip=${GBPSFC5} eth_type=${ETHER_TYPE} + ... inner_src_ip=${CLIENT_IP} inner_dst_ip=${SERVER_IP} next_hop_ip=${GBPSFC4} nsp=${NSP_path1} received_nsi=254 + +On GBPSFC4 Send HTTP req h35_3-h36_4 to GBPSFC6 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC4_CONNECTION + Inspect Service Function Forwarder in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC5} outer_dst_ip=${GBPSFC4} eth_type=${ETHER_TYPE} + ... inner_src_ip=${CLIENT_IP} inner_dst_ip=${SERVER_IP} next_hop_ip=${GBPSFC6} nsp=${NSP_path1} nsi=253 proto=${PROTO} + +On GBPSFC6 Send HTTP req h35_3-h36_4 to h36_4 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC6_CONNECTION + Inspect Classifier Inbound in_port=${VXLAN_GPE_PORT} out_port=6 eth_type=${ETHER_TYPE} inner_src_ip=${CLIENT_IP} inner_dst_ip=${SERVER_IP} + ... outer_src_ip=${GBPSFC4} outer_dst_ip=${GBPSFC6} nsp=${NSP_path1} nsi=253 proto=${PROTO} + +On GBPSFC6 Send HTTP resp h36_4-h35_3 to GBPSFC4 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC6_CONNECTION + ${flow} Inspect Classifier Outbound in_port=6 out_port=${VXLAN_GPE_PORT} eth_type=${ETHER_TYPE} inner_src_ip=${SERVER_IP} + ... inner_dst_ip=${CLIENT_IP} next_hop_ip=${GBPSFC4} nsi=255 proto=${PROTO} src_port=${SERVICE_PORT} + ${nsp_36_4-nsp_35_3} GET NSP Value From Flow ${flow} + Set Global Variable ${NSP_path2} ${nsp_36_4-nsp_35_3} + +On GBPSFC4 Send HTTP resp h36_4-h35_3 to GBPSFC5 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC4_CONNECTION + Inspect Service Function Forwarder in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC6} outer_dst_ip=${GBPSFC4} eth_type=${ETHER_TYPE} + ... inner_src_ip=${SERVER_IP} inner_dst_ip=${CLIENT_IP} next_hop_ip=${GBPSFC5} nsp=${NSP_path2} nsi=255 proto=${PROTO} + +On GBPSFC5 Send HTTP resp h36_4-h35_3 to GBPSFC4 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC5_CONNECTION + Inspect Service Function in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC4} outer_dst_ip=${GBPSFC5} eth_type=${ETHER_TYPE} + ... inner_src_ip=${SERVER_IP} inner_dst_ip=${CLIENT_IP} next_hop_ip=${GBPSFC4} nsp=${NSP_path2} received_nsi=255 + +On GBPSFC4 Send HTTP resp h36_4-h35_3 to GBPSFC2 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC4_CONNECTION + Inspect Service Function Forwarder in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC5} outer_dst_ip=${GBPSFC4} eth_type=${ETHER_TYPE} + ... inner_src_ip=${SERVER_IP} inner_dst_ip=${CLIENT_IP} next_hop_ip=${GBPSFC2} nsp=${NSP_path2} nsi=254 proto=${PROTO} + +On GBPSFC2 Send HTTP resp h36_4-h35_3 to GBPSFC3 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC2_CONNECTION + Inspect Service Function Forwarder in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC4} outer_dst_ip=${GBPSFC2} eth_type=${ETHER_TYPE} + ... inner_src_ip=${SERVER_IP} inner_dst_ip=${CLIENT_IP} next_hop_ip=${GBPSFC3} nsp=${NSP_path2} nsi=254 proto=${PROTO} + +On GBPSFC3 Send HTTP resp h36_4-h35_3 to GBPSFC2 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC3_CONNECTION + Inspect Service Function in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC2} outer_dst_ip=${GBPSFC3} eth_type=${ETHER_TYPE} + ... inner_src_ip=${SERVER_IP} inner_dst_ip=${CLIENT_IP} next_hop_ip=${GBPSFC2} nsp=${NSP_path2} received_nsi=254 + +On GBPSFC2 Send HTTP resp h36_4-h35_3 to GBPSFC1 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC2_CONNECTION + Inspect Service Function Forwarder in_port=${VXLAN_GPE_PORT} out_port=${VXLAN_GPE_PORT} outer_src_ip=${GBPSFC3} outer_dst_ip=${GBPSFC2} eth_type=${ETHER_TYPE} + ... inner_src_ip=${SERVER_IP} inner_dst_ip=${CLIENT_IP} next_hop_ip=${GBPSFC1} nsp=${NSP_path2} nsi=253 proto=${PROTO} + +On GBPSFC1 Send HTTP resp h36_4-h35_3 to h35_3 + [Documentation] HTTP traffic inspection. + Switch Connection GPSFC1_CONNECTION + Inspect Classifier Inbound in_port=${VXLAN_GPE_PORT} out_port=5 eth_type=${ETHER_TYPE} inner_src_ip=${SERVER_IP} inner_dst_ip=${CLIENT_IP} + ... outer_src_ip=${GBPSFC2} outer_dst_ip=${GBPSFC1} nsp=${NSP_path2} nsi=253 proto=${PROTO} + +Compare NSPs + [Documentation] Verifying that different paths were taken. + Should Not Be Equal As Numbers ${NSP_path1} ${NSP_path2} + +Stop Endless Curl on h35_3 on port 80 + [Documentation] Stopping endless HTTP session after traffic inspection finishes. + Switch Connection GPSFC1_CONNECTION + Stop Endless Curl from Docker ${CLIENT_NAME} + +Stop HTTP on h36_4 on Port 80 + [Documentation] Stopping HTTP service on the docker container. + Switch Connection GPSFC6_CONNECTION + Stop HTTP Service on Docker ${SERVER_NAME} + diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/998_clean_odl.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/998_clean_odl.robot new file mode 100644 index 0000000000..4863d83b2e --- /dev/null +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/998_clean_odl.robot @@ -0,0 +1,56 @@ +*** Settings *** +Documentation Test suite for cleaning up / unregister infrastructure constructs like endpoints for demo-symmetric-chain +Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} +Suite Teardown Delete All Sessions +Library RequestsLibrary +Library OperatingSystem +Library Collections +Library json +Variables ../../../../../variables/Variables.py +Resource ../../../../../libraries/Utils.robot +Resource ../../../../../libraries/GBP/RestconfUtils.robot +Resource ../Variables.robot + +*** Test Cases *** + +Delete Service Function Paths + [Documentation] Delete Service Function Paths from ODL + [Tags] GBPSFCTEAR + Remove All Elements At URI And Verify ${SFP_PATH} + +Delete Service Function Chains + [Documentation] Delete Service Function Chains from ODL + [Tags] GBPSFCTEAR + Remove All Elements At URI And Verify ${SFC_PATH} + +Delete Service Functions + [Documentation] Delete Service Function from ODL + [Tags] GBPSFCTEAR + Remove All Elements At URI And Verify ${SF_PATH} + +Delete Service Function Forwarders + [Documentation] Delete Service Function Forwarders from ODL + [Tags] GBPSFCTEAR + Remove All Elements At URI And Verify ${SFF_PATH} + +Delete Tunnels + [Documentation] Delete Tenant from ODL + [Tags] GBPSFCTEAR + Remove All Elements At URI And Verify ${TUNNELS_PATH} + +Delete Tenant + [Documentation] Delete Tenant from ODL + [Tags] GBPSFCTEAR + Remove All Elements At URI And Verify ${TENANT_PATH} + +Unregister Endpoints + [Documentation] Unregister Endpoints Endpoints from ODL + [Tags] GBPSFCTEAR + RestconfUtils.Unregister Endpoints + +Delete OVSDB Topology If Present + [Documentation] Delete OVSDB topology from ODL + [Tags] GBPSFCTEAR + ${resp} RequestsLibrary.Get Request session ${TOPOLOGY_PATH} + Run Keyword If ${resp.status_code} == 200 + ... Remove All Elements At URI And Verify ${TOPOLOGY_PATH} diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/999_teardown.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/999_teardown.robot new file mode 100644 index 0000000000..8e0e181702 --- /dev/null +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/999_teardown.robot @@ -0,0 +1,18 @@ +*** Settings *** +Library SSHLibrary +Resource ../../../../../libraries/Utils.robot +Resource ../../../../../libraries/GBP/ConnUtils.robot +Variables ../../../../../variables/Variables.py +Resource ../Variables.robot +Resource ../GBPSFC_6node.robot + + +*** Variables *** +${timeout} = 10s + + +*** Test Cases *** +Teardown Suite + Log Teardown suite in symetric-chain + :FOR ${GBPSFC} IN @{GBPSFCs} + \ GBPSFC_6node.Teardown Node ${GBPSFC} ${CURDIR} timeout=${timeout} diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/init_scripts/infrastructure_config.py b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/init_scripts/infrastructure_config.py new file mode 100644 index 0000000000..46a7deff26 --- /dev/null +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/init_scripts/infrastructure_config.py @@ -0,0 +1,64 @@ +# Config for switches, tunnelIP is the local IP address. +switches = [{'name': 'sw1', + 'type': 'gbp', + 'dpid': '1'}, + {'name': 'sw2', + 'type': 'sff', + 'dpid': '2'}, + {'name': 'sw3', + 'type': 'sf', + 'dpid': '3'}, + {'name': 'sw4', + 'type': 'sff', + 'dpid': '4'}, + {'name': 'sw5', + 'type': 'sf', + 'dpid': '5'}, + {'name': 'sw6', + 'type': 'gbp', + 'dpid': '6'}, + {'name': 'sw7', + 'type': 'none', + 'dpid': '7'}, + {'name': 'sw8', + 'type': 'none', + 'dpid': '8'} + ] + +defaultContainerImage = 'alagalah/odlpoc_ovs230' + +# Note that tenant name and endpointGroup name come from policy_config.py + +hosts = [{'name': 'h35_2', + 'mac': '00:00:00:00:35:02', + 'ip': '10.0.35.2/24', + 'switch': 'sw1'}, + {'name': 'h35_3', + 'ip': '10.0.35.3/24', + 'mac': '00:00:00:00:35:03', + 'switch': 'sw1'}, + {'name': 'h35_4', + 'ip': '10.0.35.4/24', + 'mac': '00:00:00:00:35:04', + 'switch': 'sw6'}, + {'name': 'h35_5', + 'ip': '10.0.35.5/24', + 'mac': '00:00:00:00:35:05', + 'switch': 'sw6'}, + {'name': 'h36_2', + 'ip': '10.0.36.2/24', + 'mac': '00:00:00:00:36:02', + 'switch': 'sw1'}, + {'name': 'h36_3', + 'ip': '10.0.36.3/24', + 'mac': '00:00:00:00:36:03', + 'switch': 'sw1'}, + {'name': 'h36_4', + 'ip': '10.0.36.4/24', + 'mac': '00:00:00:00:36:04', + 'switch': 'sw6'}, + {'name': 'h36_5', + 'ip': '10.0.36.5/24', + 'mac': '00:00:00:00:36:05', + 'switch': 'sw6'} + ] diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/init_scripts/sf-flows.sh b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/init_scripts/sf-flows.sh new file mode 100644 index 0000000000..0c7fc960fd --- /dev/null +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/init_scripts/sf-flows.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -e + +SFF_IP=$1 +SFF_HEX=$(printf '%02X' ${SFF_IP//./ }) +SFF_HEX=0x$SFF_HEX +sw=$(sudo ovs-vsctl show | egrep -E 'Bridge.*sw' | awk '{print $2}' | sed -e 's/^"//' -e 's/"$//') + +if [ $sw = "sw3" ] || [ $sw = "sw5" ] ; then + # delete NORMAL, if present + sudo ovs-ofctl --strict del-flows $sw priority=0 + sudo ovs-ofctl add-flow $sw "priority=1000,nsi=255 actions=move:NXM_NX_NSH_C1[]->NXM_NX_NSH_C1[],move:NXM_NX_NSH_C2[]->NXM_NX_NSH_C2[],move:NXM_NX_TUN_ID[0..31]->NXM_NX_TUN_ID[0..31],load:$SFF_HEX->NXM_NX_TUN_IPV4_DST[],set_nsi:254,IN_PORT" -OOpenFlow13 + sudo ovs-ofctl add-flow $sw "priority=1000,nsi=254 actions=move:NXM_NX_NSH_C1[]->NXM_NX_NSH_C1[],move:NXM_NX_NSH_C2[]->NXM_NX_NSH_C2[],move:NXM_NX_TUN_ID[0..31]->NXM_NX_TUN_ID[0..31],load:$SFF_HEX->NXM_NX_TUN_IPV4_DST[],set_nsi:253,IN_PORT" -OOpenFlow13 +else + echo "Invalid SF for this demo"; + exit +fi diff --git a/csit/variables/gbp/6node/demo-symmetric-chain/master/tenants.json b/csit/variables/gbp/6node/demo-symmetric-chain/master/tenants.json index f1599ddadd..41742f066c 100644 --- a/csit/variables/gbp/6node/demo-symmetric-chain/master/tenants.json +++ b/csit/variables/gbp/6node/demo-symmetric-chain/master/tenants.json @@ -1,201 +1,205 @@ { - "tenant": [ - { - "id": "tenant-red", - "l2-flood-domain": [ - { - "id": "flood-domain-1", - "parent": "bridge-domain1" - }, - { - "id": "flood-domain-2", - "parent": "bridge-domain1" - } - ], - "name": "DockerTenant", - "l3-context": [ - { - "id": "l3-context-vrf-red" - } - ], - "l2-bridge-domain": [ - { - "id": "bridge-domain1", - "parent": "l3-context-vrf-red" - } - ], - "subnet": [ - { - "id": "subnet-10.0.36.0/24", - "virtual-router-ip": "10.0.36.1", - "parent": "flood-domain-2", - "ip-prefix": "10.0.36.1/24" - }, - { - "id": "subnet-10.0.35.0/24", - "virtual-router-ip": "10.0.35.1", - "parent": "flood-domain-1", - "ip-prefix": "10.0.35.1/24" - } - ], - "endpoint-group": [ - { - "id": "webservers", - "name": "webservers", - "provider-named-selector": [ - { - "name": "webservers-clients-icmp-http-contract", - "contract": [ - "icmp-http-contract" - ] - } - ] - }, - { - "id": "clients", - "name": "clients", - "consumer-named-selector": [ - { - "name": "webservers-clients-icmp-http-contract", - "contract": [ - "icmp-http-contract" - ] - } - ] - } - ], - "subject-feature-instances": { - "classifier-instance": [ - { - "name": "icmp", - "classifier-definition-id": "Classifier-IP-Protocol", - "parameter-value": [ - { - "name": "proto", - "int-value": 1 - } - ] - }, - { - "name": "http-dest", - "classifier-definition-id": "Classifier-L4", - "parameter-value": [ - { - "int-value": "6", - "name": "proto" - }, - { - "int-value": "80", - "name": "destport" - } - ] - }, - { - "name": "http-src", - "classifier-definition-id": "Classifier-L4", - "parameter-value": [ - { - "int-value": "6", - "name": "proto" - }, - { - "int-value": "80", - "name": "sourceport" - } - ] - } - ], - "action-instance": [ - { - "name": "chain1", - "action-definition-id": "Action-Chain", - "parameter-value": [ - { - "name": "sfc-chain-name", - "string-value": "SFCGBP" - } - ] - }, - { - "name": "allow1", - "action-definition-id": "Action-Allow" - } - ] - }, - "contract": [ - { - "id": "icmp-http-contract", - "subject": [ - { - "name": "icmp-subject", - "rule": [ - { - "name": "allow-icmp-rule", - "order": 0, - "classifier-ref": [ - { - "name": "icmp", - "instance-name": "icmp" - } - ], - "action-ref": [ - { - "name": "allow1", - "order": 0 - } - ] - } - ] - }, - { - "name": "http-subject", - "rule": [ - { - "name": "http-chain-rule-in", - "classifier-ref": [ - { - "name": "http-dest", - "instance-name": "http-dest", - "direction": "in" - } - ], - "action-ref": [ - { - "name": "chain1", - "order": 0 - } - ] - }, - { - "name": "http-chain-rule-out", - "classifier-ref": [ - { - "name": "http-src", - "instance-name": "http-src", - "direction": "out" - } - ], - "action-ref": [ - { - "name": "chain1", - "order": 0 - } - ] - } - ] - } - ], - "clause": [ - { - "name": "icmp-http-clause", - "subject-refs": [ - "icmp-subject", - "http-subject" - ] - } - ] - } - ] - } - ] -} + "tenant": [ + { + "id": "tenant-red", + "name": "DockerTenant", + "forwarding-context": { + "l2-flood-domain": [ + { + "id": "flood-domain-1", + "parent": "bridge-domain1" + }, + { + "id": "flood-domain-2", + "parent": "bridge-domain1" + } + ], + "l3-context": [ + { + "id": "l3-context-vrf-red" + } + ], + "l2-bridge-domain": [ + { + "id": "bridge-domain1", + "parent": "l3-context-vrf-red" + } + ], + "subnet": [ + { + "id": "subnet-10.0.36.0/24", + "virtual-router-ip": "10.0.36.1", + "parent": "flood-domain-2", + "ip-prefix": "10.0.36.1/24" + }, + { + "id": "subnet-10.0.35.0/24", + "virtual-router-ip": "10.0.35.1", + "parent": "flood-domain-1", + "ip-prefix": "10.0.35.1/24" + } + ] + }, + "policy": { + "endpoint-group": [ + { + "id": "webservers", + "name": "webservers", + "provider-named-selector": [ + { + "name": "webservers-clients-icmp-http-contract", + "contract": [ + "icmp-http-contract" + ] + } + ] + }, + { + "id": "clients", + "name": "clients", + "consumer-named-selector": [ + { + "name": "webservers-clients-icmp-http-contract", + "contract": [ + "icmp-http-contract" + ] + } + ] + } + ], + "subject-feature-instances": { + "classifier-instance": [ + { + "name": "icmp", + "classifier-definition-id": "Classifier-IP-Protocol", + "parameter-value": [ + { + "name": "proto", + "int-value": 1 + } + ] + }, + { + "name": "http-dest", + "classifier-definition-id": "Classifier-L4", + "parameter-value": [ + { + "int-value": "6", + "name": "proto" + }, + { + "int-value": "80", + "name": "destport" + } + ] + }, + { + "name": "http-src", + "classifier-definition-id": "Classifier-L4", + "parameter-value": [ + { + "int-value": "6", + "name": "proto" + }, + { + "int-value": "80", + "name": "sourceport" + } + ] + } + ], + "action-instance": [ + { + "name": "chain1", + "action-definition-id": "Action-Chain", + "parameter-value": [ + { + "name": "sfc-chain-name", + "string-value": "SFCGBP" + } + ] + }, + { + "name": "allow1", + "action-definition-id": "Action-Allow" + } + ] + }, + "contract": [ + { + "id": "icmp-http-contract", + "subject": [ + { + "name": "icmp-subject", + "rule": [ + { + "name": "allow-icmp-rule", + "order": 0, + "classifier-ref": [ + { + "name": "icmp", + "instance-name": "icmp" + } + ], + "action-ref": [ + { + "name": "allow1", + "order": 0 + } + ] + } + ] + }, + { + "name": "http-subject", + "rule": [ + { + "name": "http-chain-rule-in", + "classifier-ref": [ + { + "name": "http-dest", + "instance-name": "http-dest", + "direction": "in" + } + ], + "action-ref": [ + { + "name": "chain1", + "order": 0 + } + ] + }, + { + "name": "http-chain-rule-out", + "classifier-ref": [ + { + "name": "http-src", + "instance-name": "http-src", + "direction": "out" + } + ], + "action-ref": [ + { + "name": "chain1", + "order": 0 + } + ] + } + ] + } + ], + "clause": [ + { + "name": "icmp-http-clause", + "subject-refs": [ + "icmp-subject", + "http-subject" + ] + } + ] + } + ] + } + } + ] + } \ No newline at end of file