cleanup: remove ConnID, DialID, TransactionID (#395)
We are not using them anymore. The only nettest still using the legacy netx implementation is tor, for which setting these fields is useless, because it performs each measurement into a separate goroutine. Hence, let us start removing this part of the legacy netx codebase, which is hampering progress in other areas. Occurred to me while doing testing for the recent changes in error mapping (https://github.com/ooni/probe/issues/1505).
This commit is contained in:
parent
1fefe5d9b8
commit
c74c94d616
32 changed files with 78 additions and 896 deletions
|
|
@ -823,22 +823,18 @@ func TestNewNetworkEventsListGood(t *testing.T) {
|
|||
NetworkEvents: []*modelx.Measurement{
|
||||
{
|
||||
Connect: &modelx.ConnectEvent{
|
||||
ConnID: 555,
|
||||
DurationSinceBeginning: 10 * time.Millisecond,
|
||||
DialID: 17,
|
||||
RemoteAddress: "1.1.1.1:443",
|
||||
},
|
||||
},
|
||||
{
|
||||
Read: &modelx.ReadEvent{
|
||||
ConnID: 555,
|
||||
DurationSinceBeginning: 20 * time.Millisecond,
|
||||
NumBytes: 1789,
|
||||
},
|
||||
},
|
||||
{
|
||||
Write: &modelx.WriteEvent{
|
||||
ConnID: 555,
|
||||
DurationSinceBeginning: 30 * time.Millisecond,
|
||||
NumBytes: 17714,
|
||||
},
|
||||
|
|
@ -852,12 +848,6 @@ func TestNewNetworkEventsListGood(t *testing.T) {
|
|||
if out[0].Address != "1.1.1.1:443" {
|
||||
t.Fatal("wrong out[0].Address")
|
||||
}
|
||||
if out[0].ConnID != 555 {
|
||||
t.Fatal("wrong out[0].ConnID")
|
||||
}
|
||||
if out[0].DialID != 17 {
|
||||
t.Fatal("wrong out[0].DialID")
|
||||
}
|
||||
if out[0].Failure != nil {
|
||||
t.Fatal("wrong out[0].Failure")
|
||||
}
|
||||
|
|
@ -867,9 +857,6 @@ func TestNewNetworkEventsListGood(t *testing.T) {
|
|||
if out[0].Operation != errorx.ConnectOperation {
|
||||
t.Fatal("wrong out[0].Operation")
|
||||
}
|
||||
if out[0].Proto != "tcp" {
|
||||
t.Fatal("wrong out[0].Proto")
|
||||
}
|
||||
if !floatEquals(out[0].T, 0.010) {
|
||||
t.Fatal("wrong out[0].T")
|
||||
}
|
||||
|
|
@ -877,12 +864,6 @@ func TestNewNetworkEventsListGood(t *testing.T) {
|
|||
if out[1].Address != "" {
|
||||
t.Fatal("wrong out[1].Address")
|
||||
}
|
||||
if out[1].ConnID != 555 {
|
||||
t.Fatal("wrong out[1].ConnID")
|
||||
}
|
||||
if out[1].DialID != 0 {
|
||||
t.Fatal("wrong out[1].DialID")
|
||||
}
|
||||
if out[1].Failure != nil {
|
||||
t.Fatal("wrong out[1].Failure")
|
||||
}
|
||||
|
|
@ -892,9 +873,6 @@ func TestNewNetworkEventsListGood(t *testing.T) {
|
|||
if out[1].Operation != errorx.ReadOperation {
|
||||
t.Fatal("wrong out[1].Operation")
|
||||
}
|
||||
if out[1].Proto != "tcp" {
|
||||
t.Fatal("wrong out[1].Proto")
|
||||
}
|
||||
if !floatEquals(out[1].T, 0.020) {
|
||||
t.Fatal("wrong out[1].T")
|
||||
}
|
||||
|
|
@ -902,12 +880,6 @@ func TestNewNetworkEventsListGood(t *testing.T) {
|
|||
if out[2].Address != "" {
|
||||
t.Fatal("wrong out[2].Address")
|
||||
}
|
||||
if out[2].ConnID != 555 {
|
||||
t.Fatal("wrong out[2].ConnID")
|
||||
}
|
||||
if out[2].DialID != 0 {
|
||||
t.Fatal("wrong out[2].DialID")
|
||||
}
|
||||
if out[2].Failure != nil {
|
||||
t.Fatal("wrong out[2].Failure")
|
||||
}
|
||||
|
|
@ -917,9 +889,6 @@ func TestNewNetworkEventsListGood(t *testing.T) {
|
|||
if out[2].Operation != errorx.WriteOperation {
|
||||
t.Fatal("wrong out[2].Operation")
|
||||
}
|
||||
if out[2].Proto != "tcp" {
|
||||
t.Fatal("wrong out[2].Proto")
|
||||
}
|
||||
if !floatEquals(out[2].T, 0.030) {
|
||||
t.Fatal("wrong out[2].T")
|
||||
}
|
||||
|
|
@ -930,16 +899,13 @@ func TestNewNetworkEventsListGoodUDPAndErrors(t *testing.T) {
|
|||
NetworkEvents: []*modelx.Measurement{
|
||||
{
|
||||
Connect: &modelx.ConnectEvent{
|
||||
ConnID: -555,
|
||||
DurationSinceBeginning: 10 * time.Millisecond,
|
||||
DialID: 17,
|
||||
Error: errors.New("mocked error"),
|
||||
RemoteAddress: "1.1.1.1:443",
|
||||
},
|
||||
},
|
||||
{
|
||||
Read: &modelx.ReadEvent{
|
||||
ConnID: -555,
|
||||
DurationSinceBeginning: 20 * time.Millisecond,
|
||||
Error: errors.New("mocked error"),
|
||||
NumBytes: 1789,
|
||||
|
|
@ -947,7 +913,6 @@ func TestNewNetworkEventsListGoodUDPAndErrors(t *testing.T) {
|
|||
},
|
||||
{
|
||||
Write: &modelx.WriteEvent{
|
||||
ConnID: -555,
|
||||
DurationSinceBeginning: 30 * time.Millisecond,
|
||||
Error: errors.New("mocked error"),
|
||||
NumBytes: 17714,
|
||||
|
|
@ -962,12 +927,6 @@ func TestNewNetworkEventsListGoodUDPAndErrors(t *testing.T) {
|
|||
if out[0].Address != "1.1.1.1:443" {
|
||||
t.Fatal("wrong out[0].Address")
|
||||
}
|
||||
if out[0].ConnID != -555 {
|
||||
t.Fatal("wrong out[0].ConnID")
|
||||
}
|
||||
if out[0].DialID != 17 {
|
||||
t.Fatal("wrong out[0].DialID")
|
||||
}
|
||||
if *out[0].Failure != "mocked error" {
|
||||
t.Fatal("wrong out[0].Failure")
|
||||
}
|
||||
|
|
@ -977,9 +936,6 @@ func TestNewNetworkEventsListGoodUDPAndErrors(t *testing.T) {
|
|||
if out[0].Operation != errorx.ConnectOperation {
|
||||
t.Fatal("wrong out[0].Operation")
|
||||
}
|
||||
if out[0].Proto != "udp" {
|
||||
t.Fatal("wrong out[0].Proto")
|
||||
}
|
||||
if !floatEquals(out[0].T, 0.010) {
|
||||
t.Fatal("wrong out[0].T")
|
||||
}
|
||||
|
|
@ -987,12 +943,6 @@ func TestNewNetworkEventsListGoodUDPAndErrors(t *testing.T) {
|
|||
if out[1].Address != "" {
|
||||
t.Fatal("wrong out[1].Address")
|
||||
}
|
||||
if out[1].ConnID != -555 {
|
||||
t.Fatal("wrong out[1].ConnID")
|
||||
}
|
||||
if out[1].DialID != 0 {
|
||||
t.Fatal("wrong out[1].DialID")
|
||||
}
|
||||
if *out[1].Failure != "mocked error" {
|
||||
t.Fatal("wrong out[1].Failure")
|
||||
}
|
||||
|
|
@ -1002,9 +952,6 @@ func TestNewNetworkEventsListGoodUDPAndErrors(t *testing.T) {
|
|||
if out[1].Operation != errorx.ReadOperation {
|
||||
t.Fatal("wrong out[1].Operation")
|
||||
}
|
||||
if out[1].Proto != "udp" {
|
||||
t.Fatal("wrong out[1].Proto")
|
||||
}
|
||||
if !floatEquals(out[1].T, 0.020) {
|
||||
t.Fatal("wrong out[1].T")
|
||||
}
|
||||
|
|
@ -1012,12 +959,6 @@ func TestNewNetworkEventsListGoodUDPAndErrors(t *testing.T) {
|
|||
if out[2].Address != "" {
|
||||
t.Fatal("wrong out[2].Address")
|
||||
}
|
||||
if out[2].ConnID != -555 {
|
||||
t.Fatal("wrong out[2].ConnID")
|
||||
}
|
||||
if out[2].DialID != 0 {
|
||||
t.Fatal("wrong out[2].DialID")
|
||||
}
|
||||
if *out[2].Failure != "mocked error" {
|
||||
t.Fatal("wrong out[2].Failure")
|
||||
}
|
||||
|
|
@ -1027,9 +968,6 @@ func TestNewNetworkEventsListGoodUDPAndErrors(t *testing.T) {
|
|||
if out[2].Operation != errorx.WriteOperation {
|
||||
t.Fatal("wrong out[2].Operation")
|
||||
}
|
||||
if out[2].Proto != "udp" {
|
||||
t.Fatal("wrong out[2].Proto")
|
||||
}
|
||||
if !floatEquals(out[2].T, 0.030) {
|
||||
t.Fatal("wrong out[2].T")
|
||||
}
|
||||
|
|
@ -1052,8 +990,7 @@ func TestNewTLSHandshakesListSuccess(t *testing.T) {
|
|||
TLSHandshakes: []*modelx.TLSHandshakeDoneEvent{
|
||||
{},
|
||||
{
|
||||
ConnID: 12345,
|
||||
Error: errors.New("mocked error"),
|
||||
Error: errors.New("mocked error"),
|
||||
},
|
||||
{
|
||||
ConnectionState: modelx.TLSConnectionState{
|
||||
|
|
@ -1080,9 +1017,6 @@ func TestNewTLSHandshakesListSuccess(t *testing.T) {
|
|||
if out[0].CipherSuite != "" {
|
||||
t.Fatal("invalid out[0].CipherSuite")
|
||||
}
|
||||
if out[0].ConnID != 0 {
|
||||
t.Fatal("invalid out[0].ConnID")
|
||||
}
|
||||
if out[0].Failure != nil {
|
||||
t.Fatal("invalid out[0].Failure")
|
||||
}
|
||||
|
|
@ -1102,9 +1036,6 @@ func TestNewTLSHandshakesListSuccess(t *testing.T) {
|
|||
if out[1].CipherSuite != "" {
|
||||
t.Fatal("invalid out[1].CipherSuite")
|
||||
}
|
||||
if out[1].ConnID != 12345 {
|
||||
t.Fatal("invalid out[1].ConnID")
|
||||
}
|
||||
if *out[1].Failure != "mocked error" {
|
||||
t.Fatal("invalid out[1].Failure")
|
||||
}
|
||||
|
|
@ -1124,9 +1055,6 @@ func TestNewTLSHandshakesListSuccess(t *testing.T) {
|
|||
if out[2].CipherSuite != "TLS_AES_128_GCM_SHA256" {
|
||||
t.Fatal("invalid out[2].CipherSuite")
|
||||
}
|
||||
if out[2].ConnID != 0 {
|
||||
t.Fatal("invalid out[2].ConnID")
|
||||
}
|
||||
if out[2].Failure != nil {
|
||||
t.Fatal("invalid out[2].Failure")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue