Skip to content

Commit

Permalink
Validated STP/RSTP/PVRST integration tests
Browse files Browse the repository at this point in the history
The original tests were moved to netlab-examples repository.
  • Loading branch information
ipspace committed Jan 3, 2025
1 parent 31e0cbd commit 79a1591
Show file tree
Hide file tree
Showing 19 changed files with 451 additions and 795 deletions.
48 changes: 48 additions & 0 deletions tests/integration/stp/01-stp-priority.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
message: |
The devices under test form a layer-2 triangle in the red VLAN.
The bridge with the highest priority (s1) should become the root, the link
x1-x2 should get blocked
module: [ vlan, stp ]

groups:
_auto_create: true
probes:
members: [ x1, x2 ]
device: frr

nodes:
dut:
stp.priority: 4096 # High STP bridge priority (low value) -> becomes root
x2:
stp.priority: 8192

vlans:
red:
mode: bridge
id: 42
links: [ dut-x1, dut-x2, x1-x2 ]

validate:
link_fwd:
wait: 40
wait_msg: Waiting for STP
nodes: [ x1 ]
pass: Link X1-DUT is forwarding; DUT is STP root
fail: Link X1-DUT is not forwarding; DUT is not STP root
devices: [ frr ]
exec: bridge link show|grep {{ interfaces[0].ifname }}
valid: |
"forwarding" in stdout
link_block:
wait: 10
wait_msg: Waiting for STP
nodes: [ x1 ]
pass: Link X1-X2 is blocking; DUT is STP root
fail: Link X1-X2 is not blocking; DUT is not STP root
devices: [ frr ]
exec: bridge link show|grep {{ interfaces[1].ifname }}
valid: |
"blocking" in stdout
35 changes: 0 additions & 35 deletions tests/integration/stp/01-vlan-loop-single.yml

This file was deleted.

62 changes: 62 additions & 0 deletions tests/integration/stp/02-stp-trunk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
message: |
The devices under test form a layer-2 triangle of VLAN trunks
The bridge with the highest priority (s1) should become the root on all VLANs,
the link x1-x2 should get blocked. Please note that we're running traditional
STP where BPDUs are sent untagged.
module: [ vlan, stp ]

groups:
_auto_create: true
probes:
members: [ x1, x2 ]
device: eos

nodes:
dut:
stp.priority: 4096 # High STP bridge priority (low value) -> becomes root
x2:
stp.priority: 16384

vlans:
red:
mode: bridge
id: 42
blue:
mode: bridge
id: 76

links:
- dut:
x1:
vlan.trunk: [ red, blue ]
- dut:
x2:
vlan.trunk: [ red, blue ]
- x1:
x2:
vlan.trunk: [ red, blue ]

validate:
link_fwd:
wait: 40
wait_msg: Waiting for STP
nodes: [ x1 ]
devices: [ eos ]
pass: Port X1 => DUT the root port; DUT is STP root
fail: Port X1 => DUT the not root port; DUT is not STP root
show: spanning-tree | json
valid: |
spanningTreeInstances.MST0.rootPort.interface == 'Ethernet1'
link_block:
wait: 10
wait_msg: Waiting for STP
nodes: [ x1 ]
devices: [ eos ]
pass: Link X1-X2 is blocking; DUT is STP root
fail: Link X1-X2 is not blocking; DUT is not STP root
show: spanning-tree | json
valid: |
spanningTreeInstances.MST0.interfaces.Ethernet2.state == 'discarding'
103 changes: 0 additions & 103 deletions tests/integration/stp/02-vlan-loop-multiple.yml

This file was deleted.

63 changes: 0 additions & 63 deletions tests/integration/stp/02b-vlan-loop-trunk.yml

This file was deleted.

73 changes: 73 additions & 0 deletions tests/integration/stp/03-stp-port-priority.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
message: |
The devices under test form a loop in the red VLAN.
The link with the lowest port_priority should be forwarding, all other links
should be blocked.
module: [ vlan, stp ]

groups:
_auto_create: true
probes:
members: [ x1 ]
device: frr

nodes:
dut:
stp.priority: 4096 # High STP bridge priority (low value) -> becomes root

vlans:
red:
mode: bridge
id: 42

links:
- dut:
stp.port_priority: 12
x1:
vlan.access: red
- dut:
stp.port_priority: 10
x1:
vlan.access: red
- dut:
stp.port_priority: 0
x1:
vlan.access: red

validate:
eth3_fwd:
wait: 40
wait_msg: Waiting for STP
nodes: [ x1 ]
devices: [ frr ]
pass: Third link is forwarding; DUT set the correct port priority
fail: Third link is not forwarding; DUT probably did not set port priority
stop_on_error: True
exec: bridge link show|grep {{ interfaces[2].ifname }}
valid: |
"forwarding" in stdout
eth1_block:
wait: 10
wait_msg: Waiting for STP
nodes: [ x1 ]
devices: [ frr ]
pass: Second link is blocking; DUT set the correct port priority
fail: Second link is not blocking; DUT probably did not set port priority
stop_on_error: True
exec: bridge link show|grep {{ interfaces[0].ifname }}
valid: |
"blocking" in stdout
eth2_block:
wait: 10
wait_msg: Waiting for STP
nodes: [ x1 ]
devices: [ frr ]
pass: First link is blocking; DUT set the correct port priority
fail: First link is not blocking; DUT probably did not set port priority
stop_on_error: True
exec: bridge link show|grep {{ interfaces[1].ifname }}
valid: |
"blocking" in stdout
Loading

0 comments on commit 79a1591

Please sign in to comment.