eliminate race (loaded systems only?) that makes gl-conf look empty
[gitolite.git] / t / hostname.t
blobdfb8885d6d70b69aa456c5f2d563ddb40e07e8ff
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 # %HOSTNAME tests
10 # ----------------------------------------------------------------------
12 try "plan 60";
14 try "pwd";
15 my $od = text();
16 chomp($od);
18 # without setting HOSTNAME in rc
19 confreset;confadd '
21 repo foo
22 RW dev/%HOSTNAME = u1
25 try "ADMIN_PUSH set1; /FATAL/";
26 try "/bad ref 'refs/heads/dev/%HOSTNAME'/";
28 # make a hostname entry
29 $ENV{G3T_RC} = "$ENV{HOME}/g3trc";
30 put "$ENV{G3T_RC}", "\$rc{HOSTNAME} = 'frodo';\n";
32 confreset;confadd '
34 repo bar
35 RW %HOSTNAME_baz = u1
38 try "ADMIN_PUSH set1; /FATAL/";
39 try "/bad ref 'refs/heads/%HOSTNAME_baz'/";
41 confreset;confadd '
43 repo bar
44 RW %HOSTNAME/ = u1
45 RW %HOSTNAME-baz = u1
48 try "ADMIN_PUSH set1; !/FATAL/";
49 try "
50 gitolite access bar u2 R any; /R any bar u2 DENIED by fallthru/
51 gitolite access bar u2 W any; /W any bar u2 DENIED by fallthru/
52 gitolite access bar u1 W any; !/DENIED/; /refs/heads/frodo/; !/baz/
53 gitolite access bar u1 R any; !/DENIED/; /refs/heads/frodo/; !/baz/
54 gitolite access bar u1 R refs/heads/frodo; /R refs/heads/frodo bar u1 DENIED by fallthru/
55 gitolite access bar u1 W refs/heads/frodo; /W refs/heads/frodo bar u1 DENIED by fallthru/
56 gitolite access bar u1 R refs/heads/frodo/1; !/DENIED/; /refs/heads/frodo/; !/baz/
57 gitolite access bar u1 W refs/heads/frodo/1; !/DENIED/; /refs/heads/frodo/; !/baz/
58 gitolite access bar u1 R refs/heads/sam; /R refs/heads/sam bar u1 DENIED by fallthru/
59 gitolite access bar u1 W refs/heads/sam; /W refs/heads/sam bar u1 DENIED by fallthru/
60 gitolite access bar u1 R refs/heads/master; /R refs/heads/master bar u1 DENIED by fallthru/
61 gitolite access bar u1 W refs/heads/master; /W refs/heads/master bar u1 DENIED by fallthru/
63 gitolite access bar u1 R refs/heads/frodo-baz; !/DENIED/; /refs/heads/frodo-baz/
64 gitolite access bar u1 W refs/heads/frodo-baz; !/DENIED/; /refs/heads/frodo-baz/
67 confreset;confadd '
69 repo foo-%HOSTNAME
70 RW = u1
73 try "ADMIN_PUSH set1; !/FATAL/";
74 try "
75 gitolite list-repos; /foo-frodo/
76 gitolite list-phy-repos; /foo-frodo/