summaryrefslogtreecommitdiff
path: root/test/py/tests/test_env.py
AgeCommit message (Collapse)Author
2017-05-22test: py: Add cmd_echo dependencyMichal Simek
There is missing dependency on echo command. Mark tests which requires echo. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>
2016-06-19test/py: fix printenv signon message disable codeStephen 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") Acked-by: Heiko Schocher <hs@denx.de> Signed-off-by: Stephen Warren <swarren@nvidia.com>
2016-06-09tests: py: disable main_signon check for printenv cmdHeiko Schocher
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. Signed-off-by: Heiko Schocher <hs@denx.de>
2016-01-29test/py: fix a couple typos in commentsStephen Warren
s/updata/update/. Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-01-29test/py: use " for docstringsStephen Warren
Python's coding style docs indicate to use " not ' for docstrings. test/py has other violations of the coding style docs, since the docs specify a stranger style than I would expect, but nobody has complained about those yet:-) Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-01-29test/py: move U-Boot respawn trigger to the test coreStephen Warren
Prior to this change, U-Boot was lazilly (re-)spawned if/when a test attempted to interact with it, and no active connection existed. This approach was simple, yet had the disadvantage that U-Boot might be spawned in the middle of a test function, e.g. after the test had already performed actions such as creating data files, etc. In that case, this could cause the log to contain the sequence (1) some test logs, (2) U-Boot's boot process, (3) the rest of that test's logs. This isn't optimally readable. This issue will affect the upcoming DFU and enhanced UMS tests. This change converts u_boot_console to be a function-scoped fixture, so that pytest attempts to re-create the object for each test invocation. This allows the fixture factory function to ensure that U-Boot is spawned prior to every test. In practice, the same object is returned each time so there is essentially no additional overhead due to this change. This allows us to remove: - The explicit ensure_spawned() call from test_sleep, since the core now ensures that the spawn happens before the test code is executed. - The laxy calls to ensure_spawned() in the u_boot_console_* implementations. The one downside is that test_env's "state_ttest_env" fixture must be converted to a function-scoped fixture too, since a module-scoped fixture cannot use a function-scoped fixture. To avoid overhead, we use the same trick of returning the same object each time. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
2016-01-21test/py: add test of setenv/printenv/echoStephen Warren
This tests basic environment variable functionality. Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>