diff options
author | 2022-05-02 19:25:02 +0200 | |
---|---|---|
committer | 2022-05-02 18:25:02 +0100 | |
commit | 4ae29a449c6b89c44a95c00a8ca97b7db953793f (patch) | |
tree | 20fb73c7aa2fa23cfe7e47b74deff56f85e92098 /plugin/geoip/setup_test.go | |
parent | 66f2ac7568ccb0178cc9ce6dbd7320bcd3428d64 (diff) | |
download | coredns-4ae29a449c6b89c44a95c00a8ca97b7db953793f.tar.gz coredns-4ae29a449c6b89c44a95c00a8ca97b7db953793f.tar.zst coredns-4ae29a449c6b89c44a95c00a8ca97b7db953793f.zip |
geoip: read source IP from EDNS0 subnet if provided (#5183)
* geoip: read source IP from EDNS0 subnet if provided
This patch implements EDNS backend processing (similar in powerdns: https://doc.powerdns.com/authoritative/settings.html#setting-edns-subnet-processing). This feature comes very handy to test whether your geo config is working properly.
Signed-off-by: Balazs Nagy <julsevern@gmail.com>
Diffstat (limited to 'plugin/geoip/setup_test.go')
-rw-r--r-- | plugin/geoip/setup_test.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugin/geoip/setup_test.go b/plugin/geoip/setup_test.go index 94d40adbc..b9b0030ee 100644 --- a/plugin/geoip/setup_test.go +++ b/plugin/geoip/setup_test.go @@ -52,14 +52,15 @@ func TestGeoIPParse(t *testing.T) { }{ // Valid {false, fmt.Sprintf("%s %s\n", pluginName, cityDBPath), "", city}, + {false, fmt.Sprintf("%s %s { edns-subnet }", pluginName, cityDBPath), "", city}, // Invalid {true, pluginName, "Wrong argument count", 0}, - {true, fmt.Sprintf("%s %s {\n\tlanguages en fr es zh-CN\n}\n", pluginName, cityDBPath), "unexpected config block", 0}, + {true, fmt.Sprintf("%s %s {\n\tlanguages en fr es zh-CN\n}\n", pluginName, cityDBPath), "unknown property \"languages\"", 0}, {true, fmt.Sprintf("%s %s\n%s %s\n", pluginName, cityDBPath, pluginName, cityDBPath), "configuring multiple databases is not supported", 0}, {true, fmt.Sprintf("%s 1 2 3", pluginName), "Wrong argument count", 0}, {true, fmt.Sprintf("%s { }", pluginName), "Error during parsing", 0}, - {true, fmt.Sprintf("%s /dbpath { city }", pluginName), "unexpected config block", 0}, + {true, fmt.Sprintf("%s /dbpath { city }", pluginName), "unknown property \"city\"", 0}, {true, fmt.Sprintf("%s /invalidPath\n", pluginName), "failed to open database file: open /invalidPath: no such file or directory", 0}, {true, fmt.Sprintf("%s %s\n", pluginName, unknownDBPath), "reader does not support the \"UnknownDbType\" database type", 0}, } |