new tester
This commit is contained in:
30
tester.sh
30
tester.sh
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user