]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
BEE Backport regress/tests/remote-fd-plugin-test
authorEric Bollengier <eric@baculasystems.com>
Wed, 2 Sep 2020 13:32:15 +0000 (15:32 +0200)
committerEric Bollengier <eric@baculasystems.com>
Tue, 1 Mar 2022 14:36:18 +0000 (15:36 +0100)
This commit is the result of the squash of the following main commits:

Author: Eric Bollengier <eric@baculasystems.com>
Date:   Tue Jul 21 10:28:13 2020 +0200

    regress: Add copyright to regress scripts

Author: Eric Bollengier <eric@baculasystems.com>
Date:   Thu Mar 1 16:40:19 2012 +0100

    regress: Add new test to test remote plugins

regress/tests/remote-fd-plugin-test [new file with mode: 0755]

diff --git a/regress/tests/remote-fd-plugin-test b/regress/tests/remote-fd-plugin-test
new file mode 100755 (executable)
index 0000000..6831a84
--- /dev/null
@@ -0,0 +1,88 @@
+#!/bin/sh
+#
+# Copyright (C) 2000-2020 Kern Sibbald
+# License: BSD 2-Clause; see file LICENSE-FOSS
+#
+# What to test
+# ------------
+# - Delta plugin
+#
+# How to use this test
+# --------------------
+#
+#
+TestName="remote-fd-plugin-test"
+. scripts/functions
+
+scripts/cleanup
+scripts/copy-test-confs
+
+start_test
+
+echo $REMOTE_FILE/save > $tmp/file-list
+
+ssh $REMOTE_ADDR test -x /opt/bacula/bin/bacula-fd
+if [ $? != 0 ]; then
+    print_debug "ERROR: Need to install bacula on $REMOTE_ADDR"
+    echo "ERROR: Need to install bacula on $REMOTE_ADDR"
+    exit 1
+fi
+
+$bperl -e remote_stop
+$bperl -e remote_init
+$bperl -e remote_config
+cfg=$conf/bacula-dir.conf
+$bperl -e "add_attribute('$cfg', 'address', '$REMOTE_ADDR', 'Client')"
+$bperl -e "add_attribute('$cfg', 'password', '$REMOTE_PASSWORD', 'Client')"
+$bperl -e "add_attribute('$cfg', 'address', '$REMOTE_STORE_ADDR', 'Storage')"
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@output
+messages
+@$out ${cwd}/tmp/log4.out
+setdebug level=1 client
+status client
+@$out ${cwd}/tmp/log1.out
+label storage=File volume=TestVolume001
+run job=DeltaTest storage=File yes
+wait
+messages
+@# 
+@# now do a restore
+@#
+@$out ${cwd}/tmp/log2.out
+restore where=$REMOTE_FILE/restore select all done storage=File
+yes
+wait
+messages
+quit
+END_OF_DATA
+
+run_bacula
+check_for_zombie_jobs storage=File
+stop_bacula
+
+check_two_logs
+
+version=`$bin/bacula-dir -? 2>&1 | awk '/Version:/ { print $2 }'`
+version_fd=`awk '/Version:/ { print $3 }' $tmp/log4.out`
+if [ "$version" != "$version_fd" ]; then
+    print_debug "ERROR: client version doesn't match $version ($version_fd)"
+    estat=1
+fi
+
+grep delta-fd.so $tmp/log4.out > /dev/null
+if [ $? != 0 ]; then
+    print_debug "ERROR: Can't find delta plugin in the status output"
+    estat=2
+fi
+
+$bperl -e remote_diff
+if [ $? != 0 ]; then
+    dstat=1
+fi
+
+$bperl -e remote_stop
+
+end_test