m-lab / traceroute-caller

A sidecar service which runs traceroute after a connection closes
Apache License 2.0
18 stars 5 forks source link

Add netblock anonymization verification test #155

Closed stephen-soltesz closed 1 year ago

stephen-soltesz commented 1 year ago

This change adds a new test for the triggertrace handler to verify that the output truly has netblock anonymization applied for v4 and v6 addresses.

This change adds a static definition of traces that include intermediate hops that should be anonymized in addition to the destination address.


This change is Reviewable

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 546


Totals Coverage Status
Change from base Build 532: 0.0%
Covered Lines: 669
Relevant Lines: 697

💛 - Coveralls
SaiedKazemi commented 1 year ago

internal/triggertrace/triggertrace_test.go line 291 at r2 (raw file):

  }

  staticIPv4Netblock = &parser.Scamper1{

Since it's very difficult to know what's different among these four initializations, does it make sense to do something like the following?

    staticIPv4Netblock = staticIPv4None
    staticIPv4None.Tracelb.Dst = "4.4.4.0" // NETBLOCK
    staticIPv4None.Tracelb.Nodes[0].Links = : [][]parser.ScamperLink{{{Addr: "4.4.4.0"}}} // NETBLOCK
    staticIPv4None.Tracelb.Nodes[1].Addr = "4.4.4.0" // NETBLOCK
    staticIPv4None.Tracelb.Nodes[1].Links = [][]parser.ScamperLink{{{Addr: "4.4.4.0"}}}, // NETBLOCK

So it's immediately clear what has changed?