aboutsummaryrefslogtreecommitdiff
path: root/test/py
diff options
context:
space:
mode:
Diffstat (limited to 'test/py')
-rw-r--r--test/py/conftest.py8
-rw-r--r--test/py/tests/test_event_dump.py4
-rw-r--r--test/py/tests/test_vbe.py7
-rw-r--r--test/py/tests/test_vbe_vpl.py38
4 files changed, 49 insertions, 8 deletions
diff --git a/test/py/conftest.py b/test/py/conftest.py
index 304e93164a..fc9dd3a83f 100644
--- a/test/py/conftest.py
+++ b/test/py/conftest.py
@@ -289,7 +289,13 @@ def generate_ut_subtest(metafunc, fixture_name, sym_path):
m = re_ut_test_list.search(l)
if not m:
continue
- vals.append(m.group(1) + ' ' + m.group(2))
+ suite, name = m.groups()
+
+ # Tests marked with _norun should only be run manually using 'ut -f'
+ if name.endswith('_norun'):
+ continue
+
+ vals.append(f'{suite} {name}')
ids = ['ut_' + s.replace(' ', '_') for s in vals]
metafunc.parametrize(fixture_name, vals, ids=ids)
diff --git a/test/py/tests/test_event_dump.py b/test/py/tests/test_event_dump.py
index 674df2ea00..1a46ca30f4 100644
--- a/test/py/tests/test_event_dump.py
+++ b/test/py/tests/test_event_dump.py
@@ -16,7 +16,7 @@ def test_event_dump(u_boot_console):
out = util.run_and_log(cons, ['scripts/event_dump.py', sandbox])
expect = '''.*Event type Id Source location
-------------------- ------------------------------ ------------------------------
-EVT_FT_FIXUP bootmeth_vbe_ft_fixup .*vbe_fixup.c:.*
-EVT_FT_FIXUP bootmeth_vbe_simple_ft_fixup .*vbe_simple.c:.*
+EVT_FT_FIXUP bootmeth_vbe_ft_fixup .*vbe_request.c:.*
+EVT_FT_FIXUP bootmeth_vbe_simple_ft_fixup .*vbe_simple_os.c:.*
EVT_MISC_INIT_F sandbox_misc_init_f .*start.c:'''
assert re.match(expect, out, re.MULTILINE) is not None
diff --git a/test/py/tests/test_vbe.py b/test/py/tests/test_vbe.py
index 559c291886..50b6c1cd91 100644
--- a/test/py/tests/test_vbe.py
+++ b/test/py/tests/test_vbe.py
@@ -85,7 +85,7 @@ bootm loados
bootm prep
fdt addr
fdt print
-ut bootstd vbe_test_fixup
+ut bootstd -f vbe_test_fixup_norun
'''
@pytest.mark.boardspec('sandbox_flattree')
@@ -117,7 +117,4 @@ def test_vbe(u_boot_console):
with cons.log.section('Kernel load'):
output = cons.run_command_list(cmd.splitlines())
- # This is a little wonky since there are two tests running in CI. The final
- # one is the 'ut bootstd' command above
- failures = [line for line in output if 'Failures' in line]
- assert len(failures) >= 1 and 'Failures: 0' in failures[-1]
+ assert 'Failures: 0' in output[-1]
diff --git a/test/py/tests/test_vbe_vpl.py b/test/py/tests/test_vbe_vpl.py
new file mode 100644
index 0000000000..d1c9d0548a
--- /dev/null
+++ b/test/py/tests/test_vbe_vpl.py
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: GPL-2.0+
+# Copyright 2022 Google LLC
+#
+# Test addition of VBE
+
+import os
+
+import pytest
+import u_boot_utils
+
+@pytest.mark.boardspec('sandbox_vpl')
+@pytest.mark.requiredtool('dtc')
+def test_vbe_vpl(u_boot_console):
+ cons = u_boot_console
+ #cmd = [cons.config.build_dir + fname, '-v']
+ ram = os.path.join(cons.config.build_dir, 'ram.bin')
+ fdt = os.path.join(cons.config.build_dir, 'arch/sandbox/dts/test.dtb')
+
+ # Enable firmware1 and the mmc that it uses. These are needed for the full
+ # VBE flow.
+ u_boot_utils.run_and_log(
+ cons, f'fdtput -t s {fdt} /bootstd/firmware0 status disabled')
+ u_boot_utils.run_and_log(
+ cons, f'fdtput -t s {fdt} /bootstd/firmware1 status okay')
+ u_boot_utils.run_and_log(
+ cons, f'fdtput -t s {fdt} /mmc3 status okay')
+
+ # Remove any existing RAM file, so we don't have old data present
+ if os.path.exists(ram):
+ os.remove(ram)
+ flags = ['-p', os.path.join(cons.config.build_dir, 'image.bin'), '-w',
+ '-s', 'state.dtb']
+ cons.restart_uboot_with_flags(flags)
+
+ # Make sure that VBE was used in both VPL (to load SPL) and SPL (to load
+ # U-Boot
+ output = cons.run_command('vbe state')
+ assert output == 'Phases: VPL SPL'