-
Notifications
You must be signed in to change notification settings - Fork 996
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
network/stress/multicast/query-flood: Convert to new API
Reviewed-by: Petr Vorel <pvorel@suse.cz> Signed-off-by: Joerg Vehlow <joerg.vehlow@aox-tech.de> [ pvorel: Remove sleep $NS_DURATION, style cleanup ] Signed-off-by: Petr Vorel <pvorel@suse.cz>
- Loading branch information
Showing
19 changed files
with
292 additions
and
2,465 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
testcases/network/stress/multicast/query-flood/mcast-queryfld01.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
# Copyright (c) 2006 International Business Machines Corp. | ||
# Copyright (c) 2020 Joerg Vehlow <joerg.vehlow@aox-tech.de> | ||
# Author: Mitsuru Chinen <mitch@jp.ibm.com> | ||
# | ||
# Verify that the kernel is not crashed when joining a multicast group | ||
# on a single socket, then receiving a large number of General Queries | ||
|
||
TST_NEEDS_ROOT=1 | ||
TST_NEEDS_TMPDIR=1 | ||
. 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" | ||
|
||
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 | ||
} | ||
|
||
tst_run |
38 changes: 38 additions & 0 deletions
38
testcases/network/stress/multicast/query-flood/mcast-queryfld02.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
# Copyright (c) 2006 International Business Machines Corp. | ||
# Copyright (c) 2020 Joerg Vehlow <joerg.vehlow@aox-tech.de> | ||
# Author: Mitsuru Chinen <mitch@jp.ibm.com> | ||
# | ||
# Verify that the kernel is not crashed when joining a multicast group | ||
# on a single socket, then receiving a large number of Multicast Address | ||
# Specific Query | ||
|
||
TST_NEEDS_ROOT=1 | ||
TST_NEEDS_TMPDIR=1 | ||
. 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" | ||
|
||
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 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 | ||
} | ||
|
||
tst_run |
46 changes: 46 additions & 0 deletions
46
testcases/network/stress/multicast/query-flood/mcast-queryfld03.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
# Copyright (c) 2006 International Business Machines Corp. | ||
# Copyright (c) 2020 Joerg Vehlow <joerg.vehlow@aox-tech.de> | ||
# Author: Mitsuru Chinen <mitch@jp.ibm.com> | ||
# | ||
# Verify that the kernel is not crashed when joining a multicast group | ||
# on a single socket, then receiving a large number of Multicast Address | ||
# and Source Specific Queries | ||
|
||
TST_NEEDS_ROOT=1 | ||
TST_NEEDS_TMPDIR=1 | ||
. 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" | ||
|
||
local prefix="$MCAST_IPV4_ADDR_PREFIX" | ||
local src_addr="$SRC_ADDR_IPV4" | ||
if [ "$TST_IPV6" ]; then | ||
prefix="$MCAST_IPV6_ADDR_PREFIX" | ||
src_addr="$SRC_ADDR_IPV6" | ||
fi | ||
|
||
# Run a multicast join tool | ||
local tmpfile=$$ | ||
EXPECT_PASS $MCAST_LCMD -n 1 -p $prefix -s $src_addr -F $FILTER_MODE \> $tmpfile | ||
tst_res TINFO "joined $(grep groups $tmpfile)" | ||
|
||
# Send Multicast Address and Source Specific Queries from the remote host | ||
local params="-m $MCAST_IPV4_ADDR -s $src_addr" | ||
[ "$TST_IPV6" ] && params="-S $(tst_ipaddr) -m -D $MCAST_IPV6_ADDR -a $src_addr" | ||
EXPECT_RHOST_PASS $MCAST_RCMD -t $NS_DURATION -r 0 $params | ||
} | ||
|
||
tst_run |
37 changes: 37 additions & 0 deletions
37
testcases/network/stress/multicast/query-flood/mcast-queryfld04.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
# Copyright (c) 2006 International Business Machines Corp. | ||
# Copyright (c) 2020 Joerg Vehlow <joerg.vehlow@aox-tech.de> | ||
# Author: Mitsuru Chinen <mitch@jp.ibm.com> | ||
# | ||
# Verify that the kernel is not crashed when joining multiple multicast | ||
# groups on separate socket, then receiving a large number of General Queries | ||
|
||
TST_NEEDS_ROOT=1 | ||
TST_NEEDS_TMPDIR=1 | ||
. 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" | ||
|
||
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 $MCASTNUM_NORMAL -p $prefix \> $tmpfile | ||
tst_res TINFO "joined $(grep groups $tmpfile)" | ||
|
||
# Send General Queries from the remote host | ||
local params | ||
[ "$TST_IPV6" ] && params="-S $(tst_ipaddr) -m" | ||
EXPECT_RHOST_PASS $MCAST_RCMD -t $NS_DURATION -r 0 $params | ||
} | ||
|
||
tst_run |
57 changes: 57 additions & 0 deletions
57
testcases/network/stress/multicast/query-flood/mcast-queryfld05.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
# Copyright (c) 2006 International Business Machines Corp. | ||
# Copyright (c) 2020 Joerg Vehlow <joerg.vehlow@aox-tech.de> | ||
# Author: Mitsuru Chinen <mitch@jp.ibm.com> | ||
# | ||
# Verify that the kernel is not crashed when joining multiple | ||
# multicast groups on separate sockets, then receiving a large number of | ||
# Multicast Address Specific Queries | ||
|
||
TST_NEEDS_ROOT=1 | ||
TST_NEEDS_TMPDIR=1 | ||
. 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" | ||
|
||
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 $MCASTNUM_NORMAL -p $prefix \> $tmpfile | ||
tst_res TINFO "joined $(grep groups $tmpfile)" | ||
|
||
# Send IGMP Multicast Address Specific Query from the remote host | ||
local n=0 | ||
while [ $n -lt $MCASTNUM_NORMAL ]; do | ||
# Define the multicast address | ||
if [ "$TST_IPV6" ]; then | ||
local n_hex=$(printf "%x" $n) | ||
local addr=${MCAST_IPV6_ADDR_PREFIX}:${n_hex} | ||
else | ||
local x=$((n / 254)) | ||
local y=$((n % 254 + 1)) | ||
local addr=${MCAST_IPV4_ADDR_PREFIX}.${x}.${y} | ||
fi | ||
|
||
local params="-m $addr" | ||
[ "$TST_IPV6" ] && params="-S $(tst_ipaddr) -m -D $addr" | ||
tst_rhost_run -c "$MCAST_RCMD -t $NS_DURATION -r 0 -b $params" | ||
|
||
n=$((n+1)) | ||
done | ||
|
||
sleep $NS_DURATION | ||
|
||
tst_res TPASS "test finished successfully" | ||
} | ||
|
||
tst_run |
65 changes: 65 additions & 0 deletions
65
testcases/network/stress/multicast/query-flood/mcast-queryfld06.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
# Copyright (c) 2006 International Business Machines Corp. | ||
# Copyright (c) 2020 Joerg Vehlow <joerg.vehlow@aox-tech.de> | ||
# Author: Mitsuru Chinen <mitch@jp.ibm.com> | ||
# | ||
# Verify that the kernel is not crashed when joining multiple | ||
# multicast groups on separate sockets, then receiving a large number of | ||
# Multicast Address and Source Specific Queries | ||
|
||
TST_NEEDS_ROOT=1 | ||
TST_NEEDS_TMPDIR=1 | ||
. 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 src_addr="$SRC_ADDR_IPV4" | ||
if [ "$TST_IPV6" ]; then | ||
prefix="$MCAST_IPV6_ADDR_PREFIX" | ||
src_addr="$SRC_ADDR_IPV6" | ||
fi | ||
|
||
# Run a multicast join tool | ||
local tmpfile=$$ | ||
EXPECT_PASS $MCAST_LCMD -n $MCASTNUM_NORMAL -p $prefix -s $src_addr -F $FILTER_MODE \> $tmpfile | ||
tst_res TINFO "joined $(grep groups $tmpfile)" | ||
|
||
# Send Multicast Address Specific Queries from the remote host | ||
local n=0 | ||
while [ $n -lt $MCASTNUM_NORMAL ]; do | ||
# Define the multicast address | ||
if [ "$TST_IPV6" ]; then | ||
local n_hex=$(printf "%x" $n) | ||
local addr=${MCAST_IPV6_ADDR_PREFIX}:${n_hex} | ||
else | ||
local x=$((n / 254)) | ||
local y=$((n % 254 + 1)) | ||
local addr=${MCAST_IPV4_ADDR_PREFIX}.${x}.${y} | ||
fi | ||
|
||
local params="-m $addr -s $src_addr" | ||
[ "$TST_IPV6" ] && params="-S $(tst_ipaddr) -m -D $addr -a $src_addr" | ||
tst_rhost_run -c "$MCAST_RCMD -t $NS_DURATION -r 0 -b $params" | ||
|
||
n=$((n+1)) | ||
done | ||
|
||
sleep $NS_DURATION | ||
|
||
tst_res TPASS "test finished successfully" | ||
} | ||
|
||
tst_run |
Oops, something went wrong.