Exemple #1
0
func TestServicePluginInitWithInvalidRefreshDetails(t *testing.T) {
	bConfig := bridge.DefaultBridgeConfig()

	bConfig.RefreshTTL = 0
	bConfig.RefreshInterval = 30
	reg, err := InitServicePlugin("skydns2:", bConfig)
	if err != nil || reg == nil {
		t.Fatalf("Service plugin init failed for values {%v}. Error: %s", bConfig, err)
	}

	bConfig.RefreshTTL = 30
	bConfig.RefreshInterval = 0
	reg, err = InitServicePlugin("skydns2:", bConfig)
	if err != nil || reg == nil {
		t.Fatalf("Service plugin init failed for values {%v}. Error: %s", bConfig, err)
	}

	bConfig.RefreshTTL = 30
	bConfig.RefreshInterval = 20
	reg, err = InitServicePlugin("skydns2:", bConfig)
	if err != nil || reg == nil {
		t.Fatalf("Service plugin init failed for values {%v}. Error: %s", bConfig, err)
	}

	bConfig.RefreshTTL = -30
	bConfig.RefreshInterval = -20
	reg, err = InitServicePlugin("skydns2:", bConfig)
	if err != nil || reg == nil {
		t.Fatalf("Service plugin init failed for values {%v}. Error: %s", bConfig, err)
	}
}
Exemple #2
0
func TestServicePluginInitWithDefaultConfig(t *testing.T) {
	bConfig := bridge.DefaultBridgeConfig()
	reg, err := InitServicePlugin("skydns2:", bConfig)
	if err != nil || reg == nil {
		t.Fatalf("Service plugin init failed. Error: %s", err)
	}
}
Exemple #3
0
func TestServicePluginInitWithInvalidDeregisterDetails(t *testing.T) {
	bConfig := bridge.DefaultBridgeConfig()

	bConfig.DeregisterCheck = "random"
	reg, err := InitServicePlugin("skydns2:", bConfig)
	if err != nil || reg == nil {
		t.Fatalf("Service plugin init failed for values {%v}. Error: %s", bConfig, err)
	}
}