go.ligato.io/vpp-agent/v3@v3.5.0/tests/robot/suites/crud/veth_crud.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/vpp_api.robot 10 Resource ../../libraries/vpp_term.robot 11 Resource ../../libraries/docker.robot 12 Resource ../../libraries/setup-teardown.robot 13 Resource ../../libraries/configurations.robot 14 Resource ../../libraries/etcdctl.robot 15 Resource ../../libraries/linux.robot 16 17 Resource ../../libraries/interface/interface_generic.robot 18 19 Force Tags crud IPv4 20 Suite Setup Testsuite Setup 21 Suite Teardown Testsuite Teardown 22 Test Setup TestSetup 23 Test Teardown TestTeardown 24 25 *** Variables *** 26 ${VARIABLES}= common 27 ${ENV}= common 28 ${VETH1_MAC}= 1a:00:00:11:11:11 29 ${VETH1_SEC_MAC}= 1a:00:00:11:11:12 30 ${VETH2_MAC}= 2a:00:00:22:22:22 31 ${VETH3_MAC}= 3a:00:00:33:33:33 32 ${VETH4_MAC}= 4a:00:00:44:44:44 33 ${WAIT_TIMEOUT}= 20s 34 ${SYNC_SLEEP}= 3s 35 *** Test Cases *** 36 Configure Environment 37 [Tags] setup 38 Configure Environment 1 39 40 Show Interfaces Before Setup 41 vpp_term: Show Interfaces agent_vpp_1 42 43 Add Veth1 Interface 44 linux: Interface Not Exists node=agent_vpp_1 mac=${VETH1_MAC} 45 Put Veth Interface With IP node=agent_vpp_1 name=vpp1_veth1 46 ... mac=${VETH1_MAC} peer=vpp1_veth2 ip=10.10.1.1 prefix=24 mtu=1500 47 linux: Interface Not Exists node=agent_vpp_1 mac=${VETH1_MAC} 48 49 Add Veth2 Interface 50 linux: Interface Not Exists node=agent_vpp_1 mac=${VETH2_MAC} 51 Put Veth Interface node=agent_vpp_1 name=vpp1_veth2 52 ... mac=${VETH2_MAC} peer=vpp1_veth1 53 54 Check That Veth1 And Veth2 Interfaces Are Created 55 Wait Until Keyword Succeeds ${WAIT_TIMEOUT} ${SYNC_SLEEP} 56 ... linux: Interface Is Created node=agent_vpp_1 mac=${VETH1_MAC} 57 Wait Until Keyword Succeeds ${WAIT_TIMEOUT} ${SYNC_SLEEP} 58 ... linux: Interface Is Created node=agent_vpp_1 mac=${VETH2_MAC} 59 linux: Check Veth Interface State agent_vpp_1 vpp1_veth1 60 ... mac=${VETH1_MAC} ipv4=10.10.1.1/24 mtu=1500 state=up 61 linux: Check Veth Interface State agent_vpp_1 vpp1_veth2 62 ... mac=${VETH2_MAC} state=up 63 64 Add Veth3 Interface 65 linux: Interface Not Exists node=agent_vpp_1 mac=${VETH3_MAC} 66 Put Veth Interface With IP node=agent_vpp_1 name=vpp1_veth3 67 ... mac=${VETH3_MAC} peer=vpp1_veth4 ip=20.20.1.1 prefix=24 mtu=1500 68 linux: Interface Not Exists node=agent_vpp_1 mac=${VETH3_MAC} 69 70 Add Veth4 Interface 71 linux: Interface Not Exists node=agent_vpp_1 mac=${VETH4_MAC} 72 Put Veth Interface node=agent_vpp_1 name=vpp1_veth4 73 ... mac=${VETH4_MAC} peer=vpp1_veth3 enabled=false 74 75 Check That Veth3 And Veth4 Interfaces Are Created 76 Wait Until Keyword Succeeds ${WAIT_TIMEOUT} ${SYNC_SLEEP} 77 ... linux: Interface Is Created node=agent_vpp_1 mac=${VETH3_MAC} 78 Wait Until Keyword Succeeds ${WAIT_TIMEOUT} ${SYNC_SLEEP} 79 ... linux: Interface Is Created node=agent_vpp_1 mac=${VETH4_MAC} 80 linux: Check Veth Interface State agent_vpp_1 vpp1_veth3 81 ... mac=${VETH3_MAC} ipv4=20.20.1.1/24 mtu=1500 state=lowerlayerdown 82 linux: Check Veth Interface State agent_vpp_1 vpp1_veth4 83 ... mac=${VETH4_MAC} state=down 84 85 Check That Veth1 And Veth2 Interfaces Are Still Configured 86 linux: Check Veth Interface State agent_vpp_1 vpp1_veth1 87 ... mac=${VETH1_MAC} ipv4=10.10.1.1/24 mtu=1500 state=up 88 linux: Check Veth Interface State agent_vpp_1 vpp1_veth2 89 ... mac=${VETH2_MAC} state=up 90 91 Update Veth1 Interface 92 Put Veth Interface With IP node=agent_vpp_1 name=vpp1_veth1 93 ... mac=${VETH1_SEC_MAC} peer=vpp1_veth2 ip=11.11.1.1 prefix=28 mtu=1600 94 Wait Until Keyword Succeeds ${WAIT_TIMEOUT} ${SYNC_SLEEP} 95 ... linux: Interface Is Deleted node=agent_vpp_1 mac=${VETH1_MAC} 96 Wait Until Keyword Succeeds ${WAIT_TIMEOUT} ${SYNC_SLEEP} 97 ... linux: Interface Is Created node=agent_vpp_1 mac=${VETH1_SEC_MAC} 98 linux: Check Veth Interface State agent_vpp_1 vpp1_veth1 99 ... mac=${VETH1_SEC_MAC} ipv4=11.11.1.1/28 mtu=1600 state=up 100 101 Check That Veth2 And Veth3 And Veth4 interfaces Are Still Configured 102 linux: Check Veth Interface State agent_vpp_1 vpp1_veth2 103 ... mac=${VETH2_MAC} state=up 104 linux: Check Veth Interface State agent_vpp_1 vpp1_veth3 105 ... mac=${VETH3_MAC} ipv4=20.20.1.1/24 mtu=1500 state=lowerlayerdown 106 linux: Check Veth Interface State agent_vpp_1 vpp1_veth4 107 ... mac=${VETH4_MAC} state=down 108 109 Delete Veth2 Interface 110 Delete Linux Interface node=agent_vpp_1 name=vpp1_veth2 111 Wait Until Keyword Succeeds ${WAIT_TIMEOUT} ${SYNC_SLEEP} 112 ... linux: Interface Is Deleted node=agent_vpp_1 mac=${VETH1_SEC_MAC} 113 Wait Until Keyword Succeeds ${WAIT_TIMEOUT} ${SYNC_SLEEP} 114 ... linux: Interface Is Deleted node=agent_vpp_1 mac=${VETH2_MAC} 115 116 Check That Veth3 And Veth4 Are Still Configured 117 linux: Check Veth Interface State agent_vpp_1 vpp1_veth3 118 ... mac=${VETH3_MAC} ipv4=20.20.1.1/24 mtu=1500 state=lowerlayerdown 119 linux: Check Veth Interface State agent_vpp_1 vpp1_veth4 120 ... mac=${VETH4_MAC} state=down 121 122 Delete Veth3 Interface 123 Delete Linux Interface node=agent_vpp_1 name=vpp1_veth3 124 Wait Until Keyword Succeeds ${WAIT_TIMEOUT} ${SYNC_SLEEP} 125 ... linux: Interface Is Deleted node=agent_vpp_1 mac=${VETH3_MAC} 126 Wait Until Keyword Succeeds ${WAIT_TIMEOUT} ${SYNC_SLEEP} 127 ... linux: Interface Is Deleted node=agent_vpp_1 mac=${VETH4_MAC} 128 129 Show Interfaces And Other Objects After Setup 130 vpp_term: Show Interfaces agent_vpp_1 131 vpp_term: Show Interfaces agent_vpp_2 132 Write To Machine agent_vpp_1_term show int addr 133 Write To Machine agent_vpp_2_term show int addr 134 Write To Machine agent_vpp_1_term show h 135 Write To Machine agent_vpp_2_term show h 136 Write To Machine agent_vpp_1_term show br 137 Write To Machine agent_vpp_2_term show br 138 Write To Machine agent_vpp_1_term show br 1 detail 139 Write To Machine agent_vpp_2_term show br 1 detail 140 Write To Machine agent_vpp_1_term show err 141 Write To Machine agent_vpp_2_term show err 142 vpp_api: Interfaces Dump agent_vpp_1 143 vpp_api: Interfaces Dump agent_vpp_2 144 Execute In Container agent_vpp_1 ip a 145 Execute In Container agent_vpp_2 ip a 146 147 *** Keywords *** 148 TestSetup 149 Make Datastore Snapshots ${TEST_NAME}_test_setup 150 151 TestTeardown 152 Make Datastore Snapshots ${TEST_NAME}_test_teardown 153