From patchwork Fri Jan 9 01:53:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 93 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767923621; bh=cIyvGOvN++PhIvcsX0ZIlwi5mUEkUFP3wPmPankP1eQ=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=Gx1AwQOLxqHnpWySNF7rE3Qwstr4uizYSVnNUGAL+MldXtCgvtfEPD7DfmLR8Q88S GHyqBEoSEt21HzdqUS+yitxD0fqJqi7ifTJBPIp0TWsW70bQuMXZqWbwTok1PIsKxD A6jsPBv+R3Hcg64DblsSIlhb3TmADvEyHCuP+dcYkjKYEU9Kvgy4dVhfRCfCvQlWUY KWDWd5SVTB8j9jYzvYwXH8DnBu+cDq5aTN187PDakDUyFWsnV9hECDpG/Q9Y+/JUmU nPVRx8gB6JN2J6GOWKsaZJPIRmI2vgBAy+hMG2Jlual3cqDbbJTyjHNaq1pGUTTe+M ckiNR29F4i91Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 55E15691EA for ; Thu, 8 Jan 2026 18:53:41 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id SxHhCBnmXBVY for ; Thu, 8 Jan 2026 18:53:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767923621; bh=cIyvGOvN++PhIvcsX0ZIlwi5mUEkUFP3wPmPankP1eQ=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=Gx1AwQOLxqHnpWySNF7rE3Qwstr4uizYSVnNUGAL+MldXtCgvtfEPD7DfmLR8Q88S GHyqBEoSEt21HzdqUS+yitxD0fqJqi7ifTJBPIp0TWsW70bQuMXZqWbwTok1PIsKxD A6jsPBv+R3Hcg64DblsSIlhb3TmADvEyHCuP+dcYkjKYEU9Kvgy4dVhfRCfCvQlWUY KWDWd5SVTB8j9jYzvYwXH8DnBu+cDq5aTN187PDakDUyFWsnV9hECDpG/Q9Y+/JUmU nPVRx8gB6JN2J6GOWKsaZJPIRmI2vgBAy+hMG2Jlual3cqDbbJTyjHNaq1pGUTTe+M ckiNR29F4i91Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4138F691E7 for ; Thu, 8 Jan 2026 18:53:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767923619; bh=nhXnyjtumiF6YVUeoz8LHnREiOHTvprPrHHaexklNng=; h=From:To:Cc:Subject:Date:From; b=ikh/IfNTySvfMRqwpw0h3/C7dQtfRfjW8hn9BDw8lnzH0DRI/IoqHQcMqCiC8OFUA CdBrs8KTp5Et/lZTd/nV3cR3fVdGvQTpOwP3yxTZIExmOvL15h/q36xsknuNm6IwI4 CpcVPDNHq5K9+SIdtaSWsihLdaeupa/OMg0InREhSdPdDJoQB0o+fN3V6uihnPJtyi mXO/0hfgHstWP9Sx3FV3VVKMdWgKWCh0+FjogNjBrrJTOuRUxylow0IrlMHmOLMYKr kiwimooJITOGt3mpDqf5NgTjAnKXKFZkYng2YSN/UufRDKdyG8p2dOLgyAvWdzxGVS 1PS8H/2u0B+Hg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D5D8069130; Thu, 8 Jan 2026 18:53:39 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id gaPkmcstqZXn; Thu, 8 Jan 2026 18:53:39 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767923615; bh=TNNj4mDwNF6Q3RdkALnE1YyRFieEVM7loRjrXAENF/I=; h=From:To:Cc:Subject:Date:From; b=tpj+y22xJm+O3FWkD9j0mt53ZIBmauPzlJwl6AXDMU25TbAayyvtyXjDUGO1S/wco 4dyQ+AvzYsjWgaMDU72omi+4CpW1pP1lmGZ72NRNFWnWSaur0k83nrOnOJrv+y5gMJ Wt8btlbdenRexrqr+kHUtbksM1R0OaqMEhcgvP3lVF/U5r+Z+Ti9VmLEEu2Exw4ZhB eFtByITqDQzGQw7Z6K6WSW40Gs/Y82OjKSFzj/ebudbRrkKGQOz5tSEeq8aDt21Tod ow+EstoHTL/qzMMdovScKAKqTRPPp2LMyhSfEe/SPvwC9ZUI4uy6p/EvDQJOSz1bg6 S5RGiJTFcp0jQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 56B786912D; Thu, 8 Jan 2026 18:53:35 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 18:53:01 -0700 Message-ID: <20260109015323.3411528-1-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Message-ID-Hash: SY7LRGGBX7C2FTPFN5JYBDBQZJEG6GH2 X-Message-ID-Hash: SY7LRGGBX7C2FTPFN5JYBDBQZJEG6GH2 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 00/16] test: pxe: Add some decent tests for the PXE/extlinux parser List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass This series adds unit tests and Python test wrappers for the PXE/extlinux configuration parser and associated logic. - Basic parsing of extlinux.conf files and label properties - The 'say' keyword for printing messages during parsing - Include directives and nested includes (up to MAX_NEST_LEVEL) - The sysboot command for booting via extlinux.conf - fdtdir path resolution using environment variables - FDT overlay loading and error handling - Helper functions (pxe_get_file_size, format_mac_pxe, get_pxelinux_path) - The pxe_timeout environment variable for menu timeout override - ipappend functionality for IP and MAC address appending - FDT fallback logic extraction - The pxe_label_override environment variable - LMB address allocation when no address env vars are set The tests use the usual hybrid approach: a Python fixtures to create filesystem images with extlinux.conf files and a C unit-test to perform the actual parsing and verification. This allows testing the parser APIs directly without needing to boot a real kernel. Simon Glass (16): buildman: Fix f-string in the delta column header test: pxe: Add unit tests for PXE/extlinux parser test: pxe: Add a test for the 'say' keyword boot: pxe: Stop after first boot attempt on sandbox test: pxe: Test include directive test: pxe: Add a test for nested include boot: pxe: Add a test for the sysboot command boot: pxe: Add a test for fdtdir path-resolution boot: pxe: Add a test for FDT error-handling test: pxe: Add a few tests for pxe functions test: pxe: Add a note about ontimeout keyword testing boot: pxe: Add a pxe_timeout env variable for menu timeout test: pxe: Add a test for the ipappend functionality boot: pxe: Extract FDT fallback logic and add test test: pxe: Add test for tpxe_label_override test: pxe: Add test for the address-allocation path boot/pxe_utils.c | 70 ++- include/pxe_utils.h | 14 + test/boot/Makefile | 1 + test/boot/pxe.c | 924 +++++++++++++++++++++++++++++++ test/cmd_ut.c | 2 + test/py/tests/test_pxe_parser.py | 450 +++++++++++++++ tools/buildman/builder.py | 2 +- 7 files changed, 1437 insertions(+), 26 deletions(-) create mode 100644 test/boot/pxe.c create mode 100644 test/py/tests/test_pxe_parser.py