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>
This commit is contained in:
Simon Glass
2023-08-14 16:40:36 -06:00
committed by Tom Rini
parent fc9c0e0771
commit bcf2b7202e
5 changed files with 105 additions and 1 deletions

View File

@@ -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);