Expect(sandboxRepo.GetArgsForCall(0)).To(Equal("some-sandbox-name")) Expect(sbox.NamespaceCallCount()).To(Equal(1)) }) It("locks and unlocks the sandbox", func() { err := startDNS.Execute(context) Expect(err).NotTo(HaveOccurred()) Expect(sbox.LockCallCount()).To(Equal(1)) Expect(sbox.UnlockCallCount()).To(Equal(1)) }) It("adds a dummy link to the sandbox namespace", func() { ns.ExecuteStub = func(callback func(*os.File) error) error { Expect(linkFactory.CreateDummyCallCount()).To(Equal(0)) err := callback(nil) Expect(linkFactory.CreateDummyCallCount()).To(Equal(1)) return err } err := startDNS.Execute(context) Expect(err).NotTo(HaveOccurred()) Expect(ns.ExecuteCallCount()).To(Equal(1)) Expect(linkFactory.CreateDummyCallCount()).To(Equal(1)) linkName := linkFactory.CreateDummyArgsForCall(0) Expect(linkName).To(Equal("dns0")) })