self-hosted/install/geoip-test.sh
2021-03-30 17:45:05 +03:00

17 lines
320 B
Bash
Executable File

#!/usr/bin/env bash
source "$(dirname $0)/_test_setup.sh"
mmdb="../geoip/GeoLite2-City.mmdb"
# Starts with no mmdb, ends up with empty.
test ! -f $mmdb
source geoip.sh
diff -rub $mmdb $mmdb.empty
# Doesn't clobber existing, though.
echo GARBAGE > $mmdb
source geoip.sh
test "$(cat $mmdb)" = "GARBAGE"
report_success