-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpfuzz_test.py
More file actions
executable file
·70 lines (54 loc) · 2.29 KB
/
pfuzz_test.py
File metadata and controls
executable file
·70 lines (54 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/python
import unittest
import pf6mod_dhcp
import pf6mod_ports
import pf6mod_mac
import os
class TestPF6modDHCP(unittest.TestCase):
def setUp(self):
self.seq = []
for i in range(8):
self.seq.append("1::%i" % i)
def test_prefixprefix(self):
for element in pf6mod_dhcp.plugin_main("1::"):
self.assertTrue(element[0:3] == "1::")
def test_usage(self):
self.assertTrue (type(pf6mod_dhcp.plugin_usage()) is str)
def test_desc(self):
self.assertTrue (type(pf6mod_dhcp.plugin_description()) is str)
class TestPF6modMAC(unittest.TestCase):
def setUp(self):
self.seq = []
for i in range(8):
self.seq.append("1::%i" % i)
def test_get_orig_mac(self):
self.assertTrue(type(pf6mod_mac.get_orig_mac("Xerox")) is list)
self.assertEqual(pf6mod_mac.get_orig_mac("Xerox"), ['00:00:01', '00:00:02', '00:00:03', '00:00:04', '00:00:05', '00:00:06', '00:00:07', '00:00:08', '00:00:09', '00:00:AA', '9C:93:4E'])
def test_manuf_dl(self):
if os.path.isfile("pfuzz_manuf") == True:
os.unlink("pfuzz_manuf")
atari = pf6mod_mac.get_orig_mac("Atari")
self.assertTrue(os.path.isfile("pfuzz_manuf") is True)
self.assertTrue("00:00:36" in atari)
def test_usage(self):
self.assertTrue (type(pf6mod_mac.plugin_usage()) is str)
def test_desc(self):
self.assertTrue (type(pf6mod_mac.plugin_description()) is str)
class TestPF6modPorts(unittest.TestCase):
def setUp(self):
self.seq = []
for i in range(8):
self.seq.append("1::%i" % i)
def test_prefixprefix(self):
for element in pf6mod_ports.plugin_main("1::"):
self.assertTrue(type(element) is str)
self.assertTrue(element[0:3] == "1::")
check_int = int(element[element.rfind(":")+1:])
self.assertTrue(type(check_int) is int)
self.assertTrue(type(element[element.rfind(":"):]) is str)
def test_usage(self):
self.assertTrue (type(pf6mod_ports.plugin_usage()) is str)
def test_desc(self):
self.assertTrue (type(pf6mod_ports.plugin_description()) is str)
if __name__ == '__main__':
unittest.main()