@@ -24,6 +24,7 @@ from utils import CIUtils
from avocado import Test
from avocado.utils import path
from avocado.utils import process
+from avocado.core import exceptions
sys.path.append(os.path.join(os.path.dirname(__file__), '../bitbake/lib'))
@@ -703,6 +704,7 @@ class CIBuilder(Test):
keep=False,
):
time_to_wait = self.params.get('time_to_wait', default=DEF_VM_TO_SEC)
+ self.skip_if_vm_image_missing(arch, distro, image)
self.log.info("===================================================")
self.log.info(f"Running Isar VM boot test for ({distro}-{arch})")
@@ -800,3 +802,20 @@ class CIBuilder(Test):
self.vm_turn_off(vm)
return stdout, stderr
+
+ def skip_if_vm_image_missing(self, arch, distro, image):
+ (
+ image_fstypes,
+ image_fullname,
+ deploy_dir_image,
+ ) = CIUtils.getVars(
+ 'IMAGE_FSTYPES',
+ 'IMAGE_FULLNAME',
+ 'DEPLOY_DIR_IMAGE',
+ target=f"mc:qemu{arch}-{distro}:{image}",
+ )
+ image_type = image_fstypes.split()[0]
+ rootfs_image = f"{image_fullname}.{image_type}"
+ rootfs_image_path = os.path.join(deploy_dir_image, rootfs_image)
+ if not os.path.exists(rootfs_image_path):
+ raise exceptions.TestSkipError(f'VM image missing: {rootfs_image}')