summaryrefslogtreecommitdiff
path: root/test/py/tests/test_source.py
diff options
context:
space:
mode:
authorRasmus Villemoes <[email protected]>2026-06-02 23:30:13 +0200
committerTom Rini <[email protected]>2026-06-11 07:56:45 -0600
commitc8a636af67c640e1427e1085c8bada672e48f805 (patch)
tree05e0b8ed8ce1b38afbd7aa672b4b179ce63ef032 /test/py/tests/test_source.py
parenta6369b8bb299aff8d5641fd11d2fcd0214103a18 (diff)
test: hook up test of allowing control DTB to act as FIT image
Add a test demonstrating how one can embed various scripts in the control DTB. Verify that the source command can be used with ${fdtcontroladdr} by itself (invoking the default script), and with :<node-name> suffix. Check that the scripts themselves can invoke "sibling" scripts. Also verify that without CONTROL_DTB_AS_FIT set, the control DTB is not accepted by the source command. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Rasmus Villemoes <[email protected]>
Diffstat (limited to 'test/py/tests/test_source.py')
-rw-r--r--test/py/tests/test_source.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/py/tests/test_source.py b/test/py/tests/test_source.py
index 970d8c79869..29ab804f81b 100644
--- a/test/py/tests/test_source.py
+++ b/test/py/tests/test_source.py
@@ -34,3 +34,34 @@ def test_source(ubman):
ubman.run_command('fdt rm /images default')
assert 'Fail' in ubman.run_command('source || echo Fail')
assert 'Fail' in ubman.run_command('source \\# || echo Fail')
+
[email protected]('cmd_echo')
[email protected]('cmd_source')
[email protected]('control_dtb_as_fit')
+def test_source_control_dtb(ubman):
+ output = ubman.run_command('source ${fdtcontroladdr}')
+ assert '* default script' in output
+
+ output = ubman.run_command('source ${fdtcontroladdr}:boot')
+ assert '* default script' in output
+
+ output = ubman.run_command('source ${fdtcontroladdr}:outer')
+ assert '* outer 1' in output
+ assert '* inner' in output
+ assert '* outer 2' in output
+
+ output = ubman.run_command('source ${fdtcontroladdr}:inner')
+ assert '* outer' not in output
+ assert '* inner' in output
+
+ assert 'Fail' in ubman.run_command('source ${fdtcontroladdr}:no-such-script || echo Fail')
+
[email protected]('cmd_echo')
[email protected]('cmd_source')
[email protected]('control_dtb_as_fit')
+def test_source_reject_control_dtb(ubman):
+ assert 'Fail' in ubman.run_command('source ${fdtcontroladdr} || echo Fail')
+ assert 'Fail' in ubman.run_command('source ${fdtcontroladdr}:boot || echo Fail')