test for journalling and journal replay.

This commit is contained in:
Oswald Buddenhagen 2006-01-29 15:48:24 +00:00
parent 9c6c158ef3
commit 635b2d7b76

View File

@ -259,10 +259,33 @@ Slave :slave:
SyncState * SyncState *
".shift(); ".shift();
close FILE; close FILE;
open FILE, "../mbsync -D -c .mbsyncrc test 2>&1 |"; open FILE, "../mbsync -D -J -c .mbsyncrc test 2>&1 |";
my @out = <FILE>; my @out = <FILE>;
close FILE; close FILE;
open(FILE, "<", "slave/.mbsyncstate") or
die "Cannot read old sync state.\n";
my @oss = <FILE>;
close FILE;
open(FILE, "<", "slave/.mbsyncstate.journal") or
die "Cannot read journal.\n";
my @nj = <FILE>;
close FILE;
open(FILE, "<", "slave/.mbsyncstate.new") or
die "Cannot read new sync state.\n";
my @nss = <FILE>;
close FILE;
open FILE, "../mbsync -D -c .mbsyncrc --noop test 2>&1 |";
my @jout = <FILE>;
close FILE;
open(FILE, "<", "slave/.mbsyncstate") or
die "Cannot read sync state.\n";
my @jss = <FILE>;
close FILE;
unlink ".mbsyncrc"; unlink ".mbsyncrc";
if ("@nss" ne "@jss") {
print "Journalling error.\nOld State:\n".join("", @oss)."\nJournal:\n".join("", @nj)."\nNew State:\n".join("", @jss)."\nExpected New State:\n".join("", @nss)."\n";
exit 1;
}
return @out; return @out;
} }