[LTP] [PATCH 1/1] network/mc_cmds: fix testing with iproute2 <= ss161212

Petr Vorel pvorel@suse.cz
Wed Jan 18 13:57:58 CET 2017


Workaround for an upstream bug in ip:
https://bugzilla.kernel.org/show_bug.cgi?id=192741

+ add whitespace in log

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/network/multicast/mc_cmds/mc_cmds | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/testcases/network/multicast/mc_cmds/mc_cmds b/testcases/network/multicast/mc_cmds/mc_cmds
index 62f9e9197..63ba82fe0 100755
--- a/testcases/network/multicast/mc_cmds/mc_cmds
+++ b/testcases/network/multicast/mc_cmds/mc_cmds
@@ -50,12 +50,16 @@ do_test()
 	ip addr show $(tst_iface) | grep -q 'MULTICAST' || \
 		tst_brkm TFAIL "Multicast not listed for $(tst_iface)"
 
-	ip maddr show $(tst_iface) | grep -q '224.0.0.1' || \
-		tst_brkm TFAIL "all-host-group for $(tst_iface) not joined"
+	ip maddr show $(tst_iface) | grep -q '224.0.0.1'
+	if [ $? -ne 0 ]; then
+		tst_resm TINFO "ip failed to detect multicast, parsing /proc/net/igmp"
+		grep "$(tst_iface)\s*:" -A 1 /proc/net/igmp | tail -1 |grep -q '\s010000E0\s' || \
+			tst_brkm TFAIL "all-host-group for $(tst_iface) not joined"
+	fi
 
 	# Do the ping tests: Execute ping 224.0.0.1 - Verify that the proper
 	# number of responses are returned.
-	tst_resm TINFO "Ping all-host-groups address(over default route!)"
+	tst_resm TINFO "Ping all-host-groups address (over default route!)"
 	ping -c2 224.0.0.1 > ping_out.log || \
 		tst_brkm TFAIL "No response from MC hosts to ping 224.0.0.1"
 
-- 
2.11.0



More information about the ltp mailing list