From 0c5db2161a4784ff21ab37ea028656f9c9070b9d Mon Sep 17 00:00:00 2001 From: Nate Sales Date: Tue, 20 Dec 2022 20:47:07 -0800 Subject: [PATCH] fix: match test --- cmd/match_test.go | 4 +- pkg/match/match_test.go | 2 +- tests/peeringdb/netixlan.json | 170 ++++++++++++++++++++++++++++++++++ 3 files changed, 173 insertions(+), 3 deletions(-) diff --git a/cmd/match_test.go b/cmd/match_test.go index 0ba8c87a..41c73d19 100644 --- a/cmd/match_test.go +++ b/cmd/match_test.go @@ -19,8 +19,8 @@ func TestMatch(t *testing.T) { asnA uint asnB uint }{ - {34553, 13335}, - {54113, 13335}, + {34553, 112}, + {112, 44977}, } for _, tc := range testCases { rootCmd.SetArgs(append(baseArgs, []string{ diff --git a/pkg/match/match_test.go b/pkg/match/match_test.go index c4be64ba..145d17bd 100644 --- a/pkg/match/match_test.go +++ b/pkg/match/match_test.go @@ -3,5 +3,5 @@ package match import "testing" func TestCommonIXs(t *testing.T) { - CommonIXs(34553, 13335, false, 10, "") + CommonIXs(34553, 112, false, 10, "") } diff --git a/tests/peeringdb/netixlan.json b/tests/peeringdb/netixlan.json index a04be686..a651c331 100644 --- a/tests/peeringdb/netixlan.json +++ b/tests/peeringdb/netixlan.json @@ -50,6 +50,176 @@ "speed": 10000, "status": "ok", "updated": "2021-08-01T05:20:55Z" + }, + { + "id": 16465, + "net_id": 21511, + "ix_id": 165, + "name": "NWAX: Primary Peering VLAN", + "ixlan_id": 165, + "notes": "", + "speed": 1000, + "asn": 34553, + "ipaddr4": "198.32.195.28", + "ipaddr6": "2620:124:2000::28", + "is_rs_peer": true, + "operational": true, + "created": "2013-12-19T00:00:00Z", + "updated": "2021-03-06T03:04:47Z", + "status": "ok" + }, + { + "id": 57950, + "net_id": 21511, + "ix_id": 2163, + "name": "FCIX", + "ixlan_id": 2163, + "notes": "", + "speed": 10000, + "asn": 34553, + "ipaddr4": "206.80.238.77", + "ipaddr6": "2001:504:91::77", + "is_rs_peer": true, + "operational": true, + "created": "2020-05-14T20:23:15Z", + "updated": "2020-05-25T22:40:28Z", + "status": "ok" + }, + { + "id": 58213, + "net_id": 21511, + "ix_id": 2741, + "name": "QCIX: Main", + "ixlan_id": 2741, + "notes": "", + "speed": 1000, + "asn": 34553, + "ipaddr4": "206.83.43.27", + "ipaddr6": "2001:504:9b::27", + "is_rs_peer": true, + "operational": true, + "created": "2020-05-27T15:55:22Z", + "updated": "2020-05-27T16:44:09Z", + "status": "ok" + }, + { + "id": 58223, + "net_id": 21511, + "ix_id": 2452, + "name": "UNM-Exch Canada-West: Main", + "ixlan_id": 2452, + "notes": "", + "speed": 10000, + "asn": 34553, + "ipaddr4": "192.34.27.18", + "ipaddr6": "2602:ffb1:200:0:192:34:27:18", + "is_rs_peer": true, + "operational": true, + "created": "2020-05-27T23:26:56Z", + "updated": "2020-05-29T00:38:16Z", + "status": "ok" + }, + { + "id": 58368, + "net_id": 21511, + "ix_id": 249, + "name": "KCIX", + "ixlan_id": 249, + "notes": "", + "speed": 1000, + "asn": 34553, + "ipaddr4": "206.51.7.39", + "ipaddr6": "2001:504:1b:1::39", + "is_rs_peer": true, + "operational": true, + "created": "2020-06-03T17:34:53Z", + "updated": "2021-10-19T01:22:38Z", + "status": "ok" + }, + { + "id": 58376, + "net_id": 21511, + "ix_id": 13, + "name": "SIX Seattle: MTU 1500", + "ixlan_id": 13, + "notes": "", + "speed": 1000, + "asn": 34553, + "ipaddr4": "206.81.80.97", + "ipaddr6": "2001:504:16::86f9", + "is_rs_peer": true, + "operational": true, + "created": "2020-06-03T18:06:49Z", + "updated": "2020-06-03T18:06:49Z", + "status": "ok" + }, + { + "id": 58420, + "net_id": 21511, + "ix_id": 2783, + "name": "Gig IX Ashburn: Peering", + "ixlan_id": 2783, + "notes": "", + "speed": 1000, + "asn": 34553, + "ipaddr4": "206.83.8.199", + "ipaddr6": "2602:fed2:ff1::199", + "is_rs_peer": true, + "operational": true, + "created": "2020-06-05T04:34:49Z", + "updated": "2020-06-05T04:34:49Z", + "status": "ok" + }, + { + "id": 58435, + "net_id": 21511, + "ix_id": 1285, + "name": "SIX Seattle (Jumbo): MTU 9000", + "ixlan_id": 1285, + "notes": "", + "speed": 1000, + "asn": 34553, + "ipaddr4": "206.81.82.97", + "ipaddr6": "2001:504:16:1::86f9", + "is_rs_peer": true, + "operational": true, + "created": "2020-06-05T17:12:22Z", + "updated": "2020-06-05T18:21:48Z", + "status": "ok" + }, + { + "id": 60114, + "net_id": 21511, + "ix_id": 3069, + "name": "ARIX: Primary", + "ixlan_id": 3069, + "notes": "", + "speed": 40000, + "asn": 34553, + "ipaddr4": "44.190.42.3", + "ipaddr6": "2602:801:30ff::3", + "is_rs_peer": true, + "operational": true, + "created": "2020-08-10T19:27:56Z", + "updated": "2022-06-29T08:50:20Z", + "status": "ok" + }, + { + "id": 60450, + "net_id": 21511, + "ix_id": 3157, + "name": "FSIX", + "ixlan_id": 3157, + "notes": "", + "speed": 1000, + "asn": 34553, + "ipaddr4": "185.1.174.15", + "ipaddr6": "2001:7f8:f7:0:185:1:174:15", + "is_rs_peer": true, + "operational": true, + "created": "2020-08-20T23:14:46Z", + "updated": "2020-08-20T23:14:46Z", + "status": "ok" } ], "meta": {}