Skip to content

Commit

Permalink
Handle HIDRAW devices that have no parents in the udev stack (BugFix) (
Browse files Browse the repository at this point in the history
…#1418)

* Only test parents of hidraw device if they exist

The parser "HID devices if nothing else is known to be
an input device on the same udev subtree" and hence tries to check
the stack of devices seen by udev, but it appears we are now
encountering hidraw devices with no parents
  • Loading branch information
jocave authored Aug 14, 2024
1 parent 4123afe commit da7297d
Show file tree
Hide file tree
Showing 4 changed files with 10,251 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,11 @@ def test_LENOVO_T420(self):
self.assertEqual(self.count(devices, "NETWORK"), 1)
self.verify_devices(devices, expected_devices)

def test_HP_ELITEBOOK_835_13_INCH_G10(self):
devices = self.parse("HP_ELITEBOOK_835_13_INCH_G10")
self.assertEqual(len(devices), 156)
self.assertEqual(self.count(devices, "HIDRAW"), 1)

def test_HP_ENVY_15_MEDIATEK_BT(self):
devices = self.parse("HP_ENVY_15_MEDIATEK_BT")
expected_devices = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
KNAME="loop0" TYPE="loop" MOUNTPOINT="/snap/snapd/20092"
KNAME="loop1" TYPE="loop" MOUNTPOINT="/snap/core22/864"
KNAME="loop2" TYPE="loop" MOUNTPOINT="/snap/bare/5"
KNAME="loop3" TYPE="loop" MOUNTPOINT="/snap/firefox/3131"
KNAME="loop4" TYPE="loop" MOUNTPOINT="/snap/gnome-42-2204/126"
KNAME="loop5" TYPE="loop" MOUNTPOINT="/snap/gtk-common-themes/1535"
KNAME="loop6" TYPE="loop" MOUNTPOINT="/snap/snap-store/959"
KNAME="loop7" TYPE="loop" MOUNTPOINT="/snap/snapd-desktop-integration/83"
KNAME="sda" TYPE="disk" MOUNTPOINT=""
KNAME="sda1" TYPE="part" MOUNTPOINT="/media/ubuntu/4526-3FDB"
KNAME="nvme0n1" TYPE="disk" MOUNTPOINT=""
KNAME="nvme0n1p1" TYPE="part" MOUNTPOINT="/boot/efi"
KNAME="nvme0n1p2" TYPE="part" MOUNTPOINT=""
KNAME="nvme0n1p3" TYPE="part" MOUNTPOINT="/"
Loading

0 comments on commit da7297d

Please sign in to comment.