comparison tests/test-push-http @ 2481:5c65b4e51610

add tests for push over http.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Wed, 21 Jun 2006 17:55:11 -0700
parents
children 83cfd95eafb5
comparison
equal deleted inserted replaced
2480:519a1011db91 2481:5c65b4e51610
1 #!/bin/sh
2
3 hg init test
4 cd test
5 echo a > a
6 hg ci -Ama
7
8 cd ..
9 hg clone test test2
10 cd test2
11 echo a >> a
12 hg ci -mb
13
14 cd ../test
15
16 echo % expect ssl error
17 hg serve -p 20059 -d --pid-file=hg.pid
18 hg --cwd ../test2 push http://localhost:20059/
19 kill `cat hg.pid`
20
21 echo % expect authorization error
22 echo '[web]' > .hg/hgrc
23 echo 'push_ssl = false' >> .hg/hgrc
24 hg serve -p 20059 -d --pid-file=hg.pid
25 hg --cwd ../test2 push http://localhost:20059/
26 kill `cat hg.pid`
27
28 echo % expect authorization error: must have authorized user
29 echo 'allow_push = unperson' >> .hg/hgrc
30 hg serve -p 20059 -d --pid-file=hg.pid
31 hg --cwd ../test2 push http://localhost:20059/
32 kill `cat hg.pid`
33
34 echo % expect success
35 echo 'allow_push = *' >> .hg/hgrc
36 hg serve -p 20059 -d --pid-file=hg.pid
37 hg --cwd ../test2 push http://localhost:20059/
38 kill `cat hg.pid`
39 hg rollback
40
41 echo % expect authorization error: all users denied
42 echo 'deny_push = *' >> .hg/hgrc
43 hg serve -p 20059 -d --pid-file=hg.pid
44 hg --cwd ../test2 push http://localhost:20059/
45 kill `cat hg.pid`
46
47 echo % expect authorization error: some users denied, users must be authenticated
48 echo 'deny_push = unperson' >> .hg/hgrc
49 hg serve -p 20059 -d --pid-file=hg.pid
50 hg --cwd ../test2 push http://localhost:20059/
51 kill `cat hg.pid`