dctcp01.sh 690 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/sh
  2. # SPDX-License-Identifier: GPL-2.0-or-later
  3. # Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved.
  4. #
  5. # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
  6. TST_SETUP="setup"
  7. TST_TESTFUNC="do_test"
  8. TST_CLEANUP="cleanup"
  9. TST_MIN_KVER="3.18"
  10. . tcp_cc_lib.sh
  11. cleanup()
  12. {
  13. tc qdisc del dev $(tst_iface) root netem loss 0.5% ecn
  14. tcp_cc_cleanup
  15. }
  16. setup()
  17. {
  18. tcp_cc_check_support dctcp
  19. tcp_cc_setup
  20. tst_res TINFO "emulate congestion with packet loss 0.5% and ECN"
  21. tc qdisc add dev $(tst_iface) root netem loss 0.5% ecn > /dev/null 2>&1
  22. if [ $? -ne 0 ]; then
  23. tst_brk TCONF "netem doesn't support ECN"
  24. fi
  25. }
  26. do_test()
  27. {
  28. tcp_cc_test01 dctcp 10
  29. }
  30. tst_run