fix 'C' and 'M' tests in 'gitolite access'...
[gitolite.git] / t / include-subconf.t
blob48bdaeef93d44cf3e94e09ba9856da6b54eaa46f
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 # include and subconf
10 # ----------------------------------------------------------------------
12 try 'plan 58';
14 confreset; confadd '
15 include "i1.conf"
16 @i2 = b1
17 subconf "i2.conf"
18 include "i1.conf"
20 confadd 'i1.conf', '
21 @g1 = a1 a2
22 repo foo
23 RW = u1
25 include "j1.conf"
27 confadd 'i2.conf', '
28 @g2 = b1 b2
29 repo bar b1 b2 i1 i2 @i1 @i2 @g2
30 RW = u2
32 confadd 'j1.conf', '
33 @h2 = c1 c2
34 repo baz
35 RW = u3
38 try "ADMIN_PUSH set2; !/FATAL/" or die text();
40 try "
41 /i1.conf already included/
42 /subconf 'i2' attempting to set access for \@i1, b2, bar, i1/
43 /WARNING: expanding '\@g2'/
45 !/attempting to set access.*i2/
46 /Initialized.*empty.*baz.git/
47 /Initialized.*empty.*foo.git/
48 /Initialized.*empty.*b1.git/
49 /Initialized.*empty.*i2.git/
50 !/Initialized.*empty.*b2.git/
51 !/Initialized.*empty.*i1.git/
52 !/Initialized.*empty.*bar.git/
55 confreset;confadd '
56 @g2 = i1 i2 i3
57 subconf "g2.conf"
59 confadd 'g2.conf', '
60 @g2 = g2 h2 i2
61 repo @g2
62 RW = u1
65 try "ADMIN_PUSH set3; !/FATAL/" or die text();
66 try "
67 /WARNING: expanding '\@g2'/
68 /WARNING: subconf 'g2' attempting to set access for h2/
69 /Initialized.*empty.*g2.git/
70 /Initialized.*empty.*i2.git/
73 confreset;confadd '
74 @g2 = i1 i2 i3
75 subconf "g2.conf"
77 confadd 'g2.conf', '
78 subconf master
79 @g2 = g2 h2 i2
80 repo @g2
81 RW = u1
84 try "
85 ADMIN_PUSH set3; ok; /FATAL: subconf \\'g2\\' attempting to run 'subconf'/
88 # ----------------------------------------------------------------------
90 confreset; confadd '
91 include "i1.conf"
92 @i2 = b1
93 subconf i2 "eye2.conf"
95 confadd 'eye2.conf', '
96 repo @eye2
97 RW = u2
100 try "ADMIN_PUSH set2; !/FATAL/" or die text();
102 try "
103 /subconf 'i2' attempting to set access for \@eye2/
106 confreset; confadd '
107 include "i1.conf"
108 @i2 = b1
109 subconf i2 "eye2.conf"
111 confadd 'eye2.conf', '
112 repo @i2
113 RW = u2
116 try "ADMIN_PUSH set2; !/FATAL/" or die text();
118 try "
119 !/subconf 'i2' attempting to set access for \@eye2/