sctp01.sh 806 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/sh
  2. # SPDX-License-Identifier: GPL-2.0-or-later
  3. # Copyright (c) 2017-2018 Oracle and/or its affiliates. All Rights Reserved.
  4. # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
  5. TST_TESTFUNC="test"
  6. TST_NEEDS_TMPDIR=1
  7. TST_NEEDS_ROOT=1
  8. TST_TEST_DATA=",-A 65000"
  9. TST_TEST_DATA_IFS=","
  10. . tst_net.sh
  11. test()
  12. {
  13. local opts="$2"
  14. tst_res TINFO "compare TCP/SCTP performance"
  15. tst_netload -H $(tst_ipaddr rhost) -T tcp -R 3 $opts
  16. local res0="$(cat tst_netload.res)"
  17. tst_netload -S $(tst_ipaddr) -H $(tst_ipaddr rhost) -T sctp -R 3 $opts
  18. local res1="$(cat tst_netload.res)"
  19. local per=$(( $res0 * 100 / $res1 - 100 ))
  20. if [ "$per" -gt "100" -o "$per" -lt "-100" ]; then
  21. tst_res TFAIL "sctp performance $per %"
  22. else
  23. tst_res TPASS "sctp performance $per % in range -100 ... 100 %"
  24. fi
  25. }
  26. tst_run