mcast-queryfld04.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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 <joerg.vehlow@aox-tech.de>
  5. # Author: Mitsuru Chinen <mitch@jp.ibm.com>
  6. #
  7. # Verify that the kernel is not crashed when joining multiple multicast
  8. # groups on separate socket, then receiving a large number of General Queries
  9. TST_NEEDS_ROOT=1
  10. TST_NEEDS_TMPDIR=1
  11. TST_SETUP="mcast_setup_normal"
  12. TST_CLEANUP="mcast_cleanup"
  13. TST_TESTFUNC="do_test"
  14. . mcast-lib.sh
  15. do_test()
  16. {
  17. 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"
  18. local prefix="$MCAST_IPV4_ADDR_PREFIX"
  19. [ "$TST_IPV6" ] && prefix="$MCAST_IPV6_ADDR_PREFIX"
  20. # Run a multicast join tool
  21. local tmpfile=$$
  22. EXPECT_PASS $MCAST_LCMD -n $MCASTNUM_NORMAL -p $prefix \> $tmpfile
  23. tst_res TINFO "joined $(grep groups $tmpfile)"
  24. # Send General Queries from the remote host
  25. local params
  26. [ "$TST_IPV6" ] && params="-S $(tst_ipaddr) -m"
  27. EXPECT_RHOST_PASS $MCAST_RCMD -t $NS_DURATION -r 0 $params
  28. }
  29. tst_run