Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
- Loading branch information
1 parent
db1f55a
commit 72a68c2
Showing
2 changed files
with
88 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
language: cpp | ||
compiler: | ||
- gcc | ||
# - clang | ||
|
||
env: | ||
matrix: | ||
- DB=postgresql CONFIGURE_DB="--with-postgresql" | ||
- DB=mysql CONFIGURE_DB="--with-mysql" | ||
- DB=sqlite CONFIGURE_DB="--with-sqlite3" | ||
|
||
before_install: | ||
- sudo apt-get update -qq | ||
- sudo apt-get install -qq zlib1g-dev libreadline-dev libsqlite3-dev libmysqlclient-dev libpq-dev postgresql-server-dev-9.1 libwrap0-dev python-dev libgtk2.0-dev libgnome2-dev libacl1-dev libgnomeui-dev libx11-dev mtx bc libxt-dev libqt4-dev acl-dev libcap-dev libssl-dev liblzo2-dev ncurses-dev | ||
|
||
before_script: | ||
- for script in $PWD/debian/*.preinst; do echo "$script"; sudo /bin/sh $script install; done | ||
- ./configure --prefix=/usr --with-sbin-perm=755 --sysconfdir=/etc/bareos --docdir=/usr/share/doc/bareos --htmldir=/usr/share/doc/bareos/html --with-archivedir=/var/lib/bareos/storage --with-scriptdir=/usr/lib/bareos/scripts --with-plugindir=/usr/lib/bareos/plugins --with-working-dir=/var/lib/bareos --with-pid-dir=/var/lib/bareos --with-bsrdir=/var/lib/bareos --with-logdir=/var/log/bareos --with-subsys-dir=/var/lock --enable-smartalloc --disable-conio --enable-readline --enable-batch-insert --enable-dynamic-cats-backends --enable-acl --enable-xattr --enable-scsi-crypto --enable-ipv6 --with-tcp-wrappers --with-openssl --with-dir-user=bareos --with-dir-group=bareos --with-sd-user=bareos --with-sd-group=bareos --with-fd-user=root --with-fd-group=bareos --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" --with-basename="XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX" --with-hostname="XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX" ${CONFIGURE_DB} | ||
- make | ||
- sudo make install | ||
- for script in $PWD/debian/*.postinst; do echo "$script"; sudo /bin/sh $script configure; done | ||
# --enable-ndmp | ||
|
||
# test script | ||
script: | ||
sudo -E $PWD/test/all |
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/bash | ||
|
||
# stop on first error | ||
set -e | ||
|
||
echo "start testing ... " | ||
echo "TRAVIS_BRANCH: $TRAVIS_BRANCH" | ||
echo "USER: $USER" | ||
echo "DB: $DB" | ||
|
||
chown ${daemon_user}:${daemon_group} /etc/bareos/*.conf | ||
chmod ug=rw,o+r /etc/bareos/*.conf | ||
chmod a+rx /etc/bareos/ | ||
|
||
ls -la /etc/bareos/ | ||
|
||
case "$DB" in | ||
postgres*) | ||
su postgres -c /usr/lib/bareos/scripts/create_bareos_database | ||
su postgres -c /usr/lib/bareos/scripts/make_bareos_tables | ||
su postgres -c /usr/lib/bareos/scripts/grant_bareos_privileges | ||
;; | ||
*) | ||
/usr/lib/bareos/scripts/create_bareos_database | ||
/usr/lib/bareos/scripts/make_bareos_tables | ||
/usr/lib/bareos/scripts/grant_bareos_privileges | ||
;; | ||
esac | ||
|
||
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\rtestvol\r2" | 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\r1\ryes\rwait" | bconsole | grep "Job queued. JobId=" | ||
echo "status dir" | bconsole | ||
echo | ||
echo "------ trigger restore job -----" | ||
echo -e "rest\r5\rls\rmark usr\rdone\ryes\rwait" | bconsole | ||
echo "status dir" | bconsole | ||
grep "bareos restore test" /tmp/bareos-restores/${BACKUP_TEST_FILE} |