go.ligato.io/vpp-agent/v3@v3.5.0/tests/robot/suites/trafficIPv6/linux_traffic/1x_vpp_3x_namespaces_trafficIPv6.robot (about) 1 *** Settings *** 2 Library OperatingSystem 3 #Library RequestsLibrary 4 #Library SSHLibrary timeout=60s 5 #Library String 6 7 Resource ../../../variables/${VARIABLES}_variables.robot 8 9 Resource ../../../libraries/all_libs.robot 10 11 Force Tags traffic IPv6 12 Suite Setup Testsuite Setup 13 Suite Teardown Testsuite Teardown 14 Test Setup TestSetup 15 Test Teardown TestTeardown 16 17 *** Variables *** 18 ${VARIABLES}= common 19 ${ENV}= common 20 ${WAIT_TIMEOUT}= 20s 21 ${SYNC_SLEEP}= 3s 22 ${RESYNC_SLEEP}= 1s 23 # wait for resync vpps after restart 24 ${RESYNC_WAIT}= 30s 25 ${IP_1}= fd31:1:a::1 26 ${IP_2}= fd31:1:a::2 27 ${IP_3}= fd31:1:a::5 28 ${IP_4}= fd31:1:a::6 29 ${PREFIX}= 126 30 31 *** Test Cases *** 32 Configure Environment 33 [Tags] setup 34 Add Agent VPP Node agent_vpp_1 35 36 Show Interfaces Before Setup 37 vpp_term: Show Interfaces agent_vpp_1 38 39 Setup Interfaces 40 Put Veth Interface Via Linux Plugin node=agent_vpp_1 namespace=ns1 41 ... name=ns1_veth1 host_if_name=ns1_veth1_linux mac=d2:74:8c:12:67:d2 42 ... peer=ns2_veth2 ip=${IP_1} prefix=${PREFIX} 43 Put Veth Interface Via Linux Plugin node=agent_vpp_1 namespace=ns2 44 ... name=ns2_veth2 host_if_name=ns2_veth2_linux mac=92:c7:42:67:ab:cd 45 ... peer=ns1_veth1 ip=${IP_2} prefix=${PREFIX} 46 47 Put Veth Interface Via Linux Plugin node=agent_vpp_1 namespace=ns2 48 ... name=ns2_veth3 host_if_name=ns2_veth3_linux mac=92:c7:42:67:ab:cf 49 ... peer=ns3_veth3 ip=${IP_3} prefix=${PREFIX} 50 Put Veth Interface Via Linux Plugin node=agent_vpp_1 namespace=ns3 51 ... name=ns3_veth3 host_if_name=ns3_veth3_linux mac=92:c7:42:67:ab:ce 52 ... peer=ns2_veth3 ip=${IP_4} prefix=${PREFIX} 53 Wait Until Keyword Succeeds ${WAIT_TIMEOUT} ${SYNC_SLEEP} 54 ... Check Linux Interfaces node=agent_vpp_1 namespace=ns1 interface=ns1_veth1 55 Wait Until Keyword Succeeds ${WAIT_TIMEOUT} ${SYNC_SLEEP} 56 ... Check Linux Interfaces node=agent_vpp_1 namespace=ns2 interface=ns2_veth2 57 Wait Until Keyword Succeeds ${WAIT_TIMEOUT} ${SYNC_SLEEP} 58 ... Check Linux Interfaces node=agent_vpp_1 namespace=ns2 interface=ns2_veth3 59 Wait Until Keyword Succeeds ${WAIT_TIMEOUT} ${SYNC_SLEEP} 60 ... Check Linux Interfaces node=agent_vpp_1 namespace=ns3 interface=ns3_veth3 61 62 Ping Within The Same Namespace 63 Ping in namespace node=agent_vpp_1 namespace=ns1 ip=${IP_2} 64 Ping in namespace node=agent_vpp_1 namespace=ns2 ip=${IP_1} 65 Ping in namespace node=agent_vpp_1 namespace=ns2 ip=${IP_4} 66 Ping in namespace node=agent_vpp_1 namespace=ns3 ip=${IP_3} 67 68 Create Linux Routes 69 Put Linux Route node=agent_vpp_1 namespace=ns1 interface=ns1_veth1 70 ... ip=${IP_4} prefix=128 next_hop=${IP_2} 71 Put Linux Route node=agent_vpp_1 namespace=ns3 interface=ns3_veth3 72 ... ip=${IP_1} prefix=128 next_hop=${IP_3} 73 # Enable forwarding in namespace ns2 74 Execute In Container agent_vpp_1 ip netns exec ns2 sysctl -w net.ipv6.conf.all.forwarding=1 75 76 Ping Across Namespaces 77 Ping in namespace node=agent_vpp_1 namespace=ns1 ip=${IP_4} 78 Ping in namespace node=agent_vpp_1 namespace=ns3 ip=${IP_1} 79 80 Create Linux Default Routes 81 Put Default Linux Route node=agent_vpp_1 namespace=ns1 interface=ns1_veth1 82 ... next_hop=${IP_2} ipv6=${TRUE} 83 Put Default Linux Route node=agent_vpp_1 namespace=ns3 interface=ns3_veth3 84 ... next_hop=${IP_3} ipv6=${TRUE} 85 Wait Until Keyword Succeeds ${WAIT_TIMEOUT} ${SYNC_SLEEP} 86 ... Check Linux Default Routes node=agent_vpp_1 namespace=ns1 next_hop=${IP_2} 87 Wait Until Keyword Succeeds ${WAIT_TIMEOUT} ${SYNC_SLEEP} 88 ... Check Linux Default Routes node=agent_vpp_1 namespace=ns3 next_hop=${IP_3} 89 90 Ping Across Namespaces Through Default Route 91 Ping in namespace via interface node=agent_vpp_1 namespace=ns1 ip=${IP_3} interface=ns1_veth1_linux 92 Ping in namespace via interface node=agent_vpp_1 namespace=ns3 ip=${IP_2} interface=ns3_veth3_linux 93 94 Restart VPP Node 95 Remove All Nodes 96 Sleep ${RESYNC_SLEEP} 97 Add Agent VPP Node agent_vpp_1 98 Sleep ${RESYNC_WAIT} 99 Execute In Container agent_vpp_1 ip netns exec ns2 sysctl -w net.ipv6.conf.all.forwarding=1 100 101 Check Linux Interfaces On VPP1 After Resync 102 ${out}= Execute In Container agent_vpp_1 ip netns exec ns1 ip address 103 Should Contain ${out} ns1_veth1_linux 104 105 ${out}= Execute In Container agent_vpp_1 ip netns exec ns2 ip address 106 Should Contain ${out} ns2_veth2_linux 107 Should Contain ${out} ns2_veth3_linux 108 109 ${out}= Execute In Container agent_vpp_1 ip netns exec ns3 ip address 110 Should Contain ${out} ns3_veth3_linux 111 112 Check Linux Interfaces node=agent_vpp_1 namespace=ns1 interface=ns1_veth1 113 Check Linux Interfaces node=agent_vpp_1 namespace=ns2 interface=ns2_veth2 114 115 Check Linux Interfaces node=agent_vpp_1 namespace=ns2 interface=ns2_veth3 116 Check Linux Interfaces node=agent_vpp_1 namespace=ns3 interface=ns3_veth3 117 118 Retry All Pings After Resync 119 Ping in namespace node=agent_vpp_1 namespace=ns1 ip=${IP_2} 120 Ping in namespace node=agent_vpp_1 namespace=ns2 ip=${IP_1} 121 122 Ping in namespace node=agent_vpp_1 namespace=ns2 ip=${IP_4} 123 Ping in namespace node=agent_vpp_1 namespace=ns3 ip=${IP_3} 124 125 Ping in namespace node=agent_vpp_1 namespace=ns1 ip=${IP_3} 126 Ping in namespace node=agent_vpp_1 namespace=ns3 ip=${IP_2} 127 128 Ping in namespace node=agent_vpp_1 namespace=ns1 ip=${IP_4} 129 Ping in namespace node=agent_vpp_1 namespace=ns3 ip=${IP_1} 130 131 *** Keywords *** 132 Check Linux Interfaces 133 [Arguments] ${node} ${namespace} ${interface} 134 ${out}= Execute In Container ${node} ip netns exec ${namespace} ip address 135 Should Contain ${out} ${interface} 136 137 Check Linux Routes 138 [Arguments] ${node} ${namespace} ${ip} 139 ${out}= Execute In Container ${node} ip netns exec ${namespace} ip -6 route show 140 Should Contain ${out} ${ip} via 141 142 Check Linux Routes Gateway 143 [Arguments] ${node} ${namespace} ${ip} ${next_hop}=${EMPTY} 144 ${out}= Execute In Container ${node} ip netns exec ${namespace} ip -6 route show 145 Should Contain ${out} ${ip} via ${next_hop} 146 147 Check Linux Default Routes 148 [Arguments] ${node} ${namespace} ${next_hop} 149 ${out}= Execute In Container ${node} ip netns exec ${namespace} ip -6 route show 150 Should Contain ${out} default via ${next_hop} 151 152 Check Linux Routes Metric 153 [Arguments] ${node} ${namespace} ${ip} ${metric} 154 ${out}= Execute In Container ${node} ip netns exec ${namespace} ip -6 route show 155 Should Match Regexp ${out} ${ip} via.*metric ${metric}\\s 156 157 Check Removed Linux Route 158 [Arguments] ${node} ${namespace} ${ip} 159 ${out}= Execute In Container ${node} ip netns exec ${namespace} ip -6 route show 160 Should Not Contain ${out} ${ip} via 161 162 Ping in namespace 163 [Arguments] ${node} ${namespace} ${ip} 164 ${out}= Execute In Container ${node} ip netns exec ${namespace} ping6 -c 5 ${ip} 165 Should Contain ${out} from ${ip} 166 Should Not Contain ${out} 100% packet loss 167 168 Ping in namespace via interface 169 [Arguments] ${node} ${namespace} ${ip} ${interface} 170 ${out}= Execute In Container ${node} ip netns exec ${namespace} ping6 -c 5 -I ${interface} ${ip} 171 Should Contain ${out} from ${ip} 172 Should Not Contain ${out} 100% packet loss 173 174 TestSetup 175 Make Datastore Snapshots ${TEST_NAME}_test_setup 176 177 TestTeardown 178 Make Datastore Snapshots ${TEST_NAME}_test_teardown