diff --git a/src/detect-geoip.c b/src/detect-geoip.c index 0558b2a5f1..d1710b2118 100644 --- a/src/detect-geoip.c +++ b/src/detect-geoip.c @@ -373,9 +373,12 @@ static DetectGeoipData *DetectGeoipDataParse (const char *str) SCLogDebug("negated geoip"); } - /* Initialize the geolocation engine */ - if (InitGeolocationEngine(geoipdata) == false) - goto error; + /* init geo engine, but not when running as unittests */ + if (!(RunmodeIsUnittests())) { + /* Initialize the geolocation engine */ + if (InitGeolocationEngine(geoipdata) == false) + goto error; + } return geoipdata;