libudev expects the "/sys/bus" and "/sys/class" directories to exist when calling udev_enumerate_scan_devices(). When this was called on an empty Testbed, it would return -ENOENT since these directories did not exist.
This fixes the issue by creating the "/sys/bus" and "/sys/class" directories at the same time that "/sys" is created in the Testbed.
num_udev_devices() is modified to call udev_enumerate_scan_devices() directly instead of using GUdev, which ignores the return value of udev_enumerate_scan_devices(). This makes t_testbed_empty() a valid test for the bug we are fixing.
Some vala tests also had to be modified to account for the change.
libudev expects the "/sys/bus" and "/sys/class" directories to exist when calling
udev_enumerate_scan_devices()
. When this was called on an emptyTestbed
, it would return-ENOENT
since these directories did not exist.This fixes the issue by creating the "/sys/bus" and "/sys/class" directories at the same time that "/sys" is created in the
Testbed
.num_udev_devices()
is modified to calludev_enumerate_scan_devices()
directly instead of using GUdev, which ignores the return value ofudev_enumerate_scan_devices()
. This makest_testbed_empty()
a valid test for the bug we are fixing.Some vala tests also had to be modified to account for the change.
Fixes: https://github.com/martinpitt/umockdev/issues/144