Fix tests

This commit is contained in:
Alfonso Acosta
2017-01-03 23:32:40 +00:00
parent a8b4e65b5c
commit 99a7dc3b9a

View File

@@ -13,7 +13,7 @@ func TestProcNet(t *testing.T) {
2: 0100007F:0019 00000000:0000 01 00000000:00000000 00:00000000 00000000 0 0 10550 1 ffff8800a729b780 100 0 0 10 0
3: A12CF62E:E4D7 57FC1EC0:01BB 01 00000000:00000000 02:000006FA 00000000 1000 0 639474 2 ffff88007e75a740 48 4 26 10 -1
`
p := NewProcNet([]byte(testString), tcpEstablished)
p := NewProcNet([]byte(testString))
expected := []Connection{
{
LocalAddress: net.IP([]byte{0, 0, 0, 0}),
@@ -64,7 +64,7 @@ func TestTransport6(t *testing.T) {
8: 4500032000BE692B8AE31EBD919D9D10:D61C 5014002A080805400000000015100000:01BB 01 00000000:00000000 02:00000045 00000000 1000 0 36856710 2 ffff88010b796080 22 4 30 8 7
`
p := NewProcNet([]byte(testString), tcpEstablished)
p := NewProcNet([]byte(testString))
expected := []Connection{
{
// state: 10,
@@ -114,7 +114,7 @@ func TestTransportNonsense(t *testing.T) {
0: 00000000:A6C0 00000000:0000 01 000000
broken line
`
p := NewProcNet([]byte(testString), tcpEstablished)
p := NewProcNet([]byte(testString))
expected := []Connection{
{
LocalAddress: net.IP([]byte{0, 0, 0, 0}),
@@ -142,7 +142,7 @@ func TestProcNetFiltersDuplicates(t *testing.T) {
0: 00000000:A6C0 00000000:0000 01 00000000:00000000 00:00000000 00000000 105 0 5107 1 ffff8800a6aaf040 100 0 0 10 0
1: 00000000:A6C0 00000000:0000 01 00000000:00000000 00:00000000 00000000 105 0 5107 1 ffff8800a6aaf040 100 0 0 10 0
`
p := NewProcNet([]byte(testString), tcpEstablished)
p := NewProcNet([]byte(testString))
expected := Connection{
LocalAddress: net.IP([]byte{0, 0, 0, 0}),
LocalPort: 0xa6c0,