make single quotes around reponame optional...
[gitolite.git] / t / sequence.t
blob81fabfc32ff492e767ebbb12efad2ff47d209313
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
5 # this is hardcoded; change it if needed
6 use lib "src/lib";
7 use Gitolite::Test;
9 # uhh, seems to be another rule sequence test
10 # ----------------------------------------------------------------------
12 try "plan 48";
14 confreset;confadd '
15 @staff = u1 u2 u3
16 @gfoo = foo/CREATOR/..*
17 repo @gfoo
18 C = u1
19 RW+ = CREATOR
20 RW = WRITERS
21 - = @staff
24 try "ADMIN_PUSH set1; !/FATAL/" or die text();
26 try "
27 cd ..
28 glt clone u1 file:///foo/u1/bar; ok
29 /Initialized empty Git repository in .*/foo/u1/bar.git//
31 cd bar
32 tc p-906
33 glt push u1 origin master
34 /To file:///foo/u1/bar/
35 /\\[new branch\\] master -> master/
36 echo WRITERS u2 | glt perms u1 foo/u1/bar
37 glt perms u1 foo/u1/bar -l
38 /WRITERS u2/
39 # expand
40 glt info u2
41 /R W *\tfoo/u1/bar/
42 /R W *\ttesting/
44 # push
45 cd ..
46 glt clone u2 file:///foo/u1/bar u2bar
47 /Cloning into 'u2bar'.../
48 cd u2bar
49 tc p-222
50 glt push u2
51 /master -> master/
52 !/DENIED/
53 !/failed to push/
56 confreset;confadd '
57 @staff = u1 u2 u3
58 @gfoo = foo/CREATOR/..*
59 repo @gfoo
60 C = u1
61 RW+ = CREATOR
62 - = @staff
63 RW = WRITERS
64 R = READERS
67 try "ADMIN_PUSH set1; !/FATAL/" or die text();
69 try "
70 cd ..
71 rm -rf bar u2bar
72 glt clone u1 file:///foo/u1/bar; ok
73 /Initialized empty Git repository in .*/foo/u1/bar.git//
75 cd bar
76 tc p-906
77 glt push u1 origin master
78 /To file:///foo/u1/bar/
79 /\\[new branch\\] master -> master/
80 echo WRITERS u2 | glt perms u1 foo/u1/bar
81 glt perms u1 foo/u1/bar -l
82 /WRITERS u2/
83 # expand
84 glt info u2
85 !/R W *\tfoo/u1/baz/
86 /R W *\tfoo/u1/bar/
87 /R W *\ttesting/
89 # push
90 cd ..
91 glt clone u2 file:///foo/u1/bar u2bar
92 /Cloning into 'u2bar'.../
93 cd u2bar
94 tc p-222
95 glt push u2
96 !ok
97 reject
98 /W refs/heads/master foo/u1/bar u2 DENIED by refs/\\.\\*/
100 # auto-create using perms fail
101 echo READERS u5 | glt perms u4 -c foo/u4/baz
102 !/Initialized empty Git repository in .*/foo/u4/baz.git/
103 /FATAL: repo does not exist, or you are not authorised/
105 # auto-create using perms
106 echo READERS u2 | glt perms u1 -c foo/u1/baz
107 /Initialized empty Git repository in .*/foo/u1/baz.git/
109 glt perms u1 foo/u1/baz -l
110 /READERS u2/
111 # expand
112 glt info u2
113 /R *\tfoo/u1/baz/
114 /R W *\tfoo/u1/bar/
115 /R W *\ttesting/