sapling/tests/test-push-http

66 lines
1.8 KiB
Plaintext
Raw Normal View History

2006-06-22 04:55:11 +04:00
#!/bin/sh
2007-03-27 06:50:00 +04:00
cp "$TESTDIR"/printenv.py .
2006-06-22 04:55:11 +04:00
hg init test
cd test
echo a > a
2007-03-27 06:50:00 +04:00
hg ci -Ama -d '0 0'
2006-06-22 04:55:11 +04:00
cd ..
hg clone test test2
cd test2
echo a >> a
2007-03-27 06:50:00 +04:00
hg ci -mb -d '0 0'
2006-06-22 04:55:11 +04:00
cd ../test
echo % expect ssl error
2007-10-05 23:17:01 +04:00
hg serve -p $HGPORT -d --pid-file=hg.pid
cat hg.pid >> $DAEMON_PIDS
2007-10-05 23:28:18 +04:00
hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
2006-06-22 04:55:11 +04:00
kill `cat hg.pid`
echo % expect authorization error
echo '[web]' > .hg/hgrc
echo 'push_ssl = false' >> .hg/hgrc
2007-10-05 23:17:01 +04:00
hg serve -p $HGPORT -d --pid-file=hg.pid
cat hg.pid >> $DAEMON_PIDS
2007-10-05 23:28:18 +04:00
hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
2006-06-22 04:55:11 +04:00
kill `cat hg.pid`
echo % expect authorization error: must have authorized user
echo 'allow_push = unperson' >> .hg/hgrc
2007-10-05 23:17:01 +04:00
hg serve -p $HGPORT -d --pid-file=hg.pid
cat hg.pid >> $DAEMON_PIDS
2007-10-05 23:28:18 +04:00
hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
2006-06-22 04:55:11 +04:00
kill `cat hg.pid`
echo % expect success
echo 'allow_push = *' >> .hg/hgrc
echo '[hooks]' >> .hg/hgrc
2007-03-27 06:50:00 +04:00
echo 'changegroup = python ../printenv.py changegroup 0 ../urls' >> .hg/hgrc
2007-10-05 23:17:01 +04:00
hg serve -p $HGPORT -d --pid-file=hg.pid
cat hg.pid >> $DAEMON_PIDS
2007-10-05 23:28:18 +04:00
hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
2006-06-22 04:55:11 +04:00
kill `cat hg.pid`
hg rollback
2007-03-27 06:50:00 +04:00
cat ../urls
2006-06-22 04:55:11 +04:00
echo % expect authorization error: all users denied
echo '[web]' > .hg/hgrc
echo 'push_ssl = false' >> .hg/hgrc
2006-06-22 04:55:11 +04:00
echo 'deny_push = *' >> .hg/hgrc
2007-10-05 23:17:01 +04:00
hg serve -p $HGPORT -d --pid-file=hg.pid
cat hg.pid >> $DAEMON_PIDS
2007-10-05 23:17:01 +04:00
hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
2006-06-22 04:55:11 +04:00
kill `cat hg.pid`
echo % expect authorization error: some users denied, users must be authenticated
echo 'deny_push = unperson' >> .hg/hgrc
2007-10-05 23:17:01 +04:00
hg serve -p $HGPORT -d --pid-file=hg.pid
cat hg.pid >> $DAEMON_PIDS
2007-10-05 23:17:01 +04:00
hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
2006-06-22 04:55:11 +04:00
kill `cat hg.pid`