From 3f2783f940cd688ac99a1c38ab6f40ce45524642 Mon Sep 17 00:00:00 2001 From: Chris Schinnerl Date: Thu, 19 Dec 2024 16:09:40 +0100 Subject: [PATCH] extend TestUploadPacking --- internal/test/e2e/cluster_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/internal/test/e2e/cluster_test.go b/internal/test/e2e/cluster_test.go index c1ca0245a..cfc84be4d 100644 --- a/internal/test/e2e/cluster_test.go +++ b/internal/test/e2e/cluster_test.go @@ -1721,6 +1721,30 @@ func TestUploadPacking(t *testing.T) { } else if res.Objects[1].Key != "/file2" { t.Fatal("expected file2", res.Objects[1].Key) } + + // sanity check object metadata + assertObjectMetadata := func(key string) { + t.Helper() + obj, err := b.Object(context.Background(), testBucket, key, api.GetObjectOptions{}) + tt.OK(err) + for _, slab := range obj.Slabs { + if len(slab.Shards) != 3 { + t.Fatalf("unexpected number of shards") + } + for _, shard := range slab.Shards { + if len(shard.Contracts) != 1 { + t.Fatalf("unexpected number of hosts in contracts map") + } + for _, fcids := range shard.Contracts { + if len(fcids) != 1 { + t.Fatalf("unexpected number of contracts") + } + } + } + } + } + assertObjectMetadata("/file1") + assertObjectMetadata("/file2") } func TestWallet(t *testing.T) {