lots of changes to tests for big-config

as well as wild, and (as much as I could) both together
This commit is contained in:
Sitaram Chamarty 2010-07-24 19:23:31 +05:30
parent f21e7780a1
commit 204b34e525
10 changed files with 271 additions and 118 deletions

View file

@ -5,7 +5,8 @@ echo "
@g1 = u1 @g1 = u1
@g2 = u2 @g2 = u2
@g3 = u3 @g3 = u3
repo aa @gaa = aa
repo @gaa
RW+ = @g1 RW+ = @g1
RW = @g2 RW = @g2
RW+ master = @g3 RW+ master = @g3
@ -116,7 +117,7 @@ expect " * \[new branch\] dev -> dev"
# u1 tries to delete dev on a new setup # u1 tries to delete dev on a new setup
name "INTERNAL" name "INTERNAL"
echo " echo "
repo aa repo @gaa
RWD dev = u4 RWD dev = u4
" | ugc " | ugc
expect "master -> master" expect "master -> master"
@ -135,7 +136,8 @@ expect " - \[deleted\] *dev"
name "INTERNAL" name "INTERNAL"
echo " echo "
repo r1 @gr1 = r1
repo @gr1
RW refs/heads/v[0-9] = u1 RW refs/heads/v[0-9] = u1
RW refs/heads = tester RW refs/heads = tester
" | ugc " | ugc
@ -155,7 +157,8 @@ expect "\* \[new branch\] v1 -> v1"
name "INTERNAL" name "INTERNAL"
echo " echo "
repo r2 @gr2 = r2
repo @gr2
RW refs/heads/v[0-9] = u1 RW refs/heads/v[0-9] = u1
- refs/heads/v[0-9] = tester - refs/heads/v[0-9] = tester
RW refs/heads = tester RW refs/heads = tester

View file

@ -7,7 +7,8 @@ echo "
@TAs = u2 u3 @TAs = u2 u3
@students = u4 u5 u6 @students = u4 u5 u6
repo foo/CREATOR/a[0-9][0-9] @gfoo = foo/CREATOR/a[0-9][0-9]
repo @gfoo
C = @all C = @all
RW+ = CREATOR RW+ = CREATOR
RW = WRITERS @TAs RW = WRITERS @TAs

View file

@ -7,7 +7,8 @@ echo "
@TAs = u2 u3 @TAs = u2 u3
@students = u4 u5 u6 @students = u4 u5 u6
repo foo/CREATOR/a[0-9][0-9] @gfoo = foo/CREATOR/a[0-9][0-9]
repo @gfoo
C = @students C = @students
RW+ = CREATOR RW+ = CREATOR
RW = WRITERS @TAs RW = WRITERS @TAs

View file

@ -11,7 +11,8 @@ do
name "INTERNAL" name "INTERNAL"
echo " echo "
@staff = u1 u2 u3 @staff = u1 u2 u3
repo foo/CREATOR/.+ @gfoo = foo/CREATOR/.+
repo @gfoo
C = u1 C = u1
RW+ = CREATOR RW+ = CREATOR
RW = WRITERS RW = WRITERS
@ -57,7 +58,8 @@ do
name "INTERNAL" name "INTERNAL"
echo " echo "
@staff = u1 u2 u3 @staff = u1 u2 u3
repo foo/CREATOR/.+ @gfoo = foo/CREATOR/.+
repo @gfoo
C = u1 C = u1
RW+ = CREATOR RW+ = CREATOR
- = @staff - = @staff

View file

@ -13,7 +13,8 @@ do
name "INTERNAL" name "INTERNAL"
echo " echo "
@staff = u1 u2 u3 u4 u5 u6 @staff = u1 u2 u3 u4 u5 u6
repo foo @gfoo = foo
repo @gfoo
RW+ = u1 u2 RW+ = u1 u2
RW+ personal/USER/ = u3 u4 RW+ personal/USER/ = u3 u4
RW temp = u5 u6 RW temp = u5 u6

View file

@ -14,7 +14,8 @@ do
@leads = u1 u2 @leads = u1 u2
@devs = u1 u2 u3 u4 @devs = u1 u2 u3 u4
repo foo @gfoo = foo
repo @gfoo
RW+C = @leads RW+C = @leads
RW+C personal/USER/ = @devs RW+C personal/USER/ = @devs
RW = @devs RW = @devs
@ -74,7 +75,8 @@ do
@leads = u1 u2 @leads = u1 u2
@devs = u1 u2 u3 u4 @devs = u1 u2 u3 u4
repo bar @gbar = bar
repo @gbar
RW+ = @leads RW+ = @leads
RW+ personal/USER/ = @devs RW+ personal/USER/ = @devs
RW = @devs RW = @devs

View file

