mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-04 15:06:37 +08:00
feat(waf): complete composable rule orchestration
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.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user