Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_netstat_sudo_lnp_ubuntu_18_4(self):
"""
Test 'sudo netstat -lnp' on Ubuntu 18.4
"""
self.assertEqual(jc.parsers.netstat.parse(self.ubuntu_18_4_netstat_sudo_lnp, quiet=True), self.ubuntu_18_4_netstat_sudo_lnp_json)
def test_netstat_p_ubuntu_18_4(self):
"""
Test 'netstat -l' on Ubuntu 18.4
"""
self.assertEqual(jc.parsers.netstat.parse(self.ubuntu_18_4_netstat_p, quiet=True), self.ubuntu_18_4_netstat_p_json)
def test_netstat_centos_7_7(self):
"""
Test 'netstat' on Centos 7.7
"""
self.assertEqual(jc.parsers.netstat.parse(self.centos_7_7_netstat, quiet=True), self.centos_7_7_netstat_json)
def test_netstat_l_ubuntu_18_4(self):
"""
Test 'netstat -l' on Ubuntu 18.4
"""
self.assertEqual(jc.parsers.netstat.parse(self.ubuntu_18_4_netstat_l, quiet=True), self.ubuntu_18_4_netstat_l_json)
def test_netstat_sudo_lnp_centos_7_7(self):
"""
Test 'sudo netstat -lnp' on Centos 7.7
"""
self.assertEqual(jc.parsers.netstat.parse(self.centos_7_7_netstat_sudo_lnp, quiet=True), self.centos_7_7_netstat_sudo_lnp_json)
def test_netstat_l_centos_7_7(self):
"""
Test 'netstat -l' on Centos 7.7
"""
self.assertEqual(jc.parsers.netstat.parse(self.centos_7_7_netstat_l, quiet=True), self.centos_7_7_netstat_l_json)
def test_netstat_ubuntu_18_4(self):
"""
Test 'netstat' on Ubuntu 18.4
"""
self.assertEqual(jc.parsers.netstat.parse(self.ubuntu_18_4_netstat, quiet=True), self.ubuntu_18_4_netstat_json)
result = jc.parsers.ls.parse(data, raw=raw, quiet=quiet)
elif '--lsblk' in sys.argv:
result = jc.parsers.lsblk.parse(data, raw=raw, quiet=quiet)
elif '--lsmod' in sys.argv:
result = jc.parsers.lsmod.parse(data, raw=raw, quiet=quiet)
elif '--lsof' in sys.argv:
result = jc.parsers.lsof.parse(data, raw=raw, quiet=quiet)
elif '--mount' in sys.argv:
result = jc.parsers.mount.parse(data, raw=raw, quiet=quiet)
elif '--netstat' in sys.argv:
result = jc.parsers.netstat.parse(data, raw=raw, quiet=quiet)
elif '--ps' in sys.argv:
result = jc.parsers.ps.parse(data, raw=raw, quiet=quiet)
elif '--route' in sys.argv:
result = jc.parsers.route.parse(data, raw=raw, quiet=quiet)
elif '--uname' in sys.argv:
result = jc.parsers.uname.parse(data, raw=raw, quiet=quiet)
elif '--uptime' in sys.argv:
result = jc.parsers.uptime.parse(data, raw=raw, quiet=quiet)
elif '--w' in sys.argv:
result = jc.parsers.w.parse(data, raw=raw, quiet=quiet)
'--df': jc.parsers.df.parse,
'--dig': jc.parsers.dig.parse,
'--env': jc.parsers.env.parse,
'--free': jc.parsers.free.parse,
'--fstab': jc.parsers.fstab.parse,
'--history': jc.parsers.history.parse,
'--hosts': jc.parsers.hosts.parse,
'--ifconfig': jc.parsers.ifconfig.parse,
'--iptables': jc.parsers.iptables.parse,
'--jobs': jc.parsers.jobs.parse,
'--ls': jc.parsers.ls.parse,
'--lsblk': jc.parsers.lsblk.parse,
'--lsmod': jc.parsers.lsmod.parse,
'--lsof': jc.parsers.lsof.parse,
'--mount': jc.parsers.mount.parse,
'--netstat': jc.parsers.netstat.parse,
'--ps': jc.parsers.ps.parse,
'--route': jc.parsers.route.parse,
'--ss': jc.parsers.ss.parse,
'--stat': jc.parsers.stat.parse,
'--systemctl': jc.parsers.systemctl.parse,
'--systemctl-lj': jc.parsers.systemctl_lj.parse,
'--systemctl-ls': jc.parsers.systemctl_ls.parse,
'--systemctl-luf': jc.parsers.systemctl_luf.parse,
'--uname': jc.parsers.uname.parse,
'--uptime': jc.parsers.uptime.parse,
'--w': jc.parsers.w.parse
}
found = False
if debug: