go.ligato.io/vpp-agent/v3@v3.5.0/tests/robot/suites/traffic/tapv2_int_traffic/tapv2_int_traffic.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 Resource ../../../libraries/all_libs.robot 9 Resource ../../../libraries/pretty_keywords.robot 10 11 Force Tags traffic IPv4 ExpectedFailure 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 ${NAME_VPP1_TAP1}= vpp1_tap1 21 ${NAME_VPP2_TAP1}= vpp2_tap1 22 ${MAC_VPP1_TAP1}= 12:21:21:11:11:11 23 ${MAC_VPP2_TAP1}= 22:21:21:22:22:22 24 ${IP_VPP1_TAP1}= 10.10.1.1 25 ${IP_VPP2_TAP1}= 20.20.1.1 26 ${IP_LINUX_VPP1_TAP1}= 10.10.1.2 27 ${IP_LINUX_VPP2_TAP1}= 20.20.1.2 28 ${IP_VPP1_TAP1_NETWORK}= 10.10.1.0 29 ${IP_VPP2_TAP1_NETWORK}= 20.20.1.0 30 ${NAME_VPP1_MEMIF1}= vpp1_memif1 31 ${NAME_VPP2_MEMIF1}= vpp2_memif1 32 ${MAC_VPP1_MEMIF1}= 13:21:21:11:11:11 33 ${MAC_VPP2_MEMIF1}= 23:21:21:22:22:22 34 ${IP_VPP1_MEMIF1}= 192.168.1.1 35 ${IP_VPP2_MEMIF1}= 192.168.1.2 36 ${PREFIX}= 24 37 ${UP_STATE}= up 38 ${WAIT_TIMEOUT}= 20s 39 ${SYNC_SLEEP}= 3s 40 # wait for resync vpps after restart 41 ${RESYNC_WAIT}= 50s 42 43 *** Test Cases *** 44 Configure Environment 45 [Tags] setup 46 Configure Environment 1 47 48 Show Interfaces Before Setup 49 vpp_term: Show Interfaces agent_vpp_1 50 vpp_term: Show Interfaces agent_vpp_2 51 52 Add VPP1_TAP1 Interface 53 vpp_term: Interface Not Exists node=agent_vpp_1 mac=${MAC_VPP1_TAP1} 54 Put TAPv2 Interface With IP node=agent_vpp_1 name=${NAME_VPP1_TAP1} mac=${MAC_VPP1_TAP1} ip=${IP_VPP1_TAP1} prefix=${PREFIX} host_if_name=linux_${NAME_VPP1_TAP1} 55 linux: Set Host TAP Interface node=agent_vpp_1 host_if_name=linux_${NAME_VPP1_TAP1} ip=${IP_LINUX_VPP1_TAP1} prefix=${PREFIX} 56 57 Check VPP1_TAP1 Interface Is Created 58 ${interfaces}= vat_term: Interfaces Dump node=agent_vpp_1 59 Wait Until Keyword Succeeds ${WAIT_TIMEOUT} ${SYNC_SLEEP} vpp_term: Interface Is Created node=agent_vpp_1 mac=${MAC_VPP1_TAP1} 60 ${actual_state}= vpp_term: Check TAPv2 interface State agent_vpp_1 ${NAME_VPP1_TAP1} mac=${MAC_VPP1_TAP1} ipv4=${IP_VPP1_TAP1}/${PREFIX} state=${UP_STATE} 61 62 Check Ping Between VPP1 and linux_VPP1_TAP1 Interface 63 linux: Check Ping node=agent_vpp_1 ip=${IP_VPP1_TAP1} 64 vpp_term: Check Ping node=agent_vpp_1 ip=${IP_LINUX_VPP1_TAP1} 65 66 Add VPP1_memif1 Interface 67 vpp_term: Interface Not Exists node=agent_vpp_1 mac=${MAC_VPP1_MEMIF1} 68 Put Memif Interface With IP node=agent_vpp_1 name=${NAME_VPP1_MEMIF1} mac=${MAC_VPP1_MEMIF1} master=true id=1 ip=${IP_VPP1_MEMIF1} prefix=24 socket=memif.sock 69 Wait Until Keyword Succeeds ${WAIT_TIMEOUT} ${SYNC_SLEEP} vpp_term: Interface Is Created node=agent_vpp_1 mac=${MAC_VPP1_MEMIF1} 70 71 Add VPP2_TAP1 Interface 72 vpp_term: Interface Not Exists node=agent_vpp_2 mac=${MAC_VPP2_TAP1} 73 Put TAPv2 Interface With IP node=agent_vpp_2 name=${NAME_VPP2_TAP1} mac=${MAC_VPP2_TAP1} ip=${IP_VPP2_TAP1} prefix=${PREFIX} host_if_name=linux_${NAME_VPP2_TAP1} 74 linux: Set Host TAP Interface node=agent_vpp_2 host_if_name=linux_${NAME_VPP2_TAP1} ip=${IP_LINUX_VPP2_TAP1} prefix=${PREFIX} 75 76 Check VPP2_TAP1 Interface Is Created 77 ${interfaces}= vat_term: Interfaces Dump node=agent_vpp_1 78 Wait Until Keyword Succeeds ${WAIT_TIMEOUT} ${SYNC_SLEEP} vpp_term: Interface Is Created node=agent_vpp_2 mac=${MAC_VPP2_TAP1} 79 ${actual_state}= vpp_term: Check TAPv2 interface State agent_vpp_2 ${NAME_VPP2_TAP1} mac=${MAC_VPP2_TAP1} ipv4=${IP_VPP2_TAP1}/${PREFIX} state=${UP_STATE} 80 81 Check Ping Between VPP2 And linux_VPP2_TAP1 Interface 82 linux: Check Ping node=agent_vpp_2 ip=${IP_VPP2_TAP1} 83 vpp_term: Check Ping node=agent_vpp_2 ip=${IP_LINUX_VPP2_TAP1} 84 85 Add VPP2_memif1 Interface 86 vpp_term: Interface Not Exists node=agent_vpp_2 mac=${MAC_VPP2_MEMIF1} 87 Put Memif Interface With IP node=agent_vpp_2 name=${NAME_VPP2_MEMIF1} mac=${MAC_VPP2_MEMIF1} master=false id=1 ip=${IP_VPP2_MEMIF1} prefix=24 socket=memif.sock 88 Wait Until Keyword Succeeds ${WAIT_TIMEOUT} ${SYNC_SLEEP} vpp_term: Interface Is Created node=agent_vpp_1 mac=${MAC_VPP1_MEMIF1} 89 90 Check Ping From VPP1 To VPP2_memif1 91 vpp_term: Check Ping node=agent_vpp_1 ip=${IP_VPP2_MEMIF1} 92 93 Check Ping From VPP2 To VPP1_memif1 94 vpp_term: Check Ping node=agent_vpp_2 ip=${IP_VPP1_MEMIF1} 95 96 Ping From VPP1 Linux To VPP2_TAP1 And LINUX_VPP2_TAP1 Should Not Pass 97 ${status1}= Run Keyword And Return Status linux: Check Ping node=agent_vpp_1 ip=${IP_VPP2_TAP1} 98 ${status2}= Run Keyword And Return Status linux: Check Ping node=agent_vpp_1 ip=${IP_LINUX_VPP2_TAP1} 99 Should Be Equal As Strings ${status1} False 100 Should Be Equal As Strings ${status2} False 101 102 Ping From VPP2 Linux To VPP1_TAP1 And LINUX_VPP1_TAP1 Should Not Pass 103 ${status1}= Run Keyword And Return Status linux: Check Ping node=agent_vpp_2 ip=${IP_VPP1_TAP1} 104 ${status2}= Run Keyword And Return Status linux: Check Ping node=agent_vpp_2 ip=${IP_LINUX_VPP1_TAP1} 105 Should Be Equal As Strings ${status1} False 106 Should Be Equal As Strings ${status2} False 107 108 Add Static Route From VPP1 Linux To VPP2 109 linux: Add Route node=agent_vpp_1 destination_ip=${IP_VPP2_TAP1_NETWORK} prefix=${PREFIX} next_hop_ip=${IP_VPP1_TAP1} 110 111 Add Static Route From VPP1 To VPP2 112 Create Route On agent_vpp_1 With IP 20.20.1.0/24 With Next Hop 192.168.1.2 And Vrf Id 0 113 114 Add Static Route From VPP2 Linux To VPP1 115 linux: Add Route node=agent_vpp_2 destination_ip=${IP_VPP1_TAP1_NETWORK} prefix=${PREFIX} next_hop_ip=${IP_VPP2_TAP1} 116 117 Add Static Route From VPP2 To VPP1 118 Create Route On agent_vpp_2 With IP 10.10.1.0/24 With Next Hop 192.168.1.1 And Vrf Id 0 119 120 Check Ping From VPP1 Linux To VPP2_TAP1 And LINUX_VPP2_TAP1 121 linux: Check Ping node=agent_vpp_1 ip=${IP_VPP2_TAP1} 122 linux: Check Ping node=agent_vpp_1 ip=${IP_LINUX_VPP2_TAP1} 123 124 Check Ping From VPP2 Linux To VPP1_TAP1 And LINUX_VPP1_TAP1 125 linux: Check Ping node=agent_vpp_2 ip=${IP_VPP1_TAP1} 126 linux: Check Ping node=agent_vpp_2 ip=${IP_LINUX_VPP1_TAP1} 127 128 Remove VPP Nodes 129 Remove All Nodes 130 Sleep ${SYNC_SLEEP} 131 132 Start VPP1 And VPP2 Again 133 Add Agent VPP Node agent_vpp_1 134 Add Agent VPP Node agent_vpp_2 135 Sleep ${RESYNC_WAIT} 136 137 Create linux_VPP1_TAP1 And linux_VPP2_TAP1 Interfaces After Resync 138 linux: Set Host TAP Interface node=agent_vpp_1 host_if_name=linux_${NAME_VPP1_TAP1} ip=${IP_LINUX_VPP1_TAP1} prefix=${PREFIX} 139 linux: Set Host TAP Interface node=agent_vpp_2 host_if_name=linux_${NAME_VPP2_TAP1} ip=${IP_LINUX_VPP2_TAP1} prefix=${PREFIX} 140 141 Check Linux Interfaces On VPP1 After Resync 142 ${out}= Execute In Container agent_vpp_1 ip a 143 Should Contain ${out} linux_${NAME_VPP1_TAP1} 144 145 Check Interfaces On VPP1 After Resync 146 ${out}= vpp_term: Show Interfaces agent_vpp_1 147 ${int}= Get Interface Internal Name node=agent_vpp_1 interface=${NAME_VPP1_MEMIF1} 148 Should Contain ${out} ${int} 149 ${int}= Get Interface Internal Name node=agent_vpp_1 interface=${NAME_VPP1_TAP1} 150 Should Contain ${out} ${int} 151 152 Check Linux Interfaces On VPP2 After Resync 153 ${out}= Execute In Container agent_vpp_2 ip a 154 Should Contain ${out} linux_${NAME_VPP2_TAP1} 155 156 Check Interfaces On VPP2 After Resync 157 ${out}= vpp_term: Show Interfaces agent_vpp_2 158 ${int}= Get Interface Internal Name node=agent_vpp_2 interface=${NAME_VPP2_MEMIF1} 159 Should Contain ${out} ${int} 160 ${int}= Get Interface Internal Name node=agent_vpp_2 interface=${NAME_VPP2_TAP1} 161 Should Contain ${out} ${int} 162 163 Add Static Route From VPP1 Linux To VPP2 After Resync 164 linux: Add Route node=agent_vpp_1 destination_ip=${IP_VPP2_TAP1_NETWORK} prefix=${PREFIX} next_hop_ip=${IP_VPP1_TAP1} 165 166 Add Static Route From VPP2 Linux To VPP1 After Resync 167 linux: Add Route node=agent_vpp_2 destination_ip=${IP_VPP1_TAP1_NETWORK} prefix=${PREFIX} next_hop_ip=${IP_VPP2_TAP1} 168 169 Check Ping From VPP1 Linux To VPP2_TAP1 And LINUX_VPP2_TAP1 After Resync 170 linux: Check Ping node=agent_vpp_1 ip=${IP_VPP2_TAP1} 171 linux: Check Ping node=agent_vpp_1 ip=${IP_LINUX_VPP2_TAP1} 172 173 Check Ping From VPP2 Linux To VPP1_TAP1 And LINUX_VPP1_TAP1 After Resync 174 linux: Check Ping node=agent_vpp_2 ip=${IP_VPP1_TAP1} 175 linux: Check Ping node=agent_vpp_2 ip=${IP_LINUX_VPP1_TAP1} 176 177 *** Keywords *** 178 TestSetup 179 Make Datastore Snapshots ${TEST_NAME}_test_setup 180 181 TestTeardown 182 Make Datastore Snapshots ${TEST_NAME}_test_teardown