/
all
executable file
·58 lines (48 loc) · 1.57 KB
/
all
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
50
51
52
53
54
55
56
57
58
#!/bin/bash
# stop on first error
set -e
echo "start testing ... "
echo "TRAVIS_BRANCH: $TRAVIS_BRANCH"
echo "USER: $USER"
echo "DB: $DB"
echo "--------- starting services ----------- "
service bareos-dir start
service bareos-sd start
service bareos-fd start
sleep 10
echo "--------- checking services ----------- "
service bareos-dir status
service bareos-sd status
service bareos-fd status
# enable bash debug
set -v
BACKUP_TEST_FILE=/usr/sbin/bareos.test
echo "----- create some file to test backup / restore ----"
echo "bareos restore test" > ${BACKUP_TEST_FILE}
echo
echo -e "status dir" | bconsole
echo
#echo "---- label a volume ----"
#echo -e "label volume=testvol pool=Full" | bconsole
#echo
echo "------ trigger backup job -----"
echo -e "run job=backup-bareos-fd yes\rwait" | bconsole | grep "Job queued. JobId="
echo "status dir" | bconsole
echo
echo "------ trigger restore job -----"
echo -e "restore select current\r2\rls\rmark usr\rdone\ryes\rwait" | bconsole
echo "status dir" | bconsole
grep "bareos restore test" /tmp/bareos-restores/${BACKUP_TEST_FILE}
if [ "${BUILD_WEBUI}" ]; then
# show environment
export | grep " TRAVIS"
service apache2 restart
#service apache2 status
export BAREOS_BROWSER="none"
export BAREOS_USERNAME="citest"
export BAREOS_PASSWORD="citestpass"
export BAREOS_CLIENT_NAME="$HOSTNAME-fd"
echo "--------- testing webui over selenium -----------"
echo "configure add console name=citest password=citestpass profile=webui-admin" | bconsole
python ${TRAVIS_BUILD_DIR}/webui/tests/selenium/webui-selenium-test.py -v
fi