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

« back to all changes in this revision

Viewing changes to t/vrefs-1.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
# VREFs - part 1
 
10
# ----------------------------------------------------------------------
 
11
 
 
12
try "plan 88";
 
13
 
 
14
put "conf/gitolite.conf", "
 
15
    repo gitolite-admin
 
16
        RW+     =   admin
 
17
 
 
18
    \@gfoo = foo
 
19
    \@lead = u1
 
20
    \@dev2 = u2
 
21
    \@dev4 = u4
 
22
    \@devs = \@dev2 \@dev4 u6
 
23
    repo  \@gfoo
 
24
          RW+                   =   \@lead \@devs
 
25
          # intentional mis-spelling
 
26
          -     VREF/MISCOUNT/2    =   \@dev2
 
27
          -     VREF/MISCOUNT/4    =   \@dev4
 
28
          -     VREF/MISCOUNT/3/NEWFILES   =   u6
 
29
          -     VREF/MISCOUNT/6            =   u6
 
30
";
 
31
 
 
32
try "
 
33
    ADMIN_PUSH vr1a
 
34
    cd ..
 
35
    [ -d foo ];                 !ok
 
36
    CLONE u1 foo;               ok;     /Cloning into/
 
37
                                        /You appear to have cloned an empty/
 
38
    cd foo;                     ok
 
39
    [ -d .git ];                ok
 
40
 
 
41
    # VREF not called for u1
 
42
    tc a1 a2 a3 a4 a5;          ok;     /aaf9e8e/
 
43
    PUSH u1 master;             ok;     /new branch.*master -. master/
 
44
                                        !/helper program missing/
 
45
                                        !/hook declined/
 
46
                                        !/remote rejected/
 
47
    # VREF is called for u2
 
48
    tc b1;                      ok;     /1f440d3/
 
49
    PUSH u2;                    !ok;    /helper program missing/
 
50
                                        /hook declined/
 
51
                                        /remote rejected/
 
52
";
 
53
 
 
54
put "../gitolite-admin/conf/gitolite.conf", "
 
55
    repo gitolite-admin
 
56
        RW+     =   admin
 
57
 
 
58
    \@gfoo = foo
 
59
    \@lead = u1
 
60
    \@dev2 = u2
 
61
    \@dev4 = u4
 
62
    \@devs = \@dev2 \@dev4 u6
 
63
    repo  \@gfoo
 
64
          RW+                   =   \@lead \@devs
 
65
          -     VREF/COUNT/2    =   \@dev2
 
66
          -     VREF/COUNT/4    =   \@dev4
 
67
          -     VREF/COUNT/3/NEWFILES   =   u6
 
68
          -     VREF/COUNT/6            =   u6
 
69
";
 
70
 
 
71
try "
 
72
    ADMIN_PUSH vr1b
 
73
    cd ../foo;                  ok
 
74
 
 
75
    # u2 1 file
 
76
    PUSH u2;                    ok;     /aaf9e8e..1f440d3.*master -. master/
 
77
 
 
78
    # u2 2 files
 
79
    tc b2 b3;                   ok;     /c3397f7/
 
80
    PUSH u2;                    ok;     /1f440d3..c3397f7.*master -. master/
 
81
 
 
82
    # u2 3 files
 
83
    tc c1 c2 c3;                ok;     /be242d7/
 
84
    PUSH u2;                    !ok;    /W VREF/COUNT/2 foo u2 DENIED by VREF/COUNT/2/
 
85
                                        /too many changed files in this push/
 
86
                                        /hook declined/
 
87
                                        /remote rejected/
 
88
 
 
89
    # u4 3 files
 
90
    PUSH u4;                    ok;     /c3397f7..be242d7.*master -. master/
 
91
 
 
92
    # u4 4 files
 
93
    tc d1 d2 d3 d4;             ok;     /88d80e2/
 
94
    PUSH u4;                    ok;     /be242d7..88d80e2.*master -. master/
 
95
 
 
96
    # u4 5 files
 
97
    tc d5 d6 d7 d8 d9;          ok;     /e9c60b0/
 
98
    PUSH u4;                    !ok;    /W VREF/COUNT/4 foo u4 DENIED by VREF/COUNT/4/
 
99
                                        /too many changed files in this push/
 
100
                                        /hook declined/
 
101
                                        /remote rejected/
 
102
 
 
103
    # u1 all files
 
104
    PUSH u1;                    ok;     /88d80e2..e9c60b0.*master -. master/
 
105
 
 
106
    # u6 6 old files
 
107
    test-tick
 
108
    tc d1 d2 d3 d4 d5 d6
 
109
                                ok;     /2773f0a/
 
110
    PUSH u6;                    ok;     /e9c60b0..2773f0a.*master -. master/
 
111
    tag six
 
112
 
 
113
    # u6 updates 7 old files
 
114
    test-tick; test-tick
 
115
    tc d1 d2 d3 d4 d5 d6 d7
 
116
                                ok;     /d3fb574/
 
117
    PUSH u6;                    !ok;    /W VREF/COUNT/6 foo u6 DENIED by VREF/COUNT/6/
 
118
                                        /too many changed files in this push/
 
119
                                        /hook declined/
 
120
                                        /remote rejected/
 
121
    reset-h six;                ok;     /HEAD is now at 2773f0a/
 
122
 
 
123
    # u6 4 new 2 old files
 
124
    test-tick; test-tick
 
125
    tc d1 d2 n1 n2 n3 n4
 
126
                                ok;     /9e90848/
 
127
    PUSH u6;                    !ok;    /W VREF/COUNT/3/NEWFILES foo u6 DENIED by VREF/COUNT/3/NEWFILES/
 
128
                                        /too many new files in this push/
 
129
                                        /hook declined/
 
130
                                        /remote rejected/
 
131
    reset-h six;                ok;     /HEAD is now at 2773f0a/
 
132
 
 
133
    # u6 3 new 3 old files
 
134
    test-tick; test-tick
 
135
    tc d1 d2 d3 n1 n2 n3
 
136
                                ok;     /e47ff5d/
 
137
    PUSH u6;                    ok;     /2773f0a..e47ff5d.*master -. master/
 
138
";