aboutsummaryrefslogtreecommitdiffstats
path: root/api/api_test.go
AgeCommit message (Collapse)AuthorFilesLines
2018-07-06make api.Channel as interfaceVladimir Lavor1-588/+0
Change-Id: I052d241ab09043b1195beebeee99df4d8536621f Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2018-06-27mock adapter: Group all replies for one request under one call to MockReplyMilan Lenco1-44/+69
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>
2018-06-26Pair requests with replies using sequence numbersMilan Lenco1-32/+32
Requests are given sequence numbers (cycling over a finite set of 2^16 integers) that are stored into the lower 16bits of the context. 1bit is also allocated for isMultipart boolean flag and the remaining 15bits are used to store the channel ID. The sequence numbers allow to reliably pair replies with requests, even in scenarious with timeouted requests or ignored (unread) replies. Sequencing is not used with asynchronous messaging as it is implemented by methods of the Channel structure, i.e. above ReqChan and ReplyChan channels. Change-Id: I7ca0e8489c7ffcc388c3cfef6d05c02f9500931c Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
2018-04-05Lookup message name by ID when receiving unexpected messageOndrej Fabry1-8/+24
Change-Id: I693e8084b7e3f036dec5e557dc772857bb7d5f3d Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2018-04-04Ignore invalid message ID if last request timed outOndrej Fabry1-3/+100
Change-Id: Iedca416a69ff20d0bac05062b87021de95eb40dc Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2018-03-23Support mocking reply for more multi requests at onceOndrej Fabry1-4/+90
Change-Id: I3610fe1e0c04f4487f6b7139fc62ef4515fad640 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2017-12-13Use core directly in tests to avoid need of vppapiclient libraryOndrej Fabry1-5/+4
Change-Id: I1fa534129ee7e04eb5058a215fa7eabfe1ecc2bf Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2017-12-04Fix events for mock adapterOndrej Fabry1-2/+45
Change-Id: Iee5fa6282e845ed2aef76c9246a9068f3765139c Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2017-06-20Upgrade dependency to VPP 17.07 RC0Milan Lenco1-1/+1
Change-Id: I732d478b71895f4d3889752c683dbb6a84c6e17c Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
2017-05-04changes import paths from gerrit.fd.io/r/govpp.git to git.fd.io/govpp.gitRastislav Szabo1-8/+8
Signed-off-by: Rastislav Szabo <raszabo@cisco.com>
2017-05-04fixed import pathsRastislav Szabo1-8/+8
Signed-off-by: Rastislav Szabo <raszabo@cisco.com>
2017-05-04initial commitRastislav Szabo1-0/+322
Signed-off-by: Rastislav Szabo <raszabo@cisco.com>