mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
add freebsd nestat tests and fixtures
This commit is contained in:
1
tests/fixtures/freebsd12/netstat-Aa.json
vendored
Normal file
1
tests/fixtures/freebsd12/netstat-Aa.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
[{"tcpcb": "fffff80003df43d0", "proto": "tcp4", "recv_q": 0, "send_q": 0, "local_address": "192.168.71.1", "foreign_address": "192.168.71.1", "state": "ESTABLISHED", "kind": "network", "local_port": "ssh", "foreign_port": "56321", "transport_protocol": "tcp", "network_protocol": "ipv4", "foreign_port_num": 56321}, {"tcpcb": "fffff80003df47a0", "proto": "tcp4", "recv_q": 0, "send_q": 0, "local_address": "localhost", "foreign_address": "*", "state": "LISTEN", "kind": "network", "local_port": "smtp", "foreign_port": "*", "transport_protocol": "tcp", "network_protocol": "ipv4"}, {"tcpcb": "fffff80003df4b70", "proto": "tcp4", "recv_q": 0, "send_q": 0, "local_address": "*", "foreign_address": "*", "state": "LISTEN", "kind": "network", "local_port": "ssh", "foreign_port": "*", "transport_protocol": "tcp", "network_protocol": "ipv4"}, {"tcpcb": "fffff80003df0000", "proto": "tcp6", "recv_q": 0, "send_q": 0, "local_address": "*", "foreign_address": "*", "state": "LISTEN", "kind": "network", "local_port": "ssh", "foreign_port": "*", "transport_protocol": "tcp", "network_protocol": "ipv6"}, {"tcpcb": "fffff80003ae81e8", "proto": "udp4", "recv_q": 0, "send_q": 0, "local_address": "*", "foreign_address": "*", "kind": "network", "local_port": "syslog", "foreign_port": "*", "transport_protocol": "udp", "network_protocol": "ipv4"}, {"tcpcb": "fffff80003ae87a0", "proto": "udp6", "recv_q": 0, "send_q": 0, "local_address": "*", "foreign_address": "*", "kind": "network", "local_port": "syslog", "foreign_port": "*", "transport_protocol": "udp", "network_protocol": "ipv6"}, {"address": "fffff80003ab6100", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6200", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6200", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6100", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6300", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "0", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6800", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6900", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6900", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6800", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003abf000", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "fffff80003c581e0", "conn": "0", "refs": "0", "nextref": "0", "addr": "/var/run/devd.pipe", "kind": "socket"}, {"address": "fffff80003ac3e00", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6c00", "refs": "0", "nextref": "fffff80003ab6400", "kind": "socket"}, {"address": "fffff80003ab6400", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6c00", "refs": "0", "nextref": "fffff80003ab6000", "kind": "socket"}, {"address": "fffff80003ab6000", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6c00", "refs": "0", "nextref": "fffff80003ab6600", "kind": "socket"}, {"address": "fffff80003ab6500", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6d00", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6600", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6c00", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6c00", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "fffff80003c59d20", "conn": "0", "refs": "fffff80003ac3e00", "nextref": "0", "addr": "/var/run/logpriv", "kind": "socket"}, {"address": "fffff80003ab6d00", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "fffff80003c67000", "conn": "0", "refs": "fffff80003ab6500", "nextref": "0", "addr": "/var/run/log", "kind": "socket"}, {"address": "fffff80003ab6e00", "type": "seqpac", "recv_q": 0, "send_q": 0, "unix_inode": "fffff80003c58000", "conn": "0", "refs": "0", "nextref": "0", "addr": "/var/run/devd.seqpacket.pipe", "kind": "socket"}]
|
1
tests/fixtures/freebsd12/netstat-AaT.json
vendored
Normal file
1
tests/fixtures/freebsd12/netstat-AaT.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
[{"tcpcb": "fffff80003df43d0", "proto": "tcp4", "rexmit": 3, "ooorcv": 0, "0_win": 0, "local_address": "192.168.71.1", "foreign_address": "192.168.71.1", "kind": "network", "local_port": "ssh", "foreign_port": "64330", "transport_protocol": "tcp", "network_protocol": "ipv4", "foreign_port_num": 64330}, {"tcpcb": "fffff80003df47a0", "proto": "tcp4", "rexmit": 0, "ooorcv": 0, "0_win": 0, "local_address": "localhost", "foreign_address": "*", "kind": "network", "local_port": "smtp", "foreign_port": "*", "transport_protocol": "tcp", "network_protocol": "ipv4"}, {"tcpcb": "fffff80003df4b70", "proto": "tcp4", "rexmit": 0, "ooorcv": 0, "0_win": 0, "local_address": "*", "foreign_address": "*", "kind": "network", "local_port": "ssh", "foreign_port": "*", "transport_protocol": "tcp", "network_protocol": "ipv4"}, {"tcpcb": "fffff80003df0000", "proto": "tcp6", "rexmit": 0, "ooorcv": 0, "0_win": 0, "local_address": "*", "foreign_address": "*", "kind": "network", "local_port": "ssh", "foreign_port": "*", "transport_protocol": "tcp", "network_protocol": "ipv6"}, {"tcpcb": "fffff80003ae81e8", "proto": "udp4", "rexmit": null, "ooorcv": null, "kind": "network", "transport_protocol": "udp", "network_protocol": "ipv4"}, {"tcpcb": "fffff80003ae87a0", "proto": "udp6", "rexmit": null, "ooorcv": null, "kind": "network", "transport_protocol": "udp", "network_protocol": "ipv6"}, {"address": "fffff80003ab6200", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6100", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6100", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6200", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6300", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "0", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6800", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6900", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6900", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6800", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003abf000", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "fffff80003c581e0", "conn": "0", "refs": "0", "nextref": "0", "addr": "/var/run/devd.pipe", "kind": "socket"}, {"address": "fffff80003ac3e00", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6c00", "refs": "0", "nextref": "fffff80003ab6400", "kind": "socket"}, {"address": "fffff80003ab6400", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6c00", "refs": "0", "nextref": "fffff80003ab6000", "kind": "socket"}, {"address": "fffff80003ab6000", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6c00", "refs": "0", "nextref": "fffff80003ab6600", "kind": "socket"}, {"address": "fffff80003ab6500", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6d00", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6600", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6c00", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6c00", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "fffff80003c59d20", "conn": "0", "refs": "fffff80003ac3e00", "nextref": "0", "addr": "/var/run/logpriv", "kind": "socket"}, {"address": "fffff80003ab6d00", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "fffff80003c67000", "conn": "0", "refs": "fffff80003ab6500", "nextref": "0", "addr": "/var/run/log", "kind": "socket"}, {"address": "fffff80003ab6e00", "type": "seqpac", "recv_q": 0, "send_q": 0, "unix_inode": "fffff80003c58000", "conn": "0", "refs": "0", "nextref": "0", "addr": "/var/run/devd.seqpacket.pipe", "kind": "socket"}]
|
24
tests/fixtures/freebsd12/netstat-AaT.out
vendored
Normal file
24
tests/fixtures/freebsd12/netstat-AaT.out
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
Active Internet connections (including servers)
|
||||
Tcpcb Proto Rexmit OOORcv 0-win Local Address Foreign Address
|
||||
fffff80003df43d0 tcp4 3 0 0 192.168.71.1.ssh 192.168.71.1.64330
|
||||
fffff80003df47a0 tcp4 0 0 0 localhost.smtp *.*
|
||||
fffff80003df4b70 tcp4 0 0 0 *.ssh *.*
|
||||
fffff80003df0000 tcp6 0 0 0 *.ssh *.*
|
||||
fffff80003ae81e8 udp4 *.syslog *.*
|
||||
fffff80003ae87a0 udp6 *.syslog *.*
|
||||
Active UNIX domain sockets
|
||||
Address Type Recv-Q Send-Q Inode Conn Refs Nextref Addr
|
||||
fffff80003ab6200 stream 0 0 0 fffff80003ab6100 0 0
|
||||
fffff80003ab6100 stream 0 0 0 fffff80003ab6200 0 0
|
||||
fffff80003ab6300 stream 0 0 0 0 0 0
|
||||
fffff80003ab6800 stream 0 0 0 fffff80003ab6900 0 0
|
||||
fffff80003ab6900 stream 0 0 0 fffff80003ab6800 0 0
|
||||
fffff80003abf000 stream 0 0 fffff80003c581e0 0 0 0 /var/run/devd.pipe
|
||||
fffff80003ac3e00 dgram 0 0 0 fffff80003ab6c00 0 fffff80003ab6400
|
||||
fffff80003ab6400 dgram 0 0 0 fffff80003ab6c00 0 fffff80003ab6000
|
||||
fffff80003ab6000 dgram 0 0 0 fffff80003ab6c00 0 fffff80003ab6600
|
||||
fffff80003ab6500 dgram 0 0 0 fffff80003ab6d00 0 0
|
||||
fffff80003ab6600 dgram 0 0 0 fffff80003ab6c00 0 0
|
||||
fffff80003ab6c00 dgram 0 0 fffff80003c59d20 0 fffff80003ac3e00 0 /var/run/logpriv
|
||||
fffff80003ab6d00 dgram 0 0 fffff80003c67000 0 fffff80003ab6500 0 /var/run/log
|
||||
fffff80003ab6e00 seqpac 0 0 fffff80003c58000 0 0 0 /var/run/devd.seqpacket.pipe
|
1
tests/fixtures/freebsd12/netstat-AanP.json
vendored
Normal file
1
tests/fixtures/freebsd12/netstat-AanP.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
[{"tcpcb": "fffff80003df43d0", "proto": "tcp4", "recv_q": 0, "send_q": 0, "local_address": "192.168.71.163", "foreign_address": "192.168.71.1", "state": "ESTABLISHED", "log": "-", "kind": "network", "local_port": "22", "foreign_port": "64330", "transport_protocol": "tcp", "network_protocol": "ipv4", "local_port_num": 22, "foreign_port_num": 64330}, {"tcpcb": "fffff80003df47a0", "proto": "tcp4", "recv_q": 0, "send_q": 0, "local_address": "127.0.0.1", "foreign_address": "*", "state": "LISTEN", "log": "-", "kind": "network", "local_port": "25", "foreign_port": "*", "transport_protocol": "tcp", "network_protocol": "ipv4", "local_port_num": 25}, {"tcpcb": "fffff80003df4b70", "proto": "tcp4", "recv_q": 0, "send_q": 0, "local_address": "*", "foreign_address": "*", "state": "LISTEN", "log": "-", "kind": "network", "local_port": "22", "foreign_port": "*", "transport_protocol": "tcp", "network_protocol": "ipv4", "local_port_num": 22}, {"tcpcb": "fffff80003df0000", "proto": "tcp6", "recv_q": 0, "send_q": 0, "local_address": "*", "foreign_address": "*", "state": "LISTEN", "log": "-", "kind": "network", "local_port": "22", "foreign_port": "*", "transport_protocol": "tcp", "network_protocol": "ipv6", "local_port_num": 22}, {"tcpcb": "fffff80003ae81e8", "proto": "udp4", "recv_q": 0, "send_q": 0, "local_address": "*", "foreign_address": "*", "kind": "network", "local_port": "514", "foreign_port": "*", "transport_protocol": "udp", "network_protocol": "ipv4", "local_port_num": 514}, {"tcpcb": "fffff80003ae87a0", "proto": "udp6", "recv_q": 0, "send_q": 0, "local_address": "*", "foreign_address": "*", "kind": "network", "local_port": "514", "foreign_port": "*", "transport_protocol": "udp", "network_protocol": "ipv6", "local_port_num": 514}, {"address": "fffff80003ab6200", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6100", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6100", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6200", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6300", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "0", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6800", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6900", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6900", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6800", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003abf000", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "fffff80003c581e0", "conn": "0", "refs": "0", "nextref": "0", "addr": "/var/run/devd.pipe", "kind": "socket"}, {"address": "fffff80003ac3e00", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6c00", "refs": "0", "nextref": "fffff80003ab6400", "kind": "socket"}, {"address": "fffff80003ab6400", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6c00", "refs": "0", "nextref": "fffff80003ab6000", "kind": "socket"}, {"address": "fffff80003ab6000", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6c00", "refs": "0", "nextref": "fffff80003ab6600", "kind": "socket"}, {"address": "fffff80003ab6500", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6d00", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6600", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6c00", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6c00", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "fffff80003c59d20", "conn": "0", "refs": "fffff80003ac3e00", "nextref": "0", "addr": "/var/run/logpriv", "kind": "socket"}, {"address": "fffff80003ab6d00", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "fffff80003c67000", "conn": "0", "refs": "fffff80003ab6500", "nextref": "0", "addr": "/var/run/log", "kind": "socket"}, {"address": "fffff80003ab6e00", "type": "seqpac", "recv_q": 0, "send_q": 0, "unix_inode": "fffff80003c58000", "conn": "0", "refs": "0", "nextref": "0", "addr": "/var/run/devd.seqpacket.pipe", "kind": "socket"}]
|
24
tests/fixtures/freebsd12/netstat-AanP.out
vendored
Normal file
24
tests/fixtures/freebsd12/netstat-AanP.out
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
Active Internet connections (including servers)
|
||||
Tcpcb Proto Recv-Q Send-Q Local Address Foreign Address (state) Log ID
|
||||
fffff80003df43d0 tcp4 0 0 192.168.71.163.22 192.168.71.1.64330 ESTABLISHED -
|
||||
fffff80003df47a0 tcp4 0 0 127.0.0.1.25 *.* LISTEN -
|
||||
fffff80003df4b70 tcp4 0 0 *.22 *.* LISTEN -
|
||||
fffff80003df0000 tcp6 0 0 *.22 *.* LISTEN -
|
||||
fffff80003ae81e8 udp4 0 0 *.514 *.*
|
||||
fffff80003ae87a0 udp6 0 0 *.514 *.*
|
||||
Active UNIX domain sockets
|
||||
Address Type Recv-Q Send-Q Inode Conn Refs Nextref Addr
|
||||
fffff80003ab6200 stream 0 0 0 fffff80003ab6100 0 0
|
||||
fffff80003ab6100 stream 0 0 0 fffff80003ab6200 0 0
|
||||
fffff80003ab6300 stream 0 0 0 0 0 0
|
||||
fffff80003ab6800 stream 0 0 0 fffff80003ab6900 0 0
|
||||
fffff80003ab6900 stream 0 0 0 fffff80003ab6800 0 0
|
||||
fffff80003abf000 stream 0 0 fffff80003c581e0 0 0 0 /var/run/devd.pipe
|
||||
fffff80003ac3e00 dgram 0 0 0 fffff80003ab6c00 0 fffff80003ab6400
|
||||
fffff80003ab6400 dgram 0 0 0 fffff80003ab6c00 0 fffff80003ab6000
|
||||
fffff80003ab6000 dgram 0 0 0 fffff80003ab6c00 0 fffff80003ab6600
|
||||
fffff80003ab6500 dgram 0 0 0 fffff80003ab6d00 0 0
|
||||
fffff80003ab6600 dgram 0 0 0 fffff80003ab6c00 0 0
|
||||
fffff80003ab6c00 dgram 0 0 fffff80003c59d20 0 fffff80003ac3e00 0 /var/run/logpriv
|
||||
fffff80003ab6d00 dgram 0 0 fffff80003c67000 0 fffff80003ab6500 0 /var/run/log
|
||||
fffff80003ab6e00 seqpac 0 0 fffff80003c58000 0 0 0 /var/run/devd.seqpacket.pipe
|
1
tests/fixtures/freebsd12/netstat-Aax.json
vendored
Normal file
1
tests/fixtures/freebsd12/netstat-Aax.json
vendored
Normal file
File diff suppressed because one or more lines are too long
24
tests/fixtures/freebsd12/netstat-Aax.out
vendored
Normal file
24
tests/fixtures/freebsd12/netstat-Aax.out
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
Active Internet connections (including servers)
|
||||
Tcpcb Proto Recv-Q Send-Q Local Address Foreign Address R-MBUF S-MBUF R-CLUS S-CLUS R-HIWA S-HIWA R-LOWA S-LOWA R-BCNT S-BCNT R-BMAX S-BMAX rexmt persist keep 2msl delack rcvtime
|
||||
fffff80003df43d0 tcp4 0 0 192.168.71.1.ssh 192.168.71.1.64330 0 0 0 0 65700 33580 1 2048 0 0 525600 268640 0.00 0.00 5079.93 0.00 0.00 0.00
|
||||
fffff80003df47a0 tcp4 0 0 localhost.smtp *.* 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0.00 0.00 0.00 0.00 8841.63
|
||||
fffff80003df4b70 tcp4 0 0 *.ssh *.* 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0.00 0.00 0.00 0.00 8857.24
|
||||
fffff80003df0000 tcp6 0 0 *.ssh *.* 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0.00 0.00 0.00 0.00 8857.24
|
||||
fffff80003ae81e8 udp4 0 0 *.syslog *.* 0 0 0 0 0 9216 0 2048 0 0 0 73728
|
||||
fffff80003ae87a0 udp6 0 0 *.syslog *.* 0 0 0 0 0 9216 0 2048 0 0 0 73728
|
||||
Active UNIX domain sockets
|
||||
Address Type Recv-Q Send-Q Inode Conn Refs Nextref Addr
|
||||
fffff80003ab6200 stream 0 0 0 fffff80003ab6100 0 0
|
||||
fffff80003ab6100 stream 0 0 0 fffff80003ab6200 0 0
|
||||
fffff80003ab6300 stream 0 0 0 0 0 0
|
||||
fffff80003ab6800 stream 0 0 0 fffff80003ab6900 0 0
|
||||
fffff80003ab6900 stream 0 0 0 fffff80003ab6800 0 0
|
||||
fffff80003abf000 stream 0 0 fffff80003c581e0 0 0 0 /var/run/devd.pipe
|
||||
fffff80003ac3e00 dgram 0 0 0 fffff80003ab6c00 0 fffff80003ab6400
|
||||
fffff80003ab6400 dgram 0 0 0 fffff80003ab6c00 0 fffff80003ab6000
|
||||
fffff80003ab6000 dgram 0 0 0 fffff80003ab6c00 0 fffff80003ab6600
|
||||
fffff80003ab6500 dgram 0 0 0 fffff80003ab6d00 0 0
|
||||
fffff80003ab6600 dgram 0 0 0 fffff80003ab6c00 0 0
|
||||
fffff80003ab6c00 dgram 0 0 fffff80003c59d20 0 fffff80003ac3e00 0 /var/run/logpriv
|
||||
fffff80003ab6d00 dgram 0 0 fffff80003c67000 0 fffff80003ab6500 0 /var/run/log
|
||||
fffff80003ab6e00 seqpac 0 0 fffff80003c58000 0 0 0 /var/run/devd.seqpacket.pipe
|
1
tests/fixtures/freebsd12/netstat-aT.json
vendored
Normal file
1
tests/fixtures/freebsd12/netstat-aT.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
[{"proto": "tcp4", "rexmit": 3, "ooorcv": 0, "0_win": 0, "local_address": "192.168.71.163", "foreign_address": "192.168.71.1", "kind": "network", "local_port": "ssh", "foreign_port": "64330", "transport_protocol": "tcp", "network_protocol": "ipv4", "foreign_port_num": 64330}, {"proto": "tcp4", "rexmit": 0, "ooorcv": 0, "0_win": 0, "local_address": "localhost", "foreign_address": "*", "kind": "network", "local_port": "smtp", "foreign_port": "*", "transport_protocol": "tcp", "network_protocol": "ipv4"}, {"proto": "tcp4", "rexmit": 0, "ooorcv": 0, "0_win": 0, "local_address": "*", "foreign_address": "*", "kind": "network", "local_port": "ssh", "foreign_port": "*", "transport_protocol": "tcp", "network_protocol": "ipv4"}, {"proto": "tcp6", "rexmit": 0, "ooorcv": 0, "0_win": 0, "local_address": "*", "foreign_address": "*", "kind": "network", "local_port": "ssh", "foreign_port": "*", "transport_protocol": "tcp", "network_protocol": "ipv6"}, {"proto": "udp4", "rexmit": null, "ooorcv": null, "0_win": null, "local_address": "*", "foreign_address": "*", "kind": "network", "local_port": "syslog", "foreign_port": "*", "transport_protocol": "udp", "network_protocol": "ipv4"}, {"proto": "udp6", "rexmit": null, "ooorcv": null, "0_win": null, "local_address": "*", "foreign_address": "*", "kind": "network", "local_port": "syslog", "foreign_port": "*", "transport_protocol": "udp", "network_protocol": "ipv6"}, {"address": "fffff80003ab6200", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6100", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6100", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6200", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6300", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "0", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6800", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6900", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6900", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6800", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003abf000", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "fffff80003c581e0", "conn": "0", "refs": "0", "nextref": "0", "addr": "/var/run/devd.pipe", "kind": "socket"}, {"address": "fffff80003ac3e00", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6c00", "refs": "0", "nextref": "fffff80003ab6400", "kind": "socket"}, {"address": "fffff80003ab6400", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6c00", "refs": "0", "nextref": "fffff80003ab6000", "kind": "socket"}, {"address": "fffff80003ab6000", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6c00", "refs": "0", "nextref": "fffff80003ab6600", "kind": "socket"}, {"address": "fffff80003ab6500", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6d00", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6600", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6c00", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6c00", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "fffff80003c59d20", "conn": "0", "refs": "fffff80003ac3e00", "nextref": "0", "addr": "/var/run/logpriv", "kind": "socket"}, {"address": "fffff80003ab6d00", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "fffff80003c67000", "conn": "0", "refs": "fffff80003ab6500", "nextref": "0", "addr": "/var/run/log", "kind": "socket"}, {"address": "fffff80003ab6e00", "type": "seqpac", "recv_q": 0, "send_q": 0, "unix_inode": "fffff80003c58000", "conn": "0", "refs": "0", "nextref": "0", "addr": "/var/run/devd.seqpacket.pipe", "kind": "socket"}]
|
24
tests/fixtures/freebsd12/netstat-aT.out
vendored
Normal file
24
tests/fixtures/freebsd12/netstat-aT.out
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
Active Internet connections (including servers)
|
||||
Proto Rexmit OOORcv 0-win Local Address Foreign Address
|
||||
tcp4 3 0 0 192.168.71.163.ssh 192.168.71.1.64330
|
||||
tcp4 0 0 0 localhost.smtp *.*
|
||||
tcp4 0 0 0 *.ssh *.*
|
||||
tcp6 0 0 0 *.ssh *.*
|
||||
udp4 *.syslog *.*
|
||||
udp6 *.syslog *.*
|
||||
Active UNIX domain sockets
|
||||
Address Type Recv-Q Send-Q Inode Conn Refs Nextref Addr
|
||||
fffff80003ab6200 stream 0 0 0 fffff80003ab6100 0 0
|
||||
fffff80003ab6100 stream 0 0 0 fffff80003ab6200 0 0
|
||||
fffff80003ab6300 stream 0 0 0 0 0 0
|
||||
fffff80003ab6800 stream 0 0 0 fffff80003ab6900 0 0
|
||||
fffff80003ab6900 stream 0 0 0 fffff80003ab6800 0 0
|
||||
fffff80003abf000 stream 0 0 fffff80003c581e0 0 0 0 /var/run/devd.pipe
|
||||
fffff80003ac3e00 dgram 0 0 0 fffff80003ab6c00 0 fffff80003ab6400
|
||||
fffff80003ab6400 dgram 0 0 0 fffff80003ab6c00 0 fffff80003ab6000
|
||||
fffff80003ab6000 dgram 0 0 0 fffff80003ab6c00 0 fffff80003ab6600
|
||||
fffff80003ab6500 dgram 0 0 0 fffff80003ab6d00 0 0
|
||||
fffff80003ab6600 dgram 0 0 0 fffff80003ab6c00 0 0
|
||||
fffff80003ab6c00 dgram 0 0 fffff80003c59d20 0 fffff80003ac3e00 0 /var/run/logpriv
|
||||
fffff80003ab6d00 dgram 0 0 fffff80003c67000 0 fffff80003ab6500 0 /var/run/log
|
||||
fffff80003ab6e00 seqpac 0 0 fffff80003c58000 0 0 0 /var/run/devd.seqpacket.pipe
|
1
tests/fixtures/freebsd12/netstat-an.json
vendored
Normal file
1
tests/fixtures/freebsd12/netstat-an.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
[{"proto": "tcp4", "recv_q": 0, "send_q": 0, "local_address": "192.168.71.163", "foreign_address": "192.168.71.1", "state": "ESTABLISHED", "kind": "network", "local_port": "22", "foreign_port": "56321", "transport_protocol": "tcp", "network_protocol": "ipv4", "local_port_num": 22, "foreign_port_num": 56321}, {"proto": "tcp4", "recv_q": 0, "send_q": 0, "local_address": "127.0.0.1", "foreign_address": "*", "state": "LISTEN", "kind": "network", "local_port": "25", "foreign_port": "*", "transport_protocol": "tcp", "network_protocol": "ipv4", "local_port_num": 25}, {"proto": "tcp4", "recv_q": 0, "send_q": 0, "local_address": "*", "foreign_address": "*", "state": "LISTEN", "kind": "network", "local_port": "22", "foreign_port": "*", "transport_protocol": "tcp", "network_protocol": "ipv4", "local_port_num": 22}, {"proto": "tcp6", "recv_q": 0, "send_q": 0, "local_address": "*", "foreign_address": "*", "state": "LISTEN", "kind": "network", "local_port": "22", "foreign_port": "*", "transport_protocol": "tcp", "network_protocol": "ipv6", "local_port_num": 22}, {"proto": "udp4", "recv_q": 0, "send_q": 0, "local_address": "*", "foreign_address": "*", "state": null, "kind": "network", "local_port": "514", "foreign_port": "*", "transport_protocol": "udp", "network_protocol": "ipv4", "local_port_num": 514}, {"proto": "udp6", "recv_q": 0, "send_q": 0, "local_address": "*", "foreign_address": "*", "state": null, "kind": "network", "local_port": "514", "foreign_port": "*", "transport_protocol": "udp", "network_protocol": "ipv6", "local_port_num": 514}, {"address": "fffff80003ab6100", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6200", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6200", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6100", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6300", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "0", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6800", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6900", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6900", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6800", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003abf000", "type": "stream", "recv_q": 0, "send_q": 0, "unix_inode": "fffff80003c581e0", "conn": "0", "refs": "0", "nextref": "0", "addr": "/var/run/devd.pipe", "kind": "socket"}, {"address": "fffff80003ac3e00", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6c00", "refs": "0", "nextref": "fffff80003ab6400", "kind": "socket"}, {"address": "fffff80003ab6400", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6c00", "refs": "0", "nextref": "fffff80003ab6000", "kind": "socket"}, {"address": "fffff80003ab6000", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6c00", "refs": "0", "nextref": "fffff80003ab6600", "kind": "socket"}, {"address": "fffff80003ab6500", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6d00", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6600", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "0", "conn": "fffff80003ab6c00", "refs": "0", "nextref": "0", "kind": "socket"}, {"address": "fffff80003ab6c00", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "fffff80003c59d20", "conn": "0", "refs": "fffff80003ac3e00", "nextref": "0", "addr": "/var/run/logpriv", "kind": "socket"}, {"address": "fffff80003ab6d00", "type": "dgram", "recv_q": 0, "send_q": 0, "unix_inode": "fffff80003c67000", "conn": "0", "refs": "fffff80003ab6500", "nextref": "0", "addr": "/var/run/log", "kind": "socket"}, {"address": "fffff80003ab6e00", "type": "seqpac", "recv_q": 0, "send_q": 0, "unix_inode": "fffff80003c58000", "conn": "0", "refs": "0", "nextref": "0", "addr": "/var/run/devd.seqpacket.pipe", "kind": "socket"}]
|
1
tests/fixtures/freebsd12/netstat-i.json
vendored
Normal file
1
tests/fixtures/freebsd12/netstat-i.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
[{"iface": "em0", "mtu": 1500, "network": "<Link#1>", "address": "00:0c:29:1a:4e:3b", "ipkts": 189449, "ierrs": 0, "idrop": 0, "opkts": 211310, "oerrs": 0, "coll": 0, "kind": "interface"}, {"iface": "em0", "mtu": null, "network": "fe80::%em0/64", "address": "fe80::20c:29ff:fe", "ipkts": 0, "ierrs": null, "idrop": null, "opkts": 4, "oerrs": null, "coll": null, "kind": "interface"}, {"iface": "em0", "mtu": null, "network": "192.168.71.0/", "address": "192.168.71.163", "ipkts": 92481, "ierrs": null, "idrop": null, "opkts": 172946, "oerrs": null, "coll": null, "kind": "interface"}, {"iface": "lo0", "mtu": 16384, "network": "<Link#2>", "address": "lo0", "ipkts": 26, "ierrs": 0, "idrop": 0, "opkts": 26, "oerrs": 0, "coll": 0, "kind": "interface"}, {"iface": "lo0", "mtu": null, "network": "localhost", "address": "localhost", "ipkts": 23, "ierrs": null, "idrop": null, "opkts": 23, "oerrs": null, "coll": null, "kind": "interface"}, {"iface": "lo0", "mtu": null, "network": "fe80::%lo0/64", "address": "fe80::1%lo0", "ipkts": 0, "ierrs": null, "idrop": null, "opkts": 0, "oerrs": null, "coll": null, "kind": "interface"}, {"iface": "lo0", "mtu": null, "network": "your-net", "address": "localhost", "ipkts": 3, "ierrs": null, "idrop": null, "opkts": 3, "oerrs": null, "coll": null, "kind": "interface"}]
|
1
tests/fixtures/freebsd12/netstat-ib.json
vendored
Normal file
1
tests/fixtures/freebsd12/netstat-ib.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
[{"iface": "em0", "mtu": 1500, "network": "<Link#1>", "address": "00:0c:29:1a:4e:3b", "ipkts": 372717, "ierrs": 0, "idrop": 0, "ibytes": 372538087, "opkts": 213821, "oerrs": 0, "obytes": 198573339, "coll": 0, "kind": "interface"}, {"iface": "em0", "mtu": null, "network": "fe80::%em0/64", "address": "fe80::20c:29ff:fe", "ipkts": 0, "ierrs": null, "idrop": null, "ibytes": 0, "opkts": 4, "oerrs": null, "obytes": 264, "coll": null, "kind": "interface"}, {"iface": "em0", "mtu": null, "network": "192.168.71.0/", "address": "192.168.71.163", "ipkts": 97396, "ierrs": null, "idrop": null, "ibytes": 68178099, "opkts": 175413, "oerrs": null, "obytes": 193957797, "coll": null, "kind": "interface"}, {"iface": "lo0", "mtu": 16384, "network": "<Link#2>", "address": "lo0", "ipkts": 98, "ierrs": 0, "idrop": 0, "ibytes": 21024, "opkts": 98, "oerrs": 0, "obytes": 21024, "coll": 0, "kind": "interface"}, {"iface": "lo0", "mtu": null, "network": "localhost", "address": "localhost", "ipkts": 25, "ierrs": null, "idrop": null, "ibytes": 4829, "opkts": 25, "oerrs": null, "obytes": 4829, "coll": null, "kind": "interface"}, {"iface": "lo0", "mtu": null, "network": "fe80::%lo0/64", "address": "fe80::1%lo0", "ipkts": 0, "ierrs": null, "idrop": null, "ibytes": 0, "opkts": 0, "oerrs": null, "obytes": 0, "coll": null, "kind": "interface"}, {"iface": "lo0", "mtu": null, "network": "your-net", "address": "localhost", "ipkts": 73, "ierrs": null, "idrop": null, "ibytes": 16195, "opkts": 73, "oerrs": null, "obytes": 16195, "coll": null, "kind": "interface"}]
|
8
tests/fixtures/freebsd12/netstat-ib.out
vendored
Normal file
8
tests/fixtures/freebsd12/netstat-ib.out
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
Name Mtu Network Address Ipkts Ierrs Idrop Ibytes Opkts Oerrs Obytes Coll
|
||||
em0 1500 <Link#1> 00:0c:29:1a:4e:3b 372717 0 0 372538087 213821 0 198573339 0
|
||||
em0 - fe80::%em0/64 fe80::20c:29ff:fe 0 - - 0 4 - 264 -
|
||||
em0 - 192.168.71.0/ 192.168.71.163 97396 - - 68178099 175413 - 193957797 -
|
||||
lo0 16384 <Link#2> lo0 98 0 0 21024 98 0 21024 0
|
||||
lo0 - localhost localhost 25 - - 4829 25 - 4829 -
|
||||
lo0 - fe80::%lo0/64 fe80::1%lo0 0 - - 0 0 - 0 -
|
||||
lo0 - your-net localhost 73 - - 16195 73 - 16195 -
|
1
tests/fixtures/freebsd12/netstat-r.json
vendored
Normal file
1
tests/fixtures/freebsd12/netstat-r.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
[{"destination": "default", "gateway": "192.168.71.2", "route_flags": "UGS", "iface": "em0", "kind": "route", "route_flags_pretty": ["UP", "GATEWAY", "STATIC"]}, {"destination": "localhost", "gateway": "link#2", "route_flags": "UH", "iface": "lo0", "kind": "route", "route_flags_pretty": ["UP", "HOST"]}, {"destination": "192.168.71.0/24", "gateway": "link#1", "route_flags": "U", "iface": "em0", "kind": "route", "route_flags_pretty": ["UP"]}, {"destination": "192.168.71.163", "gateway": "link#1", "route_flags": "UHS", "iface": "lo0", "kind": "route", "route_flags_pretty": ["UP", "HOST", "STATIC"]}, {"destination": "::/96", "gateway": "localhost", "route_flags": "UGRS", "iface": "lo0", "kind": "route", "route_flags_pretty": ["UP", "GATEWAY", "REJECT", "STATIC"]}, {"destination": "localhost", "gateway": "link#2", "route_flags": "UH", "iface": "lo0", "kind": "route", "route_flags_pretty": ["UP", "HOST"]}, {"destination": "::ffff:0.0.0.0/96", "gateway": "localhost", "route_flags": "UGRS", "iface": "lo0", "kind": "route", "route_flags_pretty": ["UP", "GATEWAY", "REJECT", "STATIC"]}, {"destination": "fe80::/10", "gateway": "localhost", "route_flags": "UGRS", "iface": "lo0", "kind": "route", "route_flags_pretty": ["UP", "GATEWAY", "REJECT", "STATIC"]}, {"destination": "fe80::%em0/64", "gateway": "link#1", "route_flags": "U", "iface": "em0", "kind": "route", "route_flags_pretty": ["UP"]}, {"destination": "fe80::20c:29ff:fe1", "gateway": "link#1", "route_flags": "UHS", "iface": "lo0", "kind": "route", "route_flags_pretty": ["UP", "HOST", "STATIC"]}, {"destination": "fe80::%lo0/64", "gateway": "link#2", "route_flags": "U", "iface": "lo0", "kind": "route", "route_flags_pretty": ["UP"]}, {"destination": "fe80::1%lo0", "gateway": "link#2", "route_flags": "UHS", "iface": "lo0", "kind": "route", "route_flags_pretty": ["UP", "HOST", "STATIC"]}, {"destination": "ff02::/16", "gateway": "localhost", "route_flags": "UGRS", "iface": "lo0", "kind": "route", "route_flags_pretty": ["UP", "GATEWAY", "REJECT", "STATIC"]}]
|
@ -56,6 +56,24 @@ class MyTests(unittest.TestCase):
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/netstat-Abn.out'), 'r', encoding='utf-8') as f:
|
||||
self.osx_14_6_netstat_Abn = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/netstat-Aa.out'), 'r', encoding='utf-8') as f:
|
||||
self.freebsd12_netstat_Aa = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/netstat-an.out'), 'r', encoding='utf-8') as f:
|
||||
self.freebsd12_netstat_an = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/netstat-AanP.out'), 'r', encoding='utf-8') as f:
|
||||
self.freebsd12_netstat_AanP = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/netstat-AaT.out'), 'r', encoding='utf-8') as f:
|
||||
self.freebsd12_netstat_AaT = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/netstat-Aax.out'), 'r', encoding='utf-8') as f:
|
||||
self.freebsd12_netstat_Aax = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/netstat-aT.out'), 'r', encoding='utf-8') as f:
|
||||
self.freebsd12_netstat_aT = f.read()
|
||||
|
||||
# netstat -r
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/netstat-r.out'), 'r', encoding='utf-8') as f:
|
||||
self.centos_7_7_netstat_r = f.read()
|
||||
@ -81,6 +99,9 @@ class MyTests(unittest.TestCase):
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/netstat-rnl.out'), 'r', encoding='utf-8') as f:
|
||||
self.osx_14_6_netstat_rnl = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/netstat-r.out'), 'r', encoding='utf-8') as f:
|
||||
self.freebsd12_netstat_r = f.read()
|
||||
|
||||
# netstat -i
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/netstat-i.out'), 'r', encoding='utf-8') as f:
|
||||
self.centos_7_7_netstat_i = f.read()
|
||||
@ -91,6 +112,12 @@ class MyTests(unittest.TestCase):
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/netstat-i.out'), 'r', encoding='utf-8') as f:
|
||||
self.osx_14_6_netstat_i = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/netstat-i.out'), 'r', encoding='utf-8') as f:
|
||||
self.freebsd12_netstat_i = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/netstat-ib.out'), 'r', encoding='utf-8') as f:
|
||||
self.freebsd12_netstat_ib = f.read()
|
||||
|
||||
#
|
||||
# output
|
||||
#
|
||||
@ -138,6 +165,24 @@ class MyTests(unittest.TestCase):
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/netstat-Abn.json'), 'r', encoding='utf-8') as f:
|
||||
self.osx_14_6_netstat_Abn_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/netstat-Aa.json'), 'r', encoding='utf-8') as f:
|
||||
self.freebsd12_netstat_Aa_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/netstat-AanP.json'), 'r', encoding='utf-8') as f:
|
||||
self.freebsd12_netstat_AanP_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/netstat-AaT.json'), 'r', encoding='utf-8') as f:
|
||||
self.freebsd12_netstat_AaT_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/netstat-Aax.json'), 'r', encoding='utf-8') as f:
|
||||
self.freebsd12_netstat_Aax_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/netstat-aT.json'), 'r', encoding='utf-8') as f:
|
||||
self.freebsd12_netstat_aT_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/netstat-an.json'), 'r', encoding='utf-8') as f:
|
||||
self.freebsd12_netstat_an_json = json.loads(f.read())
|
||||
|
||||
# netsat -r
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/netstat-r.json'), 'r', encoding='utf-8') as f:
|
||||
self.centos_7_7_netstat_r_json = json.loads(f.read())
|
||||
@ -163,6 +208,9 @@ class MyTests(unittest.TestCase):
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/netstat-rnl.json'), 'r', encoding='utf-8') as f:
|
||||
self.osx_14_6_netstat_rnl_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/netstat-r.json'), 'r', encoding='utf-8') as f:
|
||||
self.freebsd12_netstat_r_json = json.loads(f.read())
|
||||
|
||||
# netstat -i
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/netstat-i.json'), 'r', encoding='utf-8') as f:
|
||||
self.centos_7_7_netstat_i_json = json.loads(f.read())
|
||||
@ -173,6 +221,12 @@ class MyTests(unittest.TestCase):
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/netstat-i.json'), 'r', encoding='utf-8') as f:
|
||||
self.osx_14_6_netstat_i_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/netstat-i.json'), 'r', encoding='utf-8') as f:
|
||||
self.freebsd12_netstat_i_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/netstat-ib.json'), 'r', encoding='utf-8') as f:
|
||||
self.freebsd12_netstat_ib_json = json.loads(f.read())
|
||||
|
||||
def test_netstat_centos_7_7(self):
|
||||
"""
|
||||
Test 'netstat' on Centos 7.7
|
||||
@ -257,6 +311,42 @@ class MyTests(unittest.TestCase):
|
||||
"""
|
||||
self.assertEqual(jc.parsers.netstat.parse(self.osx_14_6_netstat_Abn, quiet=True), self.osx_14_6_netstat_Abn_json)
|
||||
|
||||
def test_netstat_Aa_freebsd12(self):
|
||||
"""
|
||||
Test 'netstat -Aa' on FreeBSD12
|
||||
"""
|
||||
self.assertEqual(jc.parsers.netstat.parse(self.freebsd12_netstat_Aa, quiet=True), self.freebsd12_netstat_Aa_json)
|
||||
|
||||
def test_netstat_AanP_freebsd12(self):
|
||||
"""
|
||||
Test 'netstat -AanP' on FreeBSD12
|
||||
"""
|
||||
self.assertEqual(jc.parsers.netstat.parse(self.freebsd12_netstat_AanP, quiet=True), self.freebsd12_netstat_AanP_json)
|
||||
|
||||
def test_netstat_AaT_freebsd12(self):
|
||||
"""
|
||||
Test 'netstat -AaT' on FreeBSD12
|
||||
"""
|
||||
self.assertEqual(jc.parsers.netstat.parse(self.freebsd12_netstat_AaT, quiet=True), self.freebsd12_netstat_AaT_json)
|
||||
|
||||
def test_netstat_Aax_freebsd12(self):
|
||||
"""
|
||||
Test 'netstat -Aax' on FreeBSD12
|
||||
"""
|
||||
self.assertEqual(jc.parsers.netstat.parse(self.freebsd12_netstat_Aax, quiet=True), self.freebsd12_netstat_Aax_json)
|
||||
|
||||
def test_netstat_aT_freebsd12(self):
|
||||
"""
|
||||
Test 'netstat -aT' on FreeBSD12
|
||||
"""
|
||||
self.assertEqual(jc.parsers.netstat.parse(self.freebsd12_netstat_aT, quiet=True), self.freebsd12_netstat_aT_json)
|
||||
|
||||
def test_netstat_an_freebsd12(self):
|
||||
"""
|
||||
Test 'netstat -an' on FreeBSD12
|
||||
"""
|
||||
self.assertEqual(jc.parsers.netstat.parse(self.freebsd12_netstat_an, quiet=True), self.freebsd12_netstat_an_json)
|
||||
|
||||
def test_netstat_r_centos_7_7(self):
|
||||
"""
|
||||
Test 'netstat -r' on Centos 7.7
|
||||
@ -305,6 +395,12 @@ class MyTests(unittest.TestCase):
|
||||
"""
|
||||
self.assertEqual(jc.parsers.netstat.parse(self.osx_14_6_netstat_rnl, quiet=True), self.osx_14_6_netstat_rnl_json)
|
||||
|
||||
def test_netstat_r_freebsd12(self):
|
||||
"""
|
||||
Test 'netstat -r' on FreeBSD12
|
||||
"""
|
||||
self.assertEqual(jc.parsers.netstat.parse(self.freebsd12_netstat_r, quiet=True), self.freebsd12_netstat_r_json)
|
||||
|
||||
def test_netstat_i_centos_7_7(self):
|
||||
"""
|
||||
Test 'netstat -i' on Centos 7.7
|
||||
@ -323,6 +419,18 @@ class MyTests(unittest.TestCase):
|
||||
"""
|
||||
self.assertEqual(jc.parsers.netstat.parse(self.osx_14_6_netstat_i, quiet=True), self.osx_14_6_netstat_i_json)
|
||||
|
||||
def test_netstat_i_freebsd12(self):
|
||||
"""
|
||||
Test 'netstat -i' on FreeBSD12
|
||||
"""
|
||||
self.assertEqual(jc.parsers.netstat.parse(self.freebsd12_netstat_i, quiet=True), self.freebsd12_netstat_i_json)
|
||||
|
||||
def test_netstat_ib_freebsd12(self):
|
||||
"""
|
||||
Test 'netstat -ib' on FreeBSD12
|
||||
"""
|
||||
self.assertEqual(jc.parsers.netstat.parse(self.freebsd12_netstat_ib, quiet=True), self.freebsd12_netstat_ib_json)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
Reference in New Issue
Block a user