| 39 | } |
| 40 | |
| 41 | func mustReceive(t *testing.T, dst blobserver.Storage, tb *test.Blob) blob.SizedRef { |
| 42 | tbRef := tb.BlobRef() |
| 43 | sb, err := blobserver.Receive(ctxbg, dst, tbRef, tb.Reader()) |
| 44 | if err != nil { |
| 45 | t.Fatalf("Receive: %v", err) |
| 46 | } |
| 47 | if int(sb.Size) != len(tb.Contents) { |
| 48 | t.Fatalf("size = %d; want %d", sb.Size, len(tb.Contents)) |
| 49 | } |
| 50 | if sb.Ref != tbRef { |
| 51 | t.Fatal("wrong blob received") |
| 52 | } |
| 53 | return sb |
| 54 | } |
| 55 | |
| 56 | func TestStorageTest(t *testing.T) { |
| 57 | storagetest.Test(t, func(t *testing.T) blobserver.Storage { |