diff --git a/tests/test-push-http b/tests/test-pull-http copy from tests/test-push-http copy to tests/test-pull-http --- a/tests/test-push-http +++ b/tests/test-pull-http @@ -13,44 +13,24 @@ cd test2 echo a >> a 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() { hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log 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` echo % serve errors cat errors.log } -cd ../test - -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 +echo % expect error, pulling not allowed 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 diff --git a/tests/test-pull-http.out b/tests/test-pull-http.out new file mode 100644 --- /dev/null +++ b/tests/test-pull-http.out @@ -0,0 +1,12 @@ +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