File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33program=${0##*/ }
44progdir=${0%/* }
55
6+ . $progdir /shell-utils
7+
68cd $progdir /.. # now at trunk/
79
8- test/test-setup # create a patched django for test purposes, and more
10+ pidfile=$( test/test-setup) # create a patched django for test purposes, and more
11+ [ " $pidfile " ] || die " Didn't get a pidfile name"
912
1013test/run-pyflakes ietf
1114
1215# Trap keyboard interrupt to ensure the test/teardown is run if we interrupt the tests
1316trap ' echo "$program($LINENO): Caught Interrupt"' INT
1417
1518# run tests with our patched django
16- PYTHONPATH=test:test/lib URLPREFIX=" $* " python ietf/manage.py test
19+ PYTHONPATH=test:test/lib URLPREFIX=" $* " python ietf/manage.py test &
20+ pid=$!
21+ echo $pid > $pidfile
22+ wait $pid
1723
1824# reset keyboard interrupt trap
1925trap INT
Original file line number Diff line number Diff line change 66
77[ " $program " ] || program=${0##*/ }
88
9+ function die() {
10+ echo " $program : Error: $* " 1>&2 ;
11+ exit 2
12+ }
13+
914function err() {
1015 echo " $program : Error: $* " 1>&2 ;
1116 exit 2
1217}
13- alias die=' err'
1418
1519function warn() {
1620 echo " $program : Warning: $* " 1>&2 ;
Original file line number Diff line number Diff line change @@ -66,18 +66,17 @@ while true; do
6666 echo " $$ " > $PIDFILE
6767 chmod a+rwx $LOCKDIR
6868 chmod a+rw $PIDFILE
69+ echo $PIDFILE # tell caller about the pidfile
6970 break
7071 else
7172 pid=$( < $PIDFILE )
7273 [ " $pid " ] || die " Couldn't read pidfile '$PIDFILE '"
7374 if kill -0 $pid ; then
74- echo " Pidfile for process $pid exists, and process is running. Sleeping."
75+ say " Pidfile for process $pid exists, and process is running. Sleeping."
7576 sleep 10
7677 else
77- echo " Pidfile for process $pid exists, but process isn't running."
78- echo " Removing lock and old pid file $pidfile ."
79- rm -rf $LOCKDIR
80- break
78+ say " Pidfile for process $pid exists, but process doesn't seem to be running."
79+ die " Remove lockdir $LOCKDIR and old pid file $pidfile ."
8180 fi
8281 fi
8382done
You can’t perform that action at this time.
0 commit comments