From: Kern Sibbald Date: Wed, 2 Apr 2008 13:52:49 +0000 (+0000) Subject: Update tests X-Git-Tag: Release-3.0.0~1622 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8a60cb2f62a9e84c15b372177d3f4adad14ba411;p=bacula%2Fbacula Update tests git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6724 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/regress/do_all_tests b/regress/do_all_tests index 15a5b13fc1..3603bdbcc1 100755 --- a/regress/do_all_tests +++ b/regress/do_all_tests @@ -9,8 +9,8 @@ echo " " >>test.out echo "Test results" >>test.out echo " " >>test.out ./starttime -nice ./all-non-root-tests -nice ./all-non-root-tape-tests +nice ./all-disk-tests +nice ./all-tape-tests nice ./all-changer-tests echo " " echo "End do_all tests" diff --git a/regress/scripts/cleanup-2drive.in b/regress/scripts/cleanup-2drive.in index 32b27c019e..a4ff193dd8 100755 --- a/regress/scripts/cleanup-2drive.in +++ b/regress/scripts/cleanup-2drive.in @@ -20,25 +20,25 @@ if test x@autochanger@ != x/dev/null; then slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive1@ 1` - if test x$slot != x2; then - echo "load slot 2 in drive 1" - bin/mtx-changer @autochanger@ load 2 @tape_drive1@ 1 + if test x$slot != x$SLOT2; then + echo "load slot $SLOT2 in drive 1" + bin/mtx-changer @autochanger@ load $SLOT2 @tape_drive1@ 1 fi echo "WEOF drive 1" mt -f @tape_drive1@ rewind mt -f @tape_drive1@ weof - echo "unload slot 2 in drive 1" - bin/mtx-changer @autochanger@ unload 2 @tape_drive1@ 1 + echo "unload slot $SLOT2 in drive 1" + bin/mtx-changer @autochanger@ unload $SLOT2 @tape_drive1@ 1 slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive@ 0` echo "Slot $slot in drive 0" - if test x$slot != x1; then - echo "load slot 1 in drive 0" - bin/mtx-changer @autochanger@ load 1 @tape_drive@ 0 + if test x$slot != x$SLOT1; then + echo "load slot $SLOT1 in drive 0" + bin/mtx-changer @autochanger@ load $SLOT1 @tape_drive@ 0 fi echo "WEOF drive 0" mt -f @tape_drive@ rewind mt -f @tape_drive@ weof - echo "unload slot 1 from drive 0" - bin/mtx-changer @autochanger@ unload 1 @tape_drive@ 0 + echo "unload slot $SLOT1 from drive 0" + bin/mtx-changer @autochanger@ unload $SLOT1 @tape_drive@ 0 fi diff --git a/regress/scripts/cleanup-2tape.in b/regress/scripts/cleanup-2tape.in index 0f33ec95c7..28eea0b593 100755 --- a/regress/scripts/cleanup-2tape.in +++ b/regress/scripts/cleanup-2tape.in @@ -2,13 +2,16 @@ # # Cleanup left over files -- both before and after test run # + +. scripts/functions + scripts/cleanup if test x@autochanger@ != x/dev/null; then - drive=`bin/mtx-changer @autochanger@ loaded 0 dummy 0` - if test x${drive} != x2; then - bin/mtx-changer @autochanger@ unload 0 @tape_drive@ 0 - bin/mtx-changer @autochanger@ load 2 @tape_drive@ 0 + slot=`bin/mtx-changer @autochanger@ loaded 0 dummy $DRIVE1` + if test "x${slot}" != "x$SLOT2"; then + bin/mtx-changer @autochanger@ unload $slot @tape_drive@ $DRIVE1 + bin/mtx-changer @autochanger@ load $SLOT2 @tape_drive@ $DRIVE1 fi mt -f @tape_drive@ rewind mt -f @tape_drive@ weof @@ -19,10 +22,10 @@ fi # If we have an autochanger always load tape in slot 1 # if test x@autochanger@ != x/dev/null; then - drive=`bin/mtx-changer @autochanger@ loaded 0 dummy 0` - if test x${drive} != x1; then - bin/mtx-changer @autochanger@ unload 0 @tape_drive@ 0 - bin/mtx-changer @autochanger@ load 1 @tape_drive@ 0 + slot=`bin/mtx-changer @autochanger@ loaded 0 dummy $DRIVE1` + if test "x${slot}" != "x$SLOT1"; then + bin/mtx-changer @autochanger@ unload $slot @tape_drive@ $DRIVE1 + bin/mtx-changer @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1 fi fi diff --git a/regress/scripts/new-test-bacula-dir.conf.in b/regress/scripts/new-test-bacula-dir.conf.in index ab0fcfd646..8910c0d30e 100644 --- a/regress/scripts/new-test-bacula-dir.conf.in +++ b/regress/scripts/new-test-bacula-dir.conf.in @@ -51,6 +51,19 @@ Job { Write Bootstrap = "@working_dir@/NightlySave.bsr" } +Job { + Name = "MonsterFileSet" + Type = Backup + Client=@hostname@-fd + FileSet="MonsterFileSet" + Storage = File + Messages = Standard + Pool = Default + Maximum Concurrent Jobs = 4 + Write Bootstrap = "@working_dir@/NightlySave.bsr" +} + + Job { Name = "VerifyVolume" @@ -224,6 +237,109 @@ FileSet { } } +FileSet { + Name = "MonsterFileSet" + Include { + Options { + signature = MD5 + noatime = yes + ignore case = yes + Exclude = yes + RegexDir = "Cache" + RegexDir = "Windows Defender" + RegexDir = "Temporary Internet Files" + RegexDir = "bacula" + RegexDir = "Temp" + + RegexDir = "ATI Technologies" + + RegexDir = "wmdownloads" + RegexDir = "My Music" + RegexDir = "iTunes" + RegexDir = "Cookies" + + RegexFile = "desktop.ini" + RegexFile = "thumbs.db" + RegexFile = "acrobat7.exe" + RegexFile = "acr6win.exe" + RegexFile = "AdbeRdr70_enu_full.exe" + RegexFile = "antivirus10_1_5.exe" + #thunderbird lock file + RegexFile = "parent.lock" + + RegexDir = "Retrospect Restore Points" + + #exclude i386 director of windows installer files + WildDir = "[A-Z]:/i386" + + # Exclude Mozilla-based programs' file caches + WildDir = "[A-Z]:/Documents and Settings/*/Application Data/*/Profiles/*/*/ImapMail" + WildDir = "[A-Z]:/Users/*/Application Data/*/Profiles/*/*/ImapMail" + + # Exclude user's registry files - they're always in use anyway. + WildFile = "[A-Z]:/Documents and Settings/*/Local Settings/Application Data/Microsoft/Windows/usrclass.*" + WildFile = "[A-Z]:/Users/*/Local Settings/Application Data/Microsoft/Windows/usrclass.*" + WildFile = "[A-Z]:/Documents and Settings/*/ntuser.*" + WildFile = "[A-Z]:/Users/*/ntuser.*" + + WildDir = "[A-Z]:/Documents and Settings/*/Recent" + WildDir = "[A-Z]:/Users/*/Recent" + + WildDir = "[A-Z]:/Documents and Settings/*/Local Settings/History" + WildDir = "[A-Z]:/Users/*/Local Settings/History" + + # These are always open and unable to be backed up + WildFile = "[A-Z]:/Documents and Settings/All Users/Application Data/Microsoft/Network/Downloader/qmgr[01].dat" + WildFile = "[A-Z]:/Users/All Users/Application Data/Microsoft/Network/Downloader/qmgr[01].dat" + + #Exclude all of Windows... + WildDir = "[A-Z]:/windows" + WildDir = "[A-Z]:/winnt" + WildDir = "[A-Z]:/winxp" + WildDir = "[A-Z]:/win" + + #symantec antivirus app stuff + WildDir = "[A-Z]:/*/Symantec*" + + #system volume information + WildDir = "[A-Z]:/System Volume Information" + + WildFile = "*.tmp" + # ghost image and spanning files + WildFile = "*.gho" + WildFile = "*.ghs" + + # Recycle bins + WildDir = "[A-Z]:/RECYCLER" + WildDir = "[A-Z]:/RECYCLER" + WildDir = "[A-Z]:/RECYCLED" + WildDir = "[A-Z]:/$RECYCLE.BIN" + + # Swap files + WildFile = "[A-Z]:/pagefile.sys" + + # These are programs and are easier to reinstall than restore from + # backup + WildDir = "[A-Z]:/cygwin" + WildDir = "[A-Z]:/Program Files/Adobe/Acrobat 7.0" + WildDir = "[A-Z]:/Program Files/Adobe/Acrobat 8.0" + + WildDir = "[A-Z]:/Program Files/Common Files/Software Center" + WildDir = "[A-Z]:/Software Center" + + WildDir = "[A-Z]:/Program Files/Grisoft" + WildDir = "[A-Z]:/Program Files/Java" + WildDir = "[A-Z]:/Program Files/Java Web Start" + WildDir = "[A-Z]:/Program Files/JavaSoft" + WildDir = "[A-Z]:/Program Files/Microsoft Office" + WildDir = "[A-Z]:/Program Files/Mozilla Firefox" + WildDir = "[A-Z]:/Program Files/Mozilla Thunderbird" + WildDir = "[A-Z]:/Program Files/mozilla.org" + WildDir = "[A-Z]:/Program Files/OpenOffice*" + } + File = <@tmpdir@/file-list + } +} # diff --git a/regress/scripts/prepare-two-tapes.in b/regress/scripts/prepare-two-tapes.in index 3be1775df1..28eea0b593 100755 --- a/regress/scripts/prepare-two-tapes.in +++ b/regress/scripts/prepare-two-tapes.in @@ -1,56 +1,33 @@ #!/bin/sh # -# Create two blank tapes +# Cleanup left over files -- both before and after test run # -# mt status output -# SunOS No Additional Sense -# FreeBSD Current Driver State: at rest. -# Linux ONLINE -# Note Debian has an inferior mt. When no tape is in the -# drive it waits 2 minutes. When a tape is in the drive, it -# prints user unfriendly output. -# +. scripts/functions + +scripts/cleanup -OS=`uname` -case ${OS} in - SunOS) - ready="No Additional Sense" - ;; - FreeBSD) - ready="Current Driver State: at rest." - ;; - Linux) - if test -e /etc/debian_version ; then - ready="drive status" - else - ready="ONLINE" - fi - ;; -esac +if test x@autochanger@ != x/dev/null; then + slot=`bin/mtx-changer @autochanger@ loaded 0 dummy $DRIVE1` + if test "x${slot}" != "x$SLOT2"; then + bin/mtx-changer @autochanger@ unload $slot @tape_drive@ $DRIVE1 + bin/mtx-changer @autochanger@ load $SLOT2 @tape_drive@ $DRIVE1 + fi + mt -f @tape_drive@ rewind + mt -f @tape_drive@ weof +fi -wait_for_drive() { - i=0 - while [ $i -le 300 ]; do # Wait max 300 seconds - if mt -f $1 status 2>&1 | grep "${ready}" >/dev/null 2>&1; then - break - fi -# debug "Device $1 - not ready, retrying..." - sleep 1 - i=`expr $i + 1` - done -} # -# mt -f @tape_drive@ offline -@changer_path@ -f @autochanger@ unload -@changer_path@ -f @autochanger@ load 1 -wait_for_drive @tape_drive@ -mt -f @tape_drive@ rewind -mt -f @tape_drive@ weof -@changer_path@ -f @autochanger@ unload -@changer_path@ -f @autochanger@ load 2 -wait_for_drive @tape_drive@ +# If we have an autochanger always load tape in slot 1 +# +if test x@autochanger@ != x/dev/null; then + slot=`bin/mtx-changer @autochanger@ loaded 0 dummy $DRIVE1` + if test "x${slot}" != "x$SLOT1"; then + bin/mtx-changer @autochanger@ unload $slot @tape_drive@ $DRIVE1 + bin/mtx-changer @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1 + fi +fi + mt -f @tape_drive@ rewind mt -f @tape_drive@ weof -#@changer_path@ -f @autochanger@ unload diff --git a/regress/tests/bsr-opt-test b/regress/tests/bsr-opt-test index 9413a8c081..6874e5f7cc 100755 --- a/regress/tests/bsr-opt-test +++ b/regress/tests/bsr-opt-test @@ -73,6 +73,7 @@ if [ $? != 0 -o $bsrstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then echo " !!!!! Restored files differ !!!!! " >>test.out fi echo " " + exit 1 else echo " ===== bsr-opt-test Bacula source OK `date +%R:%S` ===== " echo " ===== bsr-opt-test OK `date +%R:%S` ===== " >>test.out