keeping the profs at Cambridge happy...
[gitolite.git] / t / personal-branches.t
blob8a081280bbc68865a3df90d5a1d6f53a18ea4a31
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 # personal branches
10 # ----------------------------------------------------------------------
12 try "plan 64";
14 confreset;confadd '
15 @admins = admin dev1
16 repo gitolite-admin
17 RW+ = admin
19 repo testing
20 RW+ = @all
22 @g1 = t1
23 repo @g1
24 R = u2
25 RW = u3
26 RW+ = u4
27 RW a/USER/ = @all
28 RW+ p/USER/ = u1 u6
31 try "ADMIN_PUSH set1; !/FATAL/" or die text();
33 try "
35 gitolite access t1 u1; ok; /refs/heads/p/u1//; !/DENIED/
36 gitolite access t1 u5; !ok; /\\+ any t1 u5 DENIED by fallthru/
37 gitolite access \@g1 u5 W; ok; /refs/heads/a/u5//; !/DENIED/
39 gitolite access t1 u1 W refs/heads/a/user1/foo; !ok; /W refs/heads/a/user1/foo t1 u1 DENIED by fallthru/
40 gitolite access \@g1 u1 + refs/heads/a/user1/foo; !ok; /\\+ refs/heads/a/user1/foo \@g1 u1 DENIED by fallthru/
41 gitolite access t1 u1 W refs/heads/p/user1/foo; !ok; /W refs/heads/p/user1/foo t1 u1 DENIED by fallthru/
42 gitolite access \@g1 u1 + refs/heads/p/user1/foo; !ok; /\\+ refs/heads/p/user1/foo \@g1 u1 DENIED by fallthru/
44 gitolite access \@g1 u1 W refs/heads/a/u1/foo; ok; /refs/heads/a/u1//; !/DENIED/
45 gitolite access t1 u1 + refs/heads/a/u1/foo; !ok; /\\+ refs/heads/a/u1/foo t1 u1 DENIED by fallthru/
46 gitolite access \@g1 u1 W refs/heads/p/u1/foo; ok; /refs/heads/p/u1//; !/DENIED/
47 gitolite access t1 u1 + refs/heads/p/u1/foo; ok; /refs/heads/p/u1//; !/DENIED/
49 gitolite access \@g1 u1 W refs/heads/p/u2/foo; !ok; /W refs/heads/p/u2/foo \@g1 u1 DENIED by fallthru/
50 gitolite access t1 u1 + refs/heads/p/u2/foo; !ok; /\\+ refs/heads/p/u2/foo t1 u1 DENIED by fallthru/
53 confreset; confadd '
54 @staff = u1 u2 u3 u4 u5 u6
55 @gfoo = foo
56 repo @gfoo
57 RW+ = u1 u2
58 RW+ p/USER/ = u3 u4
59 RW temp = u5 u6
62 try "ADMIN_PUSH set1; !/FATAL/" or die text();
64 try "
65 DEF OK = gitolite access foo %1 %2 refs/heads/%3; ok
66 DEF NOK = gitolite access foo %1 %2 refs/heads/%3; !ok
69 try "
71 # u1 and u2 can push
72 OK u1 W master
73 OK u2 W master
74 OK u2 W p/u1/foo
75 OK u1 W p/u2/foo
76 OK u1 W p/u3/foo
78 # u3 cant push u1/u4 personal branches
79 NOK u3 W p/u1/foo
80 NOK u3 W p/u4/doo
82 # u4 can push u4 personal branch
83 OK u4 W p/u4/foo
84 # u5 push temp
85 OK u5 W temp
87 # u1 and u2 can rewind
88 OK u1 + master
89 OK u2 + p/u1/foo
90 OK u1 + p/u2/foo
91 OK u1 + p/u3/foo
93 # u3 cant rewind u1/u4 personal branches
94 NOK u3 + p/u1/foo
95 NOK u3 + p/u4/foo
96 # u4 can rewind u4 personal branch
97 OK u4 + p/u4/foo
98 # u5 cant rewind temp
99 NOK u5 + temp