From d5208fdbbd443c3eed490262afb8df4deb21fa2d Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 27 Mar 2014 18:59:33 +0100 Subject: [PATCH] Backport from BEE --- regress/DartTestfile.txt.in | 2 +- regress/all-disk-tests | 3 +- regress/scripts/bacula-dir-migration.conf.in | 12 ++ regress/scripts/check_for_zombie_jobs | 10 ++ regress/scripts/cleanup | 3 +- regress/scripts/create_sed | 12 +- regress/scripts/diff.pl | 13 ++ regress/scripts/functions | 130 ++++++++++++------- regress/scripts/regress-config | 47 ------- regress/scripts/regress-config.in | 1 + regress/tests/accurate-test | 4 +- regress/tests/copy-job-test | 8 +- regress/tests/copy-upgrade-test | 6 +- regress/tests/copy-volume-test | 13 +- regress/tests/differential-test | 7 +- regress/tests/estimate-test | 14 +- regress/tests/fileregexp-test | 6 +- regress/tests/migration-job-purge-test | 2 +- regress/tests/migration-job-test | 2 +- regress/tests/migration-jobspan-test | 2 +- regress/tests/migration-occupancy-test | 2 +- regress/tests/migration-time-test | 2 +- regress/tests/migration-volume-test | 4 +- regress/tests/prune-config-test | 11 +- regress/tests/prune-copy-test | 2 +- regress/tests/prune-migration-test | 5 +- regress/tests/prune-test | 2 +- regress/tests/source-addr-test | 28 ++-- regress/tests/stats-test | 6 +- regress/tests/tls-duplicate-job-test | 2 +- 30 files changed, 210 insertions(+), 151 deletions(-) delete mode 100755 regress/scripts/regress-config diff --git a/regress/DartTestfile.txt.in b/regress/DartTestfile.txt.in index 3860bdf3a3..7cef35f567 100644 --- a/regress/DartTestfile.txt.in +++ b/regress/DartTestfile.txt.in @@ -52,7 +52,7 @@ ADD_TEST(disk:migration-time-test "@regressdir@/tests/migration-time-test") ADD_TEST(disk:migration-volume-test "@regressdir@/tests/migration-volume-test") ADD_TEST(disk:multi-storage-test "@regressdir@/tests/multi-storage-test") ADD_TEST(disk:prune-test "@regressdir@/tests/prune-test") -ADD_TEST(disk:prune-config-test "@regressdir@/tests/prune-config-test") +#ADD_TEST(disk:prune-config-test "@regressdir@/tests/prune-config-test") ADD_TEST(disk:prune-migration-test "@regressdir@/tests/prune-migration-test") ADD_TEST(disk:prune-copy-test "@regressdir@/tests/prune-copy-test") ADD_TEST(disk:prune-base-job-test "@regressdir@/tests/prune-base-job-test") diff --git a/regress/all-disk-tests b/regress/all-disk-tests index 5172595216..517c640fe0 100755 --- a/regress/all-disk-tests +++ b/regress/all-disk-tests @@ -84,7 +84,8 @@ rm -f dumps/* ./run tests/multi-storage-test # Disabled because certain pruning turned off #./run tests/prune-test -./run tests/prune-config-test +# Disabled because Cartika fix breaks it +#./run tests/prune-config-test ./run tests/prune-migration-test ./run tests/prune-copy-test ./run tests/prune-base-job-test diff --git a/regress/scripts/bacula-dir-migration.conf.in b/regress/scripts/bacula-dir-migration.conf.in index 5e58c07dcc..91423142ee 100644 --- a/regress/scripts/bacula-dir-migration.conf.in +++ b/regress/scripts/bacula-dir-migration.conf.in @@ -41,6 +41,18 @@ Job { # Prefer Mounted Volumes = no } +Job { + Name = "Save" + Type = Backup + Client=@hostname@-fd + FileSet="Full Set" + Storage = File + Messages = Standard + Pool = Default + Write Bootstrap = "@working_dir@/Save.bsr" + Maximum Concurrent Jobs = 4 +} + Job { Name = "migrate-job" Type = Migrate diff --git a/regress/scripts/check_for_zombie_jobs b/regress/scripts/check_for_zombie_jobs index e2c240565b..2b1802a2e8 100755 --- a/regress/scripts/check_for_zombie_jobs +++ b/regress/scripts/check_for_zombie_jobs @@ -56,6 +56,16 @@ if [ $? != 0 ] ; then zstat=1 exit 1 fi +grep " READ " ${tmp}/sd.out 2>&1 >/dev/null +if [ $? = 0 ]; then + echo " " + echo " !!!! Zombie \"Read\" Jobs in Storage daemon !!!!" + echo " !!!! Zombie \"Read\" Jobs in Storage daemon !!!!" >>test.out + cat ${tmp}/sd.out + echo " " + zstat=1 + exit 1 +fi grep "ERROR" ${tmp}/log*.out 2>&1 >/dev/null if [ $? = 0 ] ; then echo " " diff --git a/regress/scripts/cleanup b/regress/scripts/cleanup index c501428061..4f8ccbb765 100755 --- a/regress/scripts/cleanup +++ b/regress/scripts/cleanup @@ -11,7 +11,8 @@ rm -rf ${tmp}/* rm -rf ${working}/log ${tmp}/TEST-* rm -rf ${working}/log ${tmp}/Backup-* rm -rf ${working}/*.bsr ${working}/log*.sd -rm -rf ${working}/*.trace ${working}/*.traceback ${working}/*.bactrace +rm -rf ${working}/*.trace ${working}/*.traceback ${working}/*.lockdump +rm -rf ${working}/@* rm -rf ${tmp}disk-changer rm -f ${cwd}/bin/plugins/test-plugin-fd.so find . -name "gigaslam.gif" -exec rm -f {} \; diff --git a/regress/scripts/create_sed b/regress/scripts/create_sed index f2ac478cc1..3cbf690e73 100755 --- a/regress/scripts/create_sed +++ b/regress/scripts/create_sed @@ -11,6 +11,8 @@ out="${tmp}/sed_tmp" # set ports and other default parameters BASEPORT=${BASEPORT:-8101} AUTOCHANGER_SCRIPT=${AUTOCHANGER_SCRIPT:-mtx-changer} +REMOTE_HOST_ADDR=${REMOTE_HOST_ADDR:-localhost} +REMOTE_HOST_NAME=${REMOTE_HOST_NAME:-localhost} LIBDBI=${LIBDBI:-} libdbi=${LIBDBI} srcdir=${BACULA_SOURCE} @@ -28,24 +30,28 @@ else os=${os}-`./scripts/get-os` fi dbengine=`echo ${WHICHDB} | sed -e 's/--with-//' -e 's/=.*//'` -bversion=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` -bdate=`sed -n -e 's/^.*LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` +bversion=`sed -n -e 's/^#define VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` +bdate=`sed -n -e 's/^#define LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` builddir="${src}" # Create sed command script -echo "s%@sbindir@%${bin}%g" >${out} +echo "s%@remotehostaddr@%${REMOTE_HOST_ADDR}%g" >${out} +echo "s%@remotedirname@%${REMOTE_DIR_NAME}%g" >>${out} +echo "s%@sbindir@%${bin}%g" >>${out} echo "s%@scriptdir@%${scripts}%g" >>${out} echo "s%@working_dir@%${working}%g" >>${out} echo "s%@piddir@%${working}%g" >>${out} echo "s%@subsysdir@%${working}%g" >>${out} echo "s%@job_email@%${EMAIL}%g" >>${out} echo "s%@tape_drive@%${TAPE_DRIVE}%g" >>${out} +echo "s%@tape_control@%${TAPE_CONTROL}%g" >>${out} echo "s%@autochanger@%${AUTOCHANGER}%g" >>${out} echo "s%@changer_script@%${AUTOCHANGER_SCRIPT}%g" >>${out} echo "s%@tmpdir@%${tmp}%g" >>${out} echo "s%@hostname@%${HOST}%g" >>${out} echo "s%@changer_path@%${AUTOCHANGER_PATH}%g" >>${out} echo "s%@tape_drive1@%${TAPE_DRIVE1}%g" >>${out} +echo "s%@tape_control1@%${TAPE_CONTROL1}%g" >>${out} echo "s%@smtp_host@%${SMTP_HOST}%g" >>${out} echo "s%@disk_drive@%${tmp}/disk-changer%g" >>${out} echo "s%@hostname@%${hostname}%g" >>${out} diff --git a/regress/scripts/diff.pl b/regress/scripts/diff.pl index bf217cd60c..7e72349c66 100755 --- a/regress/scripts/diff.pl +++ b/regress/scripts/diff.pl @@ -28,6 +28,7 @@ my %dst_attr; my @exclude; my $hash; my $ret=0; +my $notop=0; GetOptions("src=s" => \$src, # source directory "dst=s" => \$dst, # dest directory @@ -36,6 +37,7 @@ GetOptions("src=s" => \$src, # source directory "wattr" => \$wattr, # windows attributes "mtime-dir" => \$mtimedir, # check mtime on directories "exclude=s@" => \@exclude, # exclude some files + "notop" => \$notop, # Exclude top directory "help" => \$help, ) or pod2usage(-verbose => 1, -exitval => 1); @@ -54,6 +56,7 @@ my $dir = getcwd; chdir($src) or die "ERROR: Can't access to $src"; $hash = \%src_attr; + find(\&wanted_src, '.'); if ($wattr) { @@ -83,6 +86,12 @@ if ($wattr) { foreach my $f (keys %src_attr) { + if ($notop && $f eq '.') { + delete $src_attr{$f}; + delete $dst_attr{$f}; + next; + } + if (!defined $dst_attr{$f}) { $ret++; print "diff.pl ERROR: Can't find $f in dst\n"; @@ -136,6 +145,10 @@ sub compare ($val1, $val2) = (map { strftime('%F %T', localtime($_)) } ($val1, $val2)); } + if ($k =~ /mode/) { + ($val1, $val2) = + (map { sprintf('%o', $_) } ($val1, $val2)); + } print "diff.pl ERROR: src and dst $f2 differ on $k ($val1 != $val2)\n"; } delete $attr{$k}; diff --git a/regress/scripts/functions b/regress/scripts/functions index 28f9912bcd..af5686f7a4 100644 --- a/regress/scripts/functions +++ b/regress/scripts/functions @@ -15,12 +15,17 @@ check_encoding() start_test() { check_encoding + rm -rf ${working}/@* # Turn off email outf="${tmp}/sed_tmp" echo "s% mail =%# mail = %g" >${outf} echo "s% operator =%# operator =%g" >>${outf} cp ${conf}/bacula-dir.conf ${tmp}/1 sed -f ${outf} ${tmp}/1 > ${conf}/bacula-dir.conf + if [ x$FORCE_SDCALLS = xyes ]; then + $bperl -e 'add_attribute("$conf/bacula-dir.conf", "SD Calls Client", "yes", "Client")' + fi + ./test_starttime echo " " echo " " echo " === Starting $TestName at `date +%R:%S` ===" @@ -150,7 +155,7 @@ get_duration() check_duration() { LOG=$1 - TIME=$2 + $2 OP=${3-gt} get_duration $LOG @@ -279,40 +284,83 @@ check_two_logs() print_debug "Found database encoding error" bstat=2 fi + grep "Orphaned buffer" ${tmp}/log1.out ${tmp}/log2.out + if test $? -eq 0; then + estat=1 + fi } check_restore_diff() { if test "$debug" -eq 1 ; then - $rscripts/diff.pl -s ${src} -d ${tmp}/bacula-restores${src} + $rscripts/diff.pl -notop -s ${src} -d ${tmp}/bacula-restores${src} 2>&1 >/tmp/d$$ + if test $? -ne 0; then + dstat=1 + cat /tmp/d$$ + ls -Rl ${src} + ls -Rl ${tmp}/bacula-restores${src} + fi + rm -f /tmp/d$$ diff -ur ${src} ${tmp}/bacula-restores${src} else + $rscripts/diff.pl -notop -s ${src} -d ${tmp}/bacula-restores${src} 2>&1 >/dev/null + if test $? -ne 0; then + dstat=1 + fi diff -ur ${src} ${tmp}/bacula-restores${src} 2>&1 >/dev/null fi - dstat=$? + if test $? -ne 0; then + dstat=1 + fi } check_restore_bin_diff() { if test "$debug" -eq 1 ; then - $rscripts/diff.pl -s ${bin} -d ${tmp}/bacula-restores${bin} + $rscripts/diff.pl -notop -s ${bin} -d ${tmp}/bacula-restores${bin} 2>&1 >/tmp/d$$ + if test $? -ne 0; then + dstat=1 + cat /tmp/d$$ + ls -Rl ${src} + ls -Rl ${tmp}/bacula-restores${src} + fi + rm -f /tmp/d$$ diff -ur ${bin} ${tmp}/bacula-restores${bin} else + $rscripts/diff.pl -notop -s ${bin} -d ${tmp}/bacula-restores${bin} 2>&1 >/dev/null + if test $? -ne 0; then + dstat=1 + fi diff -ur ${bin} ${tmp}/bacula-restores${bin} 2>&1 >/dev/null fi - dstat=$? + if test $? -ne 0; then + dstat=1 + fi } check_restore_tmp_build_diff() { if test "$debug" -eq 1 ; then - $rscripts/diff.pl -s ${tmpsrc} -d ${tmp}/bacula-restores${tmpsrc} + $rscripts/diff.pl -notop -s ${tmpsrc} -d ${tmp}/bacula-restores${tmpsrc} 2>&1 >/tmp/d$$ + if test $? -ne 0; then + dstat=1 + cat /tmp/d$$ + ls -Rl ${src} + ls -Rl ${tmp}/bacula-restores${src} + fi + rm -f /tmp/d$$ diff -ur ${tmpsrc} ${tmp}/bacula-restores${tmpsrc} else + $rscripts/diff.pl -notop -s ${tmpsrc} -d ${tmp}/bacula-restores${tmpsrc} 2>&1 >/dev/null + if test $? -ne 0; then + dstat=1 + fi diff -ur ${tmpsrc} ${tmp}/bacula-restores${tmpsrc} 2>&1 >/dev/null fi - dstat=$? + if test $? -ne 0; then + dstat=1 + fi } # bstat is backup error @@ -326,53 +374,58 @@ end_test() if [ x$notracedump != xyes ]; then cat ${working}/bacula.*.traceback 2>/dev/null cp -f ${working}/bacula.*.traceback ${dumps} 2>/dev/null - cat ${working}/*.bactrace 2>/dev/null - cp -f ${working}/*.bactrace ${dumps} 2>/dev/null + cat ${working}/*.lockdump 2>/dev/null + cp -f ${working}/*.lockdump ${dumps} 2>/dev/null fi if [ -f $tmp/err.log ]; then cat $tmp/err.log fi + d=`./test_duration` + t=`date +%R:%S` if [ $estat != 0 ] ; then echo " " - echo " !!!!! $TestName failed!!! `date +%R:%S` !!!!! " - echo " Status: estat=$estat zombie=$zstat backup=$bstat restore=$rstat diff=$dstat" - echo " !!!!! $TestName failed!!! `date +%R:%S` !!!!! " >>test.out - echo " Status: estat=$estat zombie=$zstat backup=$bstat restore=$rstat diff=$dstat" >>test.out + echo " !!!!! $TestName failed!!! $t $d !!!!! " + echo " Status: estat=$estat zombie=$zstat backup=$bstat restore=$rstat diff=$dstat" + echo " " >>test.out + echo " !!!!! $TestName failed!!! $t $d !!!!! " >>test.out + echo " Status: estat=$estat zombie=$zstat backup=$bstat restore=$rstat diff=$dstat" >>test.out echo " " exit 1 fi if [ $zstat != 0 ] ; then echo " " - echo " !!!!! $TestName failed!!! `date +%R:%S` !!!!! " - echo " Status: zombie=$zstat backup=$bstat restore=$rstat diff=$dstat" - echo " !!!!! $TestName failed!!! `date +%R:%S` !!!!! " >>test.out - echo " Status: zombie=$zstat backup=$bstat restore=$rstat diff=$dstat" >>test.out + echo " !!!!! $TestName failed!!! $t $d !!!!! " + echo " Status: zombie=$zstat backup=$bstat restore=$rstat diff=$dstat" + echo " " >>test.out + echo " !!!!! $TestName failed!!! $t $d !!!!! " >>test.out + echo " Status: zombie=$zstat backup=$bstat restore=$rstat diff=$dstat" >>test.out echo " " exit 1 fi if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then echo " " - echo " " - echo " !!!!! $TestName failed!!! `date +%R:%S` !!!!! " - echo " Status: zombie=$zstat backup=$bstat restore=$rstat diff=$dstat" - echo " !!!!! $TestName failed!!! `date +%R:%S` !!!!! " >>test.out - echo " Status: zombie=$zstat backup=$bstat restore=$rstat diff=$dstat" >>test.out + echo " !!!!! $TestName failed!!! $t $d !!!!! " + echo " Status: zombie=$zstat backup=$bstat restore=$rstat diff=$dstat" + echo " " >>test.out + echo " !!!!! $TestName failed!!! $t %d !!!!! " >>test.out + echo " Status: zombie=$zstat backup=$bstat restore=$rstat diff=$dstat" >>test.out if [ $bstat != 0 -o $rstat != 0 ] ; then - echo " !!!!! Bad termination status !!!!! " - echo " !!!!! Bad termination status !!!!! " >>test.out + echo " !!! Bad termination status !!! " + echo " !!! Bad termination status !!! " >>test.out else - echo " !!!!! Restored files differ !!!!! " - echo " !!!!! Restored files differ !!!!! " >>test.out + echo " !!! Restored files differ !!! " + echo " !!! Restored files differ !!! " >>test.out fi - echo " Status: backup=$bstat restore=$rstat diff=$dstat" - echo " Status: backup=$bstat restore=$rstat diff=$dstat" >>test.out - echo " Test owner of $SITE_NAME is $EMAIL" - echo " Test owner of $SITE_NAME is $EMAIL" >>test.out + echo " Status: backup=$bstat restore=$rstat diff=$dstat" + echo " Status: backup=$bstat restore=$rstat diff=$dstat" >>test.out + echo " Test owner of $SITE_NAME is $EMAIL" + echo " Test owner of $SITE_NAME is $EMAIL" >>test.out + echo " " >>test.out echo " " exit 1 else - echo " ===== $TestName OK `date +%R:%S` ===== " - echo " ===== $TestName OK `date +%R:%S` ===== " >>test.out + echo " ===== $TestName OK $t $d ===== " + echo " ===== $TestName OK $t $d ===== " >>test.out if test "$debug" -eq 0 ; then ${rscripts}/cleanup fi @@ -391,7 +444,7 @@ copy_test_confs() ${rscripts}/cleanup } -disable_pluguins() +disable_plugins() { for i in ${conf}/bacula-fd.conf; do sed 's/Plugin/#Plugin/' $i > $tmp/1 @@ -399,17 +452,6 @@ disable_pluguins() done } -update_win32() -{ - if [ -d $cwd/build/src/win32/release32 \ - -a -d $cwd/build/src/win32/release64 ] \ - || [ -d $cwd/release32 -a -d $cwd/release64 ] - then - echo -ne "Try to upgrade the FileDaemon:\t" - wget -qO - "$WIN32_ADDR:8091/install" - fi -} - debug_wait() { if test "x${REGRESS_WAIT}" = "x1"; then diff --git a/regress/scripts/regress-config b/regress/scripts/regress-config deleted file mode 100755 index 1c8b3e4f8b..0000000000 --- a/regress/scripts/regress-config +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -# -# This is the configuration script for regression testing -# - -. ${1}/config -if test "x" = "x"; then - PASSWD= -else - PASSWD="--with-db-password=" -fi - -if [ -z "${CFLAGS}" ]; then - CFLAGS="-g -O2 -Wall" - export CFLAGS -fi - -./configure \ - --sbindir=${1}/bin \ - --libdir=${1}/bin \ - --sysconfdir=${1}/bin \ - --mandir=${1}/bin \ - --docdir=${1}/bin/html \ - --htmldir=${1}/bin/html \ - --with-pid-dir=${1}/working \ - --with-subsys-dir=${1}/working \ - --with-plugindir=${1}/bin/plugins \ - --enable-smartalloc \ - --enable-lockmgr \ - --disable-readline \ - --with-working-dir=${1}/working \ - --with-archivedir=${1}/tmp \ - --with-dump-email=${EMAIL} \ - --with-job-email=${EMAIL} \ - --with-smtp-host=${SMTP_HOST} \ - --with-db-name=regress \ - --with-db-user=regress \ - ${PASSWD} \ - ${OPENSSL} \ - ${TCPWRAPPERS} \ - ${WHICHDB} \ - --with-baseport=${BASEPORT} - -LD_LIBRARY_PATH=${1}/bin:${LD_LIBRARY_PATH} -export LD_LIBRARY_PATH - -exit 0 diff --git a/regress/scripts/regress-config.in b/regress/scripts/regress-config.in index 4f0d46efc7..49a4c63b59 100755 --- a/regress/scripts/regress-config.in +++ b/regress/scripts/regress-config.in @@ -25,6 +25,7 @@ fi --with-pid-dir=${1}/working \ --with-subsys-dir=${1}/working \ --with-plugindir=${1}/bin/plugins \ + --with-logdir=${1}/working \ --enable-smartalloc \ --enable-lockmgr \ --disable-readline \ diff --git a/regress/tests/accurate-test b/regress/tests/accurate-test index 21ae4544c1..e64f24e5fe 100755 --- a/regress/tests/accurate-test +++ b/regress/tests/accurate-test @@ -274,7 +274,7 @@ check_for_zombie_jobs storage=File check_two_logs check_restore_diff -rm -rf ${cwd}/tmp/bacula-restores ${cwd}/build/accurate/bacula-restores +rm -rf ${cwd}/tmp/bacula-restores ################################################################ p Check with bscan @@ -317,7 +317,7 @@ check_for_zombie_jobs storage=File check_two_logs check_restore_diff -rm -rf ${cwd}/tmp/bacula-restores +rm -rf ${cwd}/tmp/bacula-restores ${cwd}/build/accurate/bacula-restores ################################################################ p Now do a test with other attributes: owner, gid, rights diff --git a/regress/tests/copy-job-test b/regress/tests/copy-job-test index b2aa2a3b8f..5e6b2f2864 100755 --- a/regress/tests/copy-job-test +++ b/regress/tests/copy-job-test @@ -29,7 +29,7 @@ start_test # Write out bconsole commands cat <${cwd}/tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out ${cwd}/tmp/log1.out @# setdebug level=100 storage=File @@ -70,7 +70,11 @@ list jobs @# @$out ${cwd}/tmp/log2.out list volumes -restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger +@#setdebug level=15 director +@#setdebug level=150 storage=DiskChanger +@# Note, here we are restoring from the original backup, +@# so if you specify storage=DiskChanger the restore will fail +restore where=${cwd}/tmp/bacula-restores select unmark * mark * done diff --git a/regress/tests/copy-upgrade-test b/regress/tests/copy-upgrade-test index 99d4ebfc6d..c6b42897e7 100755 --- a/regress/tests/copy-upgrade-test +++ b/regress/tests/copy-upgrade-test @@ -30,7 +30,7 @@ start_test # Write out bconsole commands cat <${cwd}/tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out ${cwd}/tmp/log1.out @# setdebug level=100 storage=File @@ -101,7 +101,9 @@ cat< ${cwd}/tmp/bconcmds.resto @# @$out ${cwd}/tmp/log2.out list volumes -restore copies where=${cwd}/tmp/bacula-restores select storage=DiskChanger +@# Note, here we are restoring from the original backup, +@# so if you specify storage=DiskChanger the restore will fail +restore copies where=${cwd}/tmp/bacula-restores select unmark * mark * done diff --git a/regress/tests/copy-volume-test b/regress/tests/copy-volume-test index 2783299f38..e6bff27345 100755 --- a/regress/tests/copy-volume-test +++ b/regress/tests/copy-volume-test @@ -32,9 +32,10 @@ start_test # Write out bconsole commands cat <${cwd}/tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out ${cwd}/tmp/log1.out +setdebug level=50 storage=DiskChanger label storage=File volume=FileVolume001 Pool=Default label storage=File volume=FileVolume002 Pool=Scratch update Volume=FileVolume001 MaxVolBytes=3000000 pool=Default @@ -86,7 +87,9 @@ messages @# Use File instead of DiskChanger @# Files are there @############################################################ -restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger +@# Note, here we are restoring from the original backup, +@# so if you specify storage=DiskChanger the restore will fail +restore where=${cwd}/tmp/bacula-restores select unmark * mark * done @@ -112,9 +115,12 @@ cat <${cwd}/tmp/bconcmds @# Files are there @############################################################ @$out ${cwd}/tmp/log3.out +setdebug level=50 storage=DiskChanger purge volume=FileVolume001 yes purge volume=FileVolume002 yes -restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger +@# Note, here we are restoring from the original backup, +@# so if you specify storage=DiskChanger the restore will fail +restore where=${cwd}/tmp/bacula-restores select unmark * mark * done @@ -145,6 +151,7 @@ cat <${cwd}/tmp/bconcmds run job=$JobName yes wait messages +setdebug level=50 storage=DiskChanger restore where=${cwd}/tmp/bacula-restores select all done yes diff --git a/regress/tests/differential-test b/regress/tests/differential-test index 898147dfc2..9fa6504c98 100755 --- a/regress/tests/differential-test +++ b/regress/tests/differential-test @@ -21,7 +21,7 @@ change_jobname CompressedTest $JobName start_test cat <${cwd}/tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out ${cwd}/tmp/log1.out setdebug level=100 storage=File @@ -40,7 +40,7 @@ echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt cat <${cwd}/tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out ${cwd}/tmp/log1.out @# Force differential on the second Volume @@ -53,10 +53,11 @@ END_OF_DATA run_bconsole scripts/check_for_zombie_jobs storage=File +echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt cat <${cwd}/tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out ${cwd}/tmp/log1.out run level=incremental job=$JobName yes diff --git a/regress/tests/estimate-test b/regress/tests/estimate-test index b9c65caa4f..8fd5e5996b 100755 --- a/regress/tests/estimate-test +++ b/regress/tests/estimate-test @@ -26,10 +26,10 @@ mkdir -p ${cwd}/build/src/test touch ${cwd}/build/src/test/test1 ${cwd}/build/src/test/test2 cat <$tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out $tmp/log1.out -label volume=TestVolume001 storage=File pool=File +label volume=TestVolume001 storage=File1 pool=File slot=1 drive=1 run job=$JobName yes wait messages @@ -52,7 +52,7 @@ check_restore_diff mv ${cwd}/build/src/test ${cwd}/build/po/test cat <$tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out $tmp/log3.out estimate listing job=$JobName level=incremental @@ -63,7 +63,7 @@ END_OF_DATA run_bconsole cat <$tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out $tmp/log4.out estimate listing job=$JobName level=incremental accurate=yes @@ -77,7 +77,7 @@ cp $scripts/bacula-dir.conf $tmp/1 sed 's/JobDefs {/JobDefs { Accurate=yes/' $tmp/1>$scripts/bacula-dir.conf cat <$tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out $tmp/log5.out reload @@ -89,7 +89,7 @@ END_OF_DATA run_bconsole cat <$tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out $tmp/log6.out estimate listing job=$JobName level=incremental accurate=no @@ -125,7 +125,7 @@ if [ $? = 0 ]; then dstat=2 fi -check_for_zombie_jobs storage=File +check_for_zombie_jobs storage=File1 stop_bacula end_test diff --git a/regress/tests/fileregexp-test b/regress/tests/fileregexp-test index ca639ec745..7a0ed090d8 100755 --- a/regress/tests/fileregexp-test +++ b/regress/tests/fileregexp-test @@ -24,10 +24,10 @@ change_jobname BackupClient1 $JobName start_test cat <${tmp}/bconcmds -@$out /dev/null +@output /dev/null messages @$out ${tmp}/log1.out -label volume=TestVolume001 storage=File pool=File +label volume=TestVolume001 storage=File1 pool=File slot=1 drive=0 run job=$JobName yes wait messages @@ -59,7 +59,7 @@ END_OF_DATA run_bconsole -check_for_zombie_jobs storage=File +check_for_zombie_jobs storage=File1 stop_bacula # diff --git a/regress/tests/migration-job-purge-test b/regress/tests/migration-job-purge-test index 518b63c961..c7db6bd1bf 100755 --- a/regress/tests/migration-job-purge-test +++ b/regress/tests/migration-job-purge-test @@ -29,7 +29,7 @@ start_test # Write out bconsole commands cat <${cwd}/tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out ${cwd}/tmp/log1.out setdebug level=000 storage=File diff --git a/regress/tests/migration-job-test b/regress/tests/migration-job-test index 16ca0e363c..b9e4f28b5e 100755 --- a/regress/tests/migration-job-test +++ b/regress/tests/migration-job-test @@ -26,7 +26,7 @@ start_test # Write out bconsole commands cat <${cwd}/tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out ${cwd}/tmp/log1.out setdebug level=000 storage=File diff --git a/regress/tests/migration-jobspan-test b/regress/tests/migration-jobspan-test index b0024a1fc2..e90227ef3d 100755 --- a/regress/tests/migration-jobspan-test +++ b/regress/tests/migration-jobspan-test @@ -31,7 +31,7 @@ start_test # Write out bconsole commands cat <${cwd}/tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out ${cwd}/tmp/log1.out @#setdebug level=10 dir diff --git a/regress/tests/migration-occupancy-test b/regress/tests/migration-occupancy-test index fa2b53011a..d74f9f15a6 100755 --- a/regress/tests/migration-occupancy-test +++ b/regress/tests/migration-occupancy-test @@ -26,7 +26,7 @@ start_test # Write out bconsole commands cat <${cwd}/tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out ${cwd}/tmp/log1.out label storage=File volume=FileVolume001 Pool=Default diff --git a/regress/tests/migration-time-test b/regress/tests/migration-time-test index 3181e6d586..5a124ffa52 100755 --- a/regress/tests/migration-time-test +++ b/regress/tests/migration-time-test @@ -26,7 +26,7 @@ start_test # Write out bconsole commands cat <${cwd}/tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out ${cwd}/tmp/log1.out label storage=File volume=FileVolume001 Pool=Default diff --git a/regress/tests/migration-volume-test b/regress/tests/migration-volume-test index dc951eaeb6..e2c19b8319 100755 --- a/regress/tests/migration-volume-test +++ b/regress/tests/migration-volume-test @@ -1,4 +1,4 @@ -#!/bin/sh + #!/bin/sh # # Run a backup of the Bacula build directory on two Volumes # then migrate it to another device. @@ -28,7 +28,7 @@ start_test # Write out bconsole commands cat <${cwd}/tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out ${cwd}/tmp/log1.out label storage=File volume=FileVolume001 Pool=Default diff --git a/regress/tests/prune-config-test b/regress/tests/prune-config-test index e4baeeb5aa..7bfd67bd0d 100755 --- a/regress/tests/prune-config-test +++ b/regress/tests/prune-config-test @@ -1,10 +1,15 @@ #!/bin/sh # -# This script will test prune algo +# This script will test prune algo # + +echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" +echo " This test is will fail because of the workaround for the bug #5507" +echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + . scripts/functions -TestName="prune-test" +TestName="prune-config-test" JobName=NightlySave scripts/cleanup @@ -25,7 +30,7 @@ $bperl -e 'print get_resource("$conf/bacula-dir.conf", "Job", "NightlySave")' | cat $tmp/1 >> $conf/bacula-dir.conf cat < ${cwd}/tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out $tmp/log1.out label storage=File volume=TestVolume001 diff --git a/regress/tests/prune-copy-test b/regress/tests/prune-copy-test index b3a6e5ae0f..fe0f3bc444 100755 --- a/regress/tests/prune-copy-test +++ b/regress/tests/prune-copy-test @@ -31,7 +31,7 @@ start_test # Write out bconsole commands cat <${cwd}/tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out ${cwd}/tmp/log1.out label storage=File volume=FileVolume001 Pool=Default diff --git a/regress/tests/prune-migration-test b/regress/tests/prune-migration-test index e2150116cb..0d9d2f41c3 100755 --- a/regress/tests/prune-migration-test +++ b/regress/tests/prune-migration-test @@ -30,10 +30,10 @@ start_test # Write out bconsole commands cat <${cwd}/tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out ${cwd}/tmp/log1.out -setdebug level=000 storage=File +setdebug level=100 storage=File label storage=File volume=FileVolume001 Pool=Default label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0 @@ -45,6 +45,7 @@ run job=$JobName yes wait list jobs @# should migrate two jobs +setdebug level=150 storage=File run job=migrate-job yes run job=migrate-job yes wait diff --git a/regress/tests/prune-test b/regress/tests/prune-test index 308484fd25..27a58b1df0 100755 --- a/regress/tests/prune-test +++ b/regress/tests/prune-test @@ -19,7 +19,7 @@ $bperl -e 'add_attribute("$conf/bacula-dir.conf", "AutoPrune", "No", "Client")' $bperl -e 'add_attribute("$conf/bacula-dir.conf", "Job Retention", "1s", "Client")' cat < ${cwd}/tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out $tmp/log1.out label storage=File volume=TestVolume001 diff --git a/regress/tests/source-addr-test b/regress/tests/source-addr-test index 227007d21c..800c5b813e 100755 --- a/regress/tests/source-addr-test +++ b/regress/tests/source-addr-test @@ -25,12 +25,14 @@ PATH=$PATH:/sbin:/usr/sbin # the interface defined by INTERFACE= # os=`uname` +INTERFACE=lo if [ $os = 'FreeBSD' ]; then INTERFACE=bge0 IP=`ifconfig ${INTERFACE} | perl -ne '/inet (.+?) / && print $1'` elif [ $os = 'Linux' ]; then - INTERFACE=eth0 - IP=`ifconfig ${INTERFACE} | perl -ne '/inet addr:(.+?) / && print $1'` +# INTERFACE=eth0 + INTERFACE=lo + IP=`ifconfig ${INTERFACE} | perl -ne '/inet (addr:)?(.+?) / && print $2'` fi if [ "$IP" = '' ]; then @@ -40,7 +42,7 @@ fi outf="tmp/sed_tmp" echo "s/PidDirectory/DirSourceAddress=$IP; PidDirectory/g" > $outf -echo "s/Address =/Address = 127.0.0.1 #/g" >> $outf +echo "s/Address =/Address = \"127.0.0.1\" #/g" >> $outf cp $scripts/bacula-dir.conf $tmp/1 sed -f ${outf} ${cwd}/tmp/1 > $scripts/bacula-dir.conf @@ -57,11 +59,12 @@ change_jobname BackupClient1 $JobName start_test cat <${cwd}/tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out ${cwd}/tmp/log1.out -@#label volume=TestVolume001 storage=File pool=File -@#setdebug level=100 storage=File +@#label volume=TestVolume001 storage=File1 pool=File slot=1 drive=0 +@#setdebug level=100 storage=File1 +setbandwidth client limit=1000 run job=$JobName yes @sleep 3 messages @@ -72,14 +75,14 @@ run_bacula sleep 5 print_debug "Detecting connections to SD sourced from ${IP}" -netstat -tan | grep -E "127.0.0.1(.|:)$SDPORT .* ${IP}" > $tmp/log3.out +netstat -tan | grep -E "127\.0\.0\.1(.|:)$SDPORT .* ${IP}" > $tmp/log3.out if [ $? -ne 0 ]; then stat=2 print_debug "Couldn't detect a connection to the SD sourced from SourceAddress ${IP}" fi print_debug "and connections to FD sourced from ${IP}" -netstat -tan | grep -E "127.0.0.1(.|:)$FDPORT .* ${IP}" >> $tmp/log3.out +netstat -tan | grep -E "127\.0\.0\.1(.|:)$FDPORT .* ${IP}" >> $tmp/log3.out if [ $? -ne 0 ]; then stat=2 print_debug "Couldn't detect a connection to the FD sourced from SourceAddress ${IP}" @@ -94,11 +97,8 @@ if [ "$debug" = 1 ] ; then fi cat <${cwd}/tmp/bconcmds -@$out /dev/null -messages -@$out ${cwd}/tmp/log1.out -label volume=TestVolume001 storage=File pool=File -@#setdebug level=100 storage=File +@output /dev/null +setbandwidth client limit=1000000 wait messages @# @@ -113,7 +113,7 @@ quit END_OF_DATA run_bconsole -check_for_zombie_jobs storage=File +check_for_zombie_jobs storage=File1 stop_bacula check_two_logs check_restore_diff diff --git a/regress/tests/stats-test b/regress/tests/stats-test index a7e97cf264..51b6c3192d 100755 --- a/regress/tests/stats-test +++ b/regress/tests/stats-test @@ -23,10 +23,10 @@ change_jobname BackupClient1 $JobName start_test cat <${cwd}/tmp/bconcmds -@$out /dev/null +@output /dev/null messages @$out ${cwd}/tmp/log1.out -label volume=TestVolume001 storage=File pool=File +label volume=TestVolume001 storage=File1 pool=File slot=1 drive=0 run job=$JobName yes wait messages @@ -58,7 +58,7 @@ dstat=0 rstat=0 bstat=0 -check_for_zombie_jobs storage=File +check_for_zombie_jobs storage=File1 stop_bacula diff --git a/regress/tests/tls-duplicate-job-test b/regress/tests/tls-duplicate-job-test index 4161f8f18c..3b1f9322c7 100755 --- a/regress/tests/tls-duplicate-job-test +++ b/regress/tests/tls-duplicate-job-test @@ -1,7 +1,7 @@ #!/bin/sh # # -TestName="duplicate-job-test" +TestName="tls-duplicate-job-test" . scripts/functions scripts/cleanup -- 2.39.5