mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-07-13 01:20:24 +02:00
add netstat test for Fedora32
This commit is contained in:
@ -40,6 +40,9 @@ class MyTests(unittest.TestCase):
|
|||||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/netstat-sudo-aeep.out'), 'r', encoding='utf-8') as f:
|
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/netstat-sudo-aeep.out'), 'r', encoding='utf-8') as f:
|
||||||
self.ubuntu_18_4_netstat_sudo_aeep = f.read()
|
self.ubuntu_18_4_netstat_sudo_aeep = f.read()
|
||||||
|
|
||||||
|
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/netstat.out'), 'r', encoding='utf-8') as f:
|
||||||
|
self.fedora32_netstat = f.read()
|
||||||
|
|
||||||
# output
|
# output
|
||||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/netstat.json'), 'r', encoding='utf-8') as f:
|
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/netstat.json'), 'r', encoding='utf-8') as f:
|
||||||
self.centos_7_7_netstat_json = json.loads(f.read())
|
self.centos_7_7_netstat_json = json.loads(f.read())
|
||||||
@ -71,6 +74,9 @@ class MyTests(unittest.TestCase):
|
|||||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/netstat-sudo-aeep.json'), 'r', encoding='utf-8') as f:
|
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/netstat-sudo-aeep.json'), 'r', encoding='utf-8') as f:
|
||||||
self.ubuntu_18_4_netstat_sudo_aeep_json = json.loads(f.read())
|
self.ubuntu_18_4_netstat_sudo_aeep_json = json.loads(f.read())
|
||||||
|
|
||||||
|
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/fedora32/netstat.json'), 'r', encoding='utf-8') as f:
|
||||||
|
self.fedora32_netstat_json = json.loads(f.read())
|
||||||
|
|
||||||
def test_netstat_centos_7_7(self):
|
def test_netstat_centos_7_7(self):
|
||||||
"""
|
"""
|
||||||
Test 'netstat' on Centos 7.7
|
Test 'netstat' on Centos 7.7
|
||||||
@ -131,6 +137,12 @@ class MyTests(unittest.TestCase):
|
|||||||
"""
|
"""
|
||||||
self.assertEqual(jc.parsers.netstat.parse(self.ubuntu_18_4_netstat_sudo_aeep, quiet=True), self.ubuntu_18_4_netstat_sudo_aeep_json)
|
self.assertEqual(jc.parsers.netstat.parse(self.ubuntu_18_4_netstat_sudo_aeep, quiet=True), self.ubuntu_18_4_netstat_sudo_aeep_json)
|
||||||
|
|
||||||
|
def test_netstat_fedora32(self):
|
||||||
|
"""
|
||||||
|
Test 'netstat' on Fedora32
|
||||||
|
"""
|
||||||
|
self.assertEqual(jc.parsers.netstat.parse(self.fedora32_netstat, quiet=True), self.fedora32_netstat_json)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
Reference in New Issue
Block a user