From d3bcd3fb4a48ac0b80b7938e6d1e059208b60ff2 Mon Sep 17 00:00:00 2001 From: Kenneth Hsu Date: Mon, 30 Dec 2019 16:31:33 -0800 Subject: [PATCH] Add test for listing filesets without local database. This test would have failed prior to the changes in revision 8ab64071f0 ("Display correct backup type when using direct restore"). Prior to revision 8ab64071f0, all filesets would have been marked as partial when performing a direct restore without the local database. This concerns issue #3982. --- Duplicati/UnitTest/DisruptionTests.cs | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Duplicati/UnitTest/DisruptionTests.cs b/Duplicati/UnitTest/DisruptionTests.cs index 9c4ee58cf..854410c8b 100644 --- a/Duplicati/UnitTest/DisruptionTests.cs +++ b/Duplicati/UnitTest/DisruptionTests.cs @@ -193,6 +193,35 @@ namespace Duplicati.UnitTest } } + [Test] + [Category("Disruption")] + public async Task ListWithoutLocalDb() + { + // Choose a dblock size that is small enough so that more than one volume is needed. + Dictionary options = new Dictionary(this.TestOptions) + { + ["dblock-size"] = "10mb", + ["no-local-db"] = "true" + }; + + // Run a full backup. + using (Controller c = new Controller("file://" + this.TARGETFOLDER, options, null)) + { + c.Backup(new[] {this.DATAFOLDER}); + } + + // Run a partial backup. + using (Controller c = new Controller("file://" + this.TARGETFOLDER, options, null)) + { + await this.RunPartialBackup(c).ConfigureAwait(false); + + List filesets = c.List().Filesets.ToList(); + Assert.AreEqual(2, filesets.Count); + Assert.AreEqual(BackupType.FULL_BACKUP, filesets[1].IsFullBackup); + Assert.AreEqual(BackupType.PARTIAL_BACKUP, filesets[0].IsFullBackup); + } + } + [Test] [Category("Disruption")] public async Task RetentionPolicyRetention()