-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gomanuf_test.go
66 lines (58 loc) · 1.78 KB
/
gomanuf_test.go
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
package gomanuf
import "testing"
func TestDLink(t *testing.T) {
manuf, _ := Search("C4:A8:1D:73:D7:8C")
if manuf == "D-Link International" {
t.Log("D-Link International MAC address found.")
return
}
t.Errorf("Found %s instead of D-Link International!", manuf)
}
func TestNetgear(t *testing.T) {
manuf, _ := Search("9C:D3:6D:9A:CA:81")
if manuf == "Netgear" {
t.Log("Netgear MAC address found.")
return
}
t.Errorf("Found %s instead of Netgear!", manuf)
}
func TestShanghaiBroadwanCommunications(t *testing.T) {
manuf, _ := Search("40:ED:98:6F:DB:AC")
if manuf == "Shanghai Broadwan Communications Co.,Ltd" {
t.Log("Shanghai Broadwan Communications Co.,Ltd MAC address found.")
return
}
t.Errorf("Found %s instead of Shanghai Broadwan Communications Co.,Ltd!", manuf)
}
func TestPiranhaEMS(t *testing.T) {
manuf, _ := Search("70:B3:D5:8C:CD:BE")
if manuf == "Piranha EMS Inc." {
t.Log("Piranha EMS Inc. MAC address found.")
return
}
t.Errorf("Found %s instead of Piranha EMS Inc.!", manuf)
}
func TestIEEERegistrationAuthority(t *testing.T) {
manuf, _ := Search("3C:24:F0:F0:BE:CF")
if manuf == "IEEE Registration Authority" {
t.Log("IEEE Registration Authority MAC address found.")
return
}
t.Errorf("Found %s instead of IEEE Registration Authority!", manuf)
}
func TestSamsungElectronics(t *testing.T) {
manuf, _ := Search("24:FC:E5:AD:BB:89")
if manuf == "Samsung Electronics Co.,Ltd" {
t.Log("Samsung Electronics Co.,Ltd MAC address found.")
return
}
t.Errorf("Found %s instead of Samsung Electronics Co.,Ltd!", manuf)
}
func TestInvalidAddress(t *testing.T) {
manuf, _ := Search("G4:FC:E5:AD:BB:89")
if manuf == "Invalid MAC address" {
t.Log("Invalid MAC address MAC address found.")
return
}
t.Errorf("Found %s instead of Invalid MAC address!", manuf)
}