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

« back to all changes in this revision

Viewing changes to t/smart-http

  • 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
#!/bin/bash
 
2
 
 
3
die() { echo "$@"; exit 1; }
 
4
 
 
5
# git clone `url u1 r1`
 
6
url() {
 
7
    echo http://$1:$1@localhost/git/$2.git
 
8
}
 
9
 
 
10
# `cmd sitaram info`
 
11
cmd() {
 
12
    c="curl http://$1:$1@localhost/git"
 
13
    shift
 
14
    c="$c/$1"
 
15
    shift
 
16
 
 
17
    if [ -n "$1" ]
 
18
    then
 
19
        c="$c?$1"
 
20
        shift
 
21
    fi
 
22
    while [ -n "$1" ]
 
23
    do
 
24
        c="$c+$1"
 
25
        shift
 
26
    done
 
27
 
 
28
    echo $c
 
29
}
 
30
 
 
31
export tmp=$(mktemp -d);
 
32
trap "rm -rf $tmp" 0;
 
33
cd $tmp
 
34
 
 
35
tsh "plan 28"
 
36
 
 
37
tsh "
 
38
    ## ls-remote admin admin
 
39
    git ls-remote `url admin gitolite-admin`
 
40
        ok
 
41
        /HEAD/
 
42
        /refs.heads.master/
 
43
    ## clone
 
44
    git clone `url admin gitolite-admin`
 
45
        ok
 
46
        /Cloning into/
 
47
    ls -al gitolite-admin/conf
 
48
        /gitolite.conf/
 
49
" || die "step 1"
 
50
 
 
51
cd gitolite-admin
 
52
echo repo t2 >> conf/gitolite.conf
 
53
echo 'RW+  = u1 u2' >> conf/gitolite.conf
 
54
 
 
55
tsh "
 
56
    ## add, commit, push
 
57
    git add conf/gitolite.conf
 
58
        ok
 
59
        !/./
 
60
    git commit -m t2
 
61
        ok
 
62
        /1 file.*changed/
 
63
    git push
 
64
        ok
 
65
        /Initialized.*var.www.gitolite-home.repositories.t2.git/
 
66
        /To http:..admin:admin.localhost.git.gitolite-admin.git/
 
67
        /master -. master/
 
68
    ## various ls-remotes
 
69
    git ls-remote `url u1 gitolite-admin`
 
70
        !ok
 
71
        /FATAL: R any gitolite-admin u1 DENIED by fallthru/
 
72
    git ls-remote `url u1 t2`
 
73
        ok
 
74
        !/./
 
75
    git ls-remote `url u2 t2`
 
76
        ok
 
77
        !/./
 
78
    git ls-remote `url u3 t2`
 
79
        !ok
 
80
        /FATAL: R any t2 u3 DENIED by fallthru/
 
81
    ## push to u1:t2
 
82
    git push      `url u1 t2` master:master
 
83
        ok
 
84
        /To http:..u1:u1.localhost.git.t2.git/
 
85
        /master -. master/
 
86
    git ls-remote `url u2 t2`
 
87
        ok
 
88
        /HEAD/
 
89
        /refs.heads.master/
 
90
" || die "step 2"