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