From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Fri, 17 Jun 2016 09:37:43 -0600 Subject: [U-Boot] [PATCH] test/py: fix printenv signon message disable code In-Reply-To: <57637EBB.1040108@denx.de> References: <20160616185934.9223-1-swarren@wwwdotorg.org> <57637EBB.1040108@denx.de> Message-ID: <57641947.2020201@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 06/16/2016 10:38 PM, Heiko Schocher wrote: > Hello Stephen, > > Am 16.06.2016 um 20:59 schrieb Stephen Warren: >> From: Stephen Warren >> >> 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 >> Signed-off-by: Stephen Warren >> --- >> test/py/tests/test_env.py | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) > > Thanks! > Acked-by: Heiko Schocher > >> 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: > > Hmm... may we should also move VERSION_VARIABLE to Kconfig? Be my guest:-) I believe the check above will automatically adapt to such a change, because the buildconfig object contains the union of all options found in .config (from Kconfig) and include/autoconf.mk (from include/configs/xxx.h).