From: Graham K. <gr...@eq...> - 2008-08-28 11:41:59
|
On Wed, Aug 27, 2008 at 07:28:08PM +0200, Kern Sibbald wrote: > On Tuesday 26 August 2008 12:40:29 Graham Keeling wrote: > > I wonder - if you try the virtual-backup-test (with my patch from my last > > email) on your setup, does the test pass or succeed? > > No, I didn't try it because the patch guarantees that the test will fail. If > you backup a file in the build directory then delete it before the restore, > you are *guaranteed* that the test will fail. The build directory is sort of > the base, and the results of the restore are compared to it, so when you > delete something from the build directory, you can be sure the test won't > work. OK, sorry, I misunderstood what 'check_restore_diff' was doing. I thought that it was comparing the two restores, whereas it is actually comparing the restore after the VirtualFull with the original directory. So, I moved my 'rm' command to immediately before 'end_test' at the end of the script and tried again. I also made 'check_restore_diff' in scripts/functions print the output of the diff. Here is what I get... > invader regress # ./tests/virtual-backup-test > > > === Starting virtual-backup-test at 11:50:12 === > > diff -r build/date tmp/bacula-restores/home/graham/bacula/regress/build/date > 1c1 > < Thu Aug 28 11:50:41 BST 2008 > --- > > Thu Aug 28 11:50:15 BST 2008 > > > !!!!! virtual-backup-test failed!!! 11:51:31 !!!!! > !!!!! Restored files differ !!!!! > Status: backup=0 restore=0 diff=1 I then commented out the second restore in the test script and ran it again, so that the diff was being run on the original directory and the restore before the Virtual Backup: > invader regress # ./tests/virtual-backup-test > > > === Starting virtual-backup-test at 12:18:50 === > > ===== virtual-backup-test OK 12:19:57 ===== On Wed, Aug 27, 2008 at 07:28:08PM +0200, Kern Sibbald wrote: > It could potentially work if Accurate is turned on, but the > virtual-backup-test script does not have Accurate turned on, I tried the above test with and without 'Accurate = yes' added to all of the 'Job' sections in scripts/bacula-dir-migration.conf. The result was the same in both cases. > but the current test is only meant to test Virtual Backup ... Unless I am failing to understand what Virtual Backup is meant to do, my adjustments to the current test shows that it doesn't work. I would expect my 'date' file in the original directory, and after each of the two restores, to all be identical. I would expect this with either Accurate turned on or off, as the 'date' file is present at the beginning of the test, before the first Full backup. They are not identical. The current test (without my adjustments) is 'touch'ing files in the build directory between backups, which only adjusts the timestamps. The command that you are using to then check that the restores are the same is 'diff -r', which doesn't compare the timestamps. It compares whether the contents of the files actually are different or not. So, I would suggest that the current test is broken (or at the very least, not testing what I want it to test), as it cannot tell whether the Virtual Backup has included the Differentials and Incrementals. |