Files
kopia/internal/blobtesting/object_locking_map_test.go
Shikhar Mall b592776edf feat(repository): persistence for blob-retention configuration (#1596)
* feat: persisting retention options in repository blob

 - plumb retention parameters through wrapped storage
 - generalize aes encryption mechanism
 - rewrite the retention blob on password change
 - do not write retention blob when empty

* handle retention-blob not-found failures

* cli params to set retention modes on repository create

* enable versioned map mock storage with retention settings

* adding unit tests

* write format and retention blob with retention settings if available

* rename certain functions and constants specific to format blob

* delete retention cache on password-change

* fix: replace SetTime() api call with TouchBlob()

* Update repo/repository_test.go

Co-authored-by: Nick <nick@kasten.io>

* pr feedback and codecov improvements

* fix: rename retention-blob structures to generic blob-cfg

* fix: remove minio dependency on retention constants

Co-authored-by: Shikhar Mall <shikhar@kasten.io>
Co-authored-by: Nick <nick@kasten.io>
2022-01-22 08:37:00 -08:00

22 lines
413 B
Go

package blobtesting
import (
"testing"
"time"
"github.com/kopia/kopia/internal/testlogging"
"github.com/kopia/kopia/repo/blob"
)
func TestObjectLockingStorage(t *testing.T) {
r := NewVersionedMapStorage(nil)
if r == nil {
t.Errorf("unexpected result: %v", r)
}
VerifyStorage(testlogging.Context(t), t, r, blob.PutOptions{
RetentionMode: blob.Governance,
RetentionPeriod: 24 * time.Hour,
})
}