From: Peter Krempa Date: Thu, 23 Jun 2016 13:22:06 +0000 (+0200) Subject: tests: utils: Fail XML file comparison if input file doesn't exist X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=cb049b9ad4d0b76f3eac33c84846efb82a969987;p=libvirt.git tests: utils: Fail XML file comparison if input file doesn't exist In cases where we expect parse failure of the test input file the testsuite can't differentiate if the parser failed when parsing or when opening the file. Add a call to virFileExists and error out on missing input files. Missing output files are partially expected when regenerating test output. --- diff --git a/tests/testutils.c b/tests/testutils.c index 8859ed50ff..be61e4d7ee 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -1102,6 +1102,11 @@ testCompareDomXML2XMLFiles(virCapsPtr caps, virDomainXMLOptionPtr xmlopt, parse_flags |= parseFlags; + if (!virFileExists(infile)) { + VIR_TEST_DEBUG("Test input file '%s' is missing", infile); + return -1; + } + if (!live) format_flags |= VIR_DOMAIN_DEF_FORMAT_INACTIVE;