~ubuntu-branches/ubuntu/utopic/gitolite3/utopic-proposed

« back to all changes in this revision

Viewing changes to t/include-subconf.t

  • Committer: Package Import Robot
  • Author(s): David Bremner
  • Date: 2013-05-18 17:59:21 UTC
  • Revision ID: package-import@ubuntu.com-20130518175921-ac4xe6vd0jtxvjot
Tags: upstream-3.5.1+4
ImportĀ upstreamĀ versionĀ 3.5.1+4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
use strict;
 
3
use warnings;
 
4
 
 
5
# this is hardcoded; change it if needed
 
6
use lib "src/lib";
 
7
use Gitolite::Test;
 
8
 
 
9
# include and subconf
 
10
# ----------------------------------------------------------------------
 
11
 
 
12
try 'plan 55';
 
13
 
 
14
confreset; confadd '
 
15
    include "i1.conf"
 
16
    @i2 = b1
 
17
    subconf "i2.conf"
 
18
    include "i1.conf"
 
19
';
 
20
confadd 'i1.conf', '
 
21
    @g1 = a1 a2
 
22
    repo foo
 
23
        RW = u1
 
24
 
 
25
    include "j1.conf"
 
26
';
 
27
confadd 'i2.conf', '
 
28
    @g2 = b1 b2
 
29
    repo bar b1 b2 i1 i2 @i1 @i2 @g2
 
30
        RW = u2
 
31
';
 
32
confadd 'j1.conf', '
 
33
    @h2 = c1 c2
 
34
    repo baz
 
35
        RW = u3
 
36
';
 
37
 
 
38
try "ADMIN_PUSH set2; !/FATAL/" or die text();
 
39
 
 
40
try "
 
41
                                        /i1.conf already included/
 
42
                                        /subconf 'i2' attempting to set access for \@i1, b2, bar, i1, locally modified \@g2/
 
43
                                        !/attempting to set access.*i2/
 
44
                                        /Initialized.*empty.*baz.git/
 
45
                                        /Initialized.*empty.*foo.git/
 
46
                                        /Initialized.*empty.*b1.git/
 
47
                                        /Initialized.*empty.*i2.git/
 
48
                                        !/Initialized.*empty.*b2.git/
 
49
                                        !/Initialized.*empty.*i1.git/
 
50
                                        !/Initialized.*empty.*bar.git/
 
51
";
 
52
 
 
53
confreset;confadd '
 
54
    @g2 = i1 i2 i3
 
55
    subconf "g2.conf"
 
56
';
 
57
confadd 'g2.conf', '
 
58
    @g2 = g2 h2 i2
 
59
    repo @g2
 
60
        RW = u1
 
61
';
 
62
 
 
63
try "ADMIN_PUSH set3; !/FATAL/" or die text();
 
64
try "
 
65
                                        /subconf 'g2' attempting to set access for locally modified \@g2/
 
66
                                        !/Initialized.*empty/
 
67
";
 
68
 
 
69
confreset;confadd '
 
70
    @g2 = i1 i2 i3
 
71
    subconf "g2.conf"
 
72
';
 
73
confadd 'g2.conf', '
 
74
    subconf master
 
75
    @g2 = g2 h2 i2
 
76
    repo @g2
 
77
        RW = u1
 
78
';
 
79
 
 
80
try "
 
81
    ADMIN_PUSH set3;           ok;     /FATAL: subconf \\'g2\\' attempting to run 'subconf'/
 
82
";
 
83
 
 
84
# ----------------------------------------------------------------------
 
85
 
 
86
confreset; confadd '
 
87
    include "i1.conf"
 
88
    @i2 = b1
 
89
    subconf i2 "eye2.conf"
 
90
';
 
91
confadd 'eye2.conf', '
 
92
    repo @eye2
 
93
        RW = u2
 
94
';
 
95
 
 
96
try "ADMIN_PUSH set2; !/FATAL/" or die text();
 
97
 
 
98
try "
 
99
    /subconf 'i2' attempting to set access for \@eye2/
 
100
";
 
101
 
 
102
confreset; confadd '
 
103
    include "i1.conf"
 
104
    @i2 = b1
 
105
    subconf i2 "eye2.conf"
 
106
';
 
107
confadd 'eye2.conf', '
 
108
    repo @i2
 
109
        RW = u2
 
110
';
 
111
 
 
112
try "ADMIN_PUSH set2; !/FATAL/" or die text();
 
113
 
 
114
try "
 
115
    !/subconf 'i2' attempting to set access for \@eye2/
 
116
";