Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,46 @@ | ||
#!/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 -e "status dir" | bconsole | ||
echo | ||
echo "---- label a volume ----" | ||
echo -e "label volume=testvol pool=Full" | bconsole | ||
echo | ||
echo "----- create some file to test backup / restore ----" | ||
echo "bareos restore test" > ${BACKUP_TEST_FILE} | ||
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} | ||
|
||
print_header() | ||
{ | ||
TEXT="$1" | ||
printf "#\n" | ||
printf "# %s\n" "$TEXT" | ||
printf "#\n" | ||
} | ||
|
||
if [ "${COVERITY_SCAN}" ]; then | ||
cd core | ||
# run configure with default options | ||
debian/rules override_dh_auto_configure | ||
eval "$COVERITY_SCAN_BUILD" | ||
else | ||
cd regress | ||
echo ' | ||
MAKEOPT=-j4 | ||
BAREOS_SOURCE="`pwd`/../core" | ||
EMAIL=my-name@domain.com | ||
SMTP_HOST="localhost" | ||
DBTYPE="postgresql" | ||
WHICHDB=-D${DBTYPE}=yes | ||
TAPE_DRIVE="/dev/null" | ||
AUTOCHANGER="/dev/null" | ||
DRIVE1=0 | ||
DRIVE2="none" | ||
SLOT1=1 | ||
SLOT2=2 | ||
TAPE_DRIVE1="/dev/null" | ||
AUTOCHANGER_SCRIPT=mtx-changer | ||
db_name="regress" | ||
db_user="regress" | ||
db_password="" | ||
TCPWRAPPERS=-Dtcp-wrappers=yes | ||
OPENSSL=-Dopenssl=yes | ||
HOST="127.0.0.1" | ||
SCSICRYPTO="-Dscsi-crypto=yes" | ||
BASEPORT=8101 | ||
SITE_NAME=travis-bareos-${HOST} | ||
DEVELOPER=-Ddeveloper=yes | ||
COVERAGE=-Dcoverage=yes | ||
' > config | ||
|
||
fi |