G: the holder's test of a part sent again says what the receiver does since design 51 (chunk 0 again starts the part afresh, a chunk out of sequence is refused)
Builds: design 47 G A-21
This commit is contained in:
@@ -243,8 +243,13 @@ func TestTheHolderOfTheTwoImageSeats(t *testing.T) {
|
||||
if a, _ := b.h.Publish(ArtifactSeat, builder, req("t1")); !reflect.DeepEqual(a.Missing, []string{part.Digest}) {
|
||||
t.Errorf("resumed publish = %+v", a)
|
||||
}
|
||||
if _, err := b.h.PublishPart(ArtifactSeat, builder, PartRequest{Transfer: "t1", Digest: part.Digest, Sequence: 0, Data: blob[:1000]}); err == nil {
|
||||
t.Error("a chunk sent twice was taken: the transfer goes on from the chunks held")
|
||||
// A chunk 0 again starts the part afresh (it travels whole again, design 51 Publishing); a chunk that is neither the
|
||||
// cursor nor 0 is refused, naming the cursor.
|
||||
if _, err := b.h.PublishPart(ArtifactSeat, builder, PartRequest{Transfer: "t1", Digest: part.Digest, Sequence: 0, Data: blob[:1000]}); err != nil {
|
||||
t.Errorf("a chunk 0 sent again was refused: %v", err)
|
||||
}
|
||||
if _, err := b.h.PublishPart(ArtifactSeat, builder, PartRequest{Transfer: "t1", Digest: part.Digest, Sequence: 2, Data: blob[:1000]}); err == nil {
|
||||
t.Error("a chunk out of sequence was taken: the transfer goes on from the chunks held")
|
||||
}
|
||||
a, err = b.h.PublishPart(ArtifactSeat, builder, PartRequest{Transfer: "t1", Digest: part.Digest, Sequence: 1, Last: true, Data: blob[1000:]})
|
||||
if err != nil || !a.Ended || len(b.said) != 1 || b.said[0].event != EventPublished || b.said[0].body.Reference == "" {
|
||||
|
||||
Reference in New Issue
Block a user