[U-Boot] [PATCH 3/3] tests: py: dfu: Provide functionality to set test and dummy files alt settings

Lukasz Majewski l.majewski at samsung.com
Fri Apr 8 17:44:51 CEST 2016


After concatenation of "dfu_alt_info" variable from "dfu_alt_boot" and
"dfu_alt_system" it may happen that test and dummy files alt settings
are different than default 0 and 1.

This patch provides ability to set different values for them.
It was the simplest possible solution - akin to the one from original
bash dfu tests.

Signed-off-by: Lukasz Majewski <l.majewski at samsung.com>
---
 test/py/tests/test_dfu.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/test/py/tests/test_dfu.py b/test/py/tests/test_dfu.py
index 1ed6020..af9073b 100644
--- a/test/py/tests/test_dfu.py
+++ b/test/py/tests/test_dfu.py
@@ -49,6 +49,10 @@ env__dfu_configs = (
         # - dfu alt info env variable is concatenated from boot medium dependent
         #   (dfu_alt_boot) and user defined (dfu_alt_system) variables
         "alt_info_env_name": "dfu_alt_system",
+        # - after concatenation dfu alt settings for test and dummy files are
+        #   moved from 0 and 1 to other values
+        "alt_num_test_file": "5",
+        "alt_num_dummy_file": "6",
     },
 )
 
@@ -119,6 +123,8 @@ def test_dfu(u_boot_console, env__usb_dev_port, env__dfu_config):
         Returns:
             Nothing.
         """
+        global alt_setting_test_file
+        global alt_setting_dummy_file
 
         fh = u_boot_utils.attempt_to_open_file(
             env__usb_dev_port['host_usb_dev_node'])
@@ -129,6 +135,12 @@ def test_dfu(u_boot_console, env__usb_dev_port, env__dfu_config):
         u_boot_console.log.action(
             'Starting long-running U-Boot dfu shell command')
 
+        if "alt_num_test_file" in env__dfu_config:
+	        alt_setting_test_file = env__dfu_config['alt_num_test_file']
+
+        if "alt_num_dummy_file" in env__dfu_config:
+	        alt_setting_dummy_file = env__dfu_config['alt_num_dummy_file']
+
         dfu_alt_info_env = "dfu_alt_info"
         if "alt_info_env_name" in env__dfu_config:
 	        dfu_alt_info_env = env__dfu_config['alt_info_env_name']
-- 
2.0.0.rc2



More information about the U-Boot mailing list