1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-08-03 08:21:58 +03:00

sanitytest: stop passing API XML path into sanity test

We want to move over to make sanitytest.py operate like a more normal
test script, which means making it self contained.

The test already knows how to find the libvirt API XML path using
pkg-config and if an override location is required, this can be done
by pointing $PKG_CONFIG_PATH to a suitable place.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé
2022-03-22 17:44:02 +00:00
parent b0e9f12f2f
commit 4e5d903fc3
2 changed files with 2 additions and 9 deletions

View File

@ -20,12 +20,7 @@ def get_libvirt_api_xml_path():
sys.exit(proc.returncode) sys.exit(proc.returncode)
return stdout.splitlines()[0] return stdout.splitlines()[0]
xml = get_libvirt_api_xml_path()
# Path to the libvirt API XML file
if len(sys.argv) >= 3:
xml = sys.argv[2]
else:
xml = get_libvirt_api_xml_path()
with open(xml, "r") as fp: with open(xml, "r") as fp:
tree = lxml.etree.parse(fp) tree = lxml.etree.parse(fp)

View File

@ -304,15 +304,13 @@ class my_test(Command):
Run test suite Run test suite
""" """
apis = get_api_xml_files()
if "PYTHONPATH" in os.environ: if "PYTHONPATH" in os.environ:
os.environ["PYTHONPATH"] = self.build_platlib + ":" + os.environ["PYTHONPATH"] os.environ["PYTHONPATH"] = self.build_platlib + ":" + os.environ["PYTHONPATH"]
else: else:
os.environ["PYTHONPATH"] = self.build_platlib os.environ["PYTHONPATH"] = self.build_platlib
if "LIBVIRT_API_COVERAGE" in os.environ: if "LIBVIRT_API_COVERAGE" in os.environ:
self.spawn([sys.executable, "sanitytest.py", self.build_platlib, apis[0]]) self.spawn([sys.executable, "sanitytest.py", self.build_platlib])
pytest = self.find_pytest_path() pytest = self.find_pytest_path()
subprocess.check_call([pytest]) subprocess.check_call([pytest])