To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / deploy / test / smoketest.sh @ 1606:16325d2ab2dd

History | View | Annotate | Download (1.57 KB)

1
#!/bin/bash
2

    
3
# The big problem with this test script is that it needs the cron
4
# scripts that generate some of this stuff to have been run at least
5
# once
6

    
7
usage() {
8
    echo 1>&2
9
    echo "Usage: $0 <uri-base>" 1>&2
10
    echo 1>&2
11
    echo "  e.g. $0 https://code.soundsoftware.ac.uk" 1>&2
12
    echo "    or $0 http://localhost:8080" 1>&2
13
    echo 1>&2
14
    exit 2
15
}
16

    
17
uribase="$1"
18
if [ -z "$uribase" ]; then
19
    usage
20
fi
21

    
22
set -eu
23

    
24
# A project known to exist, be public, and have a repository
25
project_with_repo=vamp-plugin-sdk
26

    
27
# A project known to exist, be public, and have embedded documentation
28
project_with_docs=vamp-plugin-sdk
29

    
30
# A project known to exist, be public, and have a bibliography
31
project_with_biblio=sonic-visualiser
32

    
33
tried=0
34
succeeded=0
35

    
36
mydir=$(dirname "$0")
37

    
38
try() {
39
    mkdir -p "$mydir/output"
40
    origin=$(pwd)
41
    cd "$mydir/output"
42
    path="$1"
43
    description="$2"
44
    url="$uribase$path"
45
    echo
46
    echo "Trying \"$description\" [$url]..."
47
    echo
48
    if wget "$url" ; then
49
        echo "+++ Succeeded"
50
        succeeded=$(($succeeded + 1))
51
    else
52
        echo "--- FAILED"
53
    fi
54
    tried=$(($tried + 1))
55
    cd "$origin"
56
}
57

    
58
try "/" "Front page"
59
try "/projects/$project_with_repo" "Project page"
60
try "/projects/$project_with_biblio" "Project page with bibliography"
61
try "/projects/$project_with_repo/repository" "Repository page"
62
try "/hg/$project_with_repo" "Mercurial repo"
63
try "/projects/$project_with_docs/embedded" "Project documentation page (from docgen cron script)"
64
try "/git/$project_with_repo/info/refs" "Git repo mirror"
65

    
66
echo
67
echo "Passed $succeeded of $tried"
68
echo
69