From: Kern Sibbald Date: Thu, 17 Sep 2009 12:14:47 +0000 (+0200) Subject: Change regression scripts to use mkdir -p to avoid spurious errors X-Git-Tag: Release-5.0.0~300^2~10 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ef27b1e0d3ffd5348e60bf0d96cf062200020d06;p=bacula%2Fbacula Change regression scripts to use mkdir -p to avoid spurious errors --- diff --git a/regress/tests/2drive-incremental-2disk b/regress/tests/2drive-incremental-2disk index 2a6ff418f5..504bd06e41 100755 --- a/regress/tests/2drive-incremental-2disk +++ b/regress/tests/2drive-incremental-2disk @@ -19,7 +19,7 @@ start_test echo "${cwd}/tmp/build" >${cwd}/tmp/file-list if test ! -d ${cwd}/tmp/build ; then - mkdir ${cwd}/tmp/build + mkdir -p ${cwd}/tmp/build fi cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build cd ${cwd}/tmp diff --git a/regress/tests/2drive-incremental-changer b/regress/tests/2drive-incremental-changer index 9e38d0faf8..681aecea13 100755 --- a/regress/tests/2drive-incremental-changer +++ b/regress/tests/2drive-incremental-changer @@ -20,7 +20,7 @@ change_jobname localhost-fd $JobName echo "${cwd}/tmp/build" >${cwd}/tmp/file-list if test ! -d ${cwd}/tmp/build ; then - mkdir ${cwd}/tmp/build + mkdir -p ${cwd}/tmp/build fi cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build cd ${cwd}/tmp diff --git a/regress/tests/accurate-test b/regress/tests/accurate-test index 001d1106d5..f4fbdbde46 100755 --- a/regress/tests/accurate-test +++ b/regress/tests/accurate-test @@ -33,8 +33,8 @@ rm -rf ${cwd}/build/accurate # add extra files -mkdir ${cwd}/build/accurate -mkdir ${cwd}/build/accurate/dirtest +mkdir -p ${cwd}/build/accurate +mkdir -p ${cwd}/build/accurate/dirtest echo "test test" > ${cwd}/build/accurate/dirtest/hello echo "test test" > ${cwd}/build/accurate/xxx echo "test test" > ${cwd}/build/accurate/yyy diff --git a/regress/tests/acl-xattr-test b/regress/tests/acl-xattr-test index 162238f382..70c73d5f12 100755 --- a/regress/tests/acl-xattr-test +++ b/regress/tests/acl-xattr-test @@ -60,8 +60,8 @@ d=${cwd}/build/acl uid=`id -u` rm -rf $d -mkdir $d -mkdir $d/testdir +mkdir -p $d +mkdir -p $d/testdir cp ${cwd}/bin/bconsole $d case `uname -s` in diff --git a/regress/tests/big-files-test b/regress/tests/big-files-test index 04c543bb40..6daa915bcd 100755 --- a/regress/tests/big-files-test +++ b/regress/tests/big-files-test @@ -16,7 +16,7 @@ copy_test_confs echo "${cwd}/many-files" >${cwd}/tmp/file-list if [ ! -f ${cwd}/many-files/100000file100000 ]; then - mkdir ${cwd}/many-files + mkdir -p ${cwd}/many-files cd ${cwd}/many-files print_debug "Creating files..." time perl -e 'for($i=0; $i < 2000000; $i++) {open(FP, ">${i}file${i}") or die "$!"; print FP "$i\n"; close(FP); print "." if ($i%10000);}' diff --git a/regress/tests/disk-changer-test b/regress/tests/disk-changer-test index b497098e23..b45c687fdd 100755 --- a/regress/tests/disk-changer-test +++ b/regress/tests/disk-changer-test @@ -1,6 +1,6 @@ #!/bin/sh rm -rf tmp/disk-changer -mkdir tmp/disk-changer +mkdir -p tmp/disk-changer touch tmp/disk-changer/conf echo "Unload drive 0" $scripts/disk-changer tmp/disk-changer/conf unload 1 tmp/disk-changer/drive0 0 diff --git a/regress/tests/incremental-2disk b/regress/tests/incremental-2disk index 500d854afc..b4bf8292d0 100755 --- a/regress/tests/incremental-2disk +++ b/regress/tests/incremental-2disk @@ -15,7 +15,7 @@ scripts/prepare-disk-changer echo "${cwd}/tmp/build" >${cwd}/tmp/file-list if test ! -d ${cwd}/tmp/build ; then - mkdir ${cwd}/tmp/build + mkdir -p ${cwd}/tmp/build fi cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build cd ${cwd}/tmp diff --git a/regress/tests/incremental-changer b/regress/tests/incremental-changer index daa324c3a9..6eb5a5b959 100755 --- a/regress/tests/incremental-changer +++ b/regress/tests/incremental-changer @@ -18,7 +18,7 @@ scripts/prepare-two-tapes echo "${cwd}/tmp/build" >${cwd}/tmp/file-list if test ! -d ${cwd}/tmp/build ; then - mkdir ${cwd}/tmp/build + mkdir -p ${cwd}/tmp/build fi cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build cd ${cwd}/tmp diff --git a/regress/tests/incremental-tape b/regress/tests/incremental-tape index 26d62deb43..198834f6e5 100755 --- a/regress/tests/incremental-tape +++ b/regress/tests/incremental-tape @@ -14,7 +14,7 @@ scripts/cleanup-tape echo "${cwd}/tmp/build" >${cwd}/tmp/file-list if test ! -d ${cwd}/tmp/build ; then - mkdir ${cwd}/tmp/build + mkdir -p ${cwd}/tmp/build fi cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build cd ${cwd}/tmp diff --git a/regress/tests/multi-storage-test b/regress/tests/multi-storage-test index 5c13487ce4..da2f17b1d3 100755 --- a/regress/tests/multi-storage-test +++ b/regress/tests/multi-storage-test @@ -18,7 +18,7 @@ if (/WorkingDirectory/) { $_ =~ s/"$/2"/; } print; ' $conf/bacula-sd.conf > $conf/bacula-sd2.conf -mkdir ${working}2 +mkdir -p ${working}2 perl -ne ' if (/^Storage {/) { $in=1; $nb++; } diff --git a/regress/tests/restore-by-file-test b/regress/tests/restore-by-file-test index a01c409a25..18bc7f72c7 100755 --- a/regress/tests/restore-by-file-test +++ b/regress/tests/restore-by-file-test @@ -11,7 +11,7 @@ JobName=restorebyfile scripts/cleanup scripts/copy-test-confs echo "${cwd}/tmp/build" >${cwd}/tmp/file-list -mkdir ${cwd}/tmp/build +mkdir -p ${cwd}/tmp/build cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build cd ${cwd}/tmp/build ls >../1 diff --git a/regress/tests/restore-disk-seek-test b/regress/tests/restore-disk-seek-test index 3f6db5d143..495bb45ca2 100755 --- a/regress/tests/restore-disk-seek-test +++ b/regress/tests/restore-disk-seek-test @@ -14,7 +14,7 @@ scripts/cleanup scripts/copy-test-confs echo "${cwd}/tmp/build" >${cwd}/tmp/file-list rm -rf ${cwd}/tmp/build -mkdir ${cwd}/tmp/build +mkdir -p ${cwd}/tmp/build # Copy only the .c files (to be restored) # set files to "*.c" for all c files files="ua_tree.c ua_update.c" @@ -36,7 +36,7 @@ cd ${cwd} # Now arrange to backup *everything* # rm -rf ${cwd}/tmp/build -mkdir ${cwd}/tmp/build +mkdir -p ${cwd}/tmp/build cp -fp ${cwd}/build/src/dird/* ${cwd}/tmp/build # # Enable MaximumFileSize to ensure lots of JobMedia records and thus @@ -82,7 +82,7 @@ stop_bacula # Now setup a control directory of only what we *should* restore rm -rf ${cwd}/tmp/build -mkdir ${cwd}/tmp/build +mkdir -p ${cwd}/tmp/build for i in ${files}; do cp -p ${cwd}/build/src/dird/${i} ${cwd}/tmp/build done diff --git a/regress/tests/restore-seek-tape b/regress/tests/restore-seek-tape index f543caab4b..53bf6de6d2 100755 --- a/regress/tests/restore-seek-tape +++ b/regress/tests/restore-seek-tape @@ -17,7 +17,7 @@ scripts/cleanup-tape echo "${cwd}/tmp/build" >${cwd}/tmp/file-list rm -rf ${cwd}/tmp/build -mkdir ${cwd}/tmp/build +mkdir -p ${cwd}/tmp/build # Copy only the .c files (to be restored) # set files to "*.c" for all c files files="ua_tree.c ua_update.c" @@ -39,7 +39,7 @@ cd ${cwd} # Now arrange to backup *everything* # rm -rf ${cwd}/tmp/build -mkdir ${cwd}/tmp/build +mkdir -p ${cwd}/tmp/build cp -fp ${cwd}/build/src/dird/* ${cwd}/tmp/build # # Enable MaximumFileSize to ensure lots of JobMedia records and thus @@ -85,7 +85,7 @@ stop_bacula # Now setup a control directory of only what we *should* restore rm -rf ${cwd}/tmp/build -mkdir ${cwd}/tmp/build +mkdir -p ${cwd}/tmp/build for i in ${files}; do cp -p ${cwd}/build/src/dird/${i} ${cwd}/tmp/build done diff --git a/regress/tests/strip-test b/regress/tests/strip-test index 253cfbdc3f..31a2e33884 100755 --- a/regress/tests/strip-test +++ b/regress/tests/strip-test @@ -12,7 +12,7 @@ scripts/copy-strip-confs # Make a copy of build/src/dird to be backed up rm -rf ${tmp}/$$-strip -mkdir ${tmp}/$$-strip +mkdir -p ${tmp}/$$-strip cp -rpf ${cwd}/build/src/dird/ ${tmp}/$$-strip/ echo "${tmp}/$$-strip" >${cwd}/tmp/file-list