Skip to content

Commit

Permalink
remove invalid old test
Browse files Browse the repository at this point in the history
  • Loading branch information
gunjan5 committed Sep 24, 2017
1 parent f19710a commit 7680422
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 62 deletions.
61 changes: 0 additions & 61 deletions calico_cni_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,65 +390,4 @@ var _ = Describe("CalicoCni", func() {
})
})
})

Describe("CNI should be resilient to an already existing route", func() {
Context("add a new container when the route already exists ", func() {
netconf := fmt.Sprintf(`
{
"cniVersion": "%s",
"name": "net1",
"type": "calico",
"etcd_endpoints": "http://%s:2379",
"ipam": {
"type": "host-local",
"subnet": "10.0.0.0/24"
}
}`, cniVersion, os.Getenv("ETCD_IP"))

It("should successfully add and network the container", func() {
containerIPStr := "10.0.0.55"
_, containerIP, _ := net.ParseCIDR("10.0.0.55/32")

By("Manually programming the route that CNI plugin is going to add.")
err := netlink.RouteAdd(
&netlink.Route{
Scope: netlink.SCOPE_LINK,
Dst: containerIP,
})

log.Printf("*** error: %v", err)
// Expect(err).ShouldNot(HaveOccurred())
By("Calling the CNI plugin requesting the same IP, so CNI would try to add the same route.")
containerID, session, _, _, _, contNs, err := CreateContainer(netconf, "", containerIPStr)
Expect(err).ShouldNot(HaveOccurred())
Eventually(session).Should(gexec.Exit())

result, err := GetResultForCurrent(session, cniVersion)
if err != nil {
log.Fatalf("Error getting result from the session: %v\n", err)
}

log.Printf("Unmarshalled result from first ADD: %v\n", result)

// The endpoint should be created in the backend
endpoints, err := calicoClient.WorkloadEndpoints().List(api.WorkloadEndpointMetadata{})
Expect(err).ShouldNot(HaveOccurred())
Expect(endpoints.Items).Should(HaveLen(1))

// Set the Revision to nil since we can't assert it's exact value.
endpoints.Items[0].Metadata.Revision = nil
Expect(endpoints.Items[0].Metadata).Should(Equal(api.WorkloadEndpointMetadata{
Node: hostname,
Name: "eth0",
Workload: containerID,
ActiveInstanceID: "",
Orchestrator: "cni",
}))

By("Deleting the container we created.")
_, err = DeleteContainer(netconf, contNs.Path(), "")
Expect(err).To(HaveOccurred())
})
})
})
})
1 change: 0 additions & 1 deletion utils/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ func setupRoutes(hostVeth netlink.Link, result *current.Result) error {
}

log.Debugf("CNI adding route for interface: %v, IP: %s", hostVeth, ipAddr.Address)
log.Warningf("********* CNI adding route %#v for interface: %v, IP: %s, Index: %d\n", route, hostVeth, ipAddr.Address, hostVeth.Attrs().Index)
}
return nil
}
Expand Down

0 comments on commit 7680422

Please sign in to comment.