Add test to check for persistent deletes

Deleted file records should persist between versions.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
This commit is contained in:
Matthew Johnson
2018-02-05 12:38:00 -08:00
parent 64e3c26c1d
commit 096e1defac
+22
View File
@@ -464,3 +464,25 @@ func TestCreateManifestsMinVersion(t *testing.T) {
// we can even check that there are NO files left at version 10
checkManifestNotContains(t, testDir, "20", "full", "\t10\t")
}
func TestCreateManifestsPersistDeletes(t *testing.T) {
testDir := mustSetupTestDir(t, "persistDeletes")
defer removeIfNoErrors(t, testDir)
mustInitStandardTest(t, testDir, "0", "10", []string{"test-bundle"})
mustGenFile(t, testDir, "10", "test-bundle", "foo", "foo")
mustCreateManifestsStandard(t, 10, testDir)
mustInitStandardTest(t, testDir, "10", "20", []string{"test-bundle"})
// foo is deleted
mustCreateManifestsStandard(t, 20, testDir)
mustInitStandardTest(t, testDir, "20", "30", []string{"test-bundle"})
// foo is still deleted
// create new file to force manifest creation
mustGenFile(t, testDir, "30", "test-bundle", "bar", "bar")
mustCreateManifestsStandard(t, 30, testDir)
// the old deleted file is still there
re := regexp.MustCompile("\\.d\\.\\.\t.*\t20\t/foo")
checkManifestMatches(t, testDir, "30", "test-bundle", re)
}