Ignore invalid message ID if last request timed out
[govpp.git] / core / core_test.go
index 37c0b9c..e80f97c 100644 (file)
@@ -22,6 +22,7 @@ import (
        "git.fd.io/govpp.git/core"
        "git.fd.io/govpp.git/core/bin_api/vpe"
        "git.fd.io/govpp.git/examples/bin_api/interfaces"
+       "git.fd.io/govpp.git/examples/bin_api/stats"
 
        . "github.com/onsi/gomega"
 )
@@ -206,9 +207,9 @@ func TestFullBuffer(t *testing.T) {
        vppReply := <-ctx.ch.ReplyChan
        Expect(vppReply).ShouldNot(BeNil())
 
-       received := false
+       var received bool
        select {
-       case vppReply = <-ctx.ch.ReplyChan:
+       case <-ctx.ch.ReplyChan:
                received = true // this should not happen
        default:
                received = false // no reply to be received
@@ -222,11 +223,11 @@ func TestCodec(t *testing.T) {
        codec := &core.MsgCodec{}
 
        // request
-       data, err := codec.EncodeMsg(&vpe.CreateLoopback{MacAddress: []byte{1, 2, 3, 4, 5, 6}}, 11)
+       data, err := codec.EncodeMsg(&interfaces.CreateLoopback{MacAddress: []byte{1, 2, 3, 4, 5, 6}}, 11)
        Expect(err).ShouldNot(HaveOccurred())
        Expect(data).ShouldNot(BeEmpty())
 
-       msg1 := &vpe.CreateLoopback{}
+       msg1 := &interfaces.CreateLoopback{}
        err = codec.DecodeMsg(data, msg1)
        Expect(err).ShouldNot(HaveOccurred())
        Expect(msg1.MacAddress).To(BeEquivalentTo([]byte{1, 2, 3, 4, 5, 6}))
@@ -242,11 +243,11 @@ func TestCodec(t *testing.T) {
        Expect(msg2.Retval).To(BeEquivalentTo(55))
 
        // other
-       data, err = codec.EncodeMsg(&vpe.VnetIP4FibCounters{VrfID: 77}, 33)
+       data, err = codec.EncodeMsg(&stats.VnetIP4FibCounters{VrfID: 77}, 33)
        Expect(err).ShouldNot(HaveOccurred())
        Expect(data).ShouldNot(BeEmpty())
 
-       msg3 := &vpe.VnetIP4FibCounters{}
+       msg3 := &stats.VnetIP4FibCounters{}
        err = codec.DecodeMsg(data, msg3)
        Expect(err).ShouldNot(HaveOccurred())
        Expect(msg3.VrfID).To(BeEquivalentTo(77))