s3: implement Purge to purge versions and backend cleanup-hidden

This commit is contained in:
Nick Craig-Wood 2022-07-26 15:03:32 +01:00
parent 0ae171416f
commit 81d242473a
3 changed files with 129 additions and 0 deletions

View file

@ -158,6 +158,20 @@ func (f *Fs) InternalTestVersions(t *testing.T) {
assert.Equal(t, int64(100), o.Size(), o.Remote())
})
})
t.Run("Cleanup", func(t *testing.T) {
require.NoError(t, f.CleanUpHidden(ctx))
items := append([]fstest.Item{newItem}, fstests.InternalTestFiles...)
fstest.CheckListing(t, f, items)
// Set --s3-versions for this test
f.opt.Versions = true
defer func() {
f.opt.Versions = false
}()
fstest.CheckListing(t, f, items)
})
// Purge gets tested later
}
func (f *Fs) InternalTest(t *testing.T) {