From: Rasmus Villemoes <ravi@prevas.dk>
To: u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>,
Joe Hershberger <joe.hershberger@ni.com>,
Ravi Minnikanti <rminnikanti@marvell.com>,
Rasmus Villemoes <ravi@prevas.dk>
Subject: [PATCH 2/3] test: env: check that non-mentioned variables to "env default" are preserved
Date: Wed, 30 Oct 2024 22:34:03 +0100 [thread overview]
Message-ID: <20241030213404.2894247-3-ravi@prevas.dk> (raw)
In-Reply-To: <20241030213404.2894247-1-ravi@prevas.dk>
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>
---
test/env/cmd_ut_env.c | 7 +++----
1 file 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;
--
2.47.0
next prev parent reply other threads:[~2024-10-30 21:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-30 21:34 [PATCH 0/3] teach 'env default' to optionally keep runtime variables Rasmus Villemoes
2024-10-30 21:34 ` [PATCH 1/3] cmd/nvedit.c: " Rasmus Villemoes
2024-10-30 21:34 ` Rasmus Villemoes [this message]
2024-10-30 21:34 ` [PATCH 3/3] test: env: add some test cases for new "env default -k" flag Rasmus Villemoes
2024-11-13 22:32 ` [PATCH 0/3] teach 'env default' to optionally keep runtime variables Rasmus Villemoes
2024-11-15 14:21 ` Simon Glass
2024-11-15 15:22 ` Rasmus Villemoes
2024-11-16 3:41 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241030213404.2894247-3-ravi@prevas.dk \
--to=ravi@prevas.dk \
--cc=joe.hershberger@ni.com \
--cc=rminnikanti@marvell.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox