Skip to content

Commit

Permalink
Using "New USB device found" for all usbs (BugFix) (#1480)
Browse files Browse the repository at this point in the history
* Using "New USB device found" for all usbs

* fixed black
  • Loading branch information
fernando79513 authored Sep 27, 2024
1 parent 679e16d commit 536b5df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion checkbox-support/checkbox_support/scripts/run_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def _parse_journal_line(self, line_str):
).group(1)

# Look for insertion action
if "USB Mass Storage device detected" in line_str or "uas" in line_str:
if "New USB device found" in line_str:
self.action = "insertion"

# Look for removal action
Expand Down
7 changes: 1 addition & 6 deletions checkbox-support/checkbox_support/tests/test_run_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,12 +345,7 @@ def test_usb_storage_parse_journal_line(self):
USBStorage._parse_journal_line(mock_usb_storage, line_str)
self.assertEqual(mock_usb_storage.driver, "xhci_hcd")

line_str = "USB Mass Storage device detected"
mock_usb_storage = MagicMock()
USBStorage._parse_journal_line(mock_usb_storage, line_str)
self.assertEqual(mock_usb_storage.action, "insertion")

line_str = "kernel: scsi host0: uas"
line_str = "New USB device found"
mock_usb_storage = MagicMock()
USBStorage._parse_journal_line(mock_usb_storage, line_str)
self.assertEqual(mock_usb_storage.action, "insertion")
Expand Down

0 comments on commit 536b5df

Please sign in to comment.