summaryrefslogtreecommitdiffstats
path: root/t/deny-rules.t
blob: c0e7cbbe0213c072ce7f5001e394e6235220cfaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/perl
use strict;
use warnings;

# this is hardcoded; change it if needed
use lib "src/lib";
use Gitolite::Test;

# deny rules
# ----------------------------------------------------------------------

try "plan 11";

confreset;confadd '
    # start with...

    repo gitolite-admin
        -   =   gitweb daemon
    option deny-rules = 1

    # main ruleset goes here

    @ga = a
    @gb = b
    @gc = c

    # and end with

    repo @ga
        RW  =   u1
        -   =   @all
    option deny-rules = 1

    repo @gb
        RW  =   u2
        -   =   daemon
    option deny-rules = 1

    repo @gc
        RW  =   u3

    repo @all
        R   =   @all

';

try "ADMIN_PUSH set1; !/FATAL/" or die text();

my $rb = `gitolite query-rc -n GL_REPO_BASE`;
try "
    cat $ENV{HOME}/projects.list;                           ok
";
cmp 'b.git
c.git
testing.git
';

try "
    cd ..
    cd ..
    echo $rb
    find $rb -name git-daemon-export-ok | sort
    perl s,$rb/,,g
";
cmp 'c.git/git-daemon-export-ok
testing.git/git-daemon-export-ok
'