some tests added/expanded

This commit is contained in:
Sitaram Chamarty 2011-01-10 22:07:39 +05:30
parent 9b5793f2d1
commit d022d90031
2 changed files with 99 additions and 0 deletions

View file

@ -48,6 +48,22 @@ do
[ "$wr" = "1" ] && expect " R W .(u1).foo/u1/bar" [ "$wr" = "1" ] && expect " R W .(u1).foo/u1/bar"
[ "$wr" = "1" ] && expect "@R_ @W_..gitolite..testing" [ "$wr" = "1" ] && expect "@R_ @W_..gitolite..testing"
name "gitolite info u1"
runlocal ssh gitolite info . u1
expect "hello u1, the gitolite version here is"
expect " @R_ @W_.testing"
[ "$wr" = "1" ] && [ "$bc" = "0" ] && expect " C R W .foo/u1/\\.\\+"
[ "$wr" = "1" ] && [ "$bc" = "1" ] && notexpect " C R W .foo/u1/\\.\\+"
[ "$wr" = "1" ] && [ "$bc" = "1" ] && expect " C .@gfoo"
name "gitolite expand u1"
runlocal ssh gitolite expand . u1
[ "$wr" = "0" ] && expect "wildrepos disabled, sorry"
# XXX TODO -- expand currently does not allow superuser to query for others
# [ "$wr" = "1" ] && expect "hello u1, the gitolite version here is"
# [ "$wr" = "1" ] && expect " R W .(u1).foo/u1/bar"
# [ "$wr" = "1" ] && expect "@R_ @W_..gitolite..testing"
name INTERNAL name INTERNAL
done done
done done

83
t/t65-rsync Normal file
View file

@ -0,0 +1,83 @@
# vim: syn=sh:
cd $TESTDIR
$TESTDIR/rollback || die "rollback failed"
runremote rm -rf /tmp/rsyncbase
runremote mkdir /tmp/rsyncbase
editrc REPO_UMASK 0022
echo "\$RSYNC_BASE = '/tmp/rsyncbase';" | addrc
# ----------
name "INTERNAL"
echo "
@leads = u1 u2
@devs = u1 u2 u3 u4
repo EXTCMD/rsync
RW NAME/ = u1
- NAME/spl = @all
RW NAME/ = u2
RW NAME/foo/ = u3
" | ugc
expect_push_ok "master -> master"
name "u1 rsync to frob"
cd ~/gitolite-admin
runlocal rsync -avP conf u1:frob
expect conf/gitolite.conf
expect 386.*100%
expect "total size is 386"
runlocal find /tmp/rsyncbase -type f
expect /tmp/rsyncbase/frob/conf/gitolite.conf
name "u1 rsync from frob to local"
cd ~/td
rm -rf frobhere
runlocal rsync -avP u1:frob frobhere
runlocal find frobhere -type f
expect frobhere/frob/conf/gitolite.conf
name "u2 rsync to nitz"
cd ~/gitolite-admin
runlocal rsync -avP conf u2:nitz
expect conf/gitolite.conf
expect 386.*100%
expect "total size is 386"
runlocal find /tmp/rsyncbase -type f
expect /tmp/rsyncbase/nitz/conf/gitolite.conf
name "u2 rsync to spl"
cd ~/gitolite-admin
runlocal rsync -avP conf u2:spl
expect "W NAME/spl u2 DENIED by NAME/spl"
name "u1 rsync to spl"
cd ~/gitolite-admin
runlocal rsync -avP conf u1:spl
expect 386.*100%
expect "total size is 386"
name "u2 rsync from spl"
cd ~/td
runlocal rsync -avP u2:spl splhere
expect "R NAME/spl u2 DENIED by NAME/spl"
name "u1 rsync from spl"
cd ~/td
runlocal rsync -avP u1:spl splhere
expect 386.*100%
expect "total size is 386"
name "u3 rsync to foo"
cd ~/gitolite-admin
runlocal rsync -avP conf u3:foo/
expect 386.*100%
expect "total size is 386"
name "u3 rsync to bar"
cd ~/gitolite-admin
runlocal rsync -avP conf u3:bar
expect "W NAME/bar EXTCMD/rsync u3 DENIED by fallthru"
name "INTERNAL"