launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #25411
[Merge] ~cjwatson/launchpad:testfix-drop-geoip-legacy into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:testfix-drop-geoip-legacy into launchpad:master.
Commit message:
Add a couple more IP ranges used by the test suite
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/391519
Also arrange for the output of make-db.pl to be reproducible by explicitly setting a timestamp.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:testfix-drop-geoip-legacy into launchpad:master.
diff --git a/lib/lp/services/geoip/tests/data/make-db.pl b/lib/lp/services/geoip/tests/data/make-db.pl
index 74f01f1..279a99a 100755
--- a/lib/lp/services/geoip/tests/data/make-db.pl
+++ b/lib/lp/services/geoip/tests/data/make-db.pl
@@ -6,6 +6,8 @@
# Create a tiny test database in the style of GeoLite2-Country, for use by
# the Launchpad test suite. Requires libmaxmind-db-writer-perl.
+use Time::Local qw(timegm_modern);
+
use MaxMind::DB::Writer::Tree;
my %types = (
@@ -20,12 +22,17 @@ my $tree = MaxMind::DB::Writer::Tree->new(
languages => ['en'],
description => { en => 'Launchpad test data' },
map_key_type_callback => sub { $types{$_[0]} },
+ # Arguments are ($sec, $min, $hour, $mday, $mon, $year); $mon is
+ # 0-based. Bump this date when you change this script.
+ _build_epoch => timegm_modern(0, 38, 11, 29, 8, 2020),
);
$tree->insert_network('69.232.0.0/15', { country => { iso_code => 'US' } });
$tree->insert_network('82.211.80.0/20', { country => { iso_code => 'GB' } });
+$tree->insert_network('83.196.40.0/21', { country => { iso_code => 'FR' } });
$tree->insert_network('121.44.0.0/15', { country => { iso_code => 'AU' } });
$tree->insert_network('157.92.0.0/16', { country => { iso_code => 'AR' } });
+$tree->insert_network('196.36.0.0/14', { country => { iso_code => 'ZA' } });
$tree->insert_network('201.13.0.0/16', { country => { iso_code => 'BR' } });
$tree->insert_network('202.214.0.0/16', { country => { iso_code => 'JP' } });
diff --git a/lib/lp/services/geoip/tests/data/test.mmdb b/lib/lp/services/geoip/tests/data/test.mmdb
index ddeaded..4d96205 100644
Binary files a/lib/lp/services/geoip/tests/data/test.mmdb and b/lib/lp/services/geoip/tests/data/test.mmdb differ