Skip to content

Commit

Permalink
Fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillerDragon committed Jul 24, 2024
1 parent 9669848 commit 442089f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/test/integration/integration_test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
# script that tests this scripts repo

set -u

root_dir="$(pwd)"
integration_root_dir="${root_dir}/lib/test/integration"
testdir="$root_dir"/lib/tmp/tests
Expand Down Expand Up @@ -87,7 +89,7 @@ add_executable(teeworlds_srv main.cpp)
EOF

function fail() {
clear_testdir
# clear_testdir
echo "[-] Error: test failed"
exit 1
}
Expand Down Expand Up @@ -166,6 +168,8 @@ function test_loop_gdb() {

function test_status_size_check() {
create_server "status_size"
cd "$testdir" || fail
cd status_size || exit 1
mkdir -p logs/ddos
local x
for x in {1..150}
Expand All @@ -176,7 +180,11 @@ function test_status_size_check() {
./status.sh
if ./status.sh | grep -q WARNING
then

echo "Error: ./status.sh threw a WARNING"
echo " in $PWD"
echo " ./status.sh | grep -q WARNING"
echo " failed"
fail
fi
}
Expand All @@ -194,6 +202,7 @@ function create_server() {
mkdir -p "$serverdir"/lib
cp lib/*.sh "$serverdir"/lib
cp -r lib/include "$serverdir"/lib
cp -r lib/supp "$serverdir"/lib
cp -r bin/ "$serverdir"
cp -r .git "$serverdir"
cp .gitignore "$serverdir"
Expand Down

0 comments on commit 442089f

Please sign in to comment.