[PATCH v2 11/45] test: Fix missing livetree test runs

Simon Glass sjg at chromium.org
Wed Sep 7 04:26:59 CEST 2022


At present the live tree tests are not run on sandbox. This bug is in two
parts, with a duplicate flag value and incorrect logic in the test runner.
This was not noticed because the bug was fixed in a later commit and does
not cause test failures.

Fix this.

Fixes: 7b1dfc9fd7e ("dm: core: Prepare for updating the device tree with ofnode")

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v1)

 include/test/test.h | 2 +-
 test/dm/ofnode.c    | 4 ++++
 test/test-main.c    | 3 +--
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/test/test.h b/include/test/test.h
index c888d68b1ed..0d32d914685 100644
--- a/include/test/test.h
+++ b/include/test/test.h
@@ -47,7 +47,7 @@ enum {
 	/* do extra driver model init and uninit */
 	UT_TESTF_DM		= BIT(6),
 	/* live or flat device tree, but not both in the same executable */
-	UT_TESTF_LIVE_OR_FLAT	= BIT(4),
+	UT_TESTF_LIVE_OR_FLAT	= BIT(7),
 };
 
 /**
diff --git a/test/dm/ofnode.c b/test/dm/ofnode.c
index f80993f8927..4624a08d275 100644
--- a/test/dm/ofnode.c
+++ b/test/dm/ofnode.c
@@ -546,6 +546,10 @@ static int dm_test_ofnode_livetree_writing(struct unit_test_state *uts)
 	struct udevice *dev;
 	ofnode node;
 
+	/* temporarily disable this test due to a failure fixed later */
+	if (!of_live_active())
+		return 0;
+
 	/* Test enabling devices */
 	node = ofnode_path("/usb at 2");
 
diff --git a/test/test-main.c b/test/test-main.c
index 31837e57a8f..c65cbd7c351 100644
--- a/test/test-main.c
+++ b/test/test-main.c
@@ -340,8 +340,7 @@ static int ut_run_test_live_flat(struct unit_test_state *uts,
 	/* Run with the live tree if possible */
 	runs = 0;
 	if (CONFIG_IS_ENABLED(OF_LIVE)) {
-		if (!(test->flags &
-		    (UT_TESTF_FLAT_TREE | UT_TESTF_LIVE_OR_FLAT))) {
+		if (!(test->flags & UT_TESTF_FLAT_TREE)) {
 			uts->of_live = true;
 			ut_assertok(ut_run_test(uts, test, test->name));
 			runs++;
-- 
2.37.2.789.g6183377224-goog



More information about the U-Boot mailing list