tests: Only use one env variable to notify we are running tests

This commit is contained in:
Cole Robinson 2014-02-10 14:47:20 -05:00
parent 82754ddc84
commit d76aab264e
5 changed files with 6 additions and 14 deletions

View File

@ -20,9 +20,7 @@ import imp
import logging
import os
os.environ["VIRTINST_TEST_TRACKPROPS"] = "1"
os.environ["VIRTINST_TEST_SUITE"] = "1"
os.environ["VIRTINST_TEST_CLI_VIRTXML"] = "1"
import virtinst
virtinst.stable_defaults = False

View File

@ -45,8 +45,6 @@ urixenia64 = testuri + _capsprefix + "xen-ia64-hvm.xml,xen"
urikvm = uriqemu + _capsprefix + "libvirt-1.1.2-qemu-caps.xml"
urilxc = testuri + _capsprefix + "capabilities-lxc.xml,lxc"
os.environ["VIRTINST_TEST_SCRATCHDIR"] = os.getcwd()
def get_debug():
return ("DEBUG_TESTS" in os.environ and

View File

@ -241,12 +241,9 @@ def setup_device(dev):
logging.debug("Doing setup for disk=%s", dev)
if "VIRTINST_TEST_CLI_VIRTXML" in os.environ:
meter = progress.BaseMeter()
else:
meter = (cli.quiet and
progress.BaseMeter() or
progress.TextMeter(fo=sys.stdout))
meter = ((cli.quiet or "VIRTINST_TEST_SUITE" in os.environ) and
progress.BaseMeter() or
progress.TextMeter(fo=sys.stdout))
dev.setup(meter)
dev.virt_xml_setup = True

View File

@ -453,9 +453,8 @@ def uuidstr(rawuuid):
def get_system_scratchdir(hvtype):
scratchdir = os.environ.get("VIRTINST_TEST_SCRATCHDIR", None)
if scratchdir:
return scratchdir
if "VIRTINST_TEST_SUITE" in os.environ:
return os.getcwd()
if hvtype == "test":
return "/tmp"

View File

@ -32,7 +32,7 @@ from virtinst import util
# This whole file is calling around into non-public functions that we
# don't want regular API users to touch
_trackprops = bool("VIRTINST_TEST_TRACKPROPS" in os.environ)
_trackprops = bool("VIRTINST_TEST_SUITE" in os.environ)
_allprops = []
_seenprops = []