Skip to content
Snippets Groups Projects
Commit 959efdac authored by Dirkjan Ochtman's avatar Dirkjan Ochtman
Browse files

tests: add some tests for web.allowpull configurations

parent 44c51574
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,16 @@ ...@@ -13,6 +13,16 @@
echo a >> a echo a >> a
hg ci -mb -d '0 0' hg ci -mb -d '0 0'
echo % expect error, cloning not allowed
echo '[web]' > .hg/hgrc
echo 'allowpull = false' >> .hg/hgrc
hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
cat hg.pid >> $DAEMON_PIDS
hg clone http://localhost:$HGPORT/ test3 | sed -e 's,:[0-9][0-9]*/,/,'
kill `cat hg.pid`
echo % serve errors
cat errors.log
req() { req() {
hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
cat hg.pid >> $DAEMON_PIDS cat hg.pid >> $DAEMON_PIDS
...@@ -16,9 +26,9 @@ ...@@ -16,9 +26,9 @@
req() { req() {
hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
cat hg.pid >> $DAEMON_PIDS cat hg.pid >> $DAEMON_PIDS
hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,' hg --cwd ../test pull http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
kill `cat hg.pid` kill `cat hg.pid`
echo % serve errors echo % serve errors
cat errors.log cat errors.log
} }
...@@ -20,18 +30,7 @@ ...@@ -20,18 +30,7 @@
kill `cat hg.pid` kill `cat hg.pid`
echo % serve errors echo % serve errors
cat errors.log cat errors.log
} }
cd ../test echo % expect error, pulling not allowed
echo % expect ssl error
req
echo % expect authorization error
echo '[web]' > .hg/hgrc
echo 'push_ssl = false' >> .hg/hgrc
req
echo % expect authorization error: must have authorized user
echo 'allow_push = unperson' >> .hg/hgrc
req req
...@@ -37,20 +36,1 @@ ...@@ -37,20 +36,1 @@
req req
echo % expect success
echo 'allow_push = *' >> .hg/hgrc
echo '[hooks]' >> .hg/hgrc
echo 'changegroup = python ../printenv.py changegroup 0 ../urls' >> .hg/hgrc
req
cat ../urls
hg rollback
echo % expect authorization error: all users denied
echo '[web]' > .hg/hgrc
echo 'push_ssl = false' >> .hg/hgrc
echo 'deny_push = *' >> .hg/hgrc
req
echo % expect authorization error: some users denied, users must be authenticated
echo 'deny_push = unperson' >> .hg/hgrc
req
adding a
updating working directory
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
% expect error, cloning not allowed
abort: error:
requesting all changes
% serve errors
% expect error, pulling not allowed
abort: error:
pulling from http://localhost/
searching for changes
% serve errors
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment