mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-29 05:56:38 +08:00
a1a997bcda
Add the React Flow rule editor, ordered graph APIs and runtime DAG execution.\n\nPublish rules only on OpenResty reload and reconcile checksum-driven IP group snapshots in bounded shared memory.
25 lines
814 B
Go
25 lines
814 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/Rain-kl/Wavelet/internal/apps/agent/config"
|
|
)
|
|
|
|
func TestNewGeoIPUpdaterWiresCountryAndCity(t *testing.T) {
|
|
cfg := &config.Config{
|
|
MMDBPath: "/data/GeoLite2-Country.mmdb",
|
|
MMDBDownloadURL: "https://geo.example/GeoLite2-Country.mmdb",
|
|
CityMMDBPath: "/data/GeoLite2-City.mmdb",
|
|
CityMMDBDownloadURL: "https://geo.example/GeoLite2-City.mmdb",
|
|
MMDBUpdateInterval: config.MillisecondDuration(time.Hour),
|
|
}
|
|
updater := newGeoIPUpdater(cfg)
|
|
if updater.MMDBPath != cfg.MMDBPath || updater.DownloadURL != cfg.MMDBDownloadURL ||
|
|
updater.CityMMDBPath != cfg.CityMMDBPath || updater.CityDownloadURL != cfg.CityMMDBDownloadURL ||
|
|
updater.UpdateInterval != time.Hour {
|
|
t.Fatalf("GeoIP updater wiring incomplete: %#v", updater)
|
|
}
|
|
}
|