From 0829238ac96368a49613b1173d360cdeee974902 Mon Sep 17 00:00:00 2001 From: Ivan Pepelnjak Date: Sat, 2 Nov 2024 18:07:32 +0100 Subject: [PATCH] Rewrite the LAG integration tests Integration tests should contain the minimum topology required to test an individual feature to simplify the troubleshooting. Ideally, they would contain a single device under test and another 'standard' device to test device interworking. Finally, it's always better to hop-by-hop control-plane features (for example, OSPF adjacency) than end-to-end pings. --- tests/integration/lag/01-l3-lag.yml | 43 +++++++---------- .../integration/lag/02-l3-lag-with-vlans.yml | 47 ------------------- tests/integration/lag/02-lag-vlan-trunk.yml | 40 ++++++++++++++++ 3 files changed, 56 insertions(+), 74 deletions(-) delete mode 100644 tests/integration/lag/02-l3-lag-with-vlans.yml create mode 100644 tests/integration/lag/02-lag-vlan-trunk.yml diff --git a/tests/integration/lag/01-l3-lag.yml b/tests/integration/lag/01-l3-lag.yml index feed42823..0c62bd30e 100644 --- a/tests/integration/lag/01-l3-lag.yml +++ b/tests/integration/lag/01-l3-lag.yml @@ -1,36 +1,25 @@ --- message: | - The devices under test are a pair of routers with a L3 LAG link between them - h1 and h2 should be able to ping each other + The device under is a router with a L3 LAG link connected to a FRR device. The + devices should be able to establish an OSPF adjacency. + groups: - _auto_create: True - hosts: - members: [ h1, h2 ] - device: linux - provider: clab switches: - members: [ r1,r2,r3 ] + members: [ dut, xr ] module: [ lag, ospf ] +nodes: + dut: + xr: + device: frr + links: -- lag.members: [r1-r2,r1-r2] -- lag.ifindex: 0 # Name it as 'bond0' -> First one becomes 'bond1' - lag.members: - - r2: - ifindex: 3 - r3: - ifindex: 3 - - r2: - ifindex: 4 - r3: - ifindex: 4 -- h1-r1 -- r3-h2 +- lag.members: [ dut-xr, dut-xr ] validate: - ping: - description: Pinging H2 from H1 - nodes: [ h1 ] - wait_msg: Waiting for STP to enable the ports - wait: 45 - plugin: ping('h2') + adj: + description: Check OSPF adjacencies + wait_msg: Waiting for OSPF adjacency process to complete + wait: 50 + nodes: [ xr ] + plugin: ospf_neighbor(nodes.dut.ospf.router_id) diff --git a/tests/integration/lag/02-l3-lag-with-vlans.yml b/tests/integration/lag/02-l3-lag-with-vlans.yml deleted file mode 100644 index b025cc2b3..000000000 --- a/tests/integration/lag/02-l3-lag-with-vlans.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- -message: | - The devices under test are a pair of routers with a L3 LAG link with a trunk of VLANs between them - h1 and h2 should be able to ping each other, same applies for h3 and h4 -groups: - _auto_create: True - hosts: - members: [ h1, h2, h3, h4 ] - device: linux - provider: clab - switches: - members: [ r1,r2 ] - module: [lag,vlan] - -vlans: - v1: - v2: - -links: -- vlan.trunk: [ v1, v2 ] - lag.members: - - r1-r2 - - r1-r2 -- r1: - vlan.access: v1 - h1: -- r2: - vlan.access: v1 - h2: -- r1: - vlan.access: v2 - h3: -- r2: - vlan.access: v2 - h4: - -validate: - ping12: - description: Pinging H2 from H1 on VLAN v1 - nodes: [ h1 ] - wait_msg: Waiting for STP to enable the ports - wait: 45 - plugin: ping('h2') - ping34: - description: Pinging H4 from H3 on VLAN v2 - nodes: [ h3 ] - plugin: ping('h4') \ No newline at end of file diff --git a/tests/integration/lag/02-lag-vlan-trunk.yml b/tests/integration/lag/02-lag-vlan-trunk.yml new file mode 100644 index 000000000..f2ace16e3 --- /dev/null +++ b/tests/integration/lag/02-lag-vlan-trunk.yml @@ -0,0 +1,40 @@ +--- +message: | + The device under test is a layer-2 switch connected with a LAG VLAN trunk to + another layer-2 switch. Host in the same VLAN should be able to ping each + other. +groups: + _auto_create: True + hosts: + members: [ h1, h2, h3, h4 ] + device: linux + provider: clab + switches: + members: [ dut, xs ] + module: [ lag, vlan ] + probe: + members: [ xs ] + device: frr + +vlans: + v1: + links: [ dut-h1, xs-h2 ] + v2: + links: [ dut-h3, xs-h4 ] + +links: +- vlan.trunk: [ v1, v2 ] + lag.members: [ dut-xs, dut-xs ] + +validate: + ping_v1: + description: Pinging H2 from H1 on VLAN v1 + nodes: [ h1 ] + wait_msg: Waiting for STP to enable the ports + wait: 45 + plugin: ping('h2') + ping_v2: + description: Pinging H4 from H3 on VLAN v2 + wait: 10 + nodes: [ h3 ] + plugin: ping('h4')