Skip to content

Commit

Permalink
Add test for LoadBalancer Service for HTTP status health checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Fahim Abrar authored and asauber committed Apr 29, 2019
1 parent 3095182 commit ed407a9
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions e2e/test/ccm_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,62 @@ var _ = Describe("CloudControllerManager", func() {
checkNodeBalancerConfig(checkType, "", "", "", "", "", checkPassive)
})
})

FContext("For HTTP Status Health Check", func() {
var (
pods []string
labels map[string]string
annotations map[string]string

checkType = "http"
path = "/"
)
BeforeEach(func() {
pods = []string{"test-pod"}
ports := []core.ContainerPort{
{
Name: "http",
ContainerPort: 80,
},
}
servicePorts := []core.ServicePort{
{
Name: "http",
Port: 80,
TargetPort: intstr.FromInt(80),
Protocol: "TCP",
},
}

labels = map[string]string{
"app": "test-loadbalancer",
}
annotations = map[string]string{
annLinodeHealthCheckType: checkType,
annLinodeCheckPath: path,
annLinodeProtocol: "http",
}

By("Creating Pod")
createPodWithLabel(pods, ports, "nginx", labels, false)

By("Creating Service")
createServiceWithAnnotations(labels, annotations, servicePorts, false)
})

AfterEach(func() {
By("Deleting the Pods")
deletePods(pods)

By("Deleting the Service")
deleteService()
})

It("should successfully check the health of 2 nodes", func() {
By("Checking NodeBalancer Configurations")
checkNodeBalancerConfig(checkType, path, "", "", "", "", "")
})
})
})
})
})

0 comments on commit ed407a9

Please sign in to comment.