[systemd-devel] Programmatically setting udev properties

Martin Pitt martin.pitt at ubuntu.com
Fri Jan 30 00:24:53 PST 2015

Peter Hutterer [2015-01-30  8:12 +1000]:
> Because of uinput, the test suite runs as root. One solution would be to
> drop a custom test rule, reload, create the uinput device, run the test,
> rm the rule again. Not pretty though, I was hoping there was something
> nicer.

I'm not aware of anything nicer either, apart from completely faking
everything (cf. umockdef in the other part of the thread). Your test
suite can create/use /run/udev/rules.d/ to at least ensure that
the custom rule at least won't be around forever if your test fails
without being able to clean up after itself. That's the approach that
e. g. the gvfs tests use (see test/gvfs-testbed in the source tree).

Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

More information about the systemd-devel mailing list