mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-devtest
synced 2026-01-15 10:23:32 +01:00
Add test.cases.LsofNet
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
03da0449c4
commit
e0819d7c39
1 changed files with 18 additions and 0 deletions
18
src/python/devtest/os/test/cases/LsofNet.py
Normal file
18
src/python/devtest/os/test/cases/LsofNet.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ..ListCmd import ListCmd
|
||||
|
||||
class LsofNet(ListCmd): # export
|
||||
|
||||
# Override as needed.
|
||||
def _row_info(self):
|
||||
return (
|
||||
r'lsof +c 15 -i -n | egrep "LISTEN|UDP|COM"',
|
||||
# COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
|
||||
# systemd 1 root 42u IPv4 9763 0t0 TCP * : 222 (LISTEN)
|
||||
# confd.smp 1190 root 77u IPv4 27916 0t0 TCP *:ssh (LISTEN)
|
||||
"^ *(\S+) +([0-9]+) +(\S+) +(\S+) +(\S+) +([0-9]+) +(\S+) +(UDP|TCP) +([^: ])+:([0-9a-z]+) +(\(LISTEN\))",
|
||||
[ 'cmd', 'pid', 'user','fd', 'type', 'device','size/off','prot', 'addr', 'port', 'attrib' ],
|
||||
[ 'cmd', 'user', 'prot', 'addr', 'port' ],
|
||||
[ 'prot', 'port' ]
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue