Show More
@@ -1,123 +1,130 b'' | |||||
1 | $ "$TESTDIR/hghave" serve || exit 80 |
|
1 | $ "$TESTDIR/hghave" serve || exit 80 | |
2 |
|
2 | |||
3 | $ hg init test |
|
3 | $ hg init test | |
4 | $ cd test |
|
4 | $ cd test | |
5 | $ echo a > a |
|
5 | $ echo a > a | |
6 | $ hg ci -Ama |
|
6 | $ hg ci -Ama | |
7 | adding a |
|
7 | adding a | |
8 | $ cd .. |
|
8 | $ cd .. | |
9 | $ hg clone test test2 |
|
9 | $ hg clone test test2 | |
10 | updating to branch default |
|
10 | updating to branch default | |
11 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
11 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
12 | $ cd test2 |
|
12 | $ cd test2 | |
13 | $ echo a >> a |
|
13 | $ echo a >> a | |
14 | $ hg ci -mb |
|
14 | $ hg ci -mb | |
15 | $ req() { |
|
15 | $ req() { | |
16 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
16 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
17 | > cat hg.pid >> $DAEMON_PIDS |
|
17 | > cat hg.pid >> $DAEMON_PIDS | |
18 | > hg --cwd ../test2 push http://localhost:$HGPORT/ |
|
18 | > hg --cwd ../test2 push http://localhost:$HGPORT/ | |
|
19 | > exitstatus=$? | |||
19 |
|
|
20 | > "$TESTDIR/killdaemons.py" | |
20 |
> echo % serve |
|
21 | > echo % serve errors | |
21 | > cat errors.log |
|
22 | > cat errors.log | |
|
23 | > return $exitstatus | |||
22 | > } |
|
24 | > } | |
23 | $ cd ../test |
|
25 | $ cd ../test | |
24 |
|
26 | |||
25 | expect ssl error |
|
27 | expect ssl error | |
26 |
|
28 | |||
27 | $ req |
|
29 | $ req | |
28 | pushing to http://localhost:$HGPORT/ |
|
30 | pushing to http://localhost:$HGPORT/ | |
29 | searching for changes |
|
31 | searching for changes | |
30 | remote: ssl required |
|
32 | remote: ssl required | |
31 | remote: ssl required |
|
33 | remote: ssl required | |
32 | updating cb9a9f314b8b to public failed! |
|
34 | updating cb9a9f314b8b to public failed! | |
33 | % serve errors |
|
35 | % serve errors | |
|
36 | [1] | |||
34 |
|
37 | |||
35 | expect authorization error |
|
38 | expect authorization error | |
36 |
|
39 | |||
37 | $ echo '[web]' > .hg/hgrc |
|
40 | $ echo '[web]' > .hg/hgrc | |
38 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
41 | $ echo 'push_ssl = false' >> .hg/hgrc | |
39 | $ req |
|
42 | $ req | |
40 | pushing to http://localhost:$HGPORT/ |
|
43 | pushing to http://localhost:$HGPORT/ | |
41 | searching for changes |
|
44 | searching for changes | |
42 | abort: authorization failed |
|
45 | abort: authorization failed | |
43 | % serve errors |
|
46 | % serve errors | |
|
47 | [255] | |||
44 |
|
48 | |||
45 | expect authorization error: must have authorized user |
|
49 | expect authorization error: must have authorized user | |
46 |
|
50 | |||
47 | $ echo 'allow_push = unperson' >> .hg/hgrc |
|
51 | $ echo 'allow_push = unperson' >> .hg/hgrc | |
48 | $ req |
|
52 | $ req | |
49 | pushing to http://localhost:$HGPORT/ |
|
53 | pushing to http://localhost:$HGPORT/ | |
50 | searching for changes |
|
54 | searching for changes | |
51 | abort: authorization failed |
|
55 | abort: authorization failed | |
52 | % serve errors |
|
56 | % serve errors | |
|
57 | [255] | |||
53 |
|
58 | |||
54 | expect success |
|
59 | expect success | |
55 |
|
60 | |||
56 | $ echo 'allow_push = *' >> .hg/hgrc |
|
61 | $ echo 'allow_push = *' >> .hg/hgrc | |
57 | $ echo '[hooks]' >> .hg/hgrc |
|
62 | $ echo '[hooks]' >> .hg/hgrc | |
58 | $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup 0" >> .hg/hgrc |
|
63 | $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup 0" >> .hg/hgrc | |
59 | $ req |
|
64 | $ req | |
60 | pushing to http://localhost:$HGPORT/ |
|
65 | pushing to http://localhost:$HGPORT/ | |
61 | searching for changes |
|
66 | searching for changes | |
62 | remote: adding changesets |
|
67 | remote: adding changesets | |
63 | remote: adding manifests |
|
68 | remote: adding manifests | |
64 | remote: adding file changes |
|
69 | remote: adding file changes | |
65 | remote: added 1 changesets with 1 changes to 1 files |
|
70 | remote: added 1 changesets with 1 changes to 1 files | |
66 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob) |
|
71 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob) | |
67 | % serve errors |
|
72 | % serve errors | |
68 | $ hg rollback |
|
73 | $ hg rollback | |
69 | repository tip rolled back to revision 0 (undo serve) |
|
74 | repository tip rolled back to revision 0 (undo serve) | |
70 |
|
75 | |||
71 | expect success, server lacks the httpheader capability |
|
76 | expect success, server lacks the httpheader capability | |
72 |
|
77 | |||
73 | $ CAP=httpheader |
|
78 | $ CAP=httpheader | |
74 | $ . "$TESTDIR/notcapable" |
|
79 | $ . "$TESTDIR/notcapable" | |
75 | $ req |
|
80 | $ req | |
76 | pushing to http://localhost:$HGPORT/ |
|
81 | pushing to http://localhost:$HGPORT/ | |
77 | searching for changes |
|
82 | searching for changes | |
78 | remote: adding changesets |
|
83 | remote: adding changesets | |
79 | remote: adding manifests |
|
84 | remote: adding manifests | |
80 | remote: adding file changes |
|
85 | remote: adding file changes | |
81 | remote: added 1 changesets with 1 changes to 1 files |
|
86 | remote: added 1 changesets with 1 changes to 1 files | |
82 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob) |
|
87 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob) | |
83 | % serve errors |
|
88 | % serve errors | |
84 | $ hg rollback |
|
89 | $ hg rollback | |
85 | repository tip rolled back to revision 0 (undo serve) |
|
90 | repository tip rolled back to revision 0 (undo serve) | |
86 |
|
91 | |||
87 | expect success, server lacks the unbundlehash capability |
|
92 | expect success, server lacks the unbundlehash capability | |
88 |
|
93 | |||
89 | $ CAP=unbundlehash |
|
94 | $ CAP=unbundlehash | |
90 | $ . "$TESTDIR/notcapable" |
|
95 | $ . "$TESTDIR/notcapable" | |
91 | $ req |
|
96 | $ req | |
92 | pushing to http://localhost:$HGPORT/ |
|
97 | pushing to http://localhost:$HGPORT/ | |
93 | searching for changes |
|
98 | searching for changes | |
94 | remote: adding changesets |
|
99 | remote: adding changesets | |
95 | remote: adding manifests |
|
100 | remote: adding manifests | |
96 | remote: adding file changes |
|
101 | remote: adding file changes | |
97 | remote: added 1 changesets with 1 changes to 1 files |
|
102 | remote: added 1 changesets with 1 changes to 1 files | |
98 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob) |
|
103 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob) | |
99 | % serve errors |
|
104 | % serve errors | |
100 | $ hg rollback |
|
105 | $ hg rollback | |
101 | repository tip rolled back to revision 0 (undo serve) |
|
106 | repository tip rolled back to revision 0 (undo serve) | |
102 |
|
107 | |||
103 | expect authorization error: all users denied |
|
108 | expect authorization error: all users denied | |
104 |
|
109 | |||
105 | $ echo '[web]' > .hg/hgrc |
|
110 | $ echo '[web]' > .hg/hgrc | |
106 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
111 | $ echo 'push_ssl = false' >> .hg/hgrc | |
107 | $ echo 'deny_push = *' >> .hg/hgrc |
|
112 | $ echo 'deny_push = *' >> .hg/hgrc | |
108 | $ req |
|
113 | $ req | |
109 | pushing to http://localhost:$HGPORT/ |
|
114 | pushing to http://localhost:$HGPORT/ | |
110 | searching for changes |
|
115 | searching for changes | |
111 | abort: authorization failed |
|
116 | abort: authorization failed | |
112 | % serve errors |
|
117 | % serve errors | |
|
118 | [255] | |||
113 |
|
119 | |||
114 | expect authorization error: some users denied, users must be authenticated |
|
120 | expect authorization error: some users denied, users must be authenticated | |
115 |
|
121 | |||
116 | $ echo 'deny_push = unperson' >> .hg/hgrc |
|
122 | $ echo 'deny_push = unperson' >> .hg/hgrc | |
117 | $ req |
|
123 | $ req | |
118 | pushing to http://localhost:$HGPORT/ |
|
124 | pushing to http://localhost:$HGPORT/ | |
119 | searching for changes |
|
125 | searching for changes | |
120 | abort: authorization failed |
|
126 | abort: authorization failed | |
121 | % serve errors |
|
127 | % serve errors | |
|
128 | [255] | |||
122 |
|
129 | |||
123 | $ cd .. |
|
130 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now