}) Context("when the vxlan device cannot be found", func() { BeforeEach(func() { netlinker.LinkByNameReturns(nil, errors.New("boom-boom")) }) It("returns a meaningful error", func() { inserter.HandleResolvedNeighbors(ready, ns, "some-vxlan-name", resolved) Eventually(ready).Should(Receive(MatchError(`namespace execute failed: find link "some-vxlan-name": boom-boom`))) }) }) It("sets a neighbor entry in the sandbox namespace", func() { ns.ExecuteStub = func(callback func(ns *os.File) error) error { Expect(netlinker.SetNeighCallCount()).To(Equal(0)) callback(nil) if ns.ExecuteCallCount() == 2 { Expect(netlinker.SetNeighCallCount()).To(Equal(2)) } return nil } inserter.HandleResolvedNeighbors(ready, ns, "some-vxlan-name", resolved) Eventually(ready).Should(BeClosed()) Expect(ns.ExecuteCallCount()).To(Equal(2)) Expect(netlinker.SetNeighArgsForCall(0)).To(Equal(&netlink.Neigh{ LinkIndex: neigh.LinkIndex, Family: neigh.Family, State: netlink.NUD_REACHABLE,