The existing FIT tests should boot barebox normally without EFI,
even if given an EFI stubbed barebox.

Adapt boot_barebox to enforce this.

Signed-off-by: Ahmad Fatoum <[email protected]>
---
 test/py/test_fit.py | 17 +++++++++++++----
 test/strategy.py    |  1 +
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/test/py/test_fit.py b/test/py/test_fit.py
index 0f8fffee3361..8bcee6a75f23 100644
--- a/test/py/test_fit.py
+++ b/test/py/test_fit.py
@@ -73,10 +73,19 @@ def test_fit_dryrun(barebox, strategy, fitimage):
     barebox.run_check("global dryrun_attempts=5")
     barebox.run_check('[ "$global.dryrun_attempts" = 5 ]')
 
-    for i in range(5):
-        stdout, _, _ = barebox.run(f"bootm -d -v {fitimage}")
-        errors = filter_errors(stdout)
-        assert errors == [], errors
+    [efi] = barebox.run_check("echo ${global.bootm.efi}")
+
+    try:
+        if efi:
+            barebox.run_check("global.bootm.efi=disabled")
+
+        for i in range(5):
+            stdout, _, _ = barebox.run(f"bootm -d -v {fitimage}")
+            errors = filter_errors(stdout)
+            assert errors == [], errors
+    finally:
+        if efi:
+            barebox.run_check(f"global.bootm.efi={efi}")
 
     # If we actually did boot, this variable would be undefined
     barebox.run_check('[ "$global.dryrun_attempts" = 5 ]')
diff --git a/test/strategy.py b/test/strategy.py
index c04d38c180a7..35cda3aca498 100644
--- a/test/strategy.py
+++ b/test/strategy.py
@@ -99,6 +99,7 @@ class BareboxTestStrategy(Strategy):
         self.transition(Status.barebox)
 
         try:
+            self.barebox.run("global.bootm.efi=disabled # if it exists")
             if bootm:
                 self.barebox_bootm(boottarget)
             else:
-- 
2.47.3


Reply via email to