[Concept,04/32] test: pxe: Test devicetree alias keywords

Message ID 20260109231151.4056804-5-sjg@u-boot.org
State New
Headers
Series boot: pxe: Refactor into separate load/setup phases |

Commit Message

Simon Glass Jan. 9, 2026, 11:11 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Test the alias keywords for device tree options:
- devicetree (alias for fdt)
- devicetreedir (alias for fdtdir)
- devicetree-overlay (alias for fdtoverlays)

These use the same parsing code as their primary keywords, but verifying
they work correctly ensures compatibility with configs that use either
form.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 test/py/tests/test_pxe_parser.py | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
  

Patch

diff --git a/test/py/tests/test_pxe_parser.py b/test/py/tests/test_pxe_parser.py
index d52bf3e6b50..61ff6d11e3e 100644
--- a/test/py/tests/test_pxe_parser.py
+++ b/test/py/tests/test_pxe_parser.py
@@ -84,8 +84,11 @@  def create_extlinux_conf(srcdir, labels, menu_opts=None):
             - initrd: Initrd path (optional)
             - append: Kernel arguments (optional)
             - fdt: Device tree path (optional)
+            - devicetree: Device tree path (alias for fdt)
             - fdtdir: Device tree directory (optional)
+            - devicetreedir: Device tree directory (alias for fdtdir)
             - fdtoverlays: Device tree overlays (optional)
+            - devicetree-overlay: Device tree overlays (alias)
             - localboot: Local boot flag (optional)
             - ipappend: IP append flags (optional)
             - fit: FIT config path (optional)
@@ -145,10 +148,16 @@  def create_extlinux_conf(srcdir, labels, menu_opts=None):
                 fd.write(f"    append {label['append']}\n")
             if 'fdt' in label:
                 fd.write(f"    fdt {label['fdt']}\n")
+            if 'devicetree' in label:
+                fd.write(f"    devicetree {label['devicetree']}\n")
             if 'fdtdir' in label:
                 fd.write(f"    fdtdir {label['fdtdir']}\n")
+            if 'devicetreedir' in label:
+                fd.write(f"    devicetreedir {label['devicetreedir']}\n")
             if 'fdtoverlays' in label:
                 fd.write(f"    fdtoverlays {label['fdtoverlays']}\n")
+            if 'devicetree-overlay' in label:
+                fd.write(f"    devicetree-overlay {label['devicetree-overlay']}\n")
             if 'localboot' in label:
                 fd.write(f"    localboot {label['localboot']}\n")
             if 'ipappend' in label:
@@ -181,8 +190,9 @@  def pxe_image(u_boot_config):
             'kernel': '/vmlinuz',
             'initrd': '/initrd.img',
             'append': 'root=/dev/sda1 quiet',
-            'fdt': '/dtb/board.dtb',
-            'fdtoverlays': '/dtb/overlay1.dtbo /dtb/overlay2.dtbo',
+            # Use aliases to test devicetree/devicetree-overlay keywords
+            'devicetree': '/dtb/board.dtb',
+            'devicetree-overlay': '/dtb/overlay1.dtbo /dtb/overlay2.dtbo',
             'kaslrseed': True,
             'say': 'Booting default Linux kernel',
             'default': True,
@@ -192,7 +202,7 @@  def pxe_image(u_boot_config):
             'menu': 'Rescue Mode',
             'linux': '/vmlinuz-rescue',  # test 'linux' keyword
             'append': 'single',
-            'fdtdir': '/dtb/',
+            'devicetreedir': '/dtb/',  # test alias for fdtdir
             'ipappend': '3',
         },
         {