summaryrefslogtreecommitdiff
path: root/subplot/vmadm.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-03-03 06:06:38 +0200
committerLars Wirzenius <liw@liw.fi>2021-03-03 06:06:38 +0200
commitc5391d0f07990e0a6e65e9d3cd1efaf399edaf24 (patch)
treeeaee7434a615c463b41c5c131e444ab8de4ac4b7 /subplot/vmadm.py
parent082b786a9802f006e230a39ed088f06eed51df2b (diff)
downloadvmadm-c5391d0f07990e0a6e65e9d3cd1efaf399edaf24.tar.gz
test: make path to Debian cloud image be configurable
Diffstat (limited to 'subplot/vmadm.py')
-rw-r--r--subplot/vmadm.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/subplot/vmadm.py b/subplot/vmadm.py
index 48737a3..2daa81c 100644
--- a/subplot/vmadm.py
+++ b/subplot/vmadm.py
@@ -1,5 +1,6 @@
import logging
import os
+import shutil
import yaml
@@ -21,6 +22,19 @@ def install_vmadm(ctx):
os.mkdir("expected")
+def ensure_base_image(ctx):
+ assert_eq = globals()["assert_eq"]
+ assert_ne = globals()["assert_ne"]
+
+ base = os.environ.get("BASE_IMAGE", "")
+ _, ext = os.path.splitext(base)
+
+ assert_ne(base, "")
+ assert_eq(ext, ".qcow2")
+
+ shutil.copy(base, "base.qcow2")
+
+
def invoke_cloud_init(ctx, filename=None, dirname=None):
runcmd_run = globals()["runcmd_run"]
runcmd_exit_code_is_zero = globals()["runcmd_exit_code_is_zero"]