diff options
author | Simon Glass <sjg@chromium.org> | 2023-08-14 16:40:36 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-08-25 13:54:33 -0400 |
commit | bcf2b7202e960e7fb3df8d5e8ed0d6fa00a5a9fa (patch) | |
tree | 75f46b69fa13368405aafeb36e2b1adcfcdf6a35 /test | |
parent | fc9c0e0771cad76b24f73bb64c105b6ea39721ca (diff) | |
download | u-boot-bcf2b7202e960e7fb3df8d5e8ed0d6fa00a5a9fa.tar.gz u-boot-bcf2b7202e960e7fb3df8d5e8ed0d6fa00a5a9fa.tar.bz2 u-boot-bcf2b7202e960e7fb3df8d5e8ed0d6fa00a5a9fa.zip |
expo: cedit: Support reading settings from environment vars
Add a command to read cedit settings from environment variables so that
they can be restored as part of the environment.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/boot/cedit.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/boot/cedit.c b/test/boot/cedit.c index 26a69f0323..7cf0c3e4e9 100644 --- a/test/boot/cedit.c +++ b/test/boot/cedit.c @@ -114,7 +114,7 @@ static int cedit_fdt(struct unit_test_state *uts) } BOOTSTD_TEST(cedit_fdt, 0); -/* Check the cedit write_env command */ +/* Check the cedit write_env and read_env commands */ static int cedit_env(struct unit_test_state *uts) { struct video_priv *vid_priv; @@ -142,6 +142,16 @@ static int cedit_env(struct unit_test_state *uts) ut_asserteq(7, env_get_ulong("c.cpu-speed", 10, 0)); ut_asserteq_str("2.5 GHz", env_get("c.cpu-speed-str")); + /* reset the expo */ + menu->cur_item_id = ID_CPU_SPEED_1; + + ut_assertok(run_command("cedit read_env -v", 0)); + ut_assert_nextlinen("c.cpu-speed=7"); + ut_assert_nextlinen("c.power-loss=10"); + ut_assert_console_end(); + + ut_asserteq(ID_CPU_SPEED_2, menu->cur_item_id); + return 0; } BOOTSTD_TEST(cedit_env, 0); |