From 5a6c5153802e5567cf126cfd53800bd96479e412 Mon Sep 17 00:00:00 2001 From: Cedric Hombourger Date: Thu, 6 Feb 2025 15:59:42 +0100 Subject: [PATCH] fix(pytest): do not fail if the default TEST_IMAGE cannot be found Target in our pytest module expects the image specified in the TEST_IMAGE environment variable (or its default value) to exist. No longer fail if an image is not specified in the environment and if the default one could not be found: this may be intented. Signed-off-by: Cedric Hombourger --- mtda/pytest.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/mtda/pytest.py b/mtda/pytest.py index 88e60d9e..6bcb74fc 100644 --- a/mtda/pytest.py +++ b/mtda/pytest.py @@ -43,12 +43,16 @@ def init(): # Initialize boot media image = os.getenv("TEST_IMAGE", Consts.DEFAULT_IMAGE) if os.path.exists(image) is False: - return False + if image != Consts.DEFAULT_IMAGE: + return False + else: + image = "" - Storage.to_host() - Storage.write(image) - Storage.to_target() - Env.set("boot-from-usb", "1") + if image: + Storage.to_host() + Storage.write(image) + Storage.to_target() + Env.set("boot-from-usb", "1") return True