models.Properties{
					AppID:   appID,
					SpaceID: spaceID,
				},
			},
			ContainerID: containerID,
		}

		downSpec = models.CNIDelPayload{
			InterfaceName:      "vx-eth0",
			ContainerNamespace: containerNamespace.Name(),
			ContainerID:        containerID,
		}

		By("adding the container to a network")
		_, err = daemonClient.ContainerUp(upSpec)
		Expect(err).NotTo(HaveOccurred())
	})

	AfterEach(func() {
		By("removing the container from the network")
		Expect(daemonClient.ContainerDown(downSpec)).To(Succeed())

		session.Interrupt()
		Eventually(session, DEFAULT_TIMEOUT).Should(gexec.Exit(0))
		Expect(containerRepo.Destroy(containerNamespace)).To(Succeed())
	})

	It("catches L3 misses", func() {
		time.Sleep(2 * time.Second)
		err := containerNamespace.Execute(func(_ *os.File) error {
						AppID:   appID,
						SpaceID: spaceID,
					},
				},
				ContainerID: containerID,
			}

			downSpec = models.CNIDelPayload{
				InterfaceName:      "vx-eth0",
				ContainerNamespace: containerNamespace.Name(),
				ContainerID:        containerID,
			}

			By("adding the container to a network")
			var err error
			ipamResult, err = daemonClient.ContainerUp(upSpec)
			Expect(err).NotTo(HaveOccurred())
		})

		It("can delete a container that was created before ducatid was restarted", func() {
			var err error
			session.Interrupt()
			Eventually(session, DEFAULT_TIMEOUT).Should(gexec.Exit(0))
			Eventually(serverIsAvailable, DEFAULT_TIMEOUT).ShouldNot(Succeed())

			ducatiCmd = exec.Command(ducatidPath, "-configFile", configFilePath)
			session, err = gexec.Start(ducatiCmd, GinkgoWriter, GinkgoWriter)
			Expect(err).NotTo(HaveOccurred())
			Eventually(serverIsAvailable).Should(Succeed())

			Expect(filepath.Join(sandboxRepoDir, sandboxName)).To(BeAnExistingFile())
						AppID:   appID,
						SpaceID: spaceID,
					},
				},
				ContainerID: containerID,
			}

			downSpec = models.CNIDelPayload{
				InterfaceName:      "vx-eth0",
				ContainerNamespace: containerNamespace.Name(),
				ContainerID:        containerID,
			}

			By("adding the container to a network")
			var err error
			ipamResult, err = daemonClient.ContainerUp(upSpec)
			Expect(err).NotTo(HaveOccurred())
		})

		AfterEach(func() {
			By("removing the container from the network")
			Expect(daemonClient.ContainerDown(downSpec)).To(Succeed())

			By("checking that containers have been removed")
			containers, err := daemonClient.ListNetworkContainers(networkID)
			Expect(err).NotTo(HaveOccurred())
			Expect(containers).To(HaveLen(0))

			By("checking that the sandbox has been cleaned up")
			_, err = sandboxRepo.Get(sandboxName)
			Expect(err).To(MatchError(ContainSubstring("no such file or directory")))