From: Eric Bollengier Date: Wed, 4 May 2022 08:12:04 +0000 (+0200) Subject: regress: Fix tests for freebsd X-Git-Tag: Release-13.0.0~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=180f03f967859cb91cd1cf86cb72359aa21970df;p=thirdparty%2Fbacula.git regress: Fix tests for freebsd --- diff --git a/regress/tests/accurate-only-meta-test b/regress/tests/accurate-only-meta-test index 5d51a66e7..de71387bc 100755 --- a/regress/tests/accurate-only-meta-test +++ b/regress/tests/accurate-only-meta-test @@ -63,7 +63,7 @@ files_count=`find ${cwd}/build -type f | wc -l` find ${cwd}/build -type f -exec touch {} + > /dev/null # Change some properties of testfile chmod 740 ${cwd}/build/testfile -perm_after=`stat -c %a ${cwd}/build/testfile` +perm_after=`$bperl -e "get_perm('${cwd}/build/testfile')"` # Run backup for the second time, this time we expect that only metadata part for each file will be # backed up, so we expect the backup size to be much smaller than the first one. @@ -90,7 +90,7 @@ if [ ${backup_files} -ne ${files_count} ]; then fi # Check if testfile's restored permission are correctly changed -perm_restored=`stat -c %a ${cwd}/tmp/bacula-restores/${cwd}/build/testfile` +perm_restored=`$bperl -e "get_perm('${cwd}/tmp/bacula-restores/${cwd}/build/testfile')"` if [ ${perm_after} -ne ${perm_restored} ]; then estat=1 print_debug "Wrong permissions restored: ${perm_restored}, expected: ${perm_after}" diff --git a/regress/tests/verify-cat-test b/regress/tests/verify-cat-test index dfb3dac84..6adb6c3be 100755 --- a/regress/tests/verify-cat-test +++ b/regress/tests/verify-cat-test @@ -74,8 +74,11 @@ rstat=$? dstat=0 # Turn off verbose file listing, rerun verify jobs and check if files are not listed as expected -sed -i '/console =*/ s/$/, !verified/g' bin/bacula-dir.conf | grep verified -sed -i '/director =*/ s/$/, !verified/g' bin/bacula-fd.conf | grep verified +sed '/console =*/ s/$/, !verified/g' $conf/bacula-dir.conf > $tmp/1 +mv $tmp/1 $conf/bacula-dir.conf + +sed '/director =*/ s/$/, !verified/g' $conf/bacula-fd.conf > $tmp/1 +mv $tmp/1 $conf/bacula-fd.conf cat <tmp/bconcmds @output /dev/null diff --git a/regress/tests/verify-data-test b/regress/tests/verify-data-test index 83e05b076..410ba4eac 100755 --- a/regress/tests/verify-data-test +++ b/regress/tests/verify-data-test @@ -49,7 +49,7 @@ messages @# now do a verify volume @# @$out ${cwd}/tmp/log2.out -setdebug level=10 client +setdebug level=10 client trace=1 run job=VerifyData jobid=1 yes run job=VerifyData jobid=2 yes run job=VerifyData jobid=3 yes @@ -98,9 +98,11 @@ nbok=2 if [ x$FORCE_DEDUP = xyes -o x$FORCE_CLOUD = xyes ]; then nbok=6 elif [ x$FORCE_ALIGNED = xyes ]; then - sed -i 's/DUALCASE/PUALCASE/g' $tmp/TestVolume001.add + sed 's/DUALCASE/PUALCASE/g' $tmp/TestVolume001.add > $tmp/1 + mv $tmp/1 $tmp/TestVolume001.add else - sed -i 's/DUALCASE/PUALCASE/g' $tmp/TestVolume001 + sed 's/DUALCASE/PUALCASE/g' $tmp/TestVolume001 > $tmp/1 + mv $tmp/1 $tmp/TestVolume001 fi cat <tmp/bconcmds @@ -128,8 +130,11 @@ check_for_zombie_jobs storage=File stop_bacula # Turn off verbose file listing, rerun verify jobs and check if files are not listed as expected -sed -i '/console =*/ s/$/, !verified/g' bin/bacula-dir.conf | grep verified -sed -i '/director =*/ s/$/, !verified/g' bin/bacula-fd.conf | grep verified +sed '/console =*/ s/$/, !verified/g' $conf/bacula-dir.conf > $tmp/1 +mv $tmp/1 $conf/bacula-dir.conf + +sed '/director =*/ s/$/, !verified/g' $conf/bacula-fd.conf > $tmp/1 +mv $tmp/1 $conf/bacula-fd.conf cat <tmp/bconcmds @output /dev/null diff --git a/regress/tests/verify-vol-test b/regress/tests/verify-vol-test index 99e7e0a40..55a14d9af 100755 --- a/regress/tests/verify-vol-test +++ b/regress/tests/verify-vol-test @@ -111,8 +111,11 @@ fi dstat=0 # Turn off verbose file listing, rerun verify jobs and check if files are not listed as expected -sed -i '/console =*/ s/$/, !verified/g' bin/bacula-dir.conf | grep verified -sed -i '/director =*/ s/$/, !verified/g' bin/bacula-fd.conf | grep verified +sed '/console =*/ s/$/, !verified/g' $conf/bacula-dir.conf > $tmp/1 +mv $tmp/1 $conf/bacula-dir.conf + +sed '/director =*/ s/$/, !verified/g' $conf/bacula-fd.conf > $tmp/1 +mv $tmp/1 $conf/bacula-fd.conf cat <tmp/bconcmds @output /dev/null