@@ -12,7 +12,8 @@ class TestSingleDeviceVVParse(unittest.TestCase):
1212
1313 DEVICE_REC = {
1414 'pci_device_string' : 'Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet (rev 20)' ,
15- 'pci_device_type' : 'Ethernet controller' ,
15+ 'pci_device_class' : '0200' ,
16+ 'pci_device_class_name' : 'Ethernet controller' ,
1617 'pci_device_bus_id' : '02:00.0' ,
1718 'pci_device_sub_string' : 'Dell Device 0488' ,
1819 'pci_device_vpd_product_name' : 'Broadcom NetXtreme II Ethernet Controller' ,
@@ -36,9 +37,9 @@ def test_pci_device_bus_id(self):
3637 rec = self .parser .parse_items ().pop ()
3738 self ._assert_rec_key (rec , 'pci_device_bus_id' )
3839
39- def test_pci_device_type (self ):
40+ def test_pci_device_class_name (self ):
4041 rec = self .parser .parse_items ().pop ()
41- self ._assert_rec_key (rec , 'pci_device_type ' )
42+ self ._assert_rec_key (rec , 'pci_device_class_name ' )
4243
4344 def test_pci_device_sub_string (self ):
4445 rec = self .parser .parse_items ().pop ()
@@ -70,7 +71,7 @@ class TestSingleDeviceNParse(unittest.TestCase):
7071 'pci_device_bus_id' : 'ff:10.5' ,
7172 'pci_vendor_id' : '8086' ,
7273 'pci_device_id' : '0eb5' ,
73- 'pci_device_type_id ' : '0880' ,
74+ 'pci_device_class ' : '0880' ,
7475 }
7576
7677 def setUp (self ):
@@ -89,8 +90,8 @@ def test_pci_vendor_id(self):
8990 def test_pci_device_id (self ):
9091 self ._assert_rec_key ('pci_device_id' )
9192
92- def test_pci_device_type_id (self ):
93- self ._assert_rec_key ('pci_device_type_id ' )
93+ def test_pci_device_class (self ):
94+ self ._assert_rec_key ('pci_device_class ' )
9495
9596class TestMultiDeviceNParse (unittest .TestCase ):
9697
@@ -113,8 +114,8 @@ class TestSingleDeviceNNMMParse(unittest.TestCase):
113114
114115 DEVICE_REC = {
115116 'pci_device_bus_id' : '02:00.0' ,
116- 'pci_device_type_id ' : '0200' ,
117- 'pci_device_type_name ' : 'Ethernet controller' ,
117+ 'pci_device_class ' : '0200' ,
118+ 'pci_device_class_name ' : 'Ethernet controller' ,
118119 'pci_vendor_name' : 'Broadcom Corporation' ,
119120 'pci_vendor_id' : '14e4' ,
120121 'pci_device_id' : '163b' ,
@@ -135,11 +136,11 @@ def _assert_rec_key(self, key):
135136 def test_pci_device_bus_id (self ):
136137 self ._assert_rec_key ('pci_device_bus_id' )
137138
138- def test_pci_device_type_id (self ):
139- self ._assert_rec_key ('pci_device_type_id ' )
139+ def test_pci_device_class (self ):
140+ self ._assert_rec_key ('pci_device_class ' )
140141
141- def test_pci_device_type_name (self ):
142- self ._assert_rec_key ('pci_device_type_name ' )
142+ def test_pci_device_class_name (self ):
143+ self ._assert_rec_key ('pci_device_class_name ' )
143144
144145 def test_pci_vendor_name (self ):
145146 self ._assert_rec_key ('pci_vendor_name' )
@@ -168,8 +169,8 @@ class LsiDeviceParse(TestSingleDeviceNNMMParse):
168169
169170 DEVICE_REC = {
170171 'pci_device_bus_id' : '03:00.0' ,
171- 'pci_device_type_id ' : '0100' ,
172- 'pci_device_type_name ' : 'SCSI storage controller' ,
172+ 'pci_device_class ' : '0100' ,
173+ 'pci_device_class_name ' : 'SCSI storage controller' ,
173174 'pci_vendor_name' : 'LSI Logic / Symbios Logic' ,
174175 'pci_vendor_id' : '1000' ,
175176 'pci_device_id' : '0058' ,
@@ -187,8 +188,8 @@ class IntelUSBControllerDeviceParse(TestSingleDeviceNNMMParse):
187188
188189 DEVICE_REC = {
189190 'pci_device_bus_id' : '00:1d.0' ,
190- 'pci_device_type_id ' : '0c03' ,
191- 'pci_device_type_name ' : 'USB controller' ,
191+ 'pci_device_class ' : '0c03' ,
192+ 'pci_device_class_name ' : 'USB controller' ,
192193 'pci_vendor_name' : 'Intel Corporation' ,
193194 'pci_vendor_id' : '8086' ,
194195 'pci_device_id' : '3b34' ,
@@ -199,6 +200,61 @@ class IntelUSBControllerDeviceParse(TestSingleDeviceNNMMParse):
199200 'pci_subdevice_id' : '02a3' ,
200201 }
201202
203+ class EmulexNicDeviceParse (TestSingleDeviceNNMMParse ):
204+
205+ SAMPLE_DATA = '0c:00.0 "Ethernet controller [0200]" "Emulex Corporation [19a2]" "OneConnect 10Gb NIC (be3) [0710]" -r02 "Emulex Corporation [10df]" "Device [e70b]"'
206+
207+ DEVICE_REC = {
208+ 'pci_device_bus_id' : '0c:00.0' ,
209+ 'pci_device_class' : '0200' ,
210+ 'pci_device_class_name' : 'Ethernet controller' ,
211+ 'pci_vendor_name' : 'Emulex Corporation' ,
212+ 'pci_vendor_id' : '19a2' ,
213+ 'pci_device_id' : '0710' ,
214+ 'pci_device_name' : 'OneConnect 10Gb NIC (be3)' ,
215+ 'pci_subvendor_name' : 'Emulex Corporation' ,
216+ 'pci_subvendor_id' : '10df' ,
217+ 'pci_subdevice_name' : 'Device' ,
218+ 'pci_subdevice_id' : 'e70b' ,
219+ }
220+
221+ class LsiSASDeviceParse (TestSingleDeviceNNMMParse ):
222+
223+ SAMPLE_DATA = '06:00.0 "Serial Attached SCSI controller [0107]" "LSI Logic / Symbios Logic [1000]" "SAS2004 PCI-Express Fusion-MPT SAS-2 [Spitfire] [0070]" -r03 "IBM [1014]" "Device [03f8]"'
224+
225+ DEVICE_REC = {
226+ 'pci_device_bus_id' : '06:00.0' ,
227+ 'pci_device_class' : '0107' ,
228+ 'pci_device_class_name' : 'Serial Attached SCSI controller' ,
229+ 'pci_vendor_name' : 'LSI Logic / Symbios Logic' ,
230+ 'pci_vendor_id' : '1000' ,
231+ 'pci_device_id' : '0070' ,
232+ 'pci_device_name' : 'SAS2004 PCI-Express Fusion-MPT SAS-2 [Spitfire]' ,
233+ 'pci_subvendor_name' : 'IBM' ,
234+ 'pci_subvendor_id' : '1014' ,
235+ 'pci_subdevice_name' : 'Device' ,
236+ 'pci_subdevice_id' : '03f8' ,
237+ }
238+
239+ class BroadcomNetDeviceParse (TestSingleDeviceNNMMParse ):
240+
241+ SAMPLE_DATA = '01:00.0 "Ethernet controller [0200]" "Broadcom Corporation [14e4]" "NetXtreme BCM5720 Gigabit Ethernet PCIe [165f]" "Dell [1028]" "Device [1f5b]"'
242+
243+ DEVICE_REC = {
244+ 'pci_device_bus_id' : '01:00.0' ,
245+ 'pci_device_class' : '0200' ,
246+ 'pci_device_class_name' : 'Ethernet controller' ,
247+ 'pci_vendor_name' : 'Broadcom Corporation' ,
248+ 'pci_vendor_id' : '14e4' ,
249+ 'pci_device_id' : '165f' ,
250+ 'pci_device_name' : 'NetXtreme BCM5720 Gigabit Ethernet PCIe' ,
251+ 'pci_subvendor_name' : 'Dell' ,
252+ 'pci_subvendor_id' : '1028' ,
253+ 'pci_subdevice_name' : 'Device' ,
254+ 'pci_subdevice_id' : '1f5b' ,
255+ }
256+
257+
202258class TestMultiDeviceNNMMParse (unittest .TestCase ):
203259
204260 SAMPLE_FILE = '%s/lspci-nnmm' % DATA_DIR
0 commit comments