From 10feb30c701d3cf264746d0d81bd566f002de24b Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Mon, 22 Apr 2019 09:18:55 +0200 Subject: test/py: pytest.mark.notbuildconfigspec() We already can let a Python test depend on a build option being set via @pytest.mark.buildconfigspec(). It may be necessary to let a test depend on a build option *not* being set. So let's introduce @pytest.mark.notbuildconfigspec for this purpose. Signed-off-by: Heinrich Schuchardt --- test/py/README.md | 1 + test/py/conftest.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/py/README.md b/test/py/README.md index 4d9d2b81d1..2156661d6c 100644 --- a/test/py/README.md +++ b/test/py/README.md @@ -310,6 +310,7 @@ instances of: - `buildconfig.get(...` - `@pytest.mark.buildconfigspec(...` +- `@pytest.mark.notbuildconfigspec(...` ### Complete invocation example diff --git a/test/py/conftest.py b/test/py/conftest.py index e40cbf0ba1..00d8ef8ba9 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -460,11 +460,15 @@ def setup_buildconfigspec(item): """ mark = item.get_marker('buildconfigspec') - if not mark: - return - for option in mark.args: - if not ubconfig.buildconfig.get('config_' + option.lower(), None): - pytest.skip('.config feature "%s" not enabled' % option.lower()) + if mark: + for option in mark.args: + if not ubconfig.buildconfig.get('config_' + option.lower(), None): + pytest.skip('.config feature "%s" not enabled' % option.lower()) + notmark = item.get_marker('notbuildconfigspec') + if notmark: + for option in notmark.args: + if ubconfig.buildconfig.get('config_' + option.lower(), None): + pytest.skip('.config feature "%s" enabled' % option.lower()) def tool_is_in_path(tool): for path in os.environ["PATH"].split(os.pathsep): -- cgit From 68066d5bcdd0b427ac75cf04a1f67cfede05ec4f Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 20 Apr 2019 13:33:55 +0200 Subject: efi_selftest: do not run FDT test with ACPI table. The EBBR specification prescribes that we should have either an ACPI table or a device tree but not both. So do not run the device tree unit test on boards with an ACPI table. Hence there is no need any longer to make it 'on request' only. Do not pass $fdtcontroladdr to `bootefi selftest`. Signed-off-by: Heinrich Schuchardt --- test/py/tests/test_efi_selftest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/py/tests/test_efi_selftest.py b/test/py/tests/test_efi_selftest.py index bc226a8e63..07e4db0452 100644 --- a/test/py/tests/test_efi_selftest.py +++ b/test/py/tests/test_efi_selftest.py @@ -15,7 +15,7 @@ def test_efi_selftest(u_boot_console): This function executes all selftests that are not marked as on request. """ u_boot_console.run_command(cmd='setenv efi_selftest') - u_boot_console.run_command(cmd='bootefi selftest ${fdtcontroladdr}', wait_for_prompt=False) + u_boot_console.run_command(cmd='bootefi selftest', wait_for_prompt=False) m = u_boot_console.p.expect(['Summary: 0 failures', 'Press any key']) if m != 0: raise Exception('Failures occurred during the EFI selftest') @@ -27,6 +27,7 @@ def test_efi_selftest(u_boot_console): @pytest.mark.buildconfigspec('cmd_bootefi_selftest') @pytest.mark.buildconfigspec('of_control') +@pytest.mark.notbuildconfigspec('generate_acpi_table') def test_efi_selftest_device_tree(u_boot_console): u_boot_console.run_command(cmd='setenv efi_selftest list') output = u_boot_console.run_command('bootefi selftest') -- cgit