Skip to content

Commit

Permalink
fix(pytest): do not fail if the default TEST_IMAGE cannot be found
Browse files Browse the repository at this point in the history
Target is 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 <[email protected]>
  • Loading branch information
chombourger committed Feb 6, 2025
1 parent 025b9f7 commit 9ef79d5
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions mtda/pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9ef79d5

Please sign in to comment.