@ -14,7 +14,8 @@ do
echo " echo "
@leads = u1 u2 @leads = u1 u2
@devs = u1 u2 u3 u4 @devs = u1 u2 u3 u4
repo foo/CREATOR/.+ @gfoo = foo/CREATOR/.+
repo @gfoo
C = @leads C = @leads
RW+ = CREATOR RW+ = CREATOR
" | ugc " | ugc
@ -36,7 +37,9 @@ do
runlocal ssh u1 info runlocal ssh u1 info
expect "hello u1, the gitolite version here is" expect "hello u1, the gitolite version here is"
expect "@R.*@W.*testing" expect "@R.*@W.*testing"
[ "$wr" = "1" ] && expect "C.*R.*W.*foo/u1/\\.\\+" [ "$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 "u1 expand" name "u1 expand"
runlocal ssh u1 expand runlocal ssh u1 expand

View file

@ -15,7 +15,8 @@ do
@leads = u1 u2 @leads = u1 u2
@devs = u1 u2 u3 u4 @devs = u1 u2 u3 u4
repo bar @gbar = bar
repo @gbar
RW+ = @leads RW+ = @leads
RW = @devs RW = @devs
config foo.bar = baz config foo.bar = baz
@ -38,7 +39,8 @@ do
@leads = u1 u2 @leads = u1 u2
@devs = u1 u2 u3 u4 @devs = u1 u2 u3 u4
repo bar @gbar = bar
repo @gbar
RW+ = @leads RW+ = @leads
RW = @devs RW = @devs
config foo.bar = baz config foo.bar = baz
@ -55,7 +57,8 @@ do
@leads = u1 u2 @leads = u1 u2
@devs = u1 u2 u3 u4 @devs = u1 u2 u3 u4
repo bar @gbar = bar
repo @gbar
RW+ = @leads RW+ = @leads
RW = @devs RW = @devs
config foo.bar = baz config foo.bar = baz
@ -73,7 +76,8 @@ do
@leads = u1 u2 @leads = u1 u2
@devs = u1 u2 u3 u4 @devs = u1 u2 u3 u4
repo bar @gbar = bar
repo @gbar
RW+ = @leads RW+ = @leads
RW = @devs RW = @devs
config foo.bar = config foo.bar =

View file

@ -1,11 +1,14 @@
# vim: syn=sh: # vim: syn=sh:
for gcw in 0 1 for bc in 0 1
do do
for gcw in 0 1
do
cd $TESTDIR cd $TESTDIR
$TESTDIR/rollback || die "rollback failed" $TESTDIR/rollback || die "rollback failed"
name INTERNAL name INTERNAL
editrc GL_WILDREPOS 1 editrc GL_WILDREPOS 1
editrc GL_BIG_CONFIG $bc
echo "\$GL_GITCONFIG_WILD = $gcw;" | addrc echo "\$GL_GITCONFIG_WILD = $gcw;" | addrc
# ---------- # ----------
@ -15,7 +18,8 @@ do
@leads = u1 u2 @leads = u1 u2
@devs = u1 u2 u3 u4 @devs = u1 u2 u3 u4
repo bar/..* @gbar = bar/..*
repo @gbar
C = @leads C = @leads
RW+ = CREATOR RW+ = CREATOR
RW = @leads RW = @leads
@ -36,7 +40,8 @@ do
@leads = u1 u2 @leads = u1 u2
@devs = u1 u2 u3 u4 @devs = u1 u2 u3 u4
repo bar/..* @gbar = bar/..*
repo @gbar
C = @leads C = @leads
RW+ = CREATOR RW+ = CREATOR
RW = @leads RW = @leads
@ -54,7 +59,8 @@ do
@leads = u1 u2 @leads = u1 u2
@devs = u1 u2 u3 u4 @devs = u1 u2 u3 u4
repo bar/..* @gbar = bar/..*
repo @gbar
C = @leads C = @leads
RW+ = CREATOR RW+ = CREATOR
RW = @leads RW = @leads
@ -77,7 +83,8 @@ do
@leads = u1 u2 @leads = u1 u2
@devs = u1 u2 u3 u4 @devs = u1 u2 u3 u4
repo bar/..* @gbar = bar/..*
repo @gbar
C = @leads C = @leads
RW+ = CREATOR RW+ = CREATOR
RW = @leads RW = @leads
@ -104,7 +111,8 @@ do
@leads = u1 u2 @leads = u1 u2
@devs = u1 u2 u3 u4 @devs = u1 u2 u3 u4
repo bar/..* @gbar = bar/..*
repo @gbar
C = @leads C = @leads
RW+ = CREATOR RW+ = CREATOR
RW = @leads RW = @leads
@ -123,4 +131,5 @@ do
expect 'frob = nitz' expect 'frob = nitz'
name INTERNAL name INTERNAL
done
done done

127
t/t58-daemon-gitweb-wild Normal file
View file

@ -0,0 +1,127 @@
# vim: syn=sh:
for bc in 0 1
do
cd $TESTDIR
$TESTDIR/rollback || die "rollback failed"
editrc GL_WILDREPOS 1
editrc GL_BIG_CONFIG $bc
# ----------
name "INTERNAL"
echo "
@leads = u1 u2
@devs = u1 u2 u3 u4
@gbar = bar/CREATOR/..*
repo @gbar
C = @leads
RW+ = @leads
RW = @devs
" | ugc
expect_push_ok "master -> master"
runlocal git ls-remote u1:bar/u1/try1
runremote ls -al repositories/bar/u1/try1.git/git-daemon-export-ok
expect "ls: cannot access repositories/bar/u1/try1.git/git-daemon-export-ok: No such file or directory"
runremote ls -al projects.list
expect "gitolite-test gitolite-test 12 .* projects.list"
runremote cat projects.list
expect "testing.git"
notexpect "bar/u1/try1.git"
name "add daemon access"
echo "
R = daemon
" | ugc
runremote ls -al repositories/bar/u1/try1.git/git-daemon-export-ok
expect "gitolite-test gitolite-test .* repositories/bar/u1/try1.git/git-daemon-export-ok"
runremote ls -al projects.list
expect "gitolite-test gitolite-test 12 .* projects.list"
name "add one more repo"
runlocal git ls-remote u1:bar/u1/try2
runremote ls -al repositories/bar/u1/try2.git/git-daemon-export-ok
expect "gitolite-test gitolite-test .* repositories/bar/u1/try2.git/git-daemon-export-ok"
runremote ls -al projects.list
expect "gitolite-test gitolite-test 12 .* projects.list"
runremote cat projects.list
expect "testing.git"
notexpect "bar/u1/try1.git"
notexpect "bar/u1/try2.git"
name "add descriptions for try1 and try3 and compile"
echo "
bar/u1/try1 = \"this is bar/u1/try1\"
bar/u1/try3 = \"this is bar/u1/try3\"
" | ugc
runremote ls -al projects.list
expect "gitolite-test gitolite-test 28 .* projects.list"
runremote cat projects.list
expect "testing.git"
expect "bar/u1/try1.git"
notexpect "bar/u1/try2.git"
notexpect "bar/u1/try3.git"
runremote cat repositories/bar/u1/try1.git/description
expect "this is bar/u1/try1"
name "add try3 project"
runlocal git ls-remote u1:bar/u1/try3
runremote ls -al repositories/bar/u1/try3.git/git-daemon-export-ok
expect "gitolite-test gitolite-test .* repositories/bar/u1/try3.git/git-daemon-export-ok"
runremote ls -al projects.list
expect "gitolite-test gitolite-test 28 .* projects.list"
runremote cat projects.list
expect "testing.git"
expect "bar/u1/try1.git"
notexpect "bar/u1/try2.git"
notexpect "bar/u1/try3.git"
runremote cat repositories/bar/u1/try1.git/description
expect "this is bar/u1/try1"
runremote cat repositories/bar/u1/try3.git/description
expect "cat: repositories/bar/u1/try3.git/description: No such file or directory"
name "now compile and recheck try3 stuff"
echo "
" | ugc
runremote ls -al repositories/bar/u1/try3.git/git-daemon-export-ok
expect "gitolite-test gitolite-test .* repositories/bar/u1/try3.git/git-daemon-export-ok"
runremote ls -al projects.list
expect "gitolite-test gitolite-test 44 .* projects.list"
runremote cat projects.list
expect "testing.git"
expect "bar/u1/try1.git"
notexpect "bar/u1/try2.git"
expect "bar/u1/try3.git"
runremote cat repositories/bar/u1/try1.git/description
expect "this is bar/u1/try1"
runremote cat repositories/bar/u1/try3.git/description
expect "this is bar/u1/try3"
name "add owner for try2 and compile"
echo "
bar/u1/try2 \"owner2\" = \"this is bar/u1/try1\"
" | ugc
runremote cat repositories/bar/u1/try2.git/config
expect "\[gitweb\]"
expect "owner = owner2"
runremote ls -al projects.list
expect "gitolite-test gitolite-test 60 .* projects.list"
runremote cat projects.list
expect "bar/u1/try2.git"
name "add gitweb access to all"
echo "
repo @gbar
R = gitweb
" | ugc
expect_push_ok "master -> master"
runremote ls -al projects.list
expect "gitolite-test gitolite-test 60 .* projects.list"
runremote cat projects.list
expect "testing.git"
expect "bar/u1/try1.git"
expect "bar/u1/try2.git"
expect "bar/u1/try3.git"
name "INTERNAL"
done