You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Better handling of udev_device_get_is_initialized #267
So, device are initialised if they have (valid?) entries in /run/udev/data/$ID or if a uevent was received. Now, umockdev never creates entries in /run/udev/data/$ID, wo device are considered "not initialised" unless the uevent was processed by the client.
On the one hand, I can abuse this for tests in libusb (though maybe I should not …): libusb/libusb#1625
On the other hand, this is just broken. umockdev should probably just write out the database file when the ("add") uevent is fired. But, it would be useful if it then also added API to prevent the uevent from being fired so that one can test the enumeration corner case.
it would be useful if it then also added API to prevent the uevent from being fired so that one can test the enumeration corner case.
I was thinking of add_devicev_no_uevent(), but that is internal indeed. We could make this public, or add a new add_device_options() or so, or perhaps look at a $UMOCKDEV_DIR/no-uevent inhibitor file.
But OOI, this does feel like an abuse, as you can't do this in real life -- if you want to test the static coldplug enumeration, the test should set up /sys first and then start the lib/app?
Activity
martinpitt commentedon Mar 26, 2025
I was thinking of
add_devicev_no_uevent(), but that is internal indeed. We could make this public, or add a newadd_device_options()or so, or perhaps look at a$UMOCKDEV_DIR/no-ueventinhibitor file.But OOI, this does feel like an abuse, as you can't do this in real life -- if you want to test the static coldplug enumeration, the test should set up /sys first and then start the lib/app?
benzea commentedon Mar 26, 2025
Well, there are two parts, right? We should write the
/run/udev/data/entries so that coldplug works correctly.The other part would be whether we should permit testing the coldplug race condition. Maybe it is overkill to support that.