]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: Fix tests for freebsd
authorEric Bollengier <eric@baculasystems.com>
Wed, 4 May 2022 08:12:04 +0000 (10:12 +0200)
committerEric Bollengier <eric@baculasystems.com>
Wed, 4 May 2022 08:37:22 +0000 (10:37 +0200)
regress/tests/accurate-only-meta-test
regress/tests/verify-cat-test
regress/tests/verify-data-test
regress/tests/verify-vol-test

index 5d51a66e747b5e4389fc2d0a66027863a4cfc354..de71387bc56d2f0bb6c731768dd1c8bf1903d81d 100755 (executable)
@@ -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}"
index dfb3dac84647c5da1fe82636f8a3afcbbe957bbb..6adb6c3be2d373ec96cb35c94456e55c204d4a41 100755 (executable)
@@ -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 <<END_OF_DATA >tmp/bconcmds
 @output /dev/null
index 83e05b07608c3d9a6439b2d053c055aeab014cd6..410ba4eaccc2141acdc24be12b6ae7a2492da0d9 100755 (executable)
@@ -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 <<END_OF_DATA >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 <<END_OF_DATA >tmp/bconcmds
 @output /dev/null
index 99e7e0a403487f0e84f356621505b057b281404f..55a14d9af75679fcb76c5d638e24119fd3a11fee 100755 (executable)
@@ -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 <<END_OF_DATA >tmp/bconcmds
 @output /dev/null