diff options
author | Tom Rini <trini@konsulko.com> | 2023-01-12 10:15:24 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-01-12 10:15:24 -0500 |
commit | f58885d002302b8047446a6a15f7376bb7b1ea32 (patch) | |
tree | b87608f2330d6190c3dcfad66eba8e9da5c47de2 /test/py/tests/test_env.py | |
parent | ee4f86cc042129abf1b16fcfbf4fc705b03375b6 (diff) | |
parent | 85fd48984e670d45eddd86710aa47c38baa738ca (diff) |
Merge branch '2023-01-11-assorted-general-updates'
- Assorted Kconfig cleanups, code clean ups, env+ubi updates, correct
return value propagation out of environment scripts, and update CI to
latest "jammy" tag.
Diffstat (limited to 'test/py/tests/test_env.py')
-rw-r--r-- | test/py/tests/test_env.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py index 6d08565f0b5..00bcccd65ff 100644 --- a/test/py/tests/test_env.py +++ b/test/py/tests/test_env.py @@ -8,6 +8,7 @@ Test operation of shell commands relating to environment variables. import os import os.path +import re from subprocess import call, CalledProcessError import tempfile @@ -173,6 +174,29 @@ def validate_set(state_test_env, var, value): response = state_test_env.u_boot_console.run_command('printenv %s' % var) assert response == ('%s=%s' % (var, value)) +@pytest.mark.boardspec('sandbox') +def test_env_initial_env_file(u_boot_console): + """Test that the u-boot-initial-env make target works""" + cons = u_boot_console + builddir = 'O=' + cons.config.build_dir + envfile = cons.config.build_dir + '/u-boot-initial-env' + + # remove if already exists from an older run + try: + os.remove(envfile) + except: + pass + + u_boot_utils.run_and_log(cons, ['make', builddir, 'u-boot-initial-env']) + + assert os.path.exists(envfile) + + # assume that every environment has a board variable, e.g. board=sandbox + with open(envfile, 'r') as file: + env = file.read() + regex = re.compile('board=.+\\n') + assert re.search(regex, env) + def test_env_echo_exists(state_test_env): """Test echoing a variable that exists.""" |