summaryrefslogtreecommitdiff
path: root/test/scripts/light-system-test-start.sh
blob: cdfda8cb66440108bb5b6844e887afde1d1e8649 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh

set -o nounset
set -o errexit

top_srcdir=$(cd $(dirname $0)/../..; pwd)

. ${top_srcdir}/test/scripts/testutils.sh

start_node() {
    node=$1
    node_app=$2
    ../bin/run_erl -daemon nodes/${node}/ nodes/${node}/log/ \
                   "exec ../bin/erl -boot ${node_app} -config ${node}"
}

for nodegroup in $SIGNINGNODES $MERGESECONDARYNODES $STORAGENODES $FRONTENDNODES; do
    for node in $nodegroup; do
        echo "starting $node"
        start_node $(echo $node | tr ':' ' ')
    done
done
for i in 1 2 3 4 5 6 7 8 9 10; do
    echo "waiting for system to start"
    sleep 0.5
    allstarted=1
    notstarted=
    for testurl in ${TESTURLS}; do
	if curl -s --cacert httpsca/demoCA/cacert.pem -4 https://${testurl} > /dev/null ; then
            :
        else
            allstarted=0
            notstarted="${testurl} ${notstarted}"
        fi
	:
    done
    if [ ${allstarted} -eq 1 ]; then
        break
    elif [ ${i} -eq 10 ]; then
        echo Not started: ${notstarted}
    fi
done

if [ $# -gt 0 ] && [ "$1" = "initlog" ]; then
    shift 1
    $top_srcdir/tools/initlog.py --config machine/merge/catlfish-test.cfg --localconfig machine/merge/catlfish-test-local-merge.cfg $@
fi

start_node $(echo ${MERGEPRIMARYNODE} | tr ':' ' ')