test/py: spi: prevent overwriting relocation memory
PATCH 1/1 test/py: spi: prevent overwriting relocation memory
Update spi negative test case to prevent SF command from overwriting relocation memory area.
--- test/py/tests/test_spi.py | 12 ++++++++++++ 1 file changed, 12 insertions(+)
test/py/tests/test_spi.py +12 -0
@@ -693,4 +693,16 @@ def test_spi_negative(u_boot_console): u_boot_console, 'read', offset, size, addr, 1, error_msg, EXPECTED_READ ) + # Read to relocation address + output = u_boot_console.run_command('bdinfo') + m = re.search('relocaddr\s*= (.+)', output) + res_area = int(m.group(1), 16) + + start = 0 + size = 0x2000 + error_msg = 'ERROR: trying to overwrite reserved memory' + flash_ops( + u_boot_console, 'read', start, size, res_area, 1, error_msg, EXPECTED_READ + ) + i = i + 1
Signature · 1 line
2.25.1
Quoted 19 lines · Padmarao Begari
Update spi negative test case to prevent SF command from overwriting relocation memory area.
Signed-off-by Padmarao Begari <[email protected]>--- test/py/tests/test_spi.py | 12 ++++++++++++ 1 file changed, 12 insertions(+)test/py/tests/test_spi.py +3
-0@@ -693,4 +693,16 @@ def test_spi_negative(u_boot_console): u_boot_console, 'read', offset, size, addr, 1, error_msg, EXPECTED_READ ) + # Read to relocation address + output = u_boot_console.run_command('bdinfo') + m = re.search('relocaddr\s*= (.+)', output)
test/py/tests/test_spi.py def test_spi_negative(u_boot_console): · line 708
Quoted 10 lines
test/py/tests/test_spi.py +9
-0+ res_area = int(m.group(1), 16) + + start = 0 + size = 0x2000 + error_msg = 'ERROR: trying to overwrite reserved memory' + flash_ops( + u_boot_console, 'read', start, size, res_area, 1, error_msg, EXPECTED_READ + ) + i = i + 1
This got me looking at test/py/tests/test_spi.py more closely and this test is fine, so:
However, the error message 'No env file to read for SPI family device test' should really say that it's no test device configured (and similar change for env__spi_lock_unlock). A follow-up to rephrase those error messages would be appreciated.
Signature · 1 line
Tom
Quoted 41 lines
From: Tom Rini <[email protected]>
Sent: Wednesday, October 30, 2024 12:43 AM
To: Begari, Padmarao <[email protected]>
Cc: [email protected]; git (AMD-Xilinx) <[email protected]>; Simek, Michal <[email protected]>; Kumar, Love <[email protected]>
Subject: Re: [PATCH] test/py: spi: prevent overwriting relocation memoryQuoted 13 lines · Padmarao Begari
Update spi negative test case to prevent SF command from overwriting relocation memory area.
Signed-off-by Padmarao Begari <[email protected]>--- test/py/tests/test_spi.py | 12 ++++++++++++ 1 file changed, 12 insertions(+)test/py/tests/test_spi.py +0
-0test/py/tests/test_spi.py def test_spi_negative(u_boot_console): · line 693
Quoted 1 line
test/py/tests/test_spi.py +0
-0@@ -693,4 +693,16 @@ def test_spi_negative(u_boot_console): u_boot_console, 'read', offset, size, addr, 1, error_msg,
EXPECTED_READtest/py/tests/test_spi.py def test_spi_negative(u_boot_console):
Quoted 12 lines
test/py/tests/test_spi.py +10
-0) + # Read to relocation address + output = u_boot_console.run_command('bdinfo') + m = re.search('relocaddr\s*= (.+)', output) + res_area = int(m.group(1), 16) + + start = 0 + size = 0x2000 + error_msg = 'ERROR: trying to overwrite reserved memory' + flash_ops( + u_boot_console, 'read', start, size, res_area, 1, error_msg,
EXPECTED_READtest/py/tests/test_spi.py def test_spi_negative(u_boot_console): · line 708
Quoted 3 lines
test/py/tests/test_spi.py +2
-0+ ) + i = i + 1
Quoted 8 lines
This got me looking at
test/py/tests/test_spi.pymore closely and this test is fine, so:Reviewed-by Tom Rini <[email protected]>However, the error message 'No env file to read for SPI family device test' should really say that it's no test device configured (and similar change for
env__spi_lock_unlock). A follow-up to rephrase those error messages would be appreciated.
Sure Tom, we will do.
Regards
Padmarao
Quoted 3 lines
--
Tom
Hi Tom,
Quoted 35 lines · Tom Rini
Quoted 19 lines · Padmarao Begari
Update spi negative test case to prevent SF command from overwriting relocation memory area.
Signed-off-by Padmarao Begari <[email protected]>--- test/py/tests/test_spi.py | 12 ++++++++++++ 1 file changed, 12 insertions(+)test/py/tests/test_spi.py +3
-0@@ -693,4 +693,16 @@ def test_spi_negative(u_boot_console): u_boot_console, 'read', offset, size, addr, 1, error_msg, EXPECTED_READ ) + # Read to relocation address + output = u_boot_console.run_command('bdinfo') + m = re.search('relocaddr\s*= (.+)', output)test/py/tests/test_spi.py def test_spi_negative(u_boot_console): · line 708
Quoted 10 lines
test/py/tests/test_spi.py +9
-0+ res_area = int(m.group(1), 16) + + start = 0 + size = 0x2000 + error_msg = 'ERROR: trying to overwrite reserved memory' + flash_ops( + u_boot_console, 'read', start, size, res_area, 1, error_msg, EXPECTED_READ + ) + i = i + 1This got me looking at
test/py/tests/test_spi.pymore closely and this test is fine, so:
Quoted 7 lines
Reviewed-by Tom Rini <[email protected]>However, the error message 'No env file to read for SPI family device test' should really say that it's no test device configured (and similar change for
env__spi_lock_unlock). A follow-up to rephrase those error messages would be appreciated.
Thanks for looking it.
We'll send the separate patch for the above.
Regards,
Love Kumar
Quoted 19 lines · Padmarao Begari
Update spi negative test case to prevent SF command from overwriting relocation memory area.
Signed-off-by Padmarao Begari <[email protected]>--- test/py/tests/test_spi.py | 12 ++++++++++++ 1 file changed, 12 insertions(+)test/py/tests/test_spi.py +3
-0@@ -693,4 +693,16 @@ def test_spi_negative(u_boot_console): u_boot_console, 'read', offset, size, addr, 1, error_msg, EXPECTED_READ ) + # Read to relocation address + output = u_boot_console.run_command('bdinfo') + m = re.search('relocaddr\s*= (.+)', output)
test/py/tests/test_spi.py def test_spi_negative(u_boot_console): · line 708
Quoted 10 lines
test/py/tests/test_spi.py +9
-0+ res_area = int(m.group(1), 16) + + start = 0 + size = 0x2000 + error_msg = 'ERROR: trying to overwrite reserved memory' + flash_ops( + u_boot_console, 'read', start, size, res_area, 1, error_msg, EXPECTED_READ + ) + i = i + 1
Quoted 4 lines · Padmarao Begari
Update spi negative test case to prevent SF command from overwriting relocation memory area.
Applied to local tree/v2-tidy-test-dir, thanks!
Signature · 1 line
Tom