Exemple #1
0
func TestConfigBadHealthcheck(t *testing.T) {
	healthcheck.RegisterHealthcheck("testconstructorfail", myHealthCheckConstructorFail)
	c := &config.Config{}
	c.Validate(instancemetadata.InstanceMetadata{Instance: "i-1234"}, NewFakeRouteTableManager())
	c.Healthchecks["one"] = &healthcheck.Healthcheck{
		Type:        "testconstructorfail",
		Destination: "127.0.0.1",
	}
	err := setupHealthchecks(c)
	if assert.NotNil(t, err) {
		assert.Equal(t, err.Error(), "Test")
	}
}
Exemple #2
0
func TestConfigBadHealthcheck(t *testing.T) {
	healthcheck.RegisterHealthcheck("testconstructorfail", myHealthCheckConstructorFail)
	c := &config.Config{}
	c.Default(instancemetadata.InstanceMetadata{Instance: "i-1234"})
	c.Healthchecks["one"] = &healthcheck.Healthcheck{
		Type:        "testconstructorfail",
		Destination: "127.0.0.1",
	}
	err := setupHealthchecks(c)
	if err == nil {
		t.Fail()
	}
	if err.Error() != "Test" {
		t.Log(err.Error())
		t.Fail()
	}
}