From: Kern Sibbald Date: Wed, 2 Sep 2020 13:33:44 +0000 (+0200) Subject: BEE Backport regress/tests/short-test X-Git-Tag: Release-11.3.2~1162 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df7cce921b06603e86366c4285cb24fa361fb9f7;p=thirdparty%2Fbacula.git BEE Backport regress/tests/short-test This commit is the result of the squash of the following main commits: Author: Eric Bollengier Date: Tue Jul 21 10:28:13 2020 +0200 regress: Add copyright to regress scripts Author: Kern Sibbald Date: Sun Sep 25 14:13:14 2016 +0200 regress: reduce short-test output Author: Kern Sibbald Date: Tue Aug 23 16:12:39 2016 +0200 regress: add some new tests --- diff --git a/regress/tests/short-test b/regress/tests/short-test new file mode 100755 index 0000000000..caf469c985 --- /dev/null +++ b/regress/tests/short-test @@ -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 <${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 <${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 <${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