${NC_COMMAND} nc -zv -w 5
${RES_SUCCESS} open
${RES_FAILURE} Operation timed out
-${WEBSERVER_80} python -m SimpleHTTPServer 80 > /dev/null 2>&1 &
-${WEBSERVER_81} python -m SimpleHTTPServer 81 > /dev/null 2>&1 &
-${WEBSERVER_82} python -m SimpleHTTPServer 82 > /dev/null 2>&1 &
+${WEBSERVER_80} (python -m SimpleHTTPServer 80 > /dev/null 2>&1 &)
+${WEBSERVER_81} (python -m SimpleHTTPServer 81 > /dev/null 2>&1 &)
+${WEBSERVER_82} (python -m SimpleHTTPServer 82 > /dev/null 2>&1 &)
+${WEBSERVER_83} (python -m SimpleHTTPServer 83 > /dev/null 2>&1 &)
+${WEBSERVER_84} (python -m SimpleHTTPServer 84 > /dev/null 2>&1 &)
+${WEBSERVER_85} (python -m SimpleHTTPServer 85 > /dev/null 2>&1 &)
+${WEBSERVER_100} (python -m SimpleHTTPServer 100 > /dev/null 2>&1 &)
+${WEBSERVER_101} (python -m SimpleHTTPServer 101 > /dev/null 2>&1 &)
+${WEBSERVER_102} (python -m SimpleHTTPServer 102 > /dev/null 2>&1 &)
+${WEBSERVER_103} (python -m SimpleHTTPServer 103 > /dev/null 2>&1 &)
+${WEBSERVER_CMDS} ${WEBSERVER_80} && ${WEBSERVER_81} && ${WEBSERVER_82} && ${WEBSERVER_83} && ${WEBSERVER_84} && ${WEBSERVER_85} && ${WEBSERVER_100} && ${WEBSERVER_101} && ${WEBSERVER_102} && ${WEBSERVER_103}
${CLOUD_IMAGE} "https://artifacts.opnfv.org/sfc/images/sfc_nsh_fraser.qcow2"
${CLOUD_IMAGE_NAME} sfc_nsh_fraser
${CLOUD_FLAVOR_NAME} sfc_nsh_fraser
[Documentation] Create SFC Flow Classifier for TCP traffic between source VM and destination VM
OpenStackOperations.Create SFC Flow Classifier FC_80 @{NET1_VM_IPS}[0] @{NET1_VM_IPS}[1] tcp source_vm_port args=--destination-port 80:80
OpenStackOperations.Create SFC Flow Classifier FC_81 @{NET1_VM_IPS}[0] @{NET1_VM_IPS}[1] tcp source_vm_port args=--destination-port 81:81
+ OpenStackOperations.Create SFC Flow Classifier FC_83_85 @{NET1_VM_IPS}[0] @{NET1_VM_IPS}[1] tcp source_vm_port args=--destination-port 83:85
Create Port Pair
[Documentation] Create SFC Port Pairs
OpenStackOperations.Update SFC Port Chain Removing A Flow Classifier SFPC1 FC_80
Test Communication From Vm Instance1 In net_1 Port 81 via SF
- [Documentation] Login to the source VM instance, and send a nc req to the destination VM instance, If the SF handles the traffic, there will be delay causing the time for nc to be higher.
+ [Documentation] Login to the source VM instance, and send a nc req to the destination VM instance.
Stop Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP}
Start Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP} args=--do forward --interface ${ETH_IN} --output ${ETH_OUT} --verbose off
Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
... 80 ${RES_SUCCESS}
Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
- ... 81 ${RES_SUCCESS} cmd_timeout=60s
+ ... 81 ${RES_SUCCESS}
Stop Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP}
Start Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP} args=--do forward --interface ${ETH_IN} --output ${ETH_OUT} --verbose off --block 81
BuiltIn.Comment Port 81 communication should fail as the SF blocks the same
Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
... 80 ${RES_SUCCESS}
Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
- ... 81 ${RES_FAILURE} cmd_timeout=60s
+ ... 81 ${RES_FAILURE}
BuiltIn.Comment Test to confirm Port 80 does not continue to get routed through SF
Stop Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP}
Start Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP} args=--do forward --interface ${ETH_IN} --output ${ETH_OUT} --verbose off --block 80
Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
... 80 ${RES_SUCCESS}
Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
- ... 81 ${RES_SUCCESS} cmd_timeout=60s
+ ... 81 ${RES_SUCCESS}
Stop Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP}
[Teardown] BuiltIn.Run Keywords OpenStackOperations.Get Test Teardown Debugs
... AND OpenStackOperations.Get Test Teardown Debugs For SFC
... AND OpenStackOperations.Exit From Vm Console
+Update Port Chain To Use Flow Classifier For Port Range 83-85
+ [Documentation] Update Port Chain to use FC_83_85
+ OpenStackOperations.Update SFC Port Chain With A New Flow Classifier SFPC1 FC_83_85
+
+Test Communication From Vm Instance1 In net_1 Port 84 And 85 via SF
+ [Documentation] Login to the source VM instance, and send a nc req to the destination VM instance.
+ Stop Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP}
+ Start Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP} args=--do forward --interface ${ETH_IN} --output ${ETH_OUT} --verbose off
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
+ ... 80 ${RES_SUCCESS}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
+ ... 83 ${RES_SUCCESS}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
+ ... 84 ${RES_SUCCESS}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
+ ... 85 ${RES_SUCCESS}
+ Stop Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP}
+ Start Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP} args=--do forward --interface ${ETH_IN} --output ${ETH_OUT} --verbose off --block 83
+ BuiltIn.Comment Port 83 communication should fail as the SF blocks the same
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
+ ... 80 ${RES_SUCCESS}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
+ ... 83 ${RES_FAILURE}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
+ ... 84 ${RES_SUCCESS}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
+ ... 85 ${RES_SUCCESS}
+ Stop Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP}
+ Start Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP} args=--do forward --interface ${ETH_IN} --output ${ETH_OUT} --verbose off --block 84
+ BuiltIn.Comment Port 84 communication should fail as the SF blocks the same
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
+ ... 80 ${RES_SUCCESS}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
+ ... 84 ${RES_FAILURE}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
+ ... 83 ${RES_SUCCESS}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
+ ... 85 ${RES_SUCCESS}
+ Stop Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP}
+ Start Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP} args=--do forward --interface ${ETH_IN} --output ${ETH_OUT} --verbose off --block 85
+ BuiltIn.Comment Port 85 communication should fail as the SF blocks the same
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
+ ... 80 ${RES_SUCCESS}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
+ ... 83 ${RES_SUCCESS}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
+ ... 84 ${RES_SUCCESS}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
+ ... 85 ${RES_FAILURE}
+ Stop Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP}
+ Start Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP} args=--do forward --interface ${ETH_IN} --output ${ETH_OUT} --verbose off --block 80
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
+ ... 80 ${RES_SUCCESS}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
+ ... 83 ${RES_SUCCESS}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
+ ... 84 ${RES_SUCCESS}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND}
+ ... 85 ${RES_SUCCESS}
+
+Update Port Chain To Use Flow Classifier For Input Port Range 101-103
+ [Documentation] Update Port Chain to use FC_101_103
+ BuiltIn.Comment Removing and Deleting Existing Conflicting Flow Classifiers
+ OpenStackOperations.Update SFC Port Chain Removing A Flow Classifier SFPC1 FC_81
+ OpenStackOperations.Update SFC Port Chain Removing A Flow Classifier SFPC1 FC_83_85
+ OpenStackOperations.Delete SFC Flow Classifier FC_80
+ OpenStackOperations.Delete SFC Flow Classifier FC_81
+ OpenStackOperations.Delete SFC Flow Classifier FC_83_85
+ OpenStackOperations.Create SFC Flow Classifier FC_101_103 @{NET1_VM_IPS}[0] @{NET1_VM_IPS}[1] tcp source_vm_port args=--source-port 101:103
+ OpenStackOperations.Update SFC Port Chain With A New Flow Classifier SFPC1 FC_101_103
+
+Test Communication From Vm Instance1 In net_1 Port 100 And 102 via SF
+ [Documentation] Login to the source VM instance, and send a nc req to the destination VM instance.
+ Stop Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP}
+ Start Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP} args=--do forward --interface ${ETH_IN} --output ${ETH_OUT} --verbose off
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND} -p 80
+ ... 83 ${RES_SUCCESS}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND} -p 100
+ ... 83 ${RES_SUCCESS}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND} -p 101
+ ... 83 ${RES_SUCCESS}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND} -p 102
+ ... 83 ${RES_SUCCESS}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND} -p 103
+ ... 83 ${RES_SUCCESS}
+ Stop Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP}
+ Start Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP} args=--do forward --interface ${ETH_IN} --output ${ETH_OUT} --verbose off --block 83
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND} -p 80
+ ... 83 ${RES_SUCCESS}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND} -p 100
+ ... 83 ${RES_SUCCESS}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND} -p 101
+ ... 83 ${RES_FAILURE}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND} -p 102
+ ... 83 ${RES_FAILURE}
+ Wait Until Keyword Succeeds 3x 10s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND} -p 103
+ ... 83 ${RES_FAILURE}
+
Delete And Recreate Port Chain And Flow Classifiers For Symmetric Test
OpenStackOperations.Create SFC Flow Classifier FC_SYM @{NET1_VM_IPS}[0] @{NET1_VM_IPS}[1] tcp source_vm_port args=--destination-port 82:82 --source-port 2000 --logical-destination-port dest_vm_port
OpenStackOperations.Delete SFC Port Chain SFPC1
OpenStackOperations.Create SFC Port Chain SFPSYM args=--port-pair-group SFPPG1 --flow-classifier FC_SYM --chain-parameters symmetric=true
Test Communication From Vm Instance1 For Symmetric Chain
- [Documentation] Login to the source VM instance, and send a nc req to the destination VM instance, If the SF handles the traffic, there will be delay causing the time for nc to be higher.
+ [Documentation] Login to the source VM instance, and send a nc req to the destination VM instance.
Stop Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP}
Start Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP} args=--do forward --interface ${ETH_IN} --output ${ETH_OUT} --verbose off
Start Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP} args=--do forward --interface ${ETH_OUT} --output ${ETH_IN} --verbose off
Wait Until Keyword Succeeds 8x 20s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND} -p 2000
- ... 82 ${RES_SUCCESS} cmd_timeout=80s
+ ... 82 ${RES_SUCCESS}
BuiltIn.Comment Test to confirm the SRC->DEST Port 82 is routed through SF
Stop Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP}
Start Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP} args=--do forward --interface ${ETH_IN} --output ${ETH_OUT} --verbose off --block 82
Start Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP} args=--do forward --interface ${ETH_OUT} --output ${ETH_IN} --verbose off
Wait Until Keyword Succeeds 8x 20s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND} -p 2000
- ... 82 ${RES_FAILURE} cmd_timeout=80s
+ ... 82 ${RES_FAILURE}
BuiltIn.Comment Test to confirm DEST->SRC Port 2000 path SFC traversal
Stop Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP}
Start Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP} args=--do forward --interface ${ETH_IN} --output ${ETH_OUT} --verbose off
Start Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP} args=--do forward --interface ${ETH_OUT} --output ${ETH_IN} --verbose off --block 2000
Wait Until Keyword Succeeds 8x 20s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND} -p 2000
- ... 82 ${RES_FAILURE} cmd_timeout=80s
+ ... 82 ${RES_FAILURE}
BuiltIn.Comment Test to confirm the Normalcy restored
Stop Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP}
Start Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP} args=--do forward --interface ${ETH_IN} --output ${ETH_OUT} --verbose off
Start Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP} args=--do forward --interface ${ETH_OUT} --output ${ETH_IN} --verbose off
Wait Until Keyword Succeeds 8x 20s Check Network Reachability @{NETWORKS}[0] @{NET1_VM_IPS}[0] ${NC_COMMAND} -p 2000
- ... 82 ${RES_SUCCESS} cmd_timeout=80s
+ ... 82 ${RES_SUCCESS}
Stop Vxlan Tool in SF @{NETWORKS}[0] ${SF1_IP}
[Teardown] BuiltIn.Run Keywords OpenStackOperations.Get Test Teardown Debugs
... AND OpenStackOperations.Get Test Teardown Debugs For SFC
OpenStackOperations.Delete SFC Port Chain SFPSYM
OpenStackOperations.Delete SFC Port Pair Group SFPPG1
OpenStackOperations.Delete SFC Port Pair SFPP1
- OpenStackOperations.Delete SFC Flow Classifier FC_80
- OpenStackOperations.Delete SFC Flow Classifier FC_81
+ OpenStackOperations.Delete SFC Flow Classifier FC_101_103
OpenStackOperations.Delete SFC Flow Classifier FC_SYM
: FOR ${port} IN @{PORTS}
\ OpenStackOperations.Delete Port ${port}
Start Applications on VM Instances For Test
BuiltIn.Comment Run Web server Scripts on destination vm listening to 80,81 and 82 ports
- OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET1_VM_IPS}[1] ${WEBSERVER_80} user=${CLOUD_IMAGE_USER} password=${CLOUD_IMAGE_PASS} console=${CLOULD_IMAGE_CONSOLE}
- OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET1_VM_IPS}[1] ${WEBSERVER_81} user=${CLOUD_IMAGE_USER} password=${CLOUD_IMAGE_PASS} console=${CLOULD_IMAGE_CONSOLE}
- OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET1_VM_IPS}[1] ${WEBSERVER_82} user=${CLOUD_IMAGE_USER} password=${CLOUD_IMAGE_PASS} console=${CLOULD_IMAGE_CONSOLE}
+ ${resp} OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET1_VM_IPS}[1] ${WEBSERVER_CMDS} && (echo done) user=${CLOUD_IMAGE_USER} password=${CLOUD_IMAGE_PASS}
+ ... console=${CLOULD_IMAGE_CONSOLE}
+ BuiltIn.Should Contain ${resp} done
Start Vxlan Tool in SF
[Arguments] ${network} ${sf_vm_ip} ${args}=${EMPTY}
OpenStackOperations.Execute Command on VM Instance ${network} ${sf_vm_ip} pkill python user=${CLOUD_IMAGE_USER} password=${CLOUD_IMAGE_PASS} console=${CLOULD_IMAGE_CONSOLE}
Check Network Reachability
- [Arguments] ${net_name} ${vm_ip} ${command} ${port} ${ret_code} ${cmd_timeout}=30s
- ${nc_resp} OpenStackOperations.Execute Command on VM Instance ${net_name} ${vm_ip} ${command} @{NET1_VM_IPS}[1] ${port} cmd_timeout=${cmd_timeout} user=${CLOUD_IMAGE_USER}
+ [Arguments] ${net_name} ${source_vm_ip} ${command} ${port} ${ret_code} ${cmd_timeout}=30s
+ ${nc_resp} OpenStackOperations.Execute Command on VM Instance ${net_name} ${source_vm_ip} ${command} @{NET1_VM_IPS}[1] ${port} cmd_timeout=${cmd_timeout} user=${CLOUD_IMAGE_USER}
... password=${CLOUD_IMAGE_PASS} console=${CLOULD_IMAGE_CONSOLE}
BuiltIn.Should Contain ${nc_resp} ${ret_code}