comparison tests/test-push-http @ 2571:83cfd95eafb5

tests: add timeouts, make run-tests.py clean up dead daemon processes test timeout feature is needed for test with python 2.5 beta. if test does not complete in time (30 seconds is default), it is killed. some times daemon process used in test can be alive after the test is killed by user or by timeout. tests now record daemon pids into $DAEMON_PIDS and run-tests.py kills all living daemons after every test. final little change is to add newline to end of pid file printed by "hg serve", else "cat hg.pid >> $DAEMON_FILES" gives garbage.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Thu, 06 Jul 2006 11:45:34 -0700
parents 5c65b4e51610
children 109a22f5434a
comparison
equal deleted inserted replaced
2570:2264b2b077a1 2571:83cfd95eafb5
13 13
14 cd ../test 14 cd ../test
15 15
16 echo % expect ssl error 16 echo % expect ssl error
17 hg serve -p 20059 -d --pid-file=hg.pid 17 hg serve -p 20059 -d --pid-file=hg.pid
18 cat hg.pid >> $DAEMON_PIDS
18 hg --cwd ../test2 push http://localhost:20059/ 19 hg --cwd ../test2 push http://localhost:20059/
19 kill `cat hg.pid` 20 kill `cat hg.pid`
20 21
21 echo % expect authorization error 22 echo % expect authorization error
22 echo '[web]' > .hg/hgrc 23 echo '[web]' > .hg/hgrc
23 echo 'push_ssl = false' >> .hg/hgrc 24 echo 'push_ssl = false' >> .hg/hgrc
24 hg serve -p 20059 -d --pid-file=hg.pid 25 hg serve -p 20059 -d --pid-file=hg.pid
26 cat hg.pid >> $DAEMON_PIDS
25 hg --cwd ../test2 push http://localhost:20059/ 27 hg --cwd ../test2 push http://localhost:20059/
26 kill `cat hg.pid` 28 kill `cat hg.pid`
27 29
28 echo % expect authorization error: must have authorized user 30 echo % expect authorization error: must have authorized user
29 echo 'allow_push = unperson' >> .hg/hgrc 31 echo 'allow_push = unperson' >> .hg/hgrc
30 hg serve -p 20059 -d --pid-file=hg.pid 32 hg serve -p 20059 -d --pid-file=hg.pid
33 cat hg.pid >> $DAEMON_PIDS
31 hg --cwd ../test2 push http://localhost:20059/ 34 hg --cwd ../test2 push http://localhost:20059/
32 kill `cat hg.pid` 35 kill `cat hg.pid`
33 36
34 echo % expect success 37 echo % expect success
35 echo 'allow_push = *' >> .hg/hgrc 38 echo 'allow_push = *' >> .hg/hgrc
36 hg serve -p 20059 -d --pid-file=hg.pid 39 hg serve -p 20059 -d --pid-file=hg.pid
40 cat hg.pid >> $DAEMON_PIDS
37 hg --cwd ../test2 push http://localhost:20059/ 41 hg --cwd ../test2 push http://localhost:20059/
38 kill `cat hg.pid` 42 kill `cat hg.pid`
39 hg rollback 43 hg rollback
40 44
41 echo % expect authorization error: all users denied 45 echo % expect authorization error: all users denied
42 echo 'deny_push = *' >> .hg/hgrc 46 echo 'deny_push = *' >> .hg/hgrc
43 hg serve -p 20059 -d --pid-file=hg.pid 47 hg serve -p 20059 -d --pid-file=hg.pid
48 cat hg.pid >> $DAEMON_PIDS
44 hg --cwd ../test2 push http://localhost:20059/ 49 hg --cwd ../test2 push http://localhost:20059/
45 kill `cat hg.pid` 50 kill `cat hg.pid`
46 51
47 echo % expect authorization error: some users denied, users must be authenticated 52 echo % expect authorization error: some users denied, users must be authenticated
48 echo 'deny_push = unperson' >> .hg/hgrc 53 echo 'deny_push = unperson' >> .hg/hgrc
49 hg serve -p 20059 -d --pid-file=hg.pid 54 hg serve -p 20059 -d --pid-file=hg.pid
55 cat hg.pid >> $DAEMON_PIDS
50 hg --cwd ../test2 push http://localhost:20059/ 56 hg --cwd ../test2 push http://localhost:20059/
51 kill `cat hg.pid` 57 kill `cat hg.pid`