Add GeoIP Local mirror support

This commit is contained in:
Maxim Pogozhiy 2020-12-28 15:28:16 +10:00
parent 944d36fdba
commit b55f4371e3
4 changed files with 29 additions and 2 deletions

View file

@ -92,3 +92,16 @@ func TestMaxmindEdition(t *testing.T) {
t.Fatalf("Expected an error parsing flags but none returned")
}
}
func TestMaxmindMirror(t *testing.T) {
resetForTesting(func() { t.Fatal("Parsing failed") })
oldArgs := os.Args
defer func() { os.Args = oldArgs }()
os.Args = []string{"cmd", "--publish-service", "namespace/test", "--http-port", "0", "--https-port", "0", "--maxmind-mirror", "http://geoip.local", "--maxmind-license-key", "0000000", "--maxmind-edition-ids", "GeoLite2-City, TestCheck"}
_, _, err := parseFlags()
if err == nil {
t.Fatalf("Expected an error parsing flags but none returned")
}
}