]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
BEE Backport regress/tests/short-test
authorKern Sibbald <kern@sibbald.com>
Wed, 2 Sep 2020 13:33:44 +0000 (15:33 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:02:55 +0000 (09:02 +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: Kern Sibbald <kern@sibbald.com>
Date:   Sun Sep 25 14:13:14 2016 +0200

    regress: reduce short-test output

Author: Kern Sibbald <kern@sibbald.com>
Date:   Tue Aug 23 16:12:39 2016 +0200

    regress: add some new tests

regress/tests/short-test [new file with mode: 0755]

diff --git a/regress/tests/short-test b/regress/tests/short-test
new file mode 100755 (executable)
index 0000000..caf469c
--- /dev/null
@@ -0,0 +1,91 @@
+#!/bin/sh
+#
+# Copyright (C) 2000-2020 Kern Sibbald
+# License: BSD 2-Clause; see file LICENSE-FOSS
+#
+# Short test comprised of a backup of one or more files,
+#   and a restore.  This is most useful for testing new
+#   drivers.
+#
+TestName="short-test"
+JobName=NightlySave
+. scripts/functions
+
+scripts/cleanup
+echo "Skip copy of confs ..."
+scripts/copy-test-confs
+
+#ls -1 ${cwd}/build/*.py >${cwd}/tmp/file-list
+#echo "${cwd}/build/Makefile.in" >${cwd}/tmp/file-list
+#echo "${cwd}/build/Makefile" >>${cwd}/tmp/file-list
+#echo "${cwd}/build/libtool" >${cwd}/tmp/file-list
+echo "${cwd}/build/diff" >${cwd}/tmp/file-list
+
+
+start_test
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@output /dev/null
+messages
+@$out ${cwd}/tmp/log1.out
+label storage=File volume=Vol1
+END_OF_DATA
+
+# do label
+run_bacula
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@output /dev/null
+messages
+@$out ${cwd}/tmp/log1.out
+@#setdebug level=500 storage
+run job=$JobName level=Full yes
+wait
+list volumes
+messages
+END_OF_DATA
+
+for i in 1 ; do
+  #echo "Running job $i"
+  run_bconsole
+  ls -l tmp/Vol* >${cwd}/tmp/log5.out
+done
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds-form
+@# 
+@# now do a restore
+@#
+@$out ${cwd}/tmp/log2.out
+@#setdebug level=200 client
+@#setdebug level=350 storage
+restore where=${cwd}/tmp/bacula-restores storage=File jobid=@jobid@
+mark *
+done
+yes
+wait
+messages
+sql
+select * from JobMedia;
+
+quit
+END_OF_DATA
+
+# Restore and check each job
+for i in 1; do
+   rm -rf ${cwd}/tmp/bacula-restores
+   echo "s%@jobid@%$i%" >${cwd}/tmp/in
+   sed -f ${cwd}/tmp/in ${cwd}/tmp/bconcmds-form >${cwd}/tmp/bconcmds
+   run_bconsole
+#   check_restore_diff
+done
+
+ls -l tmp/Vol* >>${cwd}/tmp/log5.out
+du -h tmp/Vol1.add >>${cwd}/tmp/log5.out
+
+sleep 2
+check_for_zombie_jobs storage=File 
+stop_bacula
+
+check_two_logs
+#check_restore_diff
+end_test