diff options
author | Marek Vasut | 2023-08-23 02:16:52 +0200 |
---|---|---|
committer | Tom Rini | 2023-08-30 17:56:21 -0400 |
commit | 95311f7a194aabc1a52d4f240fef36f21b3178fd (patch) | |
tree | 8045eadd0f9fd2afcce77283d9b76fc5b2f85438 /test/dm | |
parent | fa03568e46c9f4535b79e16faed4841ff7bfbe5b (diff) |
fwu: Initialize global fwu library state during CI test
The current CI test worked by sheer luck, the g_dev global pointer
in the fwu library was never initialized and the test equally well
failed on sandbox64. Trigger the main loop in sandbox tests too to
initialize that global state, and move the sandbox specific exit
from fwu_boottime_checks after g_dev is initialized.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/dm')
-rw-r--r-- | test/dm/fwu_mdata.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/dm/fwu_mdata.c b/test/dm/fwu_mdata.c index 8b5c83ef4e2..52018f610fe 100644 --- a/test/dm/fwu_mdata.c +++ b/test/dm/fwu_mdata.c @@ -93,6 +93,12 @@ static int dm_test_fwu_mdata_read(struct unit_test_state *uts) struct udevice *dev; struct fwu_mdata mdata = { 0 }; + /* + * Trigger lib/fwu_updates/fwu.c fwu_boottime_checks() + * to populate g_dev global pointer in that library. + */ + event_notify_null(EVT_MAIN_LOOP); + ut_assertok(uclass_first_device_err(UCLASS_FWU_MDATA, &dev)); ut_assertok(setup_blk_device(uts)); ut_assertok(populate_mmc_disk_image(uts)); @@ -112,6 +118,12 @@ static int dm_test_fwu_mdata_write(struct unit_test_state *uts) struct udevice *dev; struct fwu_mdata mdata = { 0 }; + /* + * Trigger lib/fwu_updates/fwu.c fwu_boottime_checks() + * to populate g_dev global pointer in that library. + */ + event_notify_null(EVT_MAIN_LOOP); + ut_assertok(setup_blk_device(uts)); ut_assertok(populate_mmc_disk_image(uts)); ut_assertok(write_mmc_blk_device(uts)); |