diff options
author | Milan Lenco <milan.lenco@pantheon.tech> | 2018-06-27 15:55:43 +0200 |
---|---|---|
committer | Milan Lenco <milan.lenco@pantheon.tech> | 2018-06-27 16:20:55 +0200 |
commit | 5276b9439d0f902e125a5113bfa4f1b6622aea18 (patch) | |
tree | 012189945f413ce7f78528ea348edc41f6a11326 /govpp.go | |
parent | 8adb6cdcb496f05169263d32a857791faf8baee1 (diff) |
mock adapter: Group all replies for one request under one call to MockReply
Sequence numbers are now used to match requests with replies.
Mock adapter thus has to be able to tell how many messages
from the head of the queue with mock replies belong to the currently
processed request. Then they can be given the right context and
the rest of the queued replies are postponed to be delivered later
(when context of their request is known).
All replies for one request are now therefore queued together.
This affects just multipart requests for which replies have to
be pushed all at once. The trailling control ping reply is still
queued separately, however, because that is actualy another request,
e.g.:
mockVpp.MockReply( // push multipart messages all at once
&interfaces.SwInterfaceDetails{SwIfIndex:1},
&interfaces.SwInterfaceDetails{SwIfIndex:2},
&interfaces.SwInterfaceDetails{SwIfIndex:3},
)
mockVpp.MockReply(&vpe.ControlPingReply{})
Even if the multipart request has no replies, MockReply has to be
called exactly twice:
mockVpp.MockReply() // zero multipart messages
mockVpp.MockReply(&vpe.ControlPingReply{})
Change-Id: I28c15d2f52d14dca0b7fb06033d7270a7da2bde6
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Diffstat (limited to 'govpp.go')
0 files changed, 0 insertions, 0 deletions