File: bench_test_httpd

package info (click to toggle)
sniproxy 0.6.1%2Bgit20240321-0.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 644 kB
  • sloc: ansic: 5,594; perl: 1,673; sh: 237; makefile: 131
file content (23 lines) | stat: -rwxr-xr-x 409 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

TEST_HTTPD_PORT=8081

perl -MTestHTTPD -e "TestHTTPD::httpd(port => ${TEST_HTTPD_PORT})" &
TEST_HTTPD_PID=$!

echo -n "Wait for TestHTTPD to start"
until netstat -ltn | grep -q :${TEST_HTTPD_PORT}; do
    echo -n .
done

echo ""

# Run apache bench
ab -n 65536 -c 256 http://127.0.0.1:${TEST_HTTPD_PORT}/
RESULT=$?

# Cleanup TestHTTPD
kill ${TEST_HTTPD_PID}
wait ${TEST_HTTPD_PID}

exit ${RESULT}