[libvirt] [PATCH 02/18] Ensure LD_PRELOAD exists before running test case
Eric Blake
eblake at redhat.com
Thu Apr 4 17:27:59 UTC 2013
On 04/04/2013 07:40 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
>
> The linker will ignore LD_PRELOAD libraries which do not
> exist, just printing a warning message. This is not helpful
> for the test suite which will be utterly fubar without the
> preload library present. Add an explicit test for existance
s/existance/existence/
> of the library to protect against this
>
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
> tests/testutils.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/tests/testutils.h b/tests/testutils.h
> index 546c9ae..3647487 100644
> --- a/tests/testutils.h
> +++ b/tests/testutils.h
> @@ -75,6 +75,10 @@ int virtTestMain(int argc,
> const char *preload = getenv("LD_PRELOAD"); \
> if (preload == NULL || strstr(preload, lib) == NULL) { \
> char *newenv; \
> + if (!virFileIsExecutable(lib)) { \
> + perror(lib); \
> + return EXIT_FAILURE; \
> + } \
ACK.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130404/0d4312cf/attachment-0001.sig>
More information about the libvir-list
mailing list