test/py: add test for whitelist of variables while importing environment
authorQuentin Schulz <quentin.schulz@bootlin.com>
Mon, 9 Jul 2018 17:16:30 +0000 (19:16 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 20 Jul 2018 19:55:09 +0000 (15:55 -0400)
commitb7a7c4113c231e73a1719204cefe8d82d0047e96
tree6f8c297593961925a2e07e5de939c919c8ed9764
parenteaf734724fd8117045423d126427c8b2f33e40e3
test/py: add test for whitelist of variables while importing environment

This tests that the importing of an environment with a specified
whitelist works as intended.

If there are variables passed as parameter to the env import command,
those only should be imported in the current environment.

For each variable passed as parameter, if
 - foo is bar in current env and bar2 in exported env, after importing
 exported env, foo shall be bar2,
 - foo does not exist in current env and foo is bar2 in exported env,
 after importing exported env, foo shall be bar2,
 - foo is bar in current env and does not exist in exported env (but is
 passed as parameter), after importing exported env, foo shall be empty
 ONLY if the -d option is passed to env import, otherwise foo shall be
 bar,

Any variable not passed as parameter should be left untouched.

Two other tests are made to test that size cannot be '-' if the checksum
protection is enabled.

Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
test/py/tests/test_env.py