From 9b8e0e2335c5c45c1c9fc3fbc9a7e8f78a97745e Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Mon, 1 Jun 2020 23:00:02 +0200 Subject: [PATCH] test: Put VM image overlay into /var/tmp At least in our CI, the default place to store VM runtime overlays (testvm.get_temp_dir()) points to a tmpfs file, so that tests can put VM overlays into RAM and are not affected by slow I/O. But that doesn't work for composer, as it tends to produce huge overlays due to real-life OS composed trees. Use /var/tmp/ instead, which is meant for large files. Also simplify the VirtMachine invocation -- if `identity_file` is None, that's fine -- it's the default value of that argument anyway. --- test/composertest.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/composertest.py b/test/composertest.py index b1a18bb2..1fc3c57a 100644 --- a/test/composertest.py +++ b/test/composertest.py @@ -35,10 +35,11 @@ class VirtMachineTestCase(unittest.TestCase): def setUpTestMachine(self, image=testvm.DEFAULT_IMAGE, identity_file=None): self.network = testvm.VirtNetwork(0) - if identity_file: - self.machine = testvm.VirtMachine(image, networking=self.network.host(), cpus=2, memory_mb=2048, identity_file=identity_file) - else: - self.machine = testvm.VirtMachine(image, networking=self.network.host(), cpus=2, memory_mb=2048) + # default overlay directory is not big enough to hold the large composed trees; thus put overlay into /var/tmp/ + self.machine = testvm.VirtMachine(image, networking=self.network.host(), + cpus=2, memory_mb=2048, + overlay_dir="/var/tmp", + identity_file=identity_file) print("Starting virtual machine '{}'".format(image)) self.machine.start()