Commit f70f5f1a authored by Ido Schimmel's avatar Ido Schimmel Committed by Paolo Abeni

selftests: forwarding: Use same VRF for port and VLAN upper

The test creates a separate VRF for the VLAN upper, but does not destroy
it during cleanup, resulting in "RTNETLINK answers: File exists" errors.

Fix by using the same VRF for the port and its VLAN upper. This is OK
since their IP addresses do not overlap.

Before:

 # ./bridge_locked_port.sh
 TEST: Locked port ipv4                                              [ OK ]
 TEST: Locked port ipv6                                              [ OK ]
 TEST: Locked port vlan                                              [ OK ]

 # ./bridge_locked_port.sh
 RTNETLINK answers: File exists
 RTNETLINK answers: File exists
 RTNETLINK answers: File exists
 RTNETLINK answers: File exists
 RTNETLINK answers: File exists
 RTNETLINK answers: File exists
 TEST: Locked port ipv4                                              [ OK ]
 TEST: Locked port ipv6                                              [ OK ]
 TEST: Locked port vlan                                              [ OK ]

After:

 # ./bridge_locked_port.sh
 TEST: Locked port ipv4                                              [ OK ]
 TEST: Locked port ipv6                                              [ OK ]
 TEST: Locked port vlan                                              [ OK ]

 # ./bridge_locked_port.sh
 TEST: Locked port ipv4                                              [ OK ]
 TEST: Locked port ipv6                                              [ OK ]
 TEST: Locked port vlan                                              [ OK ]

Fixes: b2b681a4 ("selftests: forwarding: tests of locked port feature")
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 917b149a
......@@ -9,9 +9,7 @@ source lib.sh
h1_create()
{
simple_if_init $h1 192.0.2.1/24 2001:db8:1::1/64
vrf_create "vrf-vlan-h1"
ip link set dev vrf-vlan-h1 up
vlan_create $h1 100 vrf-vlan-h1 198.51.100.1/24
vlan_create $h1 100 v$h1 198.51.100.1/24
}
h1_destroy()
......@@ -23,9 +21,7 @@ h1_destroy()
h2_create()
{
simple_if_init $h2 192.0.2.2/24 2001:db8:1::2/64
vrf_create "vrf-vlan-h2"
ip link set dev vrf-vlan-h2 up
vlan_create $h2 100 vrf-vlan-h2 198.51.100.2/24
vlan_create $h2 100 v$h2 198.51.100.2/24
}
h2_destroy()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment