minor backward compat breakage in specifying owner/desc,
[gitolite.git] / t / deleg-1.t
blob89da137b6693f3cafa87a902b78ea72e11c5fae7
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 # delegation tests -- part 1
10 # ----------------------------------------------------------------------
12 try "plan 54";
14 try "
15 DEF SP_1 = git add conf ; ok; git commit -m %1; ok; /master.* %1/
16 DEF SUBCONF_PUSH = SP_1 %2; glt push %1 origin; gsh; /master -> master/
19 confreset;confadd '
20 @u1r = r1a r1b
21 @u2r = r2a r2b
22 @u3r = r3a r3b
24 # the admin repo access was probably like this to start with:
25 repo gitolite-admin
26 RW = u1 u2 u3
27 RW+ NAME/ = admin
28 RW NAME/conf/fragments/u1r = u1
29 RW NAME/conf/fragments/u2r = u2
30 RW NAME/conf/fragments/u3r = u3
31 - NAME/ = @all
33 subconf "fragments/*.conf"
35 try "ADMIN_PUSH set1; !/FATAL/" or die text();
37 mkdir "conf/fragments";
38 put "conf/fragments/u1r.conf", '
39 repo @u1r
40 RW+ = tester
43 try "ADMIN_PUSH set1; !/FATAL/" or die text();
44 try "
45 /Initialized empty Git repository in .*/r1a.git//
46 /Initialized empty Git repository in .*/r1b.git//
49 # u1 push u1r pass
50 put "conf/fragments/u1r.conf", '
51 repo @u1r
52 RW+ = u5
54 try "SUBCONF_PUSH u1 u1; !/FATAL/" or die text();
56 # u2 main push fail
57 confadd '
58 repo @u1r
59 RW+ = u6
61 try "SUBCONF_PUSH u2 u2; /FATAL/;
62 /W VREF/NAME/conf/gitolite.conf gitolite-admin u2 DENIED by VREF/NAME//
65 try "git reset --hard origin/master; ok";
67 # u2 push u1r fail
68 put "conf/fragments/u1r.conf", '
69 repo @u1r
70 RW+ = u6
72 try "SUBCONF_PUSH u2 u2; /FATAL/
73 /W VREF/NAME/conf/fragments/u1r.conf gitolite-admin u2 DENIED by VREF/NAME//
76 try "git reset --hard origin/master; ok";
78 # u3 set perms for r2a fail
79 put "conf/fragments/u3r.conf", '
80 repo r2a
81 RW+ = u6
83 try "SUBCONF_PUSH u3 u3;
84 /WARNING: subconf 'u3r' attempting to set access for r2a/
87 try "git reset --hard origin/master; ok";
89 # u3 add r2b to u3r fail
91 put "conf/fragments/u3r.conf", '
92 @u3r = r2b
93 repo @u3r
94 RW+ = u6
97 try "SUBCONF_PUSH u3 u3
98 /WARNING: expanding '\@u3r'/
99 /WARNING: subconf 'u3r' attempting to set access for r2b/