]> git.sur5r.net Git - bacula/bacula/commitdiff
regress: Add remote fd test
authorEric Bollengier <eric@eb.homelinux.org>
Sun, 27 Feb 2011 14:45:52 +0000 (15:45 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:43:30 +0000 (14:43 +0200)
regress/tests/remote-fd-test [new file with mode: 0755]

diff --git a/regress/tests/remote-fd-test b/regress/tests/remote-fd-test
new file mode 100755 (executable)
index 0000000..2d66dbb
--- /dev/null
@@ -0,0 +1,100 @@
+#!/bin/sh
+#
+# What to test
+# ------------
+# - Normal backup
+# - Weird backup
+# - Restore
+# - Accurate backup
+# - Compression
+# - Checksum
+# - TLS/Encryption
+# - compare files
+# - runscript
+#
+# How to use this test
+# --------------------
+#
+#
+TestName="remote-fd-test"
+JobName=backup
+. scripts/functions
+
+scripts/cleanup
+scripts/copy-test-confs
+
+change_jobname NightlySave $JobName
+change_jobname MonsterSave AccurateTest
+
+start_test
+
+echo $REMOTE_FILE/save > $tmp/file-list
+
+$bperl -e remote_stop
+$bperl -e remote_init
+$bperl -e remote_config
+
+$bperl -e "add_attribute('$conf/bacula-dir.conf', 'clientrunbeforejob', '$REMOTE_FILE/save/test.sh', 'Job', 'CompressedTest')"
+$bperl -e "add_attribute('$conf/bacula-dir.conf', 'accurate', 'yes', 'Job', 'AccurateTest')"
+$bperl -e "add_attribute('$conf/bacula-dir.conf', 'address', '$REMOTE_ADDR', 'Client')"
+$bperl -e "add_attribute('$conf/bacula-dir.conf', 'password', '$REMOTE_PASSWORD', 'Client')"
+$bperl -e "add_attribute('$conf/bacula-dir.conf', 'address', '$REMOTE_STORE_ADDR', 'Storage')"
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@output
+messages
+@$out ${cwd}/tmp/log1.out
+status client
+label storage=File volume=TestVolume001
+run job=$JobName 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
+@$out ${cwd}/tmp/log3.out
+@#
+@# make some runscript tests
+@#
+run job=CompressedTest storage=File yes
+wait
+messages
+@$out ${cwd}/tmp/log1.out
+@#
+@# make some accurate tests
+@#
+run job=AccurateTest storage=File yes
+wait
+messages
+run job=AccurateTest storage=File yes
+wait
+messages
+@output
+quit
+END_OF_DATA
+
+run_bacula
+check_for_zombie_jobs storage=File
+stop_bacula
+
+check_two_logs
+
+grep 'this is a script' $tmp/log3.out > /dev/null
+if [ $? != 0 ]; then
+    print_debug "ERROR: Can't find runscript output"
+    bstat=1
+fi
+
+$bperl -e remote_diff
+if [ $? != 0 ]; then
+    dstat=1
+fi
+
+$bperl -e remote_stop
+
+end_test