]> git.ipfire.org Git - thirdparty/libvirt.git/commit
tests: Introduce virhostdevmock
authorAndrea Bolognani <abologna@redhat.com>
Wed, 6 May 2020 12:38:42 +0000 (14:38 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Wed, 6 May 2020 14:24:31 +0000 (16:24 +0200)
commiteea5d63a221a8f36a3ed5b1189fe619d4fa1fde2
tree201921edef1a8b2a89aba1fc2e7d0fdd177c5efc
parent7c42aafb0990cfda0a786d03e1a58753fe9d3db2
tests: Introduce virhostdevmock

We need this for all tests that use virHostdevManager, because
during creation of this object for unprivileged connections
like those used in the test suite we would end up writing inside
the user's home directory.

That's bad manners in general, but when running the test suite
inside a purposefully constrained environment such as the one
exposed by pbuilder, it turns into an outright test failure:

  Could not initialize HostdevManager - operation failed: Failed
  to create state dir '/nonexistent/.cache/libvirt/hostdevmgr'

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virutil.h
tests/Makefile.am
tests/qemuhotplugtest.c
tests/virhostdevmock.c [new file with mode: 0644]
tests/virhostdevtest.c