diff --git a/tests/test-http-permissions.t b/tests/test-http-permissions.t new file mode 100644 --- /dev/null +++ b/tests/test-http-permissions.t @@ -0,0 +1,52 @@ +#require killdaemons + + $ hg init test + $ cd test + $ echo a > a + $ hg ci -Ama + adding a + $ cd .. + $ hg clone test test2 + updating to branch default + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ cd test2 + $ echo a >> a + $ hg ci -mb + $ cd ../test + +expect authorization error: all users denied + + $ cat > .hg/hgrc < [web] + > push_ssl = false + > deny_push = * + > EOF + + $ hg serve -p $HGPORT -d --pid-file hg.pid + $ cat hg.pid > $DAEMON_PIDS + + $ hg --cwd ../test2 push http://localhost:$HGPORT/ + pushing to http://localhost:$HGPORT/ + searching for changes + abort: authorization failed + [255] + + $ killdaemons.py + +expect authorization error: some users denied, users must be authenticated + + $ cat > .hg/hgrc < [web] + > push_ssl = false + > deny_push = unperson + > EOF + + $ hg serve -p $HGPORT -d --pid-file hg.pid + $ cat hg.pid > $DAEMON_PIDS + $ hg --cwd ../test2 push http://localhost:$HGPORT/ + pushing to http://localhost:$HGPORT/ + searching for changes + abort: authorization failed + [255] + + $ killdaemons.py diff --git a/tests/test-push-http.t b/tests/test-push-http.t --- a/tests/test-push-http.t +++ b/tests/test-push-http.t @@ -307,28 +307,6 @@ Make phases updates work $ hg --config extensions.strip= strip -r 1: saved backup bundle to $TESTTMP/test/.hg/strip-backup/ba677d0156c1-eea704d7-backup.hg -expect authorization error: all users denied - - $ echo '[web]' > .hg/hgrc - $ echo 'push_ssl = false' >> .hg/hgrc - $ echo 'deny_push = *' >> .hg/hgrc - $ req - pushing to http://localhost:$HGPORT/ - searching for changes - abort: authorization failed - % serve errors - [255] - -expect authorization error: some users denied, users must be authenticated - - $ echo 'deny_push = unperson' >> .hg/hgrc - $ req - pushing to http://localhost:$HGPORT/ - searching for changes - abort: authorization failed - % serve errors - [255] - #if bundle2 $ cat > .hg/hgrc <