(minor) test reformatting

This commit is contained in:
Sitaram Chamarty 2012-03-18 18:05:27 +05:30
parent 2069156c6b
commit 20fd0d0c19
3 changed files with 94 additions and 157 deletions

View file

@ -9,7 +9,7 @@ use Gitolite::Test;
# branch permissions test # branch permissions test
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
try "plan 58"; try "plan 82";
confreset;confadd ' confreset;confadd '
@g1 = u1 @g1 = u1
@ -53,63 +53,52 @@ try "
/\\+ refs/heads/master aa u2 DENIED by fallthru/ /\\+ refs/heads/master aa u2 DENIED by fallthru/
# u3 rewind master succeed # u3 rewind master succeed
git reset --hard HEAD^ git reset --hard HEAD^; ok
tc m-508 tc m-508; ok
glt push u3 file://aa +master glt push u3 file://aa +master; ok; /\\+ .* master -> master \\(forced update\\)/
/\\+ .* master -> master \\(forced update\\)/
# u4 push master succeed # u4 push master succeed
tc f-526 tc f-526; ok;
glt push u4 file://aa master glt push u4 file://aa master; ok; /master -> master/
/master -> master/
# u4 rewind master fail # u4 rewind master fail
git reset --hard HEAD^ git reset --hard HEAD^; ok;
glt push u4 file://aa +master glt push u4 file://aa +master; !ok; /\\+ refs/heads/master aa u4 DENIED by fallthru/
/\\+ refs/heads/master aa u4 DENIED by fallthru/
# u3 and u4 / dev foo -- all 4 fail # u3 and u4 / dev foo -- all 4 fail
glt push u3 file://aa dev glt push u3 file://aa dev; !ok; /W refs/heads/dev aa u3 DENIED by fallthru/
/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 u4 file://aa dev glt push u3 file://aa foo; !ok; /W refs/heads/foo aa u3 DENIED by fallthru/
/W refs/heads/dev aa u4 DENIED by fallthru/ glt push u4 file://aa foo; !ok; /W refs/heads/foo 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/
# clean up for next set # clean up for next set
glt push u1 -f origin master dev foo glt push u1 -f origin master dev foo
ok
# u5 push master fail # u5 push master fail
tc l-417 tc l-417; ok
glt push u5 file://aa master glt push u5 file://aa master; !ok; /W refs/heads/master aa u5 DENIED by refs/heads/master/
/W refs/heads/master aa u5 DENIED by refs/heads/master/
# u5 rewind dev succeed # u5 rewind dev succeed
glt push u5 file://aa +dev^:dev glt push u5 file://aa +dev^:dev
/\\+ .* dev\\^ -> dev \\(forced update\\)/ ok; /\\+ .* dev\\^ -> dev \\(forced update\\)/
# u5 rewind foo fail # u5 rewind foo fail
glt push u5 file://aa +foo^:foo 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 # u5 tries to push foo; succeeds
git checkout foo git checkout foo; ok; /Switched to branch 'foo'/
/Switched to branch 'foo'/
# u5 push foo succeed # u5 push foo succeed
tc e-530 tc e-530; ok;
glt push u5 file://aa foo glt push u5 file://aa foo; ok; /foo -> foo/
/foo -> foo/
# u1 delete branch dev succeed # u1 delete branch dev succeed
glt push u1 origin :dev glt push u1 origin :dev; ok; / - \\[deleted\\] *dev/
/ - \\[deleted\\] *dev/
# quietly push it back again # quietly push it back again
glt push u1 origin dev glt push u1 origin dev; ok; / * \\[new branch\\] dev -> dev/
/ * \\[new branch\\] dev -> dev/
"; ";
@ -121,16 +110,13 @@ try "
try "ADMIN_PUSH set2; !/FATAL/" or die text(); try "ADMIN_PUSH set2; !/FATAL/" or die text();
try " try "
cd ../aa
# u1 tries to delete dev on a new setup # u1 tries to delete dev on a new setup
/master -> master/ cd ../aa; ok; /master -> master/
# u1 delete branch dev fail # u1 delete branch dev fail
glt push u1 origin :dev glt push u1 origin :dev; !ok; /D refs/heads/dev aa u1 DENIED by fallthru/
/D refs/heads/dev aa u1 DENIED by fallthru/
# u4 delete branch dev succeed # u4 delete branch dev succeed
glt push u4 file://aa :dev glt push u4 file://aa :dev; ok; / - \\[deleted\\] *dev/
/ - \\[deleted\\] *dev/
"; ";

View file

@ -9,7 +9,7 @@ use Gitolite::Test;
# basic tests # basic tests
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
try "plan 43"; try "plan 66";
confreset;confadd ' confreset;confadd '
@prof = u1 @prof = u1
@ -31,81 +31,64 @@ try "
cd .. cd ..
# u1 create success # u1 create success
glt clone u1 file:///foo/u1/a01 glt clone u1 file:///foo/u1/a01; ok; /Initialized empty Git repository in .*/foo/u1/a01.git//
/Initialized empty Git repository in .*/foo/u1/a01.git//
# u2 create success # u2 create success
glt clone u2 file:///foo/u2/a02 glt clone u2 file:///foo/u2/a02; ok; /Initialized empty Git repository in .*/foo/u2/a02.git//
/Initialized empty Git repository in .*/foo/u2/a02.git//
# u4 tries to create u2 repo # u4 tries to create u2 repo
glt clone u4 file:///foo/u2/a12 glt clone u4 file:///foo/u2/a12; !ok; /R any foo/u2/a12 u4 DENIED by fallthru/
/R any foo/u2/a12 u4 DENIED by fallthru/
# line anchored regexes # line anchored regexes
glt clone u4 file:///foo/u4/a1234 glt clone u4 file:///foo/u4/a1234; !ok; /R any foo/u4/a1234 u4 DENIED by fallthru/
/R any foo/u4/a1234 u4 DENIED by fallthru/
# u4 tries to create his own repo # u4 tries to create his own repo
glt clone u4 file:///foo/u4/a12 glt clone u4 file:///foo/u4/a12; ok; /Initialized empty Git repository in .*/foo/u4/a12.git//
/Initialized empty Git repository in .*/foo/u4/a12.git// /warning: You appear to have cloned an empty repository./
/warning: You appear to have cloned an empty repository./
# u4 push success # u4 push success
cd a12 cd a12
tc p-728 p-729 p-730 p-731 tc p-728 p-729 p-730 p-731; ok
glt push u4 origin master glt push u4 origin master; ok; /To file:///foo/u4/a12/
/To file:///foo/u4/a12/ /\\* \\[new branch\\] master -> master/
/\\* \\[new branch\\] master -> master/
# u1 clone success # u1 clone success
cd .. cd ..
glt clone u1 file:///foo/u4/a12 u1a12 glt clone u1 file:///foo/u4/a12 u1a12; ok; /Cloning into 'u1a12'.../
/Cloning into 'u1a12'.../
# u1 push fail # u1 push fail
cd u1a12 cd u1a12
tc m-778 m-779 tc m-778 m-779; ok;
glt push u1 origin glt push u1 origin; !ok; /W any foo/u4/a12 u1 DENIED by fallthru/
/W any foo/u4/a12 u1 DENIED by fallthru/
# u2 clone success # u2 clone success
cd .. cd ..
glt clone u2 file:///foo/u4/a12 u2a12 glt clone u2 file:///foo/u4/a12 u2a12; ok; /Cloning into 'u2a12'.../
/Cloning into 'u2a12'.../
# u2 push success # u2 push success
cd u2a12 cd u2a12
tc s-708 s-709 tc s-708 s-709; ok;
glt push u2 origin glt push u2 origin; ok; /To file:///foo/u4/a12/
/To file:///foo/u4/a12/ /master -> master/
/master -> master/
# u2 rewind fail # u2 rewind fail
glt push u2 -f origin master^:master glt push u2 -f origin master^:master; !ok; /\\+ refs/heads/master foo/u4/a12 u2 DENIED by fallthru/
/\\+ refs/heads/master foo/u4/a12 u2 DENIED by fallthru/ reject
/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'/
# u4 pull to sync up # u4 pull to sync up
cd ../a12 cd ../a12
glt pull u4 glt pull u4; ok; /Fast-forward/
/Fast-forward/ /From file:///foo/u4/a12/
/From file:///foo/u4/a12/ /master -> origin/master/
/master -> origin/master/
# u4 rewind success # u4 rewind success
git reset --hard HEAD^ git reset --hard HEAD^; ok
glt push u4 -f glt push u4 -f; ok; /To file:///foo/u4/a12/
/To file:///foo/u4/a12/ /\\+ .* master -> master \\(forced update\\)/
/\\+ .* master -> master \\(forced update\\)/
# u5 clone fail # u5 clone fail
cd .. cd ..
glt clone u5 file:///foo/u4/a12 u5a12 glt clone u5 file:///foo/u4/a12 u5a12; !ok; /R any foo/u4/a12 u5 DENIED by fallthru/
/R any foo/u4/a12 u5 DENIED by fallthru/
glt perms u4 foo/u4/a12 + READERS u5 glt perms u4 foo/u4/a12 + READERS u5
glt perms u4 foo/u4/a12 + WRITERS u6 glt perms u4 foo/u4/a12 + WRITERS u6
@ -119,33 +102,25 @@ WRITERS u6
try " try "
# u5 clone success # u5 clone success
glt clone u5 file:///foo/u4/a12 u5a12 glt clone u5 file:///foo/u4/a12 u5a12; ok; /Cloning into 'u5a12'.../
/Cloning into 'u5a12'.../
# u5 push fail # u5 push fail
cd u5a12 cd u5a12
tc y-743 y-744 tc y-743 y-744; ok
glt push u5 glt push u5; !ok; /W any foo/u4/a12 u5 DENIED by fallthru/
/W any foo/u4/a12 u5 DENIED by fallthru/
# u6 clone success # u6 clone success
cd .. cd ..
glt clone u6 file:///foo/u4/a12 u6a12 glt clone u6 file:///foo/u4/a12 u6a12; ok; /Cloning into 'u6a12'.../
/Cloning into 'u6a12'.../
# u6 push success # u6 push success
cd u6a12 cd u6a12
tc k-68 k-69 tc k-68 k-69; ok
glt push u6 file:///foo/u4/a12 glt push u6 file:///foo/u4/a12; ok; /To file:///foo/u4/a12/
/To file:///foo/u4/a12/ /master -> master/
/master -> master/
# u6 rewind fail # u6 rewind fail
glt push u6 -f file:///foo/u4/a12 master^:master glt push u6 -f file:///foo/u4/a12 master^:master
/\\+ refs/heads/master foo/u4/a12 u6 DENIED by fallthru/ !ok; /\\+ refs/heads/master foo/u4/a12 u6 DENIED by fallthru/
/error: hook declined to update refs/heads/master/ reject
/To file:///foo/u4/a12/
/\\[remote rejected\\] master\\^ -> master \\(hook declined\\)/
/error: failed to push some refs to 'file:///foo/u4/a12'/
"; ";

View file

@ -9,7 +9,7 @@ use Gitolite::Test;
# basic tests # basic tests
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
try "plan 43"; try "plan 65";
confreset;confadd ' confreset;confadd '
@prof = u1 @prof = u1
@ -30,81 +30,64 @@ try "
cd .. cd ..
# u1 create fail # u1 create fail
glt clone u1 file:///foo/u1/a01 glt clone u1 file:///foo/u1/a01; !ok; /R any foo/u1/a01 u1 DENIED by fallthru/
/R any foo/u1/a01 u1 DENIED by fallthru/
# u2 create fail # u2 create fail
glt clone u2 file:///foo/u2/a02 glt clone u2 file:///foo/u2/a02; !ok; /R any foo/u2/a02 u2 DENIED by fallthru/
/R any foo/u2/a02 u2 DENIED by fallthru/
# u4 tries to create u2 repo # u4 tries to create u2 repo
glt clone u4 file:///foo/u2/a12 glt clone u4 file:///foo/u2/a12; !ok; /R any foo/u2/a12 u4 DENIED by fallthru/
/R any foo/u2/a12 u4 DENIED by fallthru/
# line anchored regexes # line anchored regexes
glt clone u4 file:///foo/u4/a1234 glt clone u4 file:///foo/u4/a1234; !ok; /R any foo/u4/a1234 u4 DENIED by fallthru/
/R any foo/u4/a1234 u4 DENIED by fallthru/
# u4 tries to create his own repo # u4 tries to create his own repo
glt clone u4 file:///foo/u4/a12 glt clone u4 file:///foo/u4/a12; ok; /Initialized empty Git repository in .*/foo/u4/a12.git//
/Initialized empty Git repository in .*/foo/u4/a12.git// /warning: You appear to have cloned an empty repository./
/warning: You appear to have cloned an empty repository./
# u4 push success # u4 push success
cd a12 cd a12
tc n-770 n-771 n-772 n-773 tc n-770 n-771 n-772 n-773; ok
glt push u4 origin master glt push u4 origin master; ok; /To file:///foo/u4/a12/
/To file:///foo/u4/a12/ /\\* \\[new branch\\] master -> master/
/\\* \\[new branch\\] master -> master/
# u1 clone success # u1 clone success
cd .. cd ..
glt clone u1 file:///foo/u4/a12 u1a12 glt clone u1 file:///foo/u4/a12 u1a12; ok; /Cloning into 'u1a12'.../
/Cloning into 'u1a12'.../
# u1 push fail # u1 push fail
cd u1a12 cd u1a12
tc c-442 c-443 tc c-442 c-443; ok
glt push u1 glt push u1; !ok; /W any foo/u4/a12 u1 DENIED by fallthru/
/W any foo/u4/a12 u1 DENIED by fallthru/
# u2 clone success # u2 clone success
cd .. cd ..
glt clone u2 file:///foo/u4/a12 u2a12 glt clone u2 file:///foo/u4/a12 u2a12; ok; /Cloning into 'u2a12'.../
/Cloning into 'u2a12'.../
# u2 push success # u2 push success
cd u2a12 cd u2a12
tc e-393 e-394 tc e-393 e-394; ok;
glt push u2 glt push u2; ok; /To file:///foo/u4/a12/
/To file:///foo/u4/a12/ /master -> master/
/master -> master/
# u2 rewind fail # u2 rewind fail
glt push u2 -f origin master^:master glt push u2 -f origin master^:master; !ok; /\\+ refs/heads/master foo/u4/a12 u2 DENIED by fallthru/
/\\+ refs/heads/master foo/u4/a12 u2 DENIED by fallthru/ reject
/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'/
# u4 pull to sync up # u4 pull to sync up
cd ../a12 cd ../a12
glt pull u4 glt pull u4; ok; /Fast-forward/
/Fast-forward/ /From file:///foo/u4/a12/
/From file:///foo/u4/a12/ /master -> origin/master/
/master -> origin/master/
# u4 rewind success # u4 rewind success
git reset --hard HEAD^ git reset --hard HEAD^; ok
glt push u4 -f glt push u4 -f; ok; /To file:///foo/u4/a12/
/To file:///foo/u4/a12/ /\\+ .* master -> master \\(forced update\\)/
/\\+ .* master -> master \\(forced update\\)/
# u5 clone fail # u5 clone fail
cd .. cd ..
glt clone u5 file:///foo/u4/a12 u5a12 glt clone u5 file:///foo/u4/a12 u5a12; !ok; /R any foo/u4/a12 u5 DENIED by fallthru/
/R any foo/u4/a12 u5 DENIED by fallthru/
# setperm # setperm
glt perms u4 foo/u4/a12 + READERS u5 glt perms u4 foo/u4/a12 + READERS u5
@ -120,33 +103,26 @@ WRITERS u6
try " try "
# u5 clone success # u5 clone success
glt clone u5 file:///foo/u4/a12 u5a12 glt clone u5 file:///foo/u4/a12 u5a12; ok; /Cloning into 'u5a12'.../
/Cloning into 'u5a12'.../
# u5 push fail # u5 push fail
cd u5a12 cd u5a12
tc g-809 g-810 tc g-809 g-810; ok
glt push u5 glt push u5; !ok; /W any foo/u4/a12 u5 DENIED by fallthru/
/W any foo/u4/a12 u5 DENIED by fallthru/
# u6 clone success # u6 clone success
cd .. cd ..
glt clone u6 file:///foo/u4/a12 u6a12 glt clone u6 file:///foo/u4/a12 u6a12; ok; /Cloning into 'u6a12'.../
/Cloning into 'u6a12'.../
# u6 push success # u6 push success
cd u6a12 cd u6a12
tc f-912 f-913 tc f-912 f-913
glt push u6 file:///foo/u4/a12 glt push u6 file:///foo/u4/a12; ok; /To file:///foo/u4/a12/
/To file:///foo/u4/a12/ /master -> master/
/master -> master/
# u6 rewind fail # u6 rewind fail
glt push u6 -f file:///foo/u4/a12 master^:master glt push u6 -f file:///foo/u4/a12 master^:master
/\\+ refs/heads/master foo/u4/a12 u6 DENIED by fallthru/ !ok; /\\+ refs/heads/master foo/u4/a12 u6 DENIED by fallthru/
/error: hook declined to update refs/heads/master/ reject
/To file:///foo/u4/a12/
/\\[remote rejected\\] master\\^ -> master \\(hook declined\\)/
/error: failed to push some refs to 'file:///foo/u4/a12'/
"; ";