Skip to content

Commit 0f108ae

Browse files
dsaherndavem330
authored andcommitted
selftests: Fix raw socket bind tests with VRF
Commit referenced below added negative socket bind tests for VRF. The socket binds should fail since the address to bind to is in a VRF yet the socket is not bound to the VRF or a device within it. Update the expected return code to check for 1 (bind failure) so the test passes when the bind fails as expected. Add a 'show_hint' comment to explain why the bind is expected to fail. Fixes: 75b2b2b ("selftests: Add ipv4 address bind tests to fcnal-test") Reported-by: Li Zhijian <lizhijian@fujitsu.com> Signed-off-by: David Ahern <dsahern@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 7e01475 commit 0f108ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/testing/selftests/net/fcnal-test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1810,8 +1810,9 @@ ipv4_addr_bind_vrf()
18101810
for a in ${NSA_IP} ${VRF_IP}
18111811
do
18121812
log_start
1813+
show_hint "Socket not bound to VRF, but address is in VRF"
18131814
run_cmd nettest -s -R -P icmp -l ${a} -b
1814-
log_test_addr ${a} $? 0 "Raw socket bind to local address"
1815+
log_test_addr ${a} $? 1 "Raw socket bind to local address"
18151816

18161817
log_start
18171818
run_cmd nettest -s -R -P icmp -l ${a} -I ${NSA_DEV} -b

0 commit comments

Comments
 (0)