aboutsummaryrefslogtreecommitdiff
blob: 482803ad15743fe2192c9e69c71367bfd3548bfc (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
68
69
# vim: syn=sh:
for wr in 0 1
do
    for bc in 0 1
    do
        cd $TESTDIR
        $TESTDIR/rollback || die "rollback failed"
        editrc GL_WILDREPOS $wr
        editrc GL_BIG_CONFIG $bc

        # ----------

        name "INTERNAL"
        echo "
            @leads = u1 u2
            @devs = u1 u2 u3 u4
            @gfoo = foo/CREATOR/.+
            repo    @gfoo
                C               =   @leads
                RW+             =   CREATOR
        " | ugc

        cd ~/td

        name "u1 makes a wildrepo"
        runlocal git clone u1:foo/u1/bar
        [ "$wr" = "0" ] && expect "R access for foo/u1/bar DENIED to u1"
        [ "$wr" = "0" ] && expect "fatal: The remote end hung up unexpectedly"
        [ "$wr" = "1" ] && expect "Initialized empty Git repository in $TEST_BASE_FULL/foo/u1/bar.git/"

        name "u3 fails to make a wildrepo"
        runlocal git clone u3:foo/u3/baz
        expect "R access for foo/u3/baz DENIED to u3"
        expect "fatal: The remote end hung up unexpectedly"

        name "u1 info"
        runlocal ssh u1 info
        expect "hello u1, this is gitolite v"
        expect " @R_ @W_.testing"
        [ "$wr" = "1" ] && [ "$bc" = "0" ] && expect    " C  R   W .foo/u1/\\.\\+"
        [ "$wr" = "1" ] && [ "$bc" = "1" ] && notexpect " C  R   W .foo/u1/\\.\\+"
        [ "$wr" = "1" ] && [ "$bc" = "1" ] &&    expect " C        .@gfoo"

        name "u1 expand"
        runlocal ssh u1 expand
        [ "$wr" = "0" ] && expect "wildrepos disabled, sorry"
        [ "$wr" = "1" ] && expect "hello u1, this is gitolite v"
        [ "$wr" = "1" ] && expect " R   W .(u1).foo/u1/bar"
        [ "$wr" = "1" ] && expect "@R_ @W_..gitolite..testing"

        name "gitolite info u1"
        runlocal ssh gitolite info . u1
        expect "hello u1, this is gitolite v"
        expect " @R_ @W_.testing"
        [ "$wr" = "1" ] && [ "$bc" = "0" ] && expect    " C  R   W .foo/u1/\\.\\+"
        [ "$wr" = "1" ] && [ "$bc" = "1" ] && notexpect " C  R   W .foo/u1/\\.\\+"
        [ "$wr" = "1" ] && [ "$bc" = "1" ] &&    expect " C        .@gfoo"

        name "gitolite expand u1"
        runlocal ssh gitolite expand . u1
        [ "$wr" = "0" ] && expect "wildrepos disabled, sorry"
        # XXX TODO -- expand currently does not allow superuser to query for others
        # [ "$wr" = "1" ] && expect "hello u1, the gitolite version here is"
        # [ "$wr" = "1" ] && expect " R   W .(u1).foo/u1/bar"
        # [ "$wr" = "1" ] && expect "@R_ @W_..gitolite..testing"

        name INTERNAL
    done
done