From 62c41b77371f23108f14f008a49492265eba8a45 Mon Sep 17 00:00:00 2001 From: Gustavo Garcia Date: Tue, 26 Jul 2022 23:03:46 +0200 Subject: [PATCH 1/3] Add github workflow to test the build is correct --- .github/workflows/tests.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..e93cc540 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,32 @@ +name: C/C++ CI + +on: + push: + branches: [ $default-branch ] + pull_request: + types: [ opened, reopened, synchronize ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + libevent-dev \ + libssl-dev \ + libpq-dev libmariadb-dev libsqlite3-dev \ + libhiredis-dev \ + libmongoc-dev \ + libmicrohttpd-dev + - uses: actions/checkout@v3 + - name: configure + run: ./configure + - name: make + run: make + - name: make check + run: make check + From afbe6868ff71cc7653e57a4ee122cd6b21b01ff0 Mon Sep 17 00:00:00 2001 From: Gustavo Garcia Date: Sun, 31 Jul 2022 23:40:39 +0200 Subject: [PATCH 2/3] test --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e93cc540..e90bf1df 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,4 +29,6 @@ jobs: run: make - name: make check run: make check + - name: run + run: turnserver & From ff1952033fad9b1d7e5bfee224b082bbc5cbf2fa Mon Sep 17 00:00:00 2001 From: Gustavo Garcia Date: Fri, 5 Aug 2022 13:27:09 +0200 Subject: [PATCH 3/3] Add running turn tests --- .github/workflows/tests.yml | 5 ++--- examples/run_tests.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100755 examples/run_tests.sh diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e90bf1df..9b7cdf71 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,6 +29,5 @@ jobs: run: make - name: make check run: make check - - name: run - run: turnserver & - + - name: apps tests + run: cd examples && ./run_tests.sh diff --git a/examples/run_tests.sh b/examples/run_tests.sh new file mode 100755 index 00000000..5c3671d7 --- /dev/null +++ b/examples/run_tests.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +echo 'Running turnserver' +../bin/turnserver --use-auth-secret --static-auth-secret=secret --realm=north.gov --allow-loopback-peers --no-cli > /dev/null & +echo 'Running peer client' +../bin/turnutils_peer -L 127.0.0.1 -L ::1 -L 0.0.0.0 > /dev/null & + +sleep 2 + +echo 'Running turn client TCP' +../bin/turnutils_uclient -t -e 127.0.0.1 -X -g -u user -W secret -t 127.0.0.1 | grep "start_mclient: tot_send_bytes ~ 1000, tot_recv_bytes ~ 1000" > /dev/null +if [ $? -eq 0 ]; then + echo OK +else + echo FAIL + exit $? +fi + +echo 'Running turn client UDP' +../bin/turnutils_uclient -e 127.0.0.1 -X -g -u user -W secret -t 127.0.0.1 | grep "start_mclient: tot_send_bytes ~ 1000, tot_recv_bytes ~ 1000" > /dev/null +if [ $? -eq 0 ]; then + echo OK +else + echo FAIL + exit $? +fi