keeping the profs at Cambridge happy...
[gitolite.git] / t / refex-expr-test-1
blob1372a1ea531f1c325f9da514c3914f9e633085f7
1 #!/bin/bash
3 # not part of the official test suite (yet); just some q&d testing
5 # to be run from ~/gitolite as ./$0
7 set -e
8 exec 3>&2
9 exec > /dev/null
10 exec 2> /dev/null
11 print2() { echo -n "$@" >&3; }
12 say2() { echo "$@" >&3; }
13 die() { echo FATAL: "$@" >&3; exit 1; }
15 export od=$PWD
16 export tmp=$(mktemp -d)
17 echo $tmp >&3
18 trap "rm -rf $tmp" 0
19 cd $tmp
21 print2 setting up...
22 ( cd $od; t/reset )
23 echo "push @{ \$RC{ENABLE} }, 'refex-expr';" >> ~/.gitolite.rc
24 cat <<EOF >> ~/.gitolite/conf/gitolite.conf
26 repo r1
27 RW+ = u1 u2 # line 1
29 RW+ master = u3 u4 # line 2
30 RW+ = u3 u4 # line 3
31 RW+ VREF/NAME/Makefile = u3 u4 # line 4
32 - master and VREF/NAME/Makefile = u3 u4 # line 5
34 EOF
35 gitolite setup
36 say2 done
38 # ----------------------------------------------------------------------
40 rm -rf u1
41 git clone u1:r1 u1
42 cd u1
43 tsh 'tc f1'
44 git push u1:r1 master
45 tsh 'tc f2'
46 git push u2:r1 master
47 tsh 'tc f3'
48 git push u3:r1 master
49 tsh 'tc f4'
50 git push u4:r1 master
51 say2 everyone master no Makefile
53 tsh 'tc f5 Makefile'
54 git push u1:r1 master
55 tsh 'tc f5 Makefile'
56 git push u1:r1 master:m1
57 say2 u1 Makefile master
59 tsh 'tc f5 Makefile'
60 git push u3:r1 master && die u3 r1 master should have failed
61 git push u3:r1 master:m2
62 say2 u3 Makefile master fail m2 pass