mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-09 02:06:30 +00:00
Filter out virtual vcs devices (#2489)
* Filter out virtual vcs devices * fix test
This commit is contained in:
parent
babcc0de0c
commit
b09aee7644
@ -17,7 +17,7 @@ _LOGGER: logging.Logger = logging.getLogger(__name__)
|
|||||||
_PROC_STAT: Path = Path("/proc/stat")
|
_PROC_STAT: Path = Path("/proc/stat")
|
||||||
_RE_BOOT_TIME: re.Pattern = re.compile(r"btime (\d+)")
|
_RE_BOOT_TIME: re.Pattern = re.compile(r"btime (\d+)")
|
||||||
|
|
||||||
_RE_HIDE_SYSFS: re.Pattern = re.compile(r"/sys/devices/virtual/(?:tty|block)/.*")
|
_RE_HIDE_SYSFS: re.Pattern = re.compile(r"/sys/devices/virtual/(?:tty|block|vc)/.*")
|
||||||
|
|
||||||
|
|
||||||
class HwHelper(CoreSysAttributes):
|
class HwHelper(CoreSysAttributes):
|
||||||
|
@ -69,7 +69,10 @@ def test_hide_virtual_device(coresys):
|
|||||||
udev_device.sys_path = "/sys/devices/virtual/block/test"
|
udev_device.sys_path = "/sys/devices/virtual/block/test"
|
||||||
assert coresys.hardware.helper.hide_virtual_device(udev_device)
|
assert coresys.hardware.helper.hide_virtual_device(udev_device)
|
||||||
|
|
||||||
udev_device.sys_path = "/sys/devices/virtual/tty/test"
|
udev_device.sys_path = "/sys/devices/virtual/tty/tty1"
|
||||||
|
assert coresys.hardware.helper.hide_virtual_device(udev_device)
|
||||||
|
|
||||||
|
udev_device.sys_path = "/sys/devices/virtual/vc/vcs1"
|
||||||
assert coresys.hardware.helper.hide_virtual_device(udev_device)
|
assert coresys.hardware.helper.hide_virtual_device(udev_device)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user