mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
add netstat-sudo-aeep tests
This commit is contained in:
@ -34,6 +34,12 @@ class MyTests(unittest.TestCase):
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/netstat-sudo-lnp.out'), 'r') as f:
|
||||
self.ubuntu_18_4_netstat_sudo_lnp = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/netstat-sudo-aeep.out'), 'r') as f:
|
||||
self.centos_7_7_netstat_sudo_aeep = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/netstat-sudo-aeep.out'), 'r') as f:
|
||||
self.ubuntu_18_4_netstat_sudo_aeep = f.read()
|
||||
|
||||
# output
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/netstat.json'), 'r') as f:
|
||||
self.centos_7_7_netstat_json = json.loads(f.read())
|
||||
@ -59,6 +65,12 @@ class MyTests(unittest.TestCase):
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/netstat-sudo-lnp.json'), 'r') as f:
|
||||
self.ubuntu_18_4_netstat_sudo_lnp_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/netstat-sudo-aeep.json'), 'r') as f:
|
||||
self.centos_7_7_netstat_sudo_aeep_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/netstat-sudo-aeep.json'), 'r') as f:
|
||||
self.ubuntu_18_4_netstat_sudo_aeep_json = json.loads(f.read())
|
||||
|
||||
def test_netstat_centos_7_7(self):
|
||||
"""
|
||||
Test 'netstat' on Centos 7.7
|
||||
@ -107,6 +119,18 @@ class MyTests(unittest.TestCase):
|
||||
"""
|
||||
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_sudo_aeep_centos_7_7(self):
|
||||
"""
|
||||
Test 'sudo netstat -aeep' on Centos 7.7
|
||||
"""
|
||||
self.assertEqual(jc.parsers.netstat.parse(self.centos_7_7_netstat_sudo_aeep, quiet=True), self.centos_7_7_netstat_sudo_aeep_json)
|
||||
|
||||
def test_netstat_sudo_aeep_ubuntu_18_4(self):
|
||||
"""
|
||||
Test 'sudo netstat -aeep' on Ubuntu 18.4
|
||||
"""
|
||||
self.assertEqual(jc.parsers.netstat.parse(self.ubuntu_18_4_netstat_sudo_aeep, quiet=True), self.ubuntu_18_4_netstat_sudo_aeep_json)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
Reference in New Issue
Block a user