mc_opts.sh 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/sh
  2. # Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
  3. # Copyright (c) International Business Machines Corp., 2000
  4. #
  5. # This program is free software; you can redistribute it and/or
  6. # modify it under the terms of the GNU General Public License as
  7. # published by the Free Software Foundation; either version 2 of
  8. # the License, or (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it would be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write the Free Software Foundation,
  17. # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  18. #
  19. # PURPOSE: To verify that three of the new options for level IPPROTO_IP
  20. # Service Interface are initially set to the default values as
  21. # defined in the documentation and that each of the new options
  22. # can be set and read properly by the setsockopt and getsockopt
  23. # routines, respectively. To test boundary conditions and to
  24. # generate errors while exercising the IP Multicast Service
  25. # Interface options.
  26. #
  27. #
  28. # Robbie Williamson (robbiew@us.ibm.com)
  29. # -Ported
  30. EXECUTABLES=${EXECUTABLES:-"mc_verify_opts mc_verify_opts_error"}
  31. TCID=mc_opts
  32. TST_TOTAL=1
  33. TST_USE_LEGACY_API=1
  34. . tst_net.sh
  35. COUNT=1
  36. while [ $COUNT -le 10 ]; do
  37. # Run setsockopt/getsockopt test
  38. tst_resm TINFO "Running $EXECUTABLES on $(tst_ipaddr)"
  39. for i in $EXECUTABLES; do
  40. $i $(tst_ipaddr) > /dev/null || \
  41. tst_brkm TFAIL "$i $(tst_ipaddr) failed"
  42. done
  43. tst_resm TINFO "Running ping with bad values"
  44. ping -T 777 224.0.0.1 > /dev/null 2>&1 && \
  45. tst_brkm TFAIL "Multicast range should be out of range"
  46. tst_resm TINFO "Running ping on a invalid interface!"
  47. ping -I 3.3.3.3 224.0.0.1 > /dev/null 2>&1 && \
  48. tst_brkm TFAIL "ping on bogus interface should fail"
  49. COUNT=$(( $COUNT + 1 ))
  50. done
  51. tst_resm TPASS "Test Successful"
  52. tst_exit