new tester

This commit is contained in:
asus
2023-02-17 15:03:41 +01:00
parent 356267e288
commit 101d7b7581
24 changed files with 87 additions and 12648 deletions

View File

@@ -1,15 +1,33 @@
#!/bin/bash
port=8081
clang -Wall -Wextra -Werror mini_serv.c -o mini_serv
./mini_serv "$port" &
nc localhost "$port" &
port=0
while [ $port -lt 1024 -o $port -gt 10000 ]; do
port=$RANDOM
done
clang -Wall -Wextra -Werror mini_serv.c
./a.out "$port" 2>&1 &
nc localhost "$port" 2>&1 &
sleep 0.1
test1="on short line"
test2="line 1
line 2
line 4"
test3="one long line qqqqqqqqqqqqqq wwwwwwwwwwww eeeeeeeeeeeeee rrrrrrrrrrrrr tttttttttttt yyyyyyyyyyyyyyy uy iiiiiiiiiiiiiiiii oooooooo"
echo "$test1" | nc localhost "$port" 2>&1 &
sleep 0.1
echo "$test2" | nc localhost "$port" 2>&1 &
sleep 0.1
echo "$test3" | nc localhost "$port" 2>&1 &
sleep 0.1
for i in {1..3000}
do
nc localhost "$port" &
nc localhost "$port" 2>&1 &
kill -KILL $(pidof nc | tr ' ' '\n' | head -n1)
done
killall -q mini_serv nc
killall -q a.out nc