Obtain ifname from CmdArgs and pass to backend Add ifname to second line of file tracking the IP address used by ContainerID

Update host-local tests to use ifname along with ContainerID
in store file

Signed-off-by: Michael Cambria <mcambria@redhat.com>
This commit is contained in:
Michael Cambria
2018-09-10 16:00:47 -04:00
parent 726759b29b
commit 1e8f9525a6
7 changed files with 36 additions and 36 deletions

View File

@ -111,12 +111,12 @@ var _ = Describe("host-local Operations", func() {
ipFilePath1 := filepath.Join(tmpDir, "mynet", "10.1.2.2")
contents, err := ioutil.ReadFile(ipFilePath1)
Expect(err).NotTo(HaveOccurred())
Expect(string(contents)).To(Equal(args.ContainerID))
Expect(string(contents)).To(Equal(args.ContainerID + "\n" + ifname))
ipFilePath2 := filepath.Join(tmpDir, disk.GetEscapedPath("mynet", "2001:db8:1::2"))
contents, err = ioutil.ReadFile(ipFilePath2)
Expect(err).NotTo(HaveOccurred())
Expect(string(contents)).To(Equal(args.ContainerID))
Expect(string(contents)).To(Equal(args.ContainerID + "\n" + ifname))
lastFilePath1 := filepath.Join(tmpDir, "mynet", "last_reserved_ip.0")
contents, err = ioutil.ReadFile(lastFilePath1)
@ -223,7 +223,7 @@ var _ = Describe("host-local Operations", func() {
ipFilePath := filepath.Join(tmpDir, "mynet", "10.1.2.2")
contents, err := ioutil.ReadFile(ipFilePath)
Expect(err).NotTo(HaveOccurred())
Expect(string(contents)).To(Equal(args.ContainerID))
Expect(string(contents)).To(Equal(args.ContainerID + "\n" + ifname))
lastFilePath := filepath.Join(tmpDir, "mynet", "last_reserved_ip.0")
contents, err = ioutil.ReadFile(lastFilePath)
@ -281,7 +281,7 @@ var _ = Describe("host-local Operations", func() {
ipFilePath := filepath.Join(tmpDir, "mynet", result.IPs[0].Address.IP.String())
contents, err := ioutil.ReadFile(ipFilePath)
Expect(err).NotTo(HaveOccurred())
Expect(string(contents)).To(Equal("dummy"))
Expect(string(contents)).To(Equal("dummy" + "\n" + ifname))
// Release the IP
err = testutils.CmdDelWithArgs(args, func() error {