Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

How to generate test data

Use the write-test-data go tool to create a small set of test databases with a variety of data and record sizes.

These test databases are useful for testing code that reads MaxMind DB files.

There are several ways to figure out what IP addresses are actually in the test databases. You can take a look at the source-data directory in this repository. This directory contains JSON files which are used to generate many (but not all) of the database files.

You can also use the mmdb-dump-database script in the MaxMind-DB-Reader-perl repository.

Static test data

Some of the test files are remnants of the old perl test data writer and cannot be generated with the go tool. These databases are intentionally broken, and exploited functionality simply not available in the go mmdbwriter:

  • MaxMind-DB-test-broken-pointers-24.mmdb
  • MaxMind-DB-test-broken-search-tree-24.mmdb
  • MaxMind-DB-test-pointer-decoder.mmdb
  • GeoIP2-City-Test-Broken-Double-Format.mmdb
  • GeoIP2-City-Test-Invalid-Node-Count.mmdb
  • maps-with-pointers.raw

Usage

Usage of ./write-test-data:
  -source string
        Source data directory
  -target string
        Destination directory for the generated mmdb files

Example: ./write-test-data --source ../../source-data --target ../../test-data