[U-Boot] [PATCH] test/py: fix printenv signon message disable code

Stephen Warren swarren at wwwdotorg.org
Thu Jun 16 20:59:34 CEST 2016


From: Stephen Warren <swarren at nvidia.com>

CONFIG_VERSION_VARIABLE isn't always defined, so we can't simply look up
its value directly, or an exception will occur if it isn't defined.
Instead, we must use .get() to supply a default value if the variable
isn't defined.

Fixes: da37f006e7c5 ("tests: py: disable main_signon check for printenv cmd")
Cc: Heiko Schocher <hs at denx.de>
Signed-off-by: Stephen Warren <swarren at nvidia.com>
---
 test/py/tests/test_env.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py
index 22a22d1d538b..035dbf5cac4c 100644
--- a/test/py/tests/test_env.py
+++ b/test/py/tests/test_env.py
@@ -39,7 +39,8 @@ class StateTestEnv(object):
             Nothing.
         """
 
-        if self.u_boot_console.config.buildconfig['config_version_variable'] == 'y':
+        if self.u_boot_console.config.buildconfig.get(
+                'config_version_variable', 'n') == 'y':
             with self.u_boot_console.disable_check('main_signon'):
                 response = self.u_boot_console.run_command('printenv')
         else:
-- 
2.9.0



More information about the U-Boot mailing list