@@ -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 \
@@ -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(
@@ -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])
@@ -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])
@@ -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"
@@ -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)
@@ -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"
@@ -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"
@@ -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,
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é <philmd@linaro.org> --- 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(-)