Introduction to Umockdev

The Umockdev package contains a framework that allows a developer to mock devices for use in unit testing.



Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

Package Information

Umockdev Dependencies


libgudev-238, libpcap-1.10.4, and Vala-0.56.16


GTK-Doc-1.34.0 and libgphoto2 (optional for tests)

Installation of Umockdev

Install Umockdev by running the following commands:

mkdir build &&
cd    build &&

meson setup --prefix=/usr --buildtype=release .. &&

To test the results, issue as the root user: ninja test. One test needs to be run in an X session.

Now, as the root user:

ninja install

Command Explanations

-Dgtk_doc=true: Use this switch if you have GTK-Doc-1.34.0 installed and wish to rebuild and install the API documentation.


Installed Programs: umockdev-record, umockdev-run, and umockdev-wrapper
Installed Libraries: and
Installed Directories: /usr/include/umockdev-1.0

Short Descriptions


records Linux devices and their ancestors from sysfs/udev or records ioctls for a device


runs a program under an umockdev testbed


wraps a program around through LD_PRELOAD

provides API functions that allow mocking hardware devices for unit testing