Skip to content

Commit

Permalink
extend TestUploadPacking
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Dec 19, 2024
1 parent b7787eb commit 3f2783f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions internal/test/e2e/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 3f2783f

Please sign in to comment.