diff options
author | Rasmus Villemoes <ravi@prevas.dk> | 2024-10-30 22:34:03 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-11-15 16:36:18 -0600 |
commit | 1e2325f76069f03fe0572af9599eab16674bdfc1 (patch) | |
tree | c720978aaeab9511967ecc373b63f4c76c9ff270 /test/env/cmd_ut_env.c | |
parent | 4d28fcdf65950576f0e0f5447c89421126dc4943 (diff) |
test: env: check that non-mentioned variables to "env default" are preserved
Instead of testing the same expected behaviour for both
non_default_varX, test that when var1 is not in the default env but is
mentioned in the "env default" cmdline, it is removed, while var2 is
untouched.
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Diffstat (limited to 'test/env/cmd_ut_env.c')
-rw-r--r-- | test/env/cmd_ut_env.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/test/env/cmd_ut_env.c b/test/env/cmd_ut_env.c index 4af05764fb8..e1dd1a14cb0 100644 --- a/test/env/cmd_ut_env.c +++ b/test/env/cmd_ut_env.c @@ -14,22 +14,21 @@ static int env_test_env_cmd(struct unit_test_state *uts) ut_assertok(run_command("setenv non_default_var1 1", 0)); ut_assert_console_end(); - ut_assertok(run_command("setenv non_default_var2 1", 0)); + ut_assertok(run_command("setenv non_default_var2 2", 0)); ut_assert_console_end(); ut_assertok(run_command("env print non_default_var1", 0)); ut_assert_nextline("non_default_var1=1"); ut_assert_console_end(); - ut_assertok(run_command("env default non_default_var1 non_default_var2", 0)); + ut_assertok(run_command("env default non_default_var1", 0)); ut_assert_nextline("WARNING: 'non_default_var1' not in imported env, deleting it!"); - ut_assert_nextline("WARNING: 'non_default_var2' not in imported env, deleting it!"); ut_assert_console_end(); ut_asserteq(1, run_command("env exists non_default_var1", 0)); ut_assert_console_end(); - ut_asserteq(1, run_command("env exists non_default_var2", 0)); + ut_asserteq(0, run_command("env exists non_default_var2", 0)); ut_assert_console_end(); return 0; |