Skip to content

Commit a84acf5

Browse files
committed
Remove previous preloads even on non-preload test
Because it is set by the installer and may also be set by the user, it is important to not let the tests be affected by the global preload. Setting the global preload again will not preload, as qubesd is not running. For: QubesOS/qubes-issues#1512
1 parent 6f249da commit a84acf5

File tree

1 file changed

+23
-26
lines changed

1 file changed

+23
-26
lines changed

tests/dispvm_perf.py

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -543,17 +543,16 @@ def run_test(self, test: TestConfig):
543543
f"{gui_prefix} {target} allow\n"
544544
f"{nogui_prefix} {target} allow\n"
545545
)
546-
if test.preload_max:
547-
orig_preload_threshold = self.dom0.features.get(
548-
"preload-dispvm-threshold"
549-
)
550-
orig_preload_max = self.dom0.features.get("preload-dispvm-max")
551-
if orig_preload_threshold is not None:
552-
logger.info("Deleting threshold feature")
553-
del self.dom0.features["preload-dispvm-threshold"]
554-
if orig_preload_max is not None:
555-
logger.info("Deleting global max feature")
556-
del self.dom0.features["preload-dispvm-max"]
546+
orig_preload_threshold = self.dom0.features.get(
547+
"preload-dispvm-threshold"
548+
)
549+
orig_preload_max = self.dom0.features.get("preload-dispvm-max")
550+
if orig_preload_threshold is not None:
551+
logger.info("Deleting threshold feature")
552+
del self.dom0.features["preload-dispvm-threshold"]
553+
if orig_preload_max is not None:
554+
logger.info("Deleting global max feature")
555+
del self.dom0.features["preload-dispvm-max"]
557556
try:
558557
if test.preload_max:
559558
preload_max = test.preload_max
@@ -581,21 +580,19 @@ def run_test(self, test: TestConfig):
581580
logger.info("Deleting local max feature")
582581
del self.dvm.features["preload-dispvm-max"]
583582
self.wait_for_dispvm_destroy(old_preload)
584-
if orig_preload_threshold is not None:
585-
logger.info(
586-
"Setting the original threshold feature: '%s'",
587-
orig_preload_threshold,
588-
)
589-
self.dom0.features["preload-dispvm-threshold"] = (
590-
orig_preload_threshold
591-
)
592-
if orig_preload_max is not None:
593-
logger.info(
594-
"Setting the global max feature: '%s'", orig_preload_max
595-
)
596-
self.dom0.features["preload-dispvm-max"] = orig_preload_max
597-
if orig_preload_max != 0:
598-
asyncio.run(self.wait_preload(orig_preload_max))
583+
if orig_preload_threshold is not None:
584+
logger.info(
585+
"Setting the original threshold feature: '%s'",
586+
orig_preload_threshold,
587+
)
588+
self.dom0.features["preload-dispvm-threshold"] = (
589+
orig_preload_threshold
590+
)
591+
if orig_preload_max is not None:
592+
logger.info(
593+
"Setting the global max feature: '%s'", orig_preload_max
594+
)
595+
self.dom0.features["preload-dispvm-max"] = orig_preload_max
599596
os.unlink(POLICY_FILE)
600597
if not os.getenv("QUBES_TEST_SKIP_TEARDOWN_SLEEP"):
601598
logger.info("Load before sleep: '%s'", get_load())

0 commit comments

Comments
 (0)