]> xenbits.xensource.com Git - libvirt.git/commit
tests: poison $HOME and $XDG_RUNTIME_DIR env variables
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 4 May 2020 12:09:45 +0000 (13:09 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 7 May 2020 12:39:52 +0000 (13:39 +0100)
commitf28fbb05d312fa923711afc8e036835b19bf943c
treea06a889aaed03f7e3ede73130b5314204ac573f7
parente26bfd9620c5aff46c87ebbff21fcd0c25ea47d8
tests: poison $HOME and $XDG_RUNTIME_DIR env variables

To attempt to catch unit tests which accidentally create files in $HOME,
or $XDG_RUNTIME_DIR, poison these env vars by pointing them to
directories which don't exist. This should give easier to debug test
failures. For example:

$ VIR_TEST_DEBUG=1 ./qemuhotplugtest
Could not initialize HostdevManager - operation failed: Failed to create state dir '/bad-test-used-env-xdg-runtime-dir/libvirt/hostdevmgr'

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
tests/testutils.c