Skip to content

Commit 20e9694

Browse files
committed
load-tester: clean up on exit
1 parent 193503f commit 20e9694

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

contrib/load-tester/run.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
#!/bin/bash
22

3-
COUNT=40
3+
# On Ubuntu, you may want this:
4+
# echo "core.%e.%p" > /proc/sys/kernel/core_pattern
5+
# http://stackoverflow.com/a/18368068
6+
7+
ulimit -c unlimited
8+
ulimit -a
49

10+
COUNT=40
511
echo "Make sure to configure GatewayInterface in wifidog_mock.conf"
612

713
./generate_interfaces.sh start $COUNT || exit 1
814

915
./mock_auth.py &
16+
MA_PID="$!"
1017

1118
# trace-children is necessary because of the libtool wrapper -.-
1219
#sudo valgrind --leak-check=full --trace-children=yes --trace-children-skip=/bin/sh \
1320
# --log-file=valgrind.log ../../src/wifidog -d 7 -f -c wifidog-mock.conf 2> wifidog.log &
1421

1522
../../src/wifidog -d 7 -f -c wifidog-mock.conf -a /tmp/arp 2> wifidog.log &
23+
WD_PID="$!"
1624

1725
IF=`grep GatewayInterface wifidog-mock.conf | cut -f 2 -d ' '`
1826

@@ -23,4 +31,12 @@ sleep 10
2331

2432
#./generate_interfaces.sh stop
2533

34+
function cleanup() {
35+
36+
kill $MA_PID
37+
kill $WD_PID
38+
./generate_interfaces.sh stop $COUNT
39+
40+
}
2641

42+
trap cleanup EXIT

0 commit comments

Comments
 (0)