(minor) test reformatting
This commit is contained in:
parent
2069156c6b
commit
20fd0d0c19
|
@ -9,7 +9,7 @@ use Gitolite::Test;
|
|||
# branch permissions test
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
try "plan 58";
|
||||
try "plan 82";
|
||||
|
||||
confreset;confadd '
|
||||
@g1 = u1
|
||||
|
@ -53,63 +53,52 @@ try "
|
|||
/\\+ refs/heads/master aa u2 DENIED by fallthru/
|
||||
|
||||
# u3 rewind master succeed
|
||||
git reset --hard HEAD^
|
||||
tc m-508
|
||||
glt push u3 file://aa +master
|
||||
/\\+ .* master -> master \\(forced update\\)/
|
||||
git reset --hard HEAD^; ok
|
||||
tc m-508; ok
|
||||
glt push u3 file://aa +master; ok; /\\+ .* master -> master \\(forced update\\)/
|
||||
|
||||
# u4 push master succeed
|
||||
tc f-526
|
||||
glt push u4 file://aa master
|
||||
/master -> master/
|
||||
tc f-526; ok;
|
||||
glt push u4 file://aa master; ok; /master -> master/
|
||||
|
||||
# u4 rewind master fail
|
||||
git reset --hard HEAD^
|
||||
glt push u4 file://aa +master
|
||||
/\\+ refs/heads/master aa u4 DENIED by fallthru/
|
||||
git reset --hard HEAD^; ok;
|
||||
glt push u4 file://aa +master; !ok; /\\+ refs/heads/master aa u4 DENIED by fallthru/
|
||||
|
||||
# u3 and u4 / dev foo -- all 4 fail
|
||||
glt push u3 file://aa dev
|
||||
/W refs/heads/dev aa u3 DENIED by fallthru/
|
||||
glt push u4 file://aa dev
|
||||
/W refs/heads/dev aa u4 DENIED by fallthru/
|
||||
glt push u3 file://aa foo
|
||||
/W refs/heads/foo aa u3 DENIED by fallthru/
|
||||
glt push u4 file://aa foo
|
||||
/W refs/heads/foo aa u4 DENIED by fallthru/
|
||||
glt push u3 file://aa dev; !ok; /W refs/heads/dev aa u3 DENIED by fallthru/
|
||||
glt push u4 file://aa dev; !ok; /W refs/heads/dev aa u4 DENIED by fallthru/
|
||||
glt push u3 file://aa foo; !ok; /W refs/heads/foo aa u3 DENIED by fallthru/
|
||||
glt push u4 file://aa foo; !ok; /W refs/heads/foo aa u4 DENIED by fallthru/
|
||||
|
||||
# clean up for next set
|
||||
glt push u1 -f origin master dev foo
|
||||
ok
|
||||
|
||||
# u5 push master fail
|
||||
tc l-417
|
||||
glt push u5 file://aa master
|
||||
/W refs/heads/master aa u5 DENIED by refs/heads/master/
|
||||
tc l-417; ok
|
||||
glt push u5 file://aa master; !ok; /W refs/heads/master aa u5 DENIED by refs/heads/master/
|
||||
|
||||
# u5 rewind dev succeed
|
||||
glt push u5 file://aa +dev^:dev
|
||||
/\\+ .* dev\\^ -> dev \\(forced update\\)/
|
||||
ok; /\\+ .* dev\\^ -> dev \\(forced update\\)/
|
||||
|
||||
# u5 rewind foo fail
|
||||
glt push u5 file://aa +foo^:foo
|
||||
/\\+ refs/heads/foo aa u5 DENIED by fallthru/
|
||||
!ok; /\\+ refs/heads/foo aa u5 DENIED by fallthru/
|
||||
|
||||
# u5 tries to push foo; succeeds
|
||||
git checkout foo
|
||||
/Switched to branch 'foo'/
|
||||
git checkout foo; ok; /Switched to branch 'foo'/
|
||||
|
||||
# u5 push foo succeed
|
||||
tc e-530
|
||||
glt push u5 file://aa foo
|
||||
/foo -> foo/
|
||||
tc e-530; ok;
|
||||
glt push u5 file://aa foo; ok; /foo -> foo/
|
||||
|
||||
# u1 delete branch dev succeed
|
||||
glt push u1 origin :dev
|
||||
/ - \\[deleted\\] *dev/
|
||||
glt push u1 origin :dev; ok; / - \\[deleted\\] *dev/
|
||||
|
||||
# quietly push it back again
|
||||
glt push u1 origin dev
|
||||
/ * \\[new branch\\] dev -> dev/
|
||||
glt push u1 origin dev; ok; / * \\[new branch\\] dev -> dev/
|
||||
|
||||
";
|
||||
|
||||
|
@ -121,16 +110,13 @@ try "
|
|||
try "ADMIN_PUSH set2; !/FATAL/" or die text();
|
||||
|
||||
try "
|
||||
cd ../aa
|
||||
# u1 tries to delete dev on a new setup
|
||||
/master -> master/
|
||||
cd ../aa; ok; /master -> master/
|
||||
|
||||
# u1 delete branch dev fail
|
||||
glt push u1 origin :dev
|
||||
/D refs/heads/dev aa u1 DENIED by fallthru/
|
||||
glt push u1 origin :dev; !ok; /D refs/heads/dev aa u1 DENIED by fallthru/
|
||||
|
||||
# u4 delete branch dev succeed
|
||||
glt push u4 file://aa :dev
|
||||
/ - \\[deleted\\] *dev/
|
||||
glt push u4 file://aa :dev; ok; / - \\[deleted\\] *dev/
|
||||
|
||||
";
|
||||
|
|
95
t/wild-1.t
95
t/wild-1.t
|
@ -9,7 +9,7 @@ use Gitolite::Test;
|
|||
# basic tests
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
try "plan 43";
|
||||
try "plan 66";
|
||||
|
||||
confreset;confadd '
|
||||
@prof = u1
|
||||
|
@ -31,81 +31,64 @@ try "
|
|||
cd ..
|
||||
|
||||
# u1 create success
|
||||
glt clone u1 file:///foo/u1/a01
|
||||
/Initialized empty Git repository in .*/foo/u1/a01.git//
|
||||
glt clone u1 file:///foo/u1/a01; ok; /Initialized empty Git repository in .*/foo/u1/a01.git//
|
||||
|
||||
# u2 create success
|
||||
glt clone u2 file:///foo/u2/a02
|
||||
/Initialized empty Git repository in .*/foo/u2/a02.git//
|
||||
glt clone u2 file:///foo/u2/a02; ok; /Initialized empty Git repository in .*/foo/u2/a02.git//
|
||||
|
||||
# u4 tries to create u2 repo
|
||||
glt clone u4 file:///foo/u2/a12
|
||||
/R any foo/u2/a12 u4 DENIED by fallthru/
|
||||
glt clone u4 file:///foo/u2/a12; !ok; /R any foo/u2/a12 u4 DENIED by fallthru/
|
||||
|
||||
# line anchored regexes
|
||||
glt clone u4 file:///foo/u4/a1234
|
||||
/R any foo/u4/a1234 u4 DENIED by fallthru/
|
||||
glt clone u4 file:///foo/u4/a1234; !ok; /R any foo/u4/a1234 u4 DENIED by fallthru/
|
||||
|
||||
# u4 tries to create his own repo
|
||||
glt clone u4 file:///foo/u4/a12
|
||||
/Initialized empty Git repository in .*/foo/u4/a12.git//
|
||||
/warning: You appear to have cloned an empty repository./
|
||||
glt clone u4 file:///foo/u4/a12; ok; /Initialized empty Git repository in .*/foo/u4/a12.git//
|
||||
/warning: You appear to have cloned an empty repository./
|
||||
|
||||
# u4 push success
|
||||
cd a12
|
||||
tc p-728 p-729 p-730 p-731
|
||||
glt push u4 origin master
|
||||
/To file:///foo/u4/a12/
|
||||
/\\* \\[new branch\\] master -> master/
|
||||
tc p-728 p-729 p-730 p-731; ok
|
||||
glt push u4 origin master; ok; /To file:///foo/u4/a12/
|
||||
/\\* \\[new branch\\] master -> master/
|
||||
|
||||
# u1 clone success
|
||||
cd ..
|
||||
glt clone u1 file:///foo/u4/a12 u1a12
|
||||
/Cloning into 'u1a12'.../
|
||||
glt clone u1 file:///foo/u4/a12 u1a12; ok; /Cloning into 'u1a12'.../
|
||||
|
||||
# u1 push fail
|
||||
cd u1a12
|
||||
tc m-778 m-779
|
||||
glt push u1 origin
|
||||
/W any foo/u4/a12 u1 DENIED by fallthru/
|
||||
tc m-778 m-779; ok;
|
||||
glt push u1 origin; !ok; /W any foo/u4/a12 u1 DENIED by fallthru/
|
||||
|
||||
# u2 clone success
|
||||
cd ..
|
||||
glt clone u2 file:///foo/u4/a12 u2a12
|
||||
/Cloning into 'u2a12'.../
|
||||
glt clone u2 file:///foo/u4/a12 u2a12; ok; /Cloning into 'u2a12'.../
|
||||
|
||||
# u2 push success
|
||||
cd u2a12
|
||||
tc s-708 s-709
|
||||
glt push u2 origin
|
||||
/To file:///foo/u4/a12/
|
||||
/master -> master/
|
||||
tc s-708 s-709; ok;
|
||||
glt push u2 origin; ok; /To file:///foo/u4/a12/
|
||||
/master -> master/
|
||||
|
||||
# u2 rewind fail
|
||||
glt push u2 -f origin master^:master
|
||||
/\\+ refs/heads/master foo/u4/a12 u2 DENIED by fallthru/
|
||||
/error: hook declined to update refs/heads/master/
|
||||
/To file:///foo/u4/a12/
|
||||
/\\[remote rejected\\] master\\^ -> master \\(hook declined\\)/
|
||||
/error: failed to push some refs to 'file:///foo/u4/a12'/
|
||||
glt push u2 -f origin master^:master; !ok; /\\+ refs/heads/master foo/u4/a12 u2 DENIED by fallthru/
|
||||
reject
|
||||
|
||||
# u4 pull to sync up
|
||||
cd ../a12
|
||||
glt pull u4
|
||||
/Fast-forward/
|
||||
/From file:///foo/u4/a12/
|
||||
/master -> origin/master/
|
||||
glt pull u4; ok; /Fast-forward/
|
||||
/From file:///foo/u4/a12/
|
||||
/master -> origin/master/
|
||||
|
||||
# u4 rewind success
|
||||
git reset --hard HEAD^
|
||||
glt push u4 -f
|
||||
/To file:///foo/u4/a12/
|
||||
/\\+ .* master -> master \\(forced update\\)/
|
||||
git reset --hard HEAD^; ok
|
||||
glt push u4 -f; ok; /To file:///foo/u4/a12/
|
||||
/\\+ .* master -> master \\(forced update\\)/
|
||||
|
||||
# u5 clone fail
|
||||
cd ..
|
||||
glt clone u5 file:///foo/u4/a12 u5a12
|
||||
/R any foo/u4/a12 u5 DENIED by fallthru/
|
||||
glt clone u5 file:///foo/u4/a12 u5a12; !ok; /R any foo/u4/a12 u5 DENIED by fallthru/
|
||||
|
||||
glt perms u4 foo/u4/a12 + READERS u5
|
||||
glt perms u4 foo/u4/a12 + WRITERS u6
|
||||
|
@ -119,33 +102,25 @@ WRITERS u6
|
|||
|
||||
try "
|
||||
# u5 clone success
|
||||
glt clone u5 file:///foo/u4/a12 u5a12
|
||||
/Cloning into 'u5a12'.../
|
||||
glt clone u5 file:///foo/u4/a12 u5a12; ok; /Cloning into 'u5a12'.../
|
||||
|
||||
# u5 push fail
|
||||
cd u5a12
|
||||
tc y-743 y-744
|
||||
glt push u5
|
||||
/W any foo/u4/a12 u5 DENIED by fallthru/
|
||||
|
||||
tc y-743 y-744; ok
|
||||
glt push u5; !ok; /W any foo/u4/a12 u5 DENIED by fallthru/
|
||||
|
||||
# u6 clone success
|
||||
cd ..
|
||||
glt clone u6 file:///foo/u4/a12 u6a12
|
||||
/Cloning into 'u6a12'.../
|
||||
glt clone u6 file:///foo/u4/a12 u6a12; ok; /Cloning into 'u6a12'.../
|
||||
|
||||
# u6 push success
|
||||
cd u6a12
|
||||
tc k-68 k-69
|
||||
glt push u6 file:///foo/u4/a12
|
||||
/To file:///foo/u4/a12/
|
||||
/master -> master/
|
||||
tc k-68 k-69; ok
|
||||
glt push u6 file:///foo/u4/a12; ok; /To file:///foo/u4/a12/
|
||||
/master -> master/
|
||||
|
||||
# u6 rewind fail
|
||||
glt push u6 -f file:///foo/u4/a12 master^:master
|
||||
/\\+ refs/heads/master foo/u4/a12 u6 DENIED by fallthru/
|
||||
/error: hook declined to update refs/heads/master/
|
||||
/To file:///foo/u4/a12/
|
||||
/\\[remote rejected\\] master\\^ -> master \\(hook declined\\)/
|
||||
/error: failed to push some refs to 'file:///foo/u4/a12'/
|
||||
!ok; /\\+ refs/heads/master foo/u4/a12 u6 DENIED by fallthru/
|
||||
reject
|
||||
";
|
||||
|
|
92
t/wild-2.t
92
t/wild-2.t
|
@ -9,7 +9,7 @@ use Gitolite::Test;
|
|||
# basic tests
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
try "plan 43";
|
||||
try "plan 65";
|
||||
|
||||
confreset;confadd '
|
||||
@prof = u1
|
||||
|
@ -30,81 +30,64 @@ try "
|
|||
cd ..
|
||||
|
||||
# u1 create fail
|
||||
glt clone u1 file:///foo/u1/a01
|
||||
/R any foo/u1/a01 u1 DENIED by fallthru/
|
||||
glt clone u1 file:///foo/u1/a01; !ok; /R any foo/u1/a01 u1 DENIED by fallthru/
|
||||
|
||||
# u2 create fail
|
||||
glt clone u2 file:///foo/u2/a02
|
||||
/R any foo/u2/a02 u2 DENIED by fallthru/
|
||||
glt clone u2 file:///foo/u2/a02; !ok; /R any foo/u2/a02 u2 DENIED by fallthru/
|
||||
|
||||
# u4 tries to create u2 repo
|
||||
glt clone u4 file:///foo/u2/a12
|
||||
/R any foo/u2/a12 u4 DENIED by fallthru/
|
||||
glt clone u4 file:///foo/u2/a12; !ok; /R any foo/u2/a12 u4 DENIED by fallthru/
|
||||
|
||||
# line anchored regexes
|
||||
glt clone u4 file:///foo/u4/a1234
|
||||
/R any foo/u4/a1234 u4 DENIED by fallthru/
|
||||
glt clone u4 file:///foo/u4/a1234; !ok; /R any foo/u4/a1234 u4 DENIED by fallthru/
|
||||
|
||||
# u4 tries to create his own repo
|
||||
glt clone u4 file:///foo/u4/a12
|
||||
/Initialized empty Git repository in .*/foo/u4/a12.git//
|
||||
/warning: You appear to have cloned an empty repository./
|
||||
glt clone u4 file:///foo/u4/a12; ok; /Initialized empty Git repository in .*/foo/u4/a12.git//
|
||||
/warning: You appear to have cloned an empty repository./
|
||||
|
||||
# u4 push success
|
||||
cd a12
|
||||
tc n-770 n-771 n-772 n-773
|
||||
glt push u4 origin master
|
||||
/To file:///foo/u4/a12/
|
||||
/\\* \\[new branch\\] master -> master/
|
||||
tc n-770 n-771 n-772 n-773; ok
|
||||
glt push u4 origin master; ok; /To file:///foo/u4/a12/
|
||||
/\\* \\[new branch\\] master -> master/
|
||||
|
||||
# u1 clone success
|
||||
cd ..
|
||||
glt clone u1 file:///foo/u4/a12 u1a12
|
||||
/Cloning into 'u1a12'.../
|
||||
glt clone u1 file:///foo/u4/a12 u1a12; ok; /Cloning into 'u1a12'.../
|
||||
|
||||
# u1 push fail
|
||||
cd u1a12
|
||||
tc c-442 c-443
|
||||
glt push u1
|
||||
/W any foo/u4/a12 u1 DENIED by fallthru/
|
||||
tc c-442 c-443; ok
|
||||
glt push u1; !ok; /W any foo/u4/a12 u1 DENIED by fallthru/
|
||||
|
||||
# u2 clone success
|
||||
cd ..
|
||||
glt clone u2 file:///foo/u4/a12 u2a12
|
||||
/Cloning into 'u2a12'.../
|
||||
glt clone u2 file:///foo/u4/a12 u2a12; ok; /Cloning into 'u2a12'.../
|
||||
|
||||
# u2 push success
|
||||
cd u2a12
|
||||
tc e-393 e-394
|
||||
glt push u2
|
||||
/To file:///foo/u4/a12/
|
||||
/master -> master/
|
||||
tc e-393 e-394; ok;
|
||||
glt push u2; ok; /To file:///foo/u4/a12/
|
||||
/master -> master/
|
||||
|
||||
# u2 rewind fail
|
||||
glt push u2 -f origin master^:master
|
||||
/\\+ refs/heads/master foo/u4/a12 u2 DENIED by fallthru/
|
||||
/error: hook declined to update refs/heads/master/
|
||||
/To file:///foo/u4/a12/
|
||||
/\\[remote rejected\\] master\\^ -> master \\(hook declined\\)/
|
||||
/error: failed to push some refs to 'file:///foo/u4/a12'/
|
||||
glt push u2 -f origin master^:master; !ok; /\\+ refs/heads/master foo/u4/a12 u2 DENIED by fallthru/
|
||||
reject
|
||||
|
||||
# u4 pull to sync up
|
||||
cd ../a12
|
||||
glt pull u4
|
||||
/Fast-forward/
|
||||
/From file:///foo/u4/a12/
|
||||
/master -> origin/master/
|
||||
glt pull u4; ok; /Fast-forward/
|
||||
/From file:///foo/u4/a12/
|
||||
/master -> origin/master/
|
||||
|
||||
# u4 rewind success
|
||||
git reset --hard HEAD^
|
||||
glt push u4 -f
|
||||
/To file:///foo/u4/a12/
|
||||
/\\+ .* master -> master \\(forced update\\)/
|
||||
git reset --hard HEAD^; ok
|
||||
glt push u4 -f; ok; /To file:///foo/u4/a12/
|
||||
/\\+ .* master -> master \\(forced update\\)/
|
||||
|
||||
# u5 clone fail
|
||||
cd ..
|
||||
glt clone u5 file:///foo/u4/a12 u5a12
|
||||
/R any foo/u4/a12 u5 DENIED by fallthru/
|
||||
glt clone u5 file:///foo/u4/a12 u5a12; !ok; /R any foo/u4/a12 u5 DENIED by fallthru/
|
||||
|
||||
# setperm
|
||||
glt perms u4 foo/u4/a12 + READERS u5
|
||||
|
@ -120,33 +103,26 @@ WRITERS u6
|
|||
|
||||
try "
|
||||
# u5 clone success
|
||||
glt clone u5 file:///foo/u4/a12 u5a12
|
||||
/Cloning into 'u5a12'.../
|
||||
glt clone u5 file:///foo/u4/a12 u5a12; ok; /Cloning into 'u5a12'.../
|
||||
|
||||
# u5 push fail
|
||||
cd u5a12
|
||||
tc g-809 g-810
|
||||
glt push u5
|
||||
/W any foo/u4/a12 u5 DENIED by fallthru/
|
||||
tc g-809 g-810; ok
|
||||
glt push u5; !ok; /W any foo/u4/a12 u5 DENIED by fallthru/
|
||||
|
||||
# u6 clone success
|
||||
cd ..
|
||||
glt clone u6 file:///foo/u4/a12 u6a12
|
||||
/Cloning into 'u6a12'.../
|
||||
glt clone u6 file:///foo/u4/a12 u6a12; ok; /Cloning into 'u6a12'.../
|
||||
|
||||
# u6 push success
|
||||
cd u6a12
|
||||
tc f-912 f-913
|
||||
glt push u6 file:///foo/u4/a12
|
||||
/To file:///foo/u4/a12/
|
||||
/master -> master/
|
||||
glt push u6 file:///foo/u4/a12; ok; /To file:///foo/u4/a12/
|
||||
/master -> master/
|
||||
|
||||
# u6 rewind fail
|
||||
glt push u6 -f file:///foo/u4/a12 master^:master
|
||||
/\\+ refs/heads/master foo/u4/a12 u6 DENIED by fallthru/
|
||||
/error: hook declined to update refs/heads/master/
|
||||
/To file:///foo/u4/a12/
|
||||
/\\[remote rejected\\] master\\^ -> master \\(hook declined\\)/
|
||||
/error: failed to push some refs to 'file:///foo/u4/a12'/
|
||||
!ok; /\\+ refs/heads/master foo/u4/a12 u6 DENIED by fallthru/
|
||||
reject
|
||||
|
||||
";
|
||||
|
|
Loading…
Reference in a new issue