run_tests_conf.sh 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/bash
  2. # Detect cmake build and adjust path
  3. BINDIR="../bin"
  4. if [ ! -f $BINDIR/turnserver ]; then
  5. BINDIR="../build/bin"
  6. fi
  7. echo "Creating $BINDIR/turnserver.conf file"
  8. echo "use-auth-secret" > $BINDIR/turnserver.conf
  9. echo "static-auth-secret=secret" >> $BINDIR/turnserver.conf
  10. echo "realm=north.gov" >> $BINDIR/turnserver.conf
  11. echo "allow-loopback-peers" >> $BINDIR/turnserver.conf
  12. echo "no-cli" >> $BINDIR/turnserver.conf
  13. echo "cert=../examples/ca/turn_server_cert.pem" >> $BINDIR/turnserver.conf
  14. echo "pkey=../examples/ca/turn_server_pkey.pem" >> $BINDIR/turnserver.conf
  15. echo 'Running turnserver'
  16. $BINDIR/turnserver -c $BINDIR/turnserver.conf > /dev/null &
  17. echo 'Running peer client'
  18. $BINDIR/turnutils_peer -L 127.0.0.1 -L ::1 -L 0.0.0.0 > /dev/null &
  19. sleep 2
  20. echo 'Running turn client TCP'
  21. $BINDIR/turnutils_uclient -t -e 127.0.0.1 -X -g -u user -W secret 127.0.0.1 | grep "start_mclient: tot_send_bytes ~ 1000, tot_recv_bytes ~ 1000" > /dev/null
  22. if [ $? -eq 0 ]; then
  23. echo OK
  24. else
  25. echo FAIL
  26. exit $?
  27. fi
  28. echo 'Running turn client TLS'
  29. $BINDIR/turnutils_uclient -t -S -e 127.0.0.1 -X -g -u user -W secret 127.0.0.1 | grep "start_mclient: tot_send_bytes ~ 1000, tot_recv_bytes ~ 1000" > /dev/null
  30. if [ $? -eq 0 ]; then
  31. echo OK
  32. else
  33. echo FAIL
  34. exit $?
  35. fi
  36. echo 'Running turn client UDP'
  37. $BINDIR/turnutils_uclient -e 127.0.0.1 -X -g -u user -W secret 127.0.0.1 | grep "start_mclient: tot_send_bytes ~ 1000, tot_recv_bytes ~ 1000" > /dev/null
  38. if [ $? -eq 0 ]; then
  39. echo OK
  40. else
  41. echo FAIL
  42. exit $?
  43. fi
  44. echo 'Running turn client DTLS'
  45. $BINDIR/turnutils_uclient -S -e 127.0.0.1 -X -g -u user -W secret 127.0.0.1 | grep "start_mclient: tot_send_bytes ~ 1000, tot_recv_bytes ~ 1000" > /dev/null
  46. if [ $? -eq 0 ]; then
  47. echo OK
  48. else
  49. echo FAIL
  50. exit $?
  51. fi