"git.fd.io/govpp.git/adapter/mock"
"git.fd.io/govpp.git/api"
+ "git.fd.io/govpp.git/examples/binapi/interface_types"
"git.fd.io/govpp.git/examples/binapi/interfaces"
"git.fd.io/govpp.git/examples/binapi/memif"
"git.fd.io/govpp.git/examples/binapi/vpe"
var msgs []api.Message
for i := 1; i <= 10; i++ {
msgs = append(msgs, &memif.MemifDetails{
- SwIfIndex: uint32(i),
+ SwIfIndex: interface_types.InterfaceIndex(i),
})
}
ctx.mockVpp.MockReply(msgs...)
// mock event and force its delivery
ctx.mockVpp.MockReply(&interfaces.SwInterfaceEvent{
- SwIfIndex: 2,
- LinkUpDown: 1,
+ SwIfIndex: 2,
+ Flags: interface_types.IF_STATUS_API_FLAG_LINK_UP,
})
ctx.mockVpp.SendMsg(0, []byte(""))
// verify the received notifications
Expect(notif.SwIfIndex).To(BeEquivalentTo(2), "Incorrect SwIfIndex value for SwInterfaceSetFlags")
- Expect(notif.LinkUpDown).To(BeEquivalentTo(1), "Incorrect LinkUpDown value for SwInterfaceSetFlags")
+ Expect(notif.Flags).To(BeEquivalentTo(interface_types.IF_STATUS_API_FLAG_LINK_UP), "Incorrect LinkUpDown value for SwInterfaceSetFlags")
err = sub.Unsubscribe()
Expect(err).ShouldNot(HaveOccurred())
for i := 1; i <= 3; i++ {
msgs = append(msgs, mock.MsgWithContext{
Msg: &interfaces.SwInterfaceDetails{
- SwIfIndex: uint32(i),
+ SwIfIndex: interface_types.InterfaceIndex(i),
InterfaceName: "if-name-test",
},
Multipart: true,
msgs = append(msgs,
mock.MsgWithContext{
Msg: &interfaces.SwInterfaceDetails{
- SwIfIndex: uint32(i),
+ SwIfIndex: interface_types.InterfaceIndex(i),
InterfaceName: "if-name-test",
},
Multipart: true,
)
req := &interfaces.SwInterfaceSetFlags{
- SwIfIndex: 1,
- AdminUpDown: 1,
+ SwIfIndex: 1,
+ Flags: interface_types.IF_STATUS_API_FLAG_ADMIN_UP,
}
reply := &interfaces.SwInterfaceSetFlagsReply{}
for i := 1; i <= 3; i++ {
msgs = append(msgs, mock.MsgWithContext{
Msg: &interfaces.SwInterfaceDetails{
- SwIfIndex: uint32(i),
+ SwIfIndex: interface_types.InterfaceIndex(i),
InterfaceName: "if-name-test",
},
Multipart: true,
ctx.mockVpp.MockReplyWithContext(mock.MsgWithContext{Msg: &interfaces.SwInterfaceSetFlagsReply{}, SeqNum: 3})
req := &interfaces.SwInterfaceSetFlags{
- SwIfIndex: 1,
- AdminUpDown: 1,
+ SwIfIndex: 1,
+ Flags: interface_types.IF_STATUS_API_FLAG_ADMIN_UP,
}
reply := &interfaces.SwInterfaceSetFlagsReply{}
// second should fail with error invalid message ID
err = ctx.ch.SendRequest(&ControlPing{}).ReceiveReply(&ControlPingReply{})
Expect(err).Should(HaveOccurred())
- Expect(err.Error()).To(ContainSubstring("invalid message ID"))
+ Expect(err.Error()).To(ContainSubstring("unexpected message"))
}