Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c360a82aa2 |
No files matched your search
@@ -1704,7 +1704,8 @@ func TestGetASDetailsListsEachPrefixOnce(t *testing.T) {
|
|||||||
// record of, some with stored routes. Each gets the prefixes of its routes and
|
// record of, some with stored routes. Each gets the prefixes of its routes and
|
||||||
// no seen times. One that the AS info lookup knows gets its handle and
|
// no seen times. One that the AS info lookup knows gets its handle and
|
||||||
// description from it. An AS with no record, no lookup entry and no route is
|
// description from it. An AS with no record, no lookup entry and no route is
|
||||||
// ErrNoRoute. Before the fix every AS with no record was ErrNoRoute.
|
// ErrNoRoute. Before the fix an AS with no record got no prefixes, although
|
||||||
|
// its routes were stored.
|
||||||
func TestGetASDetailsOfASNotInDatabase(t *testing.T) {
|
func TestGetASDetailsOfASNotInDatabase(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
|
|||||||
@@ -1335,8 +1335,9 @@ func newServerWithStoredAS(t *testing.T) *Server {
|
|||||||
// All but unknownASN answer 200 with the handle and description from the
|
// All but unknownASN answer 200 with the handle and description from the
|
||||||
// built-in AS list and their prefixes, as lists even when empty. Only storedASN
|
// built-in AS list and their prefixes, as lists even when empty. Only storedASN
|
||||||
// has a first_seen time. unknownASN answers 404. Before the fix builtInOnlyASN
|
// has a first_seen time. unknownASN answers 404. Before the fix builtInOnlyASN
|
||||||
// and routeOnlyASN answered 404 too
|
// answered 404, so a result of the AS name search could lead nowhere
|
||||||
// (https://git.eeqj.de/sneak/routewatch/issues/151).
|
// (https://git.eeqj.de/sneak/routewatch/issues/151), and routeOnlyASN listed
|
||||||
|
// no prefixes.
|
||||||
func TestASDetailJSONAnswersBuiltInAS(t *testing.T) {
|
func TestASDetailJSONAnswersBuiltInAS(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
@@ -1426,8 +1427,9 @@ func TestASDetailJSONAnswersBuiltInAS(t *testing.T) {
|
|||||||
// list. storedASN and routeOnlyASN list their prefixes, and builtInOnlyASN says
|
// list. storedASN and routeOnlyASN list their prefixes, and builtInOnlyASN says
|
||||||
// the AS announces none. Only storedASN shows a first-seen date, and no page
|
// the AS announces none. Only storedASN shows a first-seen date, and no page
|
||||||
// shows a date that was never set. unknownASN answers 404. Before the fix
|
// shows a date that was never set. unknownASN answers 404. Before the fix
|
||||||
// builtInOnlyASN and routeOnlyASN answered 404 too
|
// builtInOnlyASN answered 404, so a result of the AS name search led nowhere
|
||||||
// (https://git.eeqj.de/sneak/routewatch/issues/151).
|
// (https://git.eeqj.de/sneak/routewatch/issues/151), and routeOnlyASN listed no
|
||||||
|
// prefixes.
|
||||||
func TestASDetailPageShowsBuiltInAS(t *testing.T) {
|
func TestASDetailPageShowsBuiltInAS(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
@@ -1491,8 +1493,8 @@ func TestASDetailPageShowsBuiltInAS(t *testing.T) {
|
|||||||
// origin AS 0 (https://git.eeqj.de/sneak/routewatch/issues/75). It expects
|
// origin AS 0 (https://git.eeqj.de/sneak/routewatch/issues/75). It expects
|
||||||
// /as/0 and /api/v1/as/0 to answer 404. It expects a search for "iana" to leave
|
// /as/0 and /api/v1/as/0 to answer 404. It expects a search for "iana" to leave
|
||||||
// AS 0 out of its results and its total, although the AS list built into
|
// AS 0 out of its results and its total, although the AS list built into
|
||||||
// asinfo holds AS 0. That search has more matches than an answer holds, so it
|
// asinfo holds AS 0. Before the fix both AS answers were 200 and listed the
|
||||||
// still lists maxASSearchResults of them.
|
// route's prefix, and the search listed AS 0 first.
|
||||||
func TestNoOriginHasNoASAnswers(t *testing.T) {
|
func TestNoOriginHasNoASAnswers(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
@@ -1544,11 +1546,6 @@ func TestNoOriginHasNoASAnswers(t *testing.T) {
|
|||||||
t.Errorf("the search for %q has a total of %d, want %d",
|
t.Errorf("the search for %q has a total of %d, want %d",
|
||||||
query, data.Total, total-1)
|
query, data.Total, total-1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Results) != maxASSearchResults {
|
|
||||||
t.Errorf("the search for %q lists %d matches, want %d",
|
|
||||||
query, len(data.Results), maxASSearchResults)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// settledGoroutineCount lets transient goroutines finish, then reports the
|
// settledGoroutineCount lets transient goroutines finish, then reports the
|
||||||
|
|||||||
Reference in new issue
Block a user