aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-10-13 08:45:55 -0400
committerTom Rini <trini@konsulko.com>2023-10-13 08:45:55 -0400
commit6961ca0a46310da782668d8bfbf4f45b04758c55 (patch)
tree17434f00e66b9c7fa40fdfc41717c44ab816d067 /test
parent5895d5c7ab9e501205fd4b9a2b4544680ae7e72a (diff)
parent7a82bfff5ea7089905dff14e65436d23c1e5adc4 (diff)
downloadu-boot-6961ca0a46310da782668d8bfbf4f45b04758c55.zip
u-boot-6961ca0a46310da782668d8bfbf4f45b04758c55.tar.gz
u-boot-6961ca0a46310da782668d8bfbf4f45b04758c55.tar.bz2
Merge tag 'xilinx-for-v2024.01-rc1-v3' of https://source.denx.de/u-boot/custodians/u-boot-microblazeWIP/13Oct2023
Xilinx changes for v2024.01-rc1 v3 clk: - remove additional compatible strings for Versal NET net: - zynq_gem: Fix clock calculation for MDC for higher frequencies pinctrl: - core: Extend pinmux status buffere size - zynqmp driver: Show also tristate configuration test: - add test case for pxe get Xilinx: - describe SelectMAP boot mode Zynq: - Fix nand description in DT ZynqMP: - DTS sync patches with kernel and also W=1 related fixes - Add support for KD240, zcu670, e-a2197 with x-prc cards, SC revB/C with i2c description for other SC based boards - k24 psu_init cleanup
Diffstat (limited to 'test')
-rw-r--r--test/py/tests/test_net.py66
1 files changed, 66 insertions, 0 deletions
diff --git a/test/py/tests/test_net.py b/test/py/tests/test_net.py
index cd4b4dc..b2241ae 100644
--- a/test/py/tests/test_net.py
+++ b/test/py/tests/test_net.py
@@ -6,6 +6,7 @@
import pytest
import u_boot_utils
+import uuid
"""
Note: This test relies on boardenv_* containing configuration values to define
@@ -61,6 +62,16 @@ env__net_nfs_readable_file = {
'crc32': 'c2244b26',
}
+# Details regarding a file that may be read from a TFTP server. This variable
+# may be omitted or set to None if PXE testing is not possible or desired.
+env__net_pxe_readable_file = {
+ 'fn': 'default',
+ 'addr': 0x2000000,
+ 'size': 74,
+ 'timeout': 50000,
+ 'pattern': 'Linux',
+}
+
# True if a router advertisement service is connected to the network, and should
# be tested. If router advertisement testing is not possible or desired, this
variable may be omitted or set to False.
@@ -260,3 +271,58 @@ def test_net_nfs(u_boot_console):
output = u_boot_console.run_command('crc32 %x $filesize' % addr)
assert expected_crc in output
+
+@pytest.mark.buildconfigspec("cmd_net")
+@pytest.mark.buildconfigspec("cmd_pxe")
+def test_net_pxe_get(u_boot_console):
+ """Test the pxe get command.
+
+ A pxe configuration file is downloaded from the TFTP server and interpreted
+ to boot the images mentioned in pxe configuration file.
+
+ The details of the file to download are provided by the boardenv_* file;
+ see the comment at the beginning of this file.
+ """
+
+ if not net_set_up:
+ pytest.skip("Network not initialized")
+
+ test_net_setup_static(u_boot_console)
+
+ f = u_boot_console.config.env.get("env__net_pxe_readable_file", None)
+ if not f:
+ pytest.skip("No PXE readable file to read")
+
+ addr = f.get("addr", None)
+ timeout = f.get("timeout", u_boot_console.p.timeout)
+
+ pxeuuid = uuid.uuid1()
+ u_boot_console.run_command(f"setenv pxeuuid {pxeuuid}")
+ expected_text_uuid = f"Retrieving file: pxelinux.cfg/{pxeuuid}"
+
+ ethaddr = u_boot_console.run_command("echo $ethaddr")
+ ethaddr = ethaddr.replace(':', '-')
+ expected_text_ethaddr = f"Retrieving file: pxelinux.cfg/01-{ethaddr}"
+
+ ip = u_boot_console.run_command("echo $ipaddr")
+ ip = ip.split('.')
+ ipaddr_file = "".join(['%02x' % int(x) for x in ip]).upper()
+ expected_text_ipaddr = f"Retrieving file: pxelinux.cfg/{ipaddr_file}"
+ expected_text_default = f"Retrieving file: pxelinux.cfg/default"
+
+ with u_boot_console.temporary_timeout(timeout):
+ output = u_boot_console.run_command("pxe get")
+
+ assert "TIMEOUT" not in output
+ assert expected_text_uuid in output
+ assert expected_text_ethaddr in output
+ assert expected_text_ipaddr in output
+
+ i = 1
+ for i in range(0, len(ipaddr_file) - 1):
+ expected_text_ip = f"Retrieving file: pxelinux.cfg/{ipaddr_file[:-i]}"
+ assert expected_text_ip in output
+ i += 1
+
+ assert expected_text_default in output
+ assert "Config file 'default.boot' found" in output