net/multicast: Create mcast_setup_normal()
PATCH 1/4 net/multicast: Create mcast_setup_normal()
to reduce duplicity
+ define TST_SETUP in tests
--- .../grp-operation/mcast-group-multiple-socket.sh | 1 + .../multicast/grp-operation/mcast-group-same-group.sh | 6 +----- .../multicast/grp-operation/mcast-group-single-socket.sh | 1 + .../multicast/grp-operation/mcast-group-source-filter.sh | 6 +----- .../network/stress/multicast/grp-operation/mcast-lib.sh | 6 +++++- .../stress/multicast/packet-flood/mcast-pktfld01.sh | 9 +++------ .../stress/multicast/packet-flood/mcast-pktfld02.sh | 9 +++------ .../stress/multicast/query-flood/mcast-queryfld01.sh | 6 +----- .../stress/multicast/query-flood/mcast-queryfld02.sh | 6 +----- .../stress/multicast/query-flood/mcast-queryfld03.sh | 6 +----- .../stress/multicast/query-flood/mcast-queryfld04.sh | 6 +----- .../stress/multicast/query-flood/mcast-queryfld05.sh | 6 +----- .../stress/multicast/query-flood/mcast-queryfld06.sh | 8 ++------ 13 files changed, 22 insertions(+), 54 deletions(-)
testcases/network/stress/multicast/grp-operation/mcast-group-multiple-socket.sh +1 -0
@@ -19,6 +19,7 @@ # # Author: Mitsuru Chinen <[email protected]> +TST_SETUP="do_setup" . mcast-lib.sh do_setup()
testcases/network/stress/multicast/grp-operation/mcast-group-same-group.sh +1 -5
@@ -19,13 +19,9 @@ # # Author: Mitsuru Chinen <[email protected]> +TST_SETUP="mcast_setup_normal" . mcast-lib.sh -do_setup() -{ - mcast_setup $MCASTNUM_NORMAL -} - do_test() { tst_res TINFO "joining and leaving the same IPv$TST_IPVER multicast group on $MCASTNUM_NORMAL sockets in $NS_TIMES times"
testcases/network/stress/multicast/grp-operation/mcast-group-single-socket.sh +1 -0
@@ -19,6 +19,7 @@ # # Author: Mitsuru Chinen <[email protected]> +TST_SETUP="do_setup" . mcast-lib.sh do_setup()
testcases/network/stress/multicast/grp-operation/mcast-group-source-filter.sh +1 -5
@@ -19,13 +19,9 @@ # # Author: Mitsuru Chinen <[email protected]> +TST_SETUP="mcast_setup_normal" . mcast-lib.sh -do_setup() -{ - mcast_setup $MCASTNUM_NORMAL -} - do_test() { tst_res TINFO "joining and leaving the same IPv$TST_IPVER multicast group with a different source filters on $MCASTNUM_NORMAL sockets in $NS_TIMES times"
testcases/network/stress/multicast/grp-operation/mcast-lib.sh +5 -1
@@ -6,7 +6,6 @@ # # Setup script for multicast stress tests. -TST_SETUP="do_setup" TST_CLEANUP="mcast_cleanup" TST_TESTFUNC="do_test" TST_NEEDS_TMPDIR=1
@@ -59,6 +58,11 @@ mcast_setup() [ "$TST_IPV6" ] && mcast_setup6 || mcast_setup4 $max } +mcast_setup_normal() +{ + mcast_setup $MCASTNUM_NORMAL +} + mcast_cleanup4() { [ -n "$SYSFS_IGMP_MAX_MEMBERSHIPS" ] && sysctl -q -w net.ipv4.igmp_max_memberships=$SYSFS_IGMP_MAX_MEMBERSHIPS
testcases/network/stress/multicast/packet-flood/mcast-pktfld01.sh +3 -6
@@ -8,14 +8,11 @@ # a single socket, then receiving a large number of UDP packets at the socket TST_NEEDS_ROOT=1 +TST_SETUP="mcast_setup_normal" . mcast-lib.sh -do_setup() -{ - mcast_setup $MCASTNUM_NORMAL - MCAST_LCMD=ns-mcast_receiver - MCAST_RCMD=ns-udpsender -} +MCAST_LCMD="ns-mcast_receiver" +MCAST_RCMD="ns-udpsender" do_test() {
testcases/network/stress/multicast/packet-flood/mcast-pktfld02.sh +3 -6
@@ -9,14 +9,11 @@ # packets at each socket TST_NEEDS_ROOT=1 +TST_SETUP="mcast_setup_normal" . mcast-lib.sh -do_setup() -{ - mcast_setup $MCASTNUM_NORMAL - MCAST_LCMD=ns-mcast_receiver - MCAST_RCMD=ns-udpsender -} +MCAST_LCMD="ns-mcast_receiver" +MCAST_RCMD="ns-udpsender" do_test() {
testcases/network/stress/multicast/query-flood/mcast-queryfld01.sh +1 -5
@@ -9,13 +9,9 @@ TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 +TST_SETUP="mcast_setup_normal" . mcast-lib.sh -do_setup() -{ - mcast_setup $MCASTNUM_NORMAL -} - do_test() { tst_res TINFO "joining an IPv${TST_IPVER} multicast group on a single socket, then receiving a large number of General Queries in $NS_DURATION seconds"
testcases/network/stress/multicast/query-flood/mcast-queryfld02.sh +1 -5
@@ -10,13 +10,9 @@ TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 +TST_SETUP="mcast_setup_normal" . mcast-lib.sh -do_setup() -{ - mcast_setup $MCASTNUM_NORMAL -} - do_test() { tst_res TINFO "joining an IPv${TST_IPVER} multicast group on a single socket, then receiving a large number of Multicast Address Specific Query in $NS_DURATION seconds"
testcases/network/stress/multicast/query-flood/mcast-queryfld03.sh +1 -5
@@ -10,17 +10,13 @@ TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 +TST_SETUP="mcast_setup_normal" . mcast-lib.sh SRC_ADDR_IPV4="10.10.10.1" SRC_ADDR_IPV6="fec0:100:100:100::1" FILTER_MODE="include" -do_setup() -{ - mcast_setup $MCASTNUM_NORMAL -} - do_test() { tst_res TINFO "joining an IPv${TST_IPVER} multicast group on a single socket, then receiving a large number of Multicast Address and Source Specific Queries in $NS_DURATION seconds"
testcases/network/stress/multicast/query-flood/mcast-queryfld04.sh +1 -5
@@ -9,13 +9,9 @@ TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 +TST_SETUP="mcast_setup_normal" . mcast-lib.sh -do_setup() -{ - mcast_setup $MCASTNUM_NORMAL -} - do_test() { tst_res TINFO "joining $MCASTNUM_NORMAL IPv${TST_IPVER} multicast groups on separate socket, then receiving a large number of General Queries in $NS_DURATION seconds"
testcases/network/stress/multicast/query-flood/mcast-queryfld05.sh +1 -5
@@ -10,13 +10,9 @@ TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 +TST_SETUP="mcast_setup_normal" . mcast-lib.sh -do_setup() -{ - mcast_setup $MCASTNUM_NORMAL -} - do_test() { tst_res TINFO "joining $MCASTNUM_NORMAL IPv${TST_IPVER} multicast groups on separate sockets, then receiving a large number of Multicast Address Specific Queries in $NS_DURATION seconds"
testcases/network/stress/multicast/query-flood/mcast-queryfld06.sh +2 -6
@@ -10,22 +10,18 @@ TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 +TST_SETUP="mcast_setup_normal" . mcast-lib.sh SRC_ADDR_IPV4=10.10.10.1 SRC_ADDR_IPV6=fec0:100:100:100::1 FILTER_MODE="include" -do_setup() -{ - mcast_setup $MCASTNUM_NORMAL -} - do_test() { tst_res TINFO "joining $MCASTNUM_NORMAL IPv${TST_IPVER} multicast groups on separate sockets, then receiving a large number of Multicast Address and Source Specific Queries in $NS_DURATION seconds" - local prefix="$MCAST_IPV4_ADDR_PREFIX" + local prefix="$MCAST_IPV4_ADDR_PREFIX" local src_addr="$SRC_ADDR_IPV4" if [ "$TST_IPV6" ]; then prefix="$MCAST_IPV6_ADDR_PREFIX"
Signature · 1 line
2.30.0
PATCH 1/4 net/multicast: Create mcast_setup_normal()
Hi,
Quoted 6 lines
+++
b/testcases/network/stress/multicast/packet-flood/mcast-pktfld01.sh(quoted diff) +1
-0@@ -8,14 +8,11 @@ # a single socket, then receiving a large number of UDP packets at the socket TST_NEEDS_ROOT=1 +TST_SETUP="mcast_setup_normal"
Review line 15
Quoted 10 lines
(quoted diff) +2
-6. mcast-lib.sh -do_setup() -{ - mcast_setup $MCASTNUM_NORMAL - MCAST_LCMD=ns-mcast_receiver - MCAST_RCMD=ns-udpsender -} +MCAST_LCMD="ns-mcast_receiver" +MCAST_RCMD="ns-udpsender"
Actually, this is wrong.
Variables must be set after setup has been run.
Quoted 11 lines
(quoted diff) +0
-0do_test() {testcases/network/stress/multicast/packet-flood/mcast-pktfld02.sh +1
-0@@ -9,14 +9,11 @@ # packets at each socket TST_NEEDS_ROOT=1 +TST_SETUP="mcast_setup_normal"
testcases/network/stress/multicast/packet-flood/mcast-pktfld02.sh line 16
Quoted 10 lines
testcases/network/stress/multicast/packet-flood/mcast-pktfld02.sh +2
-6. mcast-lib.sh -do_setup() -{ - mcast_setup $MCASTNUM_NORMAL - MCAST_LCMD=ns-mcast_receiver - MCAST_RCMD=ns-udpsender -} +MCAST_LCMD="ns-mcast_receiver" +MCAST_RCMD="ns-udpsender"
And here as well.
Fix is to move it into test function.
Kind regards,
Petr
network/stress/multicast/packet-flood/mcast-pktfld01.sh +3 -3
@@ -11,13 +11,13 @@ TST_NEEDS_ROOT=1 TST_SETUP="mcast_setup_normal" . mcast-lib.sh -MCAST_LCMD="ns-mcast_receiver" -MCAST_RCMD="ns-udpsender" - do_test() { tst_res TINFO "joining an IPv${TST_IPVER} multicast group with a single socket, then receiving a large number of UDP packets at the socket in $NS_DURATION seconds" + MCAST_LCMD="ns-mcast_receiver" + MCAST_RCMD="ns-udpsender" + local addr="$MCAST_IPV4_ADDR" [ "$TST_IPV6" ] && addr="$MCAST_IPV6_ADDR"
network/stress/multicast/packet-flood/mcast-pktfld02.sh +3 -3
@@ -12,13 +12,13 @@ TST_NEEDS_ROOT=1 TST_SETUP="mcast_setup_normal" . mcast-lib.sh -MCAST_LCMD="ns-mcast_receiver" -MCAST_RCMD="ns-udpsender" - do_test() { tst_res TINFO "joining $MCASTNUM_NORMAL IPv${TST_IPVER} multicast groups on separate sockets, then receiving a large number of UDP packets at each socket in $NS_DURATION seconds" + MCAST_LCMD="ns-mcast_receiver" + MCAST_RCMD="ns-udpsender" + local addr port local n=0
PATCH 1/4 net/multicast: Create mcast_setup_normal()
Quoted 78 lines · Petr Vorel
Hi,
Quoted 6 lines
+++
b/testcases/network/stress/multicast/packet-flood/mcast-pktfld01.sh(quoted diff) +1
-0@@ -8,14 +8,11 @@ # a single socket, then receiving a large number of UDP packets at the socket TST_NEEDS_ROOT=1 +TST_SETUP="mcast_setup_normal"Review line 15
Quoted 10 lines
(quoted diff) +2
-6. mcast-lib.sh -do_setup() -{ - mcast_setup $MCASTNUM_NORMAL - MCAST_LCMD=ns-mcast_receiver - MCAST_RCMD=ns-udpsender -} +MCAST_LCMD="ns-mcast_receiver" +MCAST_RCMD="ns-udpsender"Actually, this is wrong.
Variables must be set after setup has been run.Quoted 11 lines
(quoted diff) +0
-0do_test() {testcases/network/stress/multicast/packet-flood/mcast-pktfld02.sh +1
-0@@ -9,14 +9,11 @@ # packets at each socket TST_NEEDS_ROOT=1 +TST_SETUP="mcast_setup_normal"testcases/network/stress/multicast/packet-flood/mcast-pktfld02.sh line 16
Quoted 10 lines
testcases/network/stress/multicast/packet-flood/mcast-pktfld02.sh +2
-6. mcast-lib.sh -do_setup() -{ - mcast_setup $MCASTNUM_NORMAL - MCAST_LCMD=ns-mcast_receiver - MCAST_RCMD=ns-udpsender -} +MCAST_LCMD="ns-mcast_receiver" +MCAST_RCMD="ns-udpsender"And here as well.
Fix is to move it into test function.
Kind regards,
Petrnetwork/stress/multicast/packet-flood/mcast-pktfld01.sh +3
-3@@ -11,13 +11,13 @@ TST_NEEDS_ROOT=1 TST_SETUP="mcast_setup_normal" . mcast-lib.sh -MCAST_LCMD="ns-mcast_receiver" -MCAST_RCMD="ns-udpsender" - do_test() { tst_res TINFO "joining an IPv${TST_IPVER} multicast group with a single socket, then receiving a large number of UDP packets at the socket in $NS_DURATION seconds" + MCAST_LCMD="ns-mcast_receiver" + MCAST_RCMD="ns-udpsender" + local addr="$MCAST_IPV4_ADDR" [ "$TST_IPV6" ] && addr="$MCAST_IPV6_ADDR"network/stress/multicast/packet-flood/mcast-pktfld02.sh +0
-0@@ -12,13 +12,13 @@ TST_NEEDS_ROOT=1 TST_SETUP="mcast_setup_normal" . mcast-lib.sh
network/stress/multicast/packet-flood/mcast-pktfld02.sh TST_NEEDS_ROOT=1 · line 21
Quoted 10 lines
network/stress/multicast/packet-flood/mcast-pktfld02.sh +3
-3-MCAST_LCMD="ns-mcast_receiver" -MCAST_RCMD="ns-udpsender" - do_test() { tst_res TINFO "joining $MCASTNUM_NORMAL IPv${TST_IPVER} multicast groups on separate sockets, then receiving a large number of UDP packets at each socket in $NS_DURATION seconds" + MCAST_LCMD="ns-mcast_receiver" + MCAST_RCMD="ns-udpsender" +
Hi Petr,
Perhaps it would be better to move this to another wrapper in the lib along with mcast_setup_normal()?
mcast_setup_normal_udp()
{
mcast_setup_normal
MCAST_LCMD="ns-mcast_receiver"
MCAST_RCMD="ns-udpsender"
}
PATCH 1/4 net/multicast: Create mcast_setup_normal()
Hi Alexey,
Quoted 12 lines
Quoted 11 lines
+++
testcases/network/stress/multicast/packet-flood/mcast-pktfld02.shnetwork/stress/multicast/packet-flood/mcast-pktfld02.sh +0
-3@@ -12,13 +12,13 @@ TST_NEEDS_ROOT=1 TST_SETUP="mcast_setup_normal" . mcast-lib.sh -MCAST_LCMD="ns-mcast_receiver" -MCAST_RCMD="ns-udpsender" - do_test() { tst_res TINFO "joining $MCASTNUM_NORMAL IPv${TST_IPVER} multicast groups on separate sockets, then receiving a large number of UDP packets at each socket in $NS_DURATION seconds"
Quoted 8 lines
network/stress/multicast/packet-flood/mcast-pktfld01.sh TST_NEEDS_ROOT=1 · line 20
Quoted 3 lines
network/stress/multicast/packet-flood/mcast-pktfld01.sh +3
-0+ MCAST_LCMD="ns-mcast_receiver" + MCAST_RCMD="ns-udpsender" +Hi Petr,
Perhaps it would be better to move this to another wrapper in the lib along with
mcast_setup_normal()?
Good idea, thanks!
Quoted 6 lines
mcast_setup_normal_udp()
{
mcast_setup_normal
MCAST_LCMD="ns-mcast_receiver"
MCAST_RCMD="ns-udpsender"
}
Kind regards,
Petr
PATCH 1/4 net/multicast: Create mcast_setup_normal()
In reply to Alexey KodanevHi Alexey,
FYI patchset merged, with with Reviewed-by on this commit.
Kind regards,
Petr
PATCH 2/4 net/multicast: Move API variables from setup to tests
In reply to Petr VorelIt's more readable to have variables in the test,
than mixing it in the test and in mcast-lib.sh.
--- .../multicast/grp-operation/mcast-group-multiple-socket.sh | 4 ++++ .../stress/multicast/grp-operation/mcast-group-same-group.sh | 4 ++++ .../multicast/grp-operation/mcast-group-single-socket.sh | 4 ++++ .../multicast/grp-operation/mcast-group-source-filter.sh | 4 ++++ testcases/network/stress/multicast/grp-operation/mcast-lib.sh | 3 --- .../network/stress/multicast/packet-flood/mcast-pktfld01.sh | 3 +++ .../network/stress/multicast/packet-flood/mcast-pktfld02.sh | 3 +++ .../network/stress/multicast/query-flood/mcast-queryfld01.sh | 2 ++ .../network/stress/multicast/query-flood/mcast-queryfld02.sh | 2 ++ .../network/stress/multicast/query-flood/mcast-queryfld03.sh | 2 ++ .../network/stress/multicast/query-flood/mcast-queryfld04.sh | 2 ++ .../network/stress/multicast/query-flood/mcast-queryfld05.sh | 2 ++ .../network/stress/multicast/query-flood/mcast-queryfld06.sh | 2 ++ 13 files changed, 34 insertions(+), 3 deletions(-)
testcases/network/stress/multicast/grp-operation/mcast-group-multiple-socket.sh +4 -0
@@ -19,7 +19,11 @@ # # Author: Mitsuru Chinen <[email protected]> +TST_NEEDS_ROOT=1 +TST_NEEDS_TMPDIR=1 TST_SETUP="do_setup" +TST_CLEANUP="mcast_cleanup" +TST_TESTFUNC="do_test" . mcast-lib.sh do_setup()
testcases/network/stress/multicast/grp-operation/mcast-group-same-group.sh +4 -0
@@ -19,7 +19,11 @@ # # Author: Mitsuru Chinen <[email protected]> +TST_NEEDS_ROOT=1 +TST_NEEDS_TMPDIR=1 TST_SETUP="mcast_setup_normal" +TST_CLEANUP="mcast_cleanup" +TST_TESTFUNC="do_test" . mcast-lib.sh do_test()
testcases/network/stress/multicast/grp-operation/mcast-group-single-socket.sh +4 -0
@@ -19,7 +19,11 @@ # # Author: Mitsuru Chinen <[email protected]> +TST_NEEDS_ROOT=1 +TST_NEEDS_TMPDIR=1 TST_SETUP="do_setup" +TST_CLEANUP="mcast_cleanup" +TST_TESTFUNC="do_test" . mcast-lib.sh do_setup()
testcases/network/stress/multicast/grp-operation/mcast-group-source-filter.sh +4 -0
@@ -19,7 +19,11 @@ # # Author: Mitsuru Chinen <[email protected]> +TST_NEEDS_ROOT=1 +TST_NEEDS_TMPDIR=1 TST_SETUP="mcast_setup_normal" +TST_CLEANUP="mcast_cleanup" +TST_TESTFUNC="do_test" . mcast-lib.sh do_test()
testcases/network/stress/multicast/grp-operation/mcast-lib.sh +0 -3
@@ -6,9 +6,6 @@ # # Setup script for multicast stress tests. -TST_CLEANUP="mcast_cleanup" -TST_TESTFUNC="do_test" -TST_NEEDS_TMPDIR=1 . tst_net_stress.sh mcast_setup4()
testcases/network/stress/multicast/packet-flood/mcast-pktfld01.sh +3 -0
@@ -8,7 +8,10 @@ # a single socket, then receiving a large number of UDP packets at the socket TST_NEEDS_ROOT=1 +TST_NEEDS_TMPDIR=1 TST_SETUP="mcast_setup_normal" +TST_CLEANUP="mcast_cleanup" +TST_TESTFUNC="do_test" . mcast-lib.sh MCAST_LCMD="ns-mcast_receiver"
testcases/network/stress/multicast/packet-flood/mcast-pktfld02.sh +3 -0
@@ -9,7 +9,10 @@ # packets at each socket TST_NEEDS_ROOT=1 +TST_NEEDS_TMPDIR=1 TST_SETUP="mcast_setup_normal" +TST_CLEANUP="mcast_cleanup" +TST_TESTFUNC="do_test" . mcast-lib.sh MCAST_LCMD="ns-mcast_receiver"
testcases/network/stress/multicast/query-flood/mcast-queryfld01.sh +2 -0
@@ -10,6 +10,8 @@ TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 TST_SETUP="mcast_setup_normal" +TST_CLEANUP="mcast_cleanup" +TST_TESTFUNC="do_test" . mcast-lib.sh do_test()
testcases/network/stress/multicast/query-flood/mcast-queryfld02.sh +2 -0
@@ -11,6 +11,8 @@ TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 TST_SETUP="mcast_setup_normal" +TST_CLEANUP="mcast_cleanup" +TST_TESTFUNC="do_test" . mcast-lib.sh do_test()
testcases/network/stress/multicast/query-flood/mcast-queryfld03.sh +2 -0
@@ -11,6 +11,8 @@ TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 TST_SETUP="mcast_setup_normal" +TST_CLEANUP="mcast_cleanup" +TST_TESTFUNC="do_test" . mcast-lib.sh SRC_ADDR_IPV4="10.10.10.1"
testcases/network/stress/multicast/query-flood/mcast-queryfld04.sh +2 -0
@@ -10,6 +10,8 @@ TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 TST_SETUP="mcast_setup_normal" +TST_CLEANUP="mcast_cleanup" +TST_TESTFUNC="do_test" . mcast-lib.sh do_test()
testcases/network/stress/multicast/query-flood/mcast-queryfld05.sh +2 -0
@@ -11,6 +11,8 @@ TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 TST_SETUP="mcast_setup_normal" +TST_CLEANUP="mcast_cleanup" +TST_TESTFUNC="do_test" . mcast-lib.sh do_test()
testcases/network/stress/multicast/query-flood/mcast-queryfld06.sh +2 -0
@@ -11,6 +11,8 @@ TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 TST_SETUP="mcast_setup_normal" +TST_CLEANUP="mcast_cleanup" +TST_TESTFUNC="do_test" . mcast-lib.sh SRC_ADDR_IPV4=10.10.10.1
Signature · 1 line
2.30.0
PATCH 3/4 net/multicast: Remove duplicity
In reply to Petr Vorel--- .../multicast/grp-operation/mcast-lib.sh | 18 +++++++++++++++++- .../multicast/query-flood/mcast-queryfld01.sh | 13 ++----------- .../multicast/query-flood/mcast-queryfld02.sh | 14 ++++---------- 3 files changed, 23 insertions(+), 22 deletions(-)
testcases/network/stress/multicast/grp-operation/mcast-lib.sh +17 -1
@@ -1,6 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (c) 2017-2018 Petr Vorel <[email protected]> +# Copyright (c) 2017-2021 Petr Vorel <[email protected]> # Copyright (c) International Business Machines Corp., 2006 # Author: Petr Vorel <[email protected]> #
@@ -141,3 +141,19 @@ do_multicast_test_join_leave() tst_res TPASS "test is finished successfully" } + +do_multicast_test_join_single_socket() +{ + local extra="$1" + local prefix="$MCAST_IPV4_ADDR_PREFIX" + [ "$TST_IPV6" ] && prefix="$MCAST_IPV6_ADDR_PREFIX" + + # Run a multicast join tool + local tmpfile=$$ + EXPECT_PASS $MCAST_LCMD -n 1 -p $prefix \> $tmpfile + tst_res TINFO "joined $(grep groups $tmpfile)" + + local params + [ "$TST_IPV6" ] && params="-S $(tst_ipaddr) -m" + EXPECT_RHOST_PASS $MCAST_RCMD -t $NS_DURATION -r 0 $params $extra +}
testcases/network/stress/multicast/query-flood/mcast-queryfld01.sh +2 -11
@@ -2,6 +2,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2006 International Business Machines Corp. # Copyright (c) 2020 Joerg Vehlow <[email protected]> +# Copyright (c) 2021 Petr Vorel <[email protected]> # Author: Mitsuru Chinen <[email protected]> # # Verify that the kernel is not crashed when joining a multicast group
@@ -18,18 +19,8 @@ do_test() { tst_res TINFO "joining an IPv${TST_IPVER} multicast group on a single socket, then receiving a large number of General Queries in $NS_DURATION seconds" - local prefix="$MCAST_IPV4_ADDR_PREFIX" - [ "$TST_IPV6" ] && prefix="$MCAST_IPV6_ADDR_PREFIX" - - # Run a multicast join tool - local tmpfile=$$ - EXPECT_PASS $MCAST_LCMD -n 1 -p $prefix \> $tmpfile - tst_res TINFO "joined $(grep groups $tmpfile)" - # Send General Query from the remote host - local params - [ "$TST_IPV6" ] && params="-S $(tst_ipaddr) -m" - EXPECT_RHOST_PASS $MCAST_RCMD -t $NS_DURATION -r 0 $params + do_multicast_test_join_single_socket } tst_run
testcases/network/stress/multicast/query-flood/mcast-queryfld02.sh +4 -10
@@ -2,6 +2,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2006 International Business Machines Corp. # Copyright (c) 2020 Joerg Vehlow <[email protected]> +# Copyright (c) 2021 Petr Vorel <[email protected]> # Author: Mitsuru Chinen <[email protected]> # # Verify that the kernel is not crashed when joining a multicast group
@@ -19,18 +20,11 @@ do_test() { tst_res TINFO "joining an IPv${TST_IPVER} multicast group on a single socket, then receiving a large number of Multicast Address Specific Query in $NS_DURATION seconds" - local prefix="$MCAST_IPV4_ADDR_PREFIX" - [ "$TST_IPV6" ] && prefix="$MCAST_IPV6_ADDR_PREFIX" - - # Run a multicast join tool - local tmpfile=$$ - EXPECT_PASS $MCAST_LCMD -n 1 -p $prefix \> $tmpfile - tst_res TINFO "joined $(grep groups $tmpfile)" + local extra="-m $MCAST_IPV4_ADDR" + [ "$TST_IPV6" ] && extra="-D $MCAST_IPV6_ADDR" # Send IGMP Multicast Address Specific Query from the remote host - local params="-m $MCAST_IPV4_ADDR" - [ "$TST_IPV6" ] && params="-S $(tst_ipaddr) -m -D $MCAST_IPV6_ADDR" - EXPECT_RHOST_PASS $MCAST_RCMD -t $NS_DURATION -r 0 $params + do_multicast_test_join_single_socket "$extra" } tst_run
Signature · 1 line
2.30.0
PATCH 4/4 net/multicast: Use SPDX-License-Identifier
In reply to Petr Vorel--- .../mcast-group-multiple-socket.sh | 17 +---------------- .../grp-operation/mcast-group-same-group.sh | 17 +---------------- .../grp-operation/mcast-group-single-socket.sh | 17 +---------------- .../grp-operation/mcast-group-source-filter.sh | 17 +---------------- 4 files changed, 4 insertions(+), 64 deletions(-)
testcases/network/stress/multicast/grp-operation/mcast-group-multiple-socket.sh +1 -16
@@ -1,22 +1,7 @@ #!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2017-2018 Petr Vorel <[email protected]> # Copyright (c) International Business Machines Corp., 2006 -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# This program is distributed in the hope that it would be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -# Setup: testcases/network/stress/README -# # Author: Mitsuru Chinen <[email protected]> TST_NEEDS_ROOT=1
testcases/network/stress/multicast/grp-operation/mcast-group-same-group.sh +1 -16
@@ -1,22 +1,7 @@ #!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2017-2018 Petr Vorel <[email protected]> # Copyright (c) International Business Machines Corp., 2006 -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# This program is distributed in the hope that it would be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -# Setup: testcases/network/stress/README -# # Author: Mitsuru Chinen <[email protected]> TST_NEEDS_ROOT=1
testcases/network/stress/multicast/grp-operation/mcast-group-single-socket.sh +1 -16
@@ -1,22 +1,7 @@ #!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2017-2018 Petr Vorel <[email protected]> # Copyright (c) International Business Machines Corp., 2006 -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# This program is distributed in the hope that it would be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -# Setup: testcases/network/stress/README -# # Author: Mitsuru Chinen <[email protected]> TST_NEEDS_ROOT=1
testcases/network/stress/multicast/grp-operation/mcast-group-source-filter.sh +1 -16
@@ -1,22 +1,7 @@ #!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2017-2018 Petr Vorel <[email protected]> # Copyright (c) International Business Machines Corp., 2006 -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# This program is distributed in the hope that it would be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# -# Setup: testcases/network/stress/README -# # Author: Mitsuru Chinen <[email protected]> TST_NEEDS_ROOT=1
Signature · 1 line
2.30.0