To be able to use artifacts from the repository, always pass the repository source path when building a VM image.
Signed-off-by: Philippe Mathieu-Daudé <[email protected]> --- tests/vm/Makefile.include | 1 + tests/vm/basevm.py | 4 ++-- tests/vm/centos | 2 +- tests/vm/centos.aarch64 | 2 +- tests/vm/freebsd | 2 +- tests/vm/haiku.x86_64 | 2 +- tests/vm/netbsd | 2 +- tests/vm/openbsd | 2 +- tests/vm/ubuntuvm.py | 2 +- 9 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index f0f5d32fb0..ff63038d85 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -117,6 +117,7 @@ vm-build-%: $(IMAGES_DIR)/%.img $(VM_VENV) $(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \ $(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \ $(if $(LOG_CONSOLE),--log-console) \ + --source-path $(SRC_PATH) \ --image "$<" \ $(if $(BUILD_TARGET),--build-target $(BUILD_TARGET)) \ --snapshot \ diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 23229e23d1..8ec021ddcf 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -261,7 +261,7 @@ def ssh_check(self, *cmd): def ssh_root_check(self, *cmd): self._ssh_do(self._config["root_user"], cmd, True) - def build_image(self, img): + def build_image(self, img, src_path): raise NotImplementedError def exec_qemu_img(self, *args): @@ -636,7 +636,7 @@ def main(vmcls, config=None): sys.stderr.writelines(["Image file exists: %s\n" % args.image, "Use --force option to overwrite\n"]) return 1 - return vm.build_image(args.image) + return vm.build_image(args.image, args.source_path) if args.build_qemu: vm.add_source_dir(args.build_qemu) cmd = [vm.BUILD_SCRIPT.format( diff --git a/tests/vm/centos b/tests/vm/centos index 097a9ca14d..009faceb9e 100755 --- a/tests/vm/centos +++ b/tests/vm/centos @@ -30,7 +30,7 @@ class CentosVM(basevm.BaseVM): make docker-test-quick@centos8 {verbose} J={jobs} NETWORK=1; """ - def build_image(self, img): + def build_image(self, img, src_path): cimg = self._download_with_cache("https://cloud.centos.org/centos/8-stream/x86_64/images/CentOS-Stream-GenericCloud-8-20220125.1.x86_64.qcow2") img_tmp = img + ".tmp" subprocess.check_call(['cp', '-f', cimg, img_tmp]) diff --git a/tests/vm/centos.aarch64 b/tests/vm/centos.aarch64 index 3f58de1e64..ce09a41b31 100755 --- a/tests/vm/centos.aarch64 +++ b/tests/vm/centos.aarch64 @@ -72,7 +72,7 @@ class CentosAarch64VM(basevm.BaseVM): # Call down to the base class method. super(CentosAarch64VM, self).boot(img, extra_args=extra_args) - def build_image(self, img): + def build_image(self, img, src_path): cimg = self._download_with_cache(self.image_link) img_tmp = img + ".tmp" subprocess.run(['cp', '-f', cimg, img_tmp]) diff --git a/tests/vm/freebsd b/tests/vm/freebsd index 11de6473f4..6a0d7a4569 100755 --- a/tests/vm/freebsd +++ b/tests/vm/freebsd @@ -82,7 +82,7 @@ class FreeBSDVM(basevm.BaseVM): gmake --output-sync -j{jobs} {target} {verbose}; """ - def build_image(self, img): + def build_image(self, img, src_path): self.print_step("Downloading disk image") cimg = self._download_with_cache(self.link, sha256sum=self.csum) tmp_raw = img + ".tmp.raw" diff --git a/tests/vm/haiku.x86_64 b/tests/vm/haiku.x86_64 index 71cf75a9a3..7ee343415d 100755 --- a/tests/vm/haiku.x86_64 +++ b/tests/vm/haiku.x86_64 @@ -93,7 +93,7 @@ class HaikuVM(basevm.BaseVM): make --output-sync -j{jobs} {target} {verbose}; """ - def build_image(self, img): + def build_image(self, img, src_path): self.print_step("Downloading disk image") tarball = self._download_with_cache(self.link, sha256sum=self.csum) diff --git a/tests/vm/netbsd b/tests/vm/netbsd index c7e3f1e735..5bc5ca54ca 100755 --- a/tests/vm/netbsd +++ b/tests/vm/netbsd @@ -79,7 +79,7 @@ class NetBSDVM(basevm.BaseVM): # take more than a minute to be established. ipv6 = False - def build_image(self, img): + def build_image(self, img, src_path): cimg = self._download_with_cache(self.link, sha512sum=self.csum) img_tmp = img + ".tmp" iso = img + ".install.iso" diff --git a/tests/vm/openbsd b/tests/vm/openbsd index 6b4fc29793..1464c52014 100755 --- a/tests/vm/openbsd +++ b/tests/vm/openbsd @@ -73,7 +73,7 @@ class OpenBSDVM(basevm.BaseVM): """ poweroff = "halt -p" - def build_image(self, img): + def build_image(self, img, src_path): self.print_step("Downloading install iso") cimg = self._download_with_cache(self.link, sha256sum=self.csum) img_tmp = img + ".tmp" diff --git a/tests/vm/ubuntuvm.py b/tests/vm/ubuntuvm.py index 6689ad87aa..1311fce4be 100644 --- a/tests/vm/ubuntuvm.py +++ b/tests/vm/ubuntuvm.py @@ -22,7 +22,7 @@ def __init__(self, args, config=None): self.login_prompt = "ubuntu-{}-guest login:".format(self.arch) basevm.BaseVM.__init__(self, args, config) - def build_image(self, img): + def build_image(self, img, src_path): """Build an Ubuntu VM image. The child class will define the install_cmds to init the VM.""" os_img = self._download_with_cache(self.image_link, -- 2.38.1
