Every US state capital, Washington DC, Canada's capitals and Greenland
44 US cities (every missing state capital and DC) and 12 Canadian ones (every provincial and territorial capital), sized by metro population, with exchanges only where PeeringDB lists a real one. Level Tree is in every state capital; Cogentle, AT&Tease and Drizzle Electric in the bigger ones, and Drizzle on the Edmonton, Winnipeg, Saskatoon and Quebec City exchanges as Hurricane is. Greenland: Nuuk, Qaqortoq, Sisimiut and Aasiaat, each its own landmass (no road or fiber over the ice), on Greenland Connect's real landings (Iceland-Qaqortoq- Nuuk-Newfoundland) and Connect-the-Dots North up the coast. Too Sassy (Tusass, AS8818) is the one operator. Iqaluit has only satellites: a beach, no seller. New regional carriers: Bell Alien (Bell Aliant, AS855), SaskTell-Tale (SaskTel, AS803), Northwest Passage Tel (Northwestel, AS22573). Victoria and Iqaluit are documented W3 exceptions, Greenland a W2 one; the real names go on the blocklist.
This commit is contained in:
parent
41d5bc8b21
commit
017eba4ca2
17 changed files with 372 additions and 9 deletions
|
|
@ -13,6 +13,7 @@ const EXCEPTIONS = {
|
|||
W2: {
|
||||
CU: 'Cuba has one state operator (ETECSA); Cubacel is its own mobile brand',
|
||||
DJ: 'Djibouti Telecom is the monopoly for homes and phones',
|
||||
GL: 'Greenland has one operator (Tusass), for homes, phones and the cables',
|
||||
MH: 'the Marshall Islands have one telco (NTA)',
|
||||
PN: 'Pitcairn has no network at all: land your own cable (#124)',
|
||||
SH: 'St Helena has one operator (Sure South Atlantic)',
|
||||
|
|
@ -23,6 +24,8 @@ const EXCEPTIONS = {
|
|||
pcn: 'Pitcairn: no cable, no network, land your own (#124)',
|
||||
prr: 'Prince Rupert is a remote town with no carrier in it',
|
||||
stg: 'Stuttgart is the Only Spätzle-IX scenario city: peering only, by design (#114)',
|
||||
yfb: 'Iqaluit has no fiber, only satellite: land your own cable (the real plan runs from Nuuk)',
|
||||
yyj: 'Victoria buys from Telus and Rogers, consumer networks only in the game: link it from Vancouver',
|
||||
},
|
||||
// N3: networks in no founding Tier 1's customer cone. Old saves need PNIs with the founding five for Tier 1,
|
||||
// so anyone outside their cones has to be peered with directly.
|
||||
|
|
@ -88,7 +91,7 @@ const EXCEPTIONS = {
|
|||
// The real names the puns are based on. No network, cable, exchange, data center, router or optic may be called one.
|
||||
const REAL_NAMES = [
|
||||
// Tier 1s and carriers
|
||||
'AT&T', 'BICS', 'Cogent', 'GTT', 'Hurricane Electric', 'Level 3', 'Level3', 'Liquid', 'Liquid Intelligent Technologies', 'Lumen', 'NTT', 'Orange', 'PCCW', 'Seacom', 'Singtel', 'Sparkle', 'Tata', 'Tata Communications', 'Telia', 'Telxius', 'Vodafone', 'Zayo',
|
||||
'AT&T', 'Bell Aliant', 'BICS', 'Cogent', 'GTT', 'Hurricane Electric', 'Level 3', 'Level3', 'Liquid', 'Liquid Intelligent Technologies', 'Lumen', 'Northwestel', 'NTT', 'Orange', 'PCCW', 'SaskTel', 'Seacom', 'Singtel', 'Sparkle', 'Tata', 'Tata Communications', 'Telia', 'Telxius', 'Tusass', 'Vodafone', 'Zayo',
|
||||
// content and clouds
|
||||
'Akamai', 'Alibaba Cloud', 'Amazon', 'Amazon Web Services', 'AWS', 'Baidu', 'ByteDance', 'Cloudflare', 'Facebook', 'Fastly', 'Google', 'Mercado Libre', 'Meta', 'Microsoft', 'Netflix', 'Tencent', 'TikTok', 'VK', 'VKontakte', 'Yandex',
|
||||
// eyeballs and incumbents
|
||||
|
|
@ -96,7 +99,7 @@ const REAL_NAMES = [
|
|||
// exchanges and data centers
|
||||
'AMS-IX', 'Any2', 'BCIX', 'CoreSite', 'DE-CIX', 'DigiCo', 'Digital Realty', 'Equinix', 'France-IX', 'Interxion', 'iseek', 'IX.br', 'JPIX', 'LINX', 'NAPAfrica', 'NetIX', 'NEXTDC', 'NIX', 'NL-ix', 'SIX', 'Telehouse',
|
||||
// cables
|
||||
'2Africa', 'Amitié', 'Darwin-Jakarta-Singapore Cable', 'Dunant', 'EllaLink', 'Equiano', 'Grace Hopper', 'Hibernia Express', 'Jupiter', 'MAREA', 'North West Cable System', 'PEACE', 'SEA-ME-WE 6',
|
||||
'2Africa', 'Amitié', 'Darwin-Jakarta-Singapore Cable', 'Dunant', 'EllaLink', 'Equiano', 'Grace Hopper', 'Greenland Connect', 'Greenland Connect North', 'Hibernia Express', 'Jupiter', 'MAREA', 'North West Cable System', 'PEACE', 'SEA-ME-WE 6',
|
||||
// cable ships, their operators and maintenance clubs
|
||||
'ACMA', 'ASEAN Explorer', 'ASEAN Protector', 'ASEAN Restorer', 'Cable Innovator', 'Cable Retriever', 'Global Marine', 'Léon Thévenin', 'MECMA', 'Orange Marine', 'Pierre de Fermat', 'René Descartes', 'SEAIOCMA', 'Sophie Germain', 'Sovereign', 'Wave Sentinel', 'Yokohama Zone',
|
||||
// vendors
|
||||
|
|
|
|||
59
tests/north-america.test.js
Normal file
59
tests/north-america.test.js
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const { load } = require('./harness');
|
||||
|
||||
const { ev } = load();
|
||||
const J = (s) => JSON.parse(ev(`JSON.stringify(${s})`));
|
||||
const R = Math.PI / 180, km = (a, b) => 6371 * Math.acos(Math.min(1, Math.sin(a[1] * R) * Math.sin(b[1] * R) + Math.cos(a[1] * R) * Math.cos(b[1] * R) * Math.cos((a[0] - b[0]) * R)));
|
||||
const cities = J('CITIES.filter(c=>!c.off).map(c=>({id:c.id,name:c.name,cc:c.cc,ll:[c.lon,c.lat]}))');
|
||||
// A capital is on the map when a city of its country sits within 25 km of it.
|
||||
const has = (cc, ll) => cities.some((c) => c.cc === cc && km(c.ll, ll) < 25);
|
||||
|
||||
test('every US state capital and Washington, DC is a city', () => {
|
||||
const caps = { Montgomery: [-86.30, 32.37], Juneau: [-134.42, 58.30], Phoenix: [-112.07, 33.45], 'Little Rock': [-92.29, 34.75], Sacramento: [-121.49, 38.58],
|
||||
Denver: [-104.99, 39.74], Hartford: [-72.68, 41.76], Dover: [-75.52, 39.16], Tallahassee: [-84.28, 30.44], Atlanta: [-84.39, 33.75], Honolulu: [-157.86, 21.31],
|
||||
Boise: [-116.20, 43.62], Springfield: [-89.65, 39.80], Indianapolis: [-86.16, 39.77], 'Des Moines': [-93.61, 41.59], Topeka: [-95.68, 39.05], Frankfort: [-84.87, 38.20],
|
||||
'Baton Rouge': [-91.15, 30.45], Augusta: [-69.78, 44.31], Annapolis: [-76.49, 38.98], Boston: [-71.06, 42.36], Lansing: [-84.56, 42.73], 'Saint Paul': [-93.09, 44.95],
|
||||
Jackson: [-90.18, 32.30], 'Jefferson City': [-92.17, 38.58], Helena: [-112.03, 46.59], Lincoln: [-96.70, 40.81], 'Carson City': [-119.77, 39.16], Concord: [-71.54, 43.21],
|
||||
Trenton: [-74.76, 40.22], 'Santa Fe': [-105.94, 35.69], Albany: [-73.76, 42.65], Raleigh: [-78.64, 35.78], Bismarck: [-100.78, 46.81], Columbus: [-82.99, 39.96],
|
||||
'Oklahoma City': [-97.52, 35.47], Salem: [-123.03, 44.94], Harrisburg: [-76.88, 40.27], Providence: [-71.41, 41.82], Columbia: [-81.03, 34.00], Pierre: [-100.35, 44.37],
|
||||
Nashville: [-86.78, 36.16], Austin: [-97.74, 30.27], 'Salt Lake City': [-111.89, 40.76], Montpelier: [-72.58, 44.26], Richmond: [-77.44, 37.54], Olympia: [-122.90, 47.04],
|
||||
Charleston: [-81.63, 38.35], Madison: [-89.40, 43.07], Cheyenne: [-104.82, 41.14], Washington: [-77.04, 38.91] };
|
||||
assert.equal(Object.keys(caps).length, 51);
|
||||
assert.deepEqual(Object.entries(caps).filter(([, ll]) => !has('US', ll)).map(([n]) => n), []);
|
||||
});
|
||||
|
||||
test('every Canadian provincial and territorial capital, and Greenland on its cables', () => {
|
||||
const caps = { Victoria: [-123.37, 48.43], Edmonton: [-113.49, 53.55], Regina: [-104.62, 50.45], Winnipeg: [-97.14, 49.90], Toronto: [-79.38, 43.65], 'Quebec City': [-71.21, 46.81],
|
||||
Fredericton: [-66.64, 45.96], Halifax: [-63.57, 44.65], Charlottetown: [-63.13, 46.24], "St. John's": [-52.71, 47.56], Whitehorse: [-135.06, 60.72], Yellowknife: [-114.37, 62.45],
|
||||
Iqaluit: [-68.52, 63.75], Ottawa: [-75.70, 45.42] };
|
||||
assert.deepEqual(Object.entries(caps).filter(([, ll]) => !has('CA', ll)).map(([n]) => n), []);
|
||||
// Greenland: no road and no fiber over the ice, so each town is its own landmass, reached on Greenland Connect's real landings.
|
||||
const gl = J("CITIES.filter(c=>c.cc==='GL').map(c=>({id:c.id,land:c.land,cab:CABLE_PAIRS.some(p=>p.a===c.id||p.b===c.id)}))");
|
||||
assert.deepEqual(gl.map((c) => c.id).sort(), ['aas', 'nuk', 'qaq', 'sis']);
|
||||
assert.equal(new Set(gl.map((c) => c.land)).size, 4, 'one landmass per town');
|
||||
assert.ok(gl.every((c) => c.cab), 'every town lands a cable');
|
||||
for (const [a, b] of [['rek', 'qaq'], ['qaq', 'nuk'], ['nuk', 'yyt'], ['nuk', 'sis'], ['sis', 'aas']])
|
||||
assert.ok(J(`CABLES.some(c=>c.pairs.some(p=>(p[0]==='${a}'&&p[1]==='${b}')||(p[0]==='${b}'&&p[1]==='${a}')))`), `${a}–${b} has a cable`);
|
||||
assert.ok(J("CABLES.find(c=>c.id==='gcon').pairs.some(p=>p[0]==='rek'&&p[1]==='mtl')"), 'the old Reykjavik–Montreal pair stays for saves');
|
||||
});
|
||||
|
||||
test('who sells transit in the new cities', () => {
|
||||
const sellers = (c) => J(`NETS.filter(n=>sellsAt(n,'${c}')).map(n=>n.id)`);
|
||||
for (const c of ['was', 'aus', 'pir', 'mpv']) assert.ok(sellers(c).includes('lvl'), `${c}: Level Tree`);
|
||||
for (const c of ['yeg', 'ywg', 'yxe', 'yqb']) assert.ok(sellers(c).includes('drz'), `${c}: on its exchange, per PeeringDB`);
|
||||
assert.ok(sellers('yqr').includes('skt'), 'Regina: SaskTell-Tale');
|
||||
for (const c of ['yfc', 'yyg', 'yyt']) assert.ok(sellers(c).includes('bal'), `${c}: Bell Alien`);
|
||||
for (const c of ['yxy', 'yzf']) assert.deepEqual(sellers(c), ['nwt'], `${c}: only the north's carrier`);
|
||||
for (const c of ['nuk', 'qaq', 'sis', 'aas']) assert.deepEqual(sellers(c), ['tus'], `${c}: only Too Sassy`);
|
||||
// Iqaluit has only satellites: nobody sells, but a beach takes your own cable.
|
||||
assert.deepEqual(sellers('yfb'), []);
|
||||
assert.equal(J("CITY.yfb.beach"), true);
|
||||
});
|
||||
|
||||
test('a game still starts and runs a month in a new capital', () => {
|
||||
const { ev: e, errors } = load();
|
||||
e("ACT.start({});S.nextFail=1e9;S.nextEvent=1e9;S.cash=1e8;ACT.buildPop({city:'aus'});ACT.buildPop({city:'nuk'});for(let i=0;i<30;i++)dayTick()");
|
||||
assert.ok(e("!!S.pops.aus&&!!S.pops.nuk"));
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
@ -15,7 +15,12 @@ function pages() {
|
|||
fs.writeFileSync(head, page.assemble().html);
|
||||
let base = head;
|
||||
try { const b = path.join(os.tmpdir(), `tubes-fuzz-test-${process.pid}-base.html`); fs.writeFileSync(b, page.assembleRef('origin/main')); base = b; } catch (e) {}
|
||||
return { base: openPage(base, 'base'), head: openPage(head, 'head') };
|
||||
let P = { base: openPage(base, 'base'), head: openPage(head, 'head') };
|
||||
// A change to the world itself (cities, networks, cables) cannot route like main: there is no same game to compare.
|
||||
// Then the base is this checkout too, and the cache on/off check still runs; equivalence with main resumes once it lands.
|
||||
const world = (p) => p.ev("JSON.stringify([CITIES.map(c=>[c.id,c.land,c.P]),NETS.map(n=>[n.id,n.pops,n.ix,n.share,n.price,n.up]),CABLES.map(c=>[c.id,c.pairs.map(q=>[q[0],q[1]])])])");
|
||||
if (base !== head && world(P.base) !== world(P.head)) { console.log('# route fuzz: the world differs from main, so both pages are this checkout'); P = { base: openPage(head, 'base'), head: P.head }; }
|
||||
return P;
|
||||
}
|
||||
|
||||
test('random games route the same as main, with and without the routing cache, move for move', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue