1#!/bin/sh 2# SPDX-License-Identifier: GPL-2.0-or-later 3# Copyright (c) 2006 International Business Machines Corp. 4# Copyright (c) 2020 Joerg Vehlow <[email protected]> 5# Author: Mitsuru Chinen <[email protected]> 6# 7# Verify that the kernel is not crashed when joining a multicast group with 8# a single socket, then receiving a large number of UDP packets at the socket 9 10TST_NEEDS_ROOT=1 11TST_NEEDS_TMPDIR=1 12TST_SETUP="mcast_setup_normal_udp" 13TST_CLEANUP="mcast_cleanup" 14TST_TESTFUNC="do_test" 15 16do_test() 17{ 18 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" 19 20 local addr="$MCAST_IPV4_ADDR" 21 [ "$TST_IPV6" ] && addr="$MCAST_IPV6_ADDR" 22 23 local port=$(tst_get_unused_port ipv${TST_IPVER} dgram) 24 [ $? -ne 0 ] && tst_brk TBROK "no free udp port available" 25 26 # Run a receiver 27 ROD $MCAST_LCMD -f $TST_IPVER -I $(tst_iface lhost) -m $addr -p $port -b 28 29 # Run a sender 30 tst_rhost_run -s -c "$MCAST_RCMD -D $addr -f $TST_IPVER -p $port -s 32767 -m -I $(tst_iface rhost) -t $NS_DURATION" 31 32 tst_res TPASS "test finished successfully" 33} 34 35. mcast-lib.sh 36tst_run 37