You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
465 B

7 years ago
7 years ago
  1. #!/bin/bash
  2. number=$1
  3. method=$2
  4. ss-tunnel -k test -m $method -l 8387 -L 127.0.0.1:8388 -s 127.0.0.1 -p 8389 &
  5. ss_tunnel_pid=$!
  6. ss-server -k test -m $method -s 127.0.0.1 -p 8389 &
  7. ss_server_pid=$!
  8. iperf -s -p 8388 &
  9. iperf_pid=$!
  10. sleep 1
  11. iperf -c 127.0.0.1 -p 8387 -n $number
  12. # Wait for iperf server to receive all data.
  13. # One second should be enough in most cases.
  14. sleep 1
  15. kill $ss_tunnel_pid
  16. kill $ss_server_pid
  17. kill $iperf_pid
  18. sleep 1
  19. echo "Test Finished"