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