martinpitt / umockdev

Mock hardware devices for creating unit tests and bug reporting

Home Page:https://launchpad.net/umockdev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to record "remove" udev actions?

Degoah opened this issue · comments

commented

Hi,

I was studying the toolsuite but couldn't find any information if it is possible to record and replay the effects of removing a hot-plugged USB device, i.e. is it possible to start "umockdev-run" and make it record the udev-events when the USB device is removed from the USB port?

Any hints or suggestion, how to test that are very appreciated!

commented

I have figured it out: It is possible to simulate the sending of "add" and "remove" etc. udev-specific actions by programmatically using the "umockdev" library, i.e. by including "umockdev" and linking againgst the shared umockdev library.
For concrete examples just refer to the battery-example provided here, or by taking a look at the unit-test here.