
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 swarren@nvidia.com