Skip to content

Commit

Permalink
update the search pattern for CAN device (BugFix) (canonical#849)
Browse files Browse the repository at this point in the history
* Fix: update the search pattern for CAN device

Update the search pattern for CAN device and adding unittest

* Fix: fixed unit test for NXP S32G

fixed the unit tests for the CAN device in NXP S32G

* Fix: updated the search pattern

updated the search pattern

* Add check for socketcan in udevadm parser unit test for ZCU

---------

Co-authored-by: Pierre Equoy <[email protected]>
  • Loading branch information
2 people authored and LiaoU3 committed Jan 9, 2024
1 parent 7e71252 commit b2acd19
Show file tree
Hide file tree
Showing 3 changed files with 5,934 additions and 2 deletions.
21 changes: 20 additions & 1 deletion checkbox-support/checkbox_support/parsers/tests/test_udevadm.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ def test_openfirmware_network(self):
devices = parser.run()
self.assertEqual(devices[0].category, "NETWORK")


def test_DELL_INSPIRON3521_TOUCHSCREEN(self):
"""
Check devices category having the ID_INPUT_TOUCHSCREEN property
Expand Down Expand Up @@ -884,6 +883,25 @@ def test_CARA_T_SOCKETCAN(self):
self.assertEqual(self.count(devices, "SOCKETCAN"), 1)
self.assertEqual(self.count(devices, "WATCHDOG"), 1)

def test_NXP_S32G_SOCKETCAN(self):
devices = self.parse("NXP_S32G_DEV_BOARD")
self.assertEqual(len(devices), 27)
self.assertEqual(self.count(devices, "VIDEO"), 0)
self.assertEqual(self.count(devices, "AUDIO"), 0)
self.assertEqual(self.count(devices, "KEYBOARD"), 0)
self.assertEqual(self.count(devices, "CARDREADER"), 1)
self.assertEqual(self.count(devices, "CDROM"), 0)
self.assertEqual(self.count(devices, "FIREWIRE"), 0)
self.assertEqual(self.count(devices, "MOUSE"), 0)
self.assertEqual(self.count(devices, "WIRELESS"), 0)
self.assertEqual(self.count(devices, "NETWORK"), 4)
self.assertEqual(self.count(devices, "BLUETOOTH"), 0)
self.assertEqual(self.count(devices, "CAPTURE"), 0)
self.assertEqual(self.count(devices, "DISK"), 0)
self.assertEqual(self.count(devices, "CANBUS"), 0)
self.assertEqual(self.count(devices, "SOCKETCAN"), 17)
self.assertEqual(self.count(devices, "WATCHDOG"), 4)

def test_IBM_s390x_DASD(self):
devices = self.parse("IBM_s390x_DASD")
self.assertEqual(len(devices), 8)
Expand Down Expand Up @@ -1007,6 +1025,7 @@ def test_ZCU104(self):
devices = self.parse("ZCU104")
self.assertEqual(self.count(devices, "VIDEO"), 1)
self.assertEqual(self.count(devices, "DRI"), 0)
self.assertEqual(self.count(devices, "SOCKETCAN"), 1)

def test_CAPTURE_METADATA(self):
devices = self.parse("CAPTURE_METADATA")
Expand Down
Loading

0 comments on commit b2acd19

Please sign in to comment.