martinpitt / umockdev

Mock hardware devices for creating unit tests and bug reporting
https://launchpad.net/umockdev
GNU Lesser General Public License v2.1
308 stars 55 forks source link

Include udev properties in emulated netlink messages #165

Closed martinpitt closed 2 years ago

martinpitt commented 2 years ago

Current systemd by and large does not read the /uevent file any more, but entirely relies on udevd sending the properties in the udev netlink events.

Pass the properties to uevent_sender_send(), massage them from a newline separated (as in our uevent file) to a nul separated (as expected by the udev netlink message) array. In Testbed.uevent(), read the current properties from the /uevent file.

This is all rather hackish right now and cries for a more thorough rewrite. But this is a relatively unintrusive and quick bandaid which helps users for the time being.

Test this both with the libudev and with the gudev (through Python) APIs.

Fixes #164