diff mbox series

[PATHv11,15/43] test_efi_loader.py: use $filesize var

Message ID 20231127125726.3735-16-maxim.uvarov@linaro.org
State New
Headers show
Series net/lwip: add lwip library for the network stack | expand

Commit Message

Maxim Uvarov Nov. 27, 2023, 12:56 p.m. UTC
bootefi code relays in internal variable then to filesize environment.
lwip tftp do not update this variable. For not I update test to provide
correct size.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 test/py/tests/test_efi_loader.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Tom Rini Nov. 27, 2023, 6:18 p.m. UTC | #1
On Mon, Nov 27, 2023 at 06:56:58PM +0600, Maxim Uvarov wrote:

> bootefi code relays in internal variable then to filesize environment.
> lwip tftp do not update this variable. For not I update test to provide
> correct size.
> 
> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

This is a lwip problem then, loading a "file" should update filesize and
there's use cases, not just tests, which rely on this behavior.
Neil Armstrong Nov. 28, 2023, 11:05 a.m. UTC | #2
On 27/11/2023 19:18, Tom Rini wrote:
> On Mon, Nov 27, 2023 at 06:56:58PM +0600, Maxim Uvarov wrote:
> 
>> bootefi code relays in internal variable then to filesize environment.
>> lwip tftp do not update this variable. For not I update test to provide
>> correct size.
>>
>> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> 
> This is a lwip problem then, loading a "file" should update filesize and
> there's use cases, not just tests, which rely on this behavior.
> 

filesize is updated in tftp_close, but what's missing is a call to efi_set_bootdev
when tftp transfer is finished:

https://elixir.bootlin.com/u-boot/latest/source/net/tftp.c#L305 :
	if (IS_ENABLED(CONFIG_CMD_BOOTEFI)) {
		if (!tftp_put_active)
			efi_set_bootdev("Net", "", tftp_filename,
					map_sysmem(tftp_load_addr, 0),
					net_boot_file_size);

Neil
diff mbox series

Patch

diff --git a/test/py/tests/test_efi_loader.py b/test/py/tests/test_efi_loader.py
index 85473a9049..9b2541593c 100644
--- a/test/py/tests/test_efi_loader.py
+++ b/test/py/tests/test_efi_loader.py
@@ -158,7 +158,7 @@  def test_efi_helloworld_net(u_boot_console):
 
     addr = fetch_tftp_file(u_boot_console, 'env__efi_loader_helloworld_file')
 
-    output = u_boot_console.run_command('bootefi %x' % addr)
+    output = u_boot_console.run_command('bootefi $fileaddr:$filesize')
     expected_text = 'Hello, world'
     assert expected_text in output
     expected_text = '## Application failed'
@@ -187,7 +187,7 @@  def test_efi_grub_net(u_boot_console):
 
     addr = fetch_tftp_file(u_boot_console, 'env__efi_loader_grub_file')
 
-    u_boot_console.run_command('bootefi %x' % addr, wait_for_prompt=False)
+    u_boot_console.run_command('bootefi %x:$filesize' % addr, wait_for_prompt=False)
 
     # Verify that we have an SMBIOS table
     check_smbios = u_boot_console.config.env.get('env__efi_loader_check_smbios', False)