2010-06-12 07:33:53 +02:00
|
|
|
# vim: syn=sh:
|
2010-06-18 16:44:40 +02:00
|
|
|
for bc in 0 1
|
2010-06-12 07:33:53 +02:00
|
|
|
do
|
2010-06-18 16:44:40 +02:00
|
|
|
cd $TESTDIR
|
2010-06-18 18:13:53 +02:00
|
|
|
$TESTDIR/rollback || die "rollback failed"
|
2010-06-18 16:44:40 +02:00
|
|
|
editrc GL_BIG_CONFIG $bc
|
|
|
|
|
|
|
|
# ----------
|
|
|
|
|
|
|
|
# test "C" permissions
|
|
|
|
|
|
|
|
name "INTERNAL"
|
|
|
|
echo "
|
|
|
|
@leads = u1 u2
|
|
|
|
@devs = u1 u2 u3 u4
|
|
|
|
|
2010-07-24 15:53:31 +02:00
|
|
|
@gfoo = foo
|
|
|
|
repo @gfoo
|
2010-06-18 16:44:40 +02:00
|
|
|
RW+C = @leads
|
|
|
|
RW+C personal/USER/ = @devs
|
|
|
|
RW = @devs
|
|
|
|
" | ugc
|
|
|
|
|
|
|
|
cd ~/td
|
|
|
|
runlocal git clone u1:foo
|
|
|
|
|
|
|
|
cd foo
|
|
|
|
mdc; mdc; mdc; mdc; mdc
|
|
|
|
|
|
|
|
name "u1 can push/rewind master on foo"
|
|
|
|
runlocal git push origin master
|
|
|
|
expect_push_ok "master -> master"
|
|
|
|
runlocal git push -f origin master^^:master
|
|
|
|
expect_push_ok "master^^ -> master"
|
|
|
|
|
|
|
|
name "u2 can create newbr1 on foo"
|
|
|
|
runlocal git push u2:foo master:newbr1
|
|
|
|
expect_push_ok "master -> newbr1"
|
|
|
|
|
2010-06-18 19:46:42 +02:00
|
|
|
name "u2 can create newtag on foo"
|
|
|
|
runlocal git tag newtag
|
|
|
|
runlocal git push u2:foo newtag
|
|
|
|
expect_push_ok "newtag -> newtag"
|
|
|
|
|
2010-06-18 16:44:40 +02:00
|
|
|
name "u3 can push newbr1 on foo"
|
|
|
|
mdc; mdc; mdc; mdc; mdc
|
|
|
|
runlocal git push u3:foo master:newbr1
|
|
|
|
expect_push_ok "master -> newbr1"
|
|
|
|
|
|
|
|
name "u4 canNOT create newbr2 on foo"
|
|
|
|
mdc; mdc; mdc; mdc; mdc
|
|
|
|
runlocal git push u3:foo master:newbr2
|
|
|
|
expect "remote: C refs/heads/newbr2 foo u3 DENIED by fallthru"
|
|
|
|
expect "hook declined"
|
|
|
|
expect "failed to push"
|
|
|
|
|
2010-06-18 19:46:42 +02:00
|
|
|
name "u4 canNOT create newtag2 on foo"
|
|
|
|
runlocal git tag newtag2
|
|
|
|
runlocal git push u3:foo newtag2
|
|
|
|
expect "remote: C refs/tags/newtag2 foo u3 DENIED by fallthru"
|
|
|
|
expect "hook declined"
|
|
|
|
expect "failed to push"
|
|
|
|
|
2010-06-18 16:44:40 +02:00
|
|
|
name "u4 can create/rewind personal/u4/newbr3 on foo"
|
|
|
|
mdc; mdc; mdc; mdc; mdc
|
|
|
|
runlocal git push u4:foo master:personal/u4/newbr3
|
|
|
|
expect_push_ok "master -> personal/u4/newbr3"
|
|
|
|
runlocal git push -f origin master^^:personal/u4/newbr3
|
|
|
|
expect_push_ok "master^^ -> personal/u4/newbr3"
|
|
|
|
|
|
|
|
# bar, without "C" permissions, should behave like old
|
|
|
|
|
|
|
|
name "INTERNAL"
|
|
|
|
echo "
|
|
|
|
@leads = u1 u2
|
|
|
|
@devs = u1 u2 u3 u4
|
|
|
|
|
2010-07-24 15:53:31 +02:00
|
|
|
@gbar = bar
|
|
|
|
repo @gbar
|
2010-06-18 16:44:40 +02:00
|
|
|
RW+ = @leads
|
|
|
|
RW+ personal/USER/ = @devs
|
|
|
|
RW = @devs
|
|
|
|
" | ugc
|
|
|
|
|
|
|
|
cd ~/td
|
|
|
|
runlocal git clone u1:bar
|
|
|
|
|
|
|
|
cd bar
|
|
|
|
mdc; mdc; mdc; mdc; mdc
|
|
|
|
|
|
|
|
name "u1 can push/rewind master on bar"
|
|
|
|
runlocal git push origin master
|
|
|
|
expect_push_ok "master -> master"
|
|
|
|
runlocal git push -f origin master^^:master
|
|
|
|
expect_push_ok "master^^ -> master"
|
|
|
|
|
|
|
|
name "u2 can create newbr1 on bar"
|
|
|
|
runlocal git push u2:bar master:newbr1
|
|
|
|
expect_push_ok "master -> newbr1"
|
|
|
|
|
2010-06-18 19:46:42 +02:00
|
|
|
name "u2 can create newtag on bar"
|
|
|
|
runlocal git tag newtag
|
|
|
|
runlocal git push u2:bar newtag
|
|
|
|
expect_push_ok "newtag -> newtag"
|
|
|
|
|
2010-06-18 16:44:40 +02:00
|
|
|
name "u3 can push newbr1 on bar"
|
|
|
|
mdc; mdc; mdc; mdc; mdc
|
|
|
|
runlocal git push u3:bar master:newbr1
|
|
|
|
expect_push_ok "master -> newbr1"
|
|
|
|
|
|
|
|
name "u4 can create newbr2 on bar"
|
|
|
|
mdc; mdc; mdc; mdc; mdc
|
|
|
|
runlocal git push u3:bar master:newbr2
|
|
|
|
expect_push_ok "master -> newbr2"
|
|
|
|
|
2010-06-18 19:46:42 +02:00
|
|
|
name "u4 can create newtag2 on bar"
|
|
|
|
runlocal git tag newtag2
|
|
|
|
runlocal git push u3:bar newtag2
|
|
|
|
expect_push_ok "newtag2 -> newtag2"
|
|
|
|
|
2010-06-18 16:44:40 +02:00
|
|
|
name "u4 can create/rewind personal/u4/newbr3 on bar"
|
|
|
|
mdc; mdc; mdc; mdc; mdc
|
|
|
|
runlocal git push u4:bar master:personal/u4/newbr3
|
|
|
|
expect_push_ok "master -> personal/u4/newbr3"
|
|
|
|
runlocal git push -f origin master^^:personal/u4/newbr3
|
|
|
|
expect_push_ok "master^^ -> personal/u4/newbr3"
|
|
|
|
|
|
|
|
name INTERNAL
|
2010-06-12 07:33:53 +02:00
|
|
|
done
|