test: Tweak FDT-overlay tests
authorSimon Glass <sjg@chromium.org>
Fri, 7 Feb 2025 18:30:39 +0000 (11:30 -0700)
committerTom Rini <trini@konsulko.com>
Wed, 12 Feb 2025 02:10:58 +0000 (20:10 -0600)
Use fdt_overlay consistently in the identifiers and file/dir names.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 files changed:
Makefile
include/test/fdt_overlay.h [moved from include/test/overlay.h with 66% similarity]
include/test/suites.h
test/Kconfig
test/cmd_ut.c
test/fdt_overlay/Kconfig [moved from test/overlay/Kconfig with 93% similarity]
test/fdt_overlay/Makefile [moved from test/overlay/Makefile with 89% similarity]
test/fdt_overlay/cmd_ut_fdt_overlay.c [moved from test/overlay/cmd_ut_overlay.c with 77% similarity]
test/fdt_overlay/test-fdt-base.dts [moved from test/overlay/test-fdt-base.dts with 100% similarity]
test/fdt_overlay/test-fdt-overlay-stacked.dtso [moved from test/overlay/test-fdt-overlay-stacked.dtso with 100% similarity]
test/fdt_overlay/test-fdt-overlay.dtso [moved from test/overlay/test-fdt-overlay.dtso with 100% similarity]
test/py/tests/test_suite.py

index b32606b..a9cc235 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -895,7 +895,7 @@ endif
 libs-$(CONFIG_$(PHASE_)UNIT_TEST) += test/
 libs-$(CONFIG_UT_ENV) += test/env/
 libs-$(CONFIG_UT_OPTEE) += test/optee/
-libs-$(CONFIG_UT_OVERLAY) += test/overlay/
+libs-$(CONFIG_UT_FDT_OVERLAY) += test/fdt_overlay/
 
 libs-y += $(if $(wildcard $(srctree)/board/$(BOARDDIR)/Makefile),board/$(BOARDDIR)/)
 
similarity index 66%
rename from include/test/overlay.h
rename to include/test/fdt_overlay.h
index 5dc9839..34e8020 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <test/test.h>
 
-/* Declare a new environment test */
-#define OVERLAY_TEST(_name, _flags)    UNIT_TEST(_name, _flags, overlay)
+/* Declare a new FDT-overlay test */
+#define FDT_OVERLAY_TEST(_name, _flags)        UNIT_TEST(_name, _flags, fdt_overlay)
 
 #endif /* __TEST_OVERLAY_H__ */
index 774dd89..dce720b 100644 (file)
@@ -36,8 +36,8 @@ int cmd_ut_category(struct unit_test_state *uts, const char *name,
 
 int do_ut_bootstd(struct unit_test_state *uts, struct cmd_tbl *cmdtp, int flag,
                  int argc, char *const argv[]);
+int do_ut_fdt_overlay(struct unit_test_state *uts, struct cmd_tbl *cmdtp,
+                     int flag, int argc, char *const argv[]);
 int do_ut_optee(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
-int do_ut_overlay(struct unit_test_state *uts, struct cmd_tbl *cmdtp, int flag,
-                 int argc, char *const argv[]);
 
 #endif /* __TEST_SUITES_H__ */
index 1c8e3d1..01d6464 100644 (file)
@@ -120,7 +120,7 @@ source "test/env/Kconfig"
 source "test/image/Kconfig"
 source "test/lib/Kconfig"
 source "test/optee/Kconfig"
-source "test/overlay/Kconfig"
+source "test/fdt_overlay/Kconfig"
 
 config POST
        bool "Power On Self Test support"
index 0b923ee..958b591 100644 (file)
@@ -105,6 +105,7 @@ SUITE_DECL(dm);
 SUITE_DECL(env);
 SUITE_DECL(exit);
 SUITE_DECL(fdt);
+SUITE_DECL(fdt_overlay);
 SUITE_DECL(font);
 SUITE_DECL(hush);
 SUITE_DECL(lib);
@@ -114,7 +115,6 @@ SUITE_DECL(mbr);
 SUITE_DECL(measurement);
 SUITE_DECL(mem);
 SUITE_DECL(optee);
-SUITE_DECL(overlay);
 SUITE_DECL(pci_mps);
 SUITE_DECL(seama);
 SUITE_DECL(setexpr);
@@ -134,6 +134,9 @@ static struct suite suites[] = {
        SUITE(env, "environment"),
        SUITE(exit, "shell exit and variables"),
        SUITE(fdt, "fdt command"),
+#ifdef CONFIG_UT_FDT_OVERLAY
+       SUITE_CMD(fdt_overlay, do_ut_fdt_overlay, "device tree overlays"),
+#endif
        SUITE(font, "font command"),
        SUITE(hush, "hush behaviour"),
        SUITE(lib, "library functions"),
@@ -144,9 +147,6 @@ static struct suite suites[] = {
        SUITE(mem, "memory-related commands"),
 #ifdef CONFIG_UT_OPTEE
        SUITE_CMD(optee, do_ut_optee, "OP-TEE"),
-#endif
-#ifdef CONFIG_UT_OVERLAY
-       SUITE_CMD(overlay, do_ut_overlay, "device tree overlays"),
 #endif
        SUITE(pci_mps, "PCI Express Maximum Payload Size"),
        SUITE(seama, "seama command parameters loading and decoding"),
similarity index 93%
rename from test/overlay/Kconfig
rename to test/fdt_overlay/Kconfig
index 8818489..c2bb70f 100644 (file)
@@ -1,4 +1,4 @@
-config UT_OVERLAY
+config UT_FDT_OVERLAY
        bool "Enable Device Tree Overlays Unit Tests"
        depends on UNIT_TEST && OF_CONTROL && SANDBOX
        default y
similarity index 89%
rename from test/overlay/Makefile
rename to test/fdt_overlay/Makefile
index 47937e3..5625c0d 100644 (file)
@@ -4,7 +4,7 @@
 # Copyright (c) 2016 Free Electrons
 
 # Test files
-obj-y += cmd_ut_overlay.o
+obj-y += cmd_ut_fdt_overlay.o
 
 DTC_FLAGS += -@
 
similarity index 77%
rename from test/overlay/cmd_ut_overlay.c
rename to test/fdt_overlay/cmd_ut_fdt_overlay.c
index aefa147..9fe18b6 100644 (file)
@@ -13,8 +13,8 @@
 
 #include <linux/sizes.h>
 
+#include <test/fdt_overlay.h>
 #include <test/ut.h>
-#include <test/overlay.h>
 #include <test/suites.h>
 
 /* 4k ought to be enough for anybody */
@@ -68,7 +68,7 @@ static int fdt_getprop_str(void *fdt, const char *path, const char *name,
        return len < 0 ? len : 0;
 }
 
-static int fdt_overlay_change_int_property(struct unit_test_state *uts)
+static int fdt_overlay_test_change_int_property(struct unit_test_state *uts)
 {
        u32 val = 0;
 
@@ -78,9 +78,9 @@ static int fdt_overlay_change_int_property(struct unit_test_state *uts)
 
        return CMD_RET_SUCCESS;
 }
-OVERLAY_TEST(fdt_overlay_change_int_property, 0);
+FDT_OVERLAY_TEST(fdt_overlay_test_change_int_property, 0);
 
-static int fdt_overlay_change_str_property(struct unit_test_state *uts)
+static int fdt_overlay_test_change_str_property(struct unit_test_state *uts)
 {
        const char *val = NULL;
 
@@ -90,9 +90,9 @@ static int fdt_overlay_change_str_property(struct unit_test_state *uts)
 
        return CMD_RET_SUCCESS;
 }
-OVERLAY_TEST(fdt_overlay_change_str_property, 0);
+FDT_OVERLAY_TEST(fdt_overlay_test_change_str_property, 0);
 
-static int fdt_overlay_add_str_property(struct unit_test_state *uts)
+static int fdt_overlay_test_add_str_property(struct unit_test_state *uts)
 {
        const char *val = NULL;
 
@@ -102,9 +102,9 @@ static int fdt_overlay_add_str_property(struct unit_test_state *uts)
 
        return CMD_RET_SUCCESS;
 }
-OVERLAY_TEST(fdt_overlay_add_str_property, 0);
+FDT_OVERLAY_TEST(fdt_overlay_test_add_str_property, 0);
 
-static int fdt_overlay_add_node_by_phandle(struct unit_test_state *uts)
+static int fdt_overlay_test_add_node_by_phandle(struct unit_test_state *uts)
 {
        int off;
 
@@ -115,9 +115,9 @@ static int fdt_overlay_add_node_by_phandle(struct unit_test_state *uts)
 
        return CMD_RET_SUCCESS;
 }
-OVERLAY_TEST(fdt_overlay_add_node_by_phandle, 0);
+FDT_OVERLAY_TEST(fdt_overlay_test_add_node_by_phandle, 0);
 
-static int fdt_overlay_add_node_by_path(struct unit_test_state *uts)
+static int fdt_overlay_test_add_node_by_path(struct unit_test_state *uts)
 {
        int off;
 
@@ -128,9 +128,9 @@ static int fdt_overlay_add_node_by_path(struct unit_test_state *uts)
 
        return CMD_RET_SUCCESS;
 }
-OVERLAY_TEST(fdt_overlay_add_node_by_path, 0);
+FDT_OVERLAY_TEST(fdt_overlay_test_add_node_by_path, 0);
 
-static int fdt_overlay_add_subnode_property(struct unit_test_state *uts)
+static int fdt_overlay_test_add_subnode_property(struct unit_test_state *uts)
 {
        int off;
 
@@ -142,9 +142,9 @@ static int fdt_overlay_add_subnode_property(struct unit_test_state *uts)
 
        return CMD_RET_SUCCESS;
 }
-OVERLAY_TEST(fdt_overlay_add_subnode_property, 0);
+FDT_OVERLAY_TEST(fdt_overlay_test_add_subnode_property, 0);
 
-static int fdt_overlay_local_phandle(struct unit_test_state *uts)
+static int fdt_overlay_test_local_phandle(struct unit_test_state *uts)
 {
        uint32_t local_phandle;
        u32 val = 0;
@@ -166,9 +166,9 @@ static int fdt_overlay_local_phandle(struct unit_test_state *uts)
 
        return CMD_RET_SUCCESS;
 }
-OVERLAY_TEST(fdt_overlay_local_phandle, 0);
+FDT_OVERLAY_TEST(fdt_overlay_test_local_phandle, 0);
 
-static int fdt_overlay_local_phandles(struct unit_test_state *uts)
+static int fdt_overlay_test_local_phandles(struct unit_test_state *uts)
 {
        uint32_t local_phandle, test_phandle;
        u32 val = 0;
@@ -196,9 +196,9 @@ static int fdt_overlay_local_phandles(struct unit_test_state *uts)
 
        return CMD_RET_SUCCESS;
 }
-OVERLAY_TEST(fdt_overlay_local_phandles, 0);
+FDT_OVERLAY_TEST(fdt_overlay_test_local_phandles, 0);
 
-static int fdt_overlay_stacked(struct unit_test_state *uts)
+static int fdt_overlay_test_stacked(struct unit_test_state *uts)
 {
        u32 val = 0;
 
@@ -208,13 +208,13 @@ static int fdt_overlay_stacked(struct unit_test_state *uts)
 
        return CMD_RET_SUCCESS;
 }
-OVERLAY_TEST(fdt_overlay_stacked, 0);
+FDT_OVERLAY_TEST(fdt_overlay_test_stacked, 0);
 
-int do_ut_overlay(struct unit_test_state *uts, struct cmd_tbl *cmdtp, int flag,
-                 int argc, char *const argv[])
+int do_ut_fdt_overlay(struct unit_test_state *uts, struct cmd_tbl *cmdtp,
+                     int flag, int argc, char *const argv[])
 {
-       struct unit_test *tests = UNIT_TEST_SUITE_START(overlay);
-       const int n_ents = UNIT_TEST_SUITE_COUNT(overlay);
+       struct unit_test *tests = UNIT_TEST_SUITE_START(fdt_overlay);
+       const int n_ents = UNIT_TEST_SUITE_COUNT(fdt_overlay);
        void *fdt_base = &__dtb_test_fdt_base_begin;
        void *fdt_overlay = &__dtbo_test_fdt_overlay_begin;
        void *fdt_overlay_stacked = &__dtbo_test_fdt_overlay_stacked_begin;
@@ -268,7 +268,8 @@ int do_ut_overlay(struct unit_test_state *uts, struct cmd_tbl *cmdtp, int flag,
        /* Apply the stacked overlay */
        ut_assertok(fdt_overlay_apply(fdt, fdt_overlay_stacked_copy));
 
-       ret = cmd_ut_category(uts, "overlay", "", tests, n_ents, argc, argv);
+       ret = cmd_ut_category(uts, "fdt_overlay", "fdt_overlay_test_", tests,
+                             n_ents, argc, argv);
 
        free(fdt_overlay_stacked_copy);
 err3:
index ae12730..1e02d67 100644 (file)
@@ -7,10 +7,10 @@ import re
 # List of test suites we expect to find with 'ut info' and 'ut all'
 EXPECTED_SUITES = [
     'addrmap', 'bdinfo', 'bloblist', 'bootm', 'bootstd',
-    'cmd', 'common', 'dm', 'env', 'exit',
+    'cmd', 'common', 'dm', 'env', 'exit', 'fdt_overlay',
     'fdt', 'font', 'hush', 'lib',
     'loadm', 'log', 'mbr', 'measurement', 'mem',
-    'overlay', 'pci_mps', 'setexpr', 'upl',
+    'pci_mps', 'setexpr', 'upl',
     ]