From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Thu, 16 Jun 2016 11:09:19 -0600 Subject: [U-Boot] [PATCH v1 02/12] tests: py: disable main_signon check for printenv cmd In-Reply-To: <573C9A31.2060505@wwwdotorg.org> References: <1463581128-22188-1-git-send-email-hs@denx.de> <1463581128-22188-3-git-send-email-hs@denx.de> <573C9A31.2060505@wwwdotorg.org> Message-ID: <5762DD3F.2080906@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 05/18/2016 10:37 AM, Stephen Warren wrote: > On 05/18/2016 08:18 AM, Heiko Schocher wrote: >> if CONFIG_VERSION_VARIABLE is set, the U-Boot environment >> contains a "vers" variable with the current U-Boot version >> string. If now "printenv" is called, test/py fails as it >> detects the main_sign string, which is in this case correct. >> >> So check only the main_sign as an error, if CONFIG_VERSION_VARIABLE >> is not set. > > Interesting. I wonder if it would be possible to instead adjust the > regex so it didn't match the printenv output; that way if printenv > crashed and the system rebooted, the test would still catch it. Still, > the current patch is probably simpler and the window for issues small > enough that I think this is fine. > >> diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py > >> + if >> self.u_boot_console.config.buildconfig['config_version_variable'] == 'y': > > I think that should instead be: > >> if >> self.u_boot_console.config.buildconfig.get('config_version_variable', >> 'n') == 'y': > > That way, if there's no value for CONFIG_VERSION_VARIABLE at all, the > code will still work, rather than raising an exception when the lookup > fails. > > With that change, > Acked-by: Stephen Warren Unfortunately, this patch got applied in the original form, which causes a lot of breakage, since CONFIG_VERSION_VARIABLE doesn't exist in many cases. I'll send a fixup patch.