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_iptables_mangle_ubuntu_18_4(self):
"""
Test 'sudo iptables -L -t mangle' on Ubuntu 18.4
"""
self.assertEqual(jc.parsers.iptables.parse(self.ubuntu_18_4_iptables_mangle, quiet=True), self.ubuntu_18_4_iptables_mangle_json)
def test_iptables_filter_ubuntu_18_4(self):
"""
Test 'sudo iptables -L -t filter' on Ubuntu 18.4
"""
self.assertEqual(jc.parsers.iptables.parse(self.ubuntu_18_4_iptables_filter, quiet=True), self.ubuntu_18_4_iptables_filter_json)
def test_iptables_raw_centos_7_7(self):
"""
Test 'sudo iptables -L -t raw' on Centos 7.7
"""
self.assertEqual(jc.parsers.iptables.parse(self.centos_7_7_iptables_raw, quiet=True), self.centos_7_7_iptables_raw_json)
def test_iptables_mangle_centos_7_7(self):
"""
Test 'sudo iptables -L -t mangle' on Centos 7.7
"""
self.assertEqual(jc.parsers.iptables.parse(self.centos_7_7_iptables_mangle, quiet=True), self.centos_7_7_iptables_mangle_json)
def test_iptables_nat_centos_7_7(self):
"""
Test 'sudo iptables -L -t nat' on Centos 7.7
"""
self.assertEqual(jc.parsers.iptables.parse(self.centos_7_7_iptables_nat, quiet=True), self.centos_7_7_iptables_nat_json)
def test_iptables_filter_nv_centos_7_7(self):
"""
Test 'sudo iptables -nvL -t filter' on Centos 7.7
"""
self.assertEqual(jc.parsers.iptables.parse(self.centos_7_7_iptables_filter_nv, quiet=True), self.centos_7_7_iptables_filter_nv_json)
def test_iptables_filter_centos_7_7(self):
"""
Test 'sudo iptables -L -t filter' on Centos 7.7
"""
self.assertEqual(jc.parsers.iptables.parse(self.centos_7_7_iptables_filter, quiet=True), self.centos_7_7_iptables_filter_json)
result = jc.parsers.dig.parse(data, raw=raw, quiet=quiet)
elif '--env' in sys.argv:
result = jc.parsers.env.parse(data, raw=raw, quiet=quiet)
elif '--free' in sys.argv:
result = jc.parsers.free.parse(data, raw=raw, quiet=quiet)
elif '--history' in sys.argv:
result = jc.parsers.history.parse(data, raw=raw, quiet=quiet)
elif '--ifconfig' in sys.argv:
result = jc.parsers.ifconfig.parse(data, raw=raw, quiet=quiet)
elif '--iptables' in sys.argv:
result = jc.parsers.iptables.parse(data, raw=raw, quiet=quiet)
elif '--jobs' in sys.argv:
result = jc.parsers.jobs.parse(data, raw=raw, quiet=quiet)
elif '--ls' in sys.argv:
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)