diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/boot/bootflow.c | 6 | ||||
-rw-r--r-- | test/dm/clk_ccf.c | 22 | ||||
-rw-r--r-- | test/dm/scmi.c | 1 | ||||
-rwxr-xr-x | test/py/tests/test_fit.py | 8 |
4 files changed, 33 insertions, 4 deletions
diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c index 597f624d036..a9b555c7794 100644 --- a/test/boot/bootflow.c +++ b/test/boot/bootflow.c @@ -374,7 +374,7 @@ static int bootflow_system(struct unit_test_state *uts) { struct udevice *bootstd, *dev; - if (!IS_ENABLED(CONFIG_CMD_BOOTEFI_BOOTMGR)) + if (!IS_ENABLED(CONFIG_BOOTEFI_BOOTMGR)) return -EAGAIN; ut_assertok(uclass_first_device_err(UCLASS_BOOTSTD, &bootstd)); ut_assertok(device_bind(bootstd, DM_DRIVER_GET(bootmeth_efi_mgr), @@ -1095,6 +1095,10 @@ static int bootflow_cmdline(struct unit_test_state *uts) ut_asserteq(0, run_command("bootflow cmdline get mary", 0)); ut_assert_nextline_empty(); + ut_asserteq(0, run_command("bootflow cmdline set mary abc", 0)); + ut_asserteq(0, run_command("bootflow cmdline set mary", 0)); + ut_assert_nextline_empty(); + ut_assert_console_end(); return 0; diff --git a/test/dm/clk_ccf.c b/test/dm/clk_ccf.c index e4ebb93cdad..61dad8d8527 100644 --- a/test/dm/clk_ccf.c +++ b/test/dm/clk_ccf.c @@ -19,16 +19,18 @@ static int dm_test_clk_ccf(struct unit_test_state *uts) { struct clk *clk, *pclk; - struct udevice *dev; + struct udevice *dev, *test_dev; long long rate; int ret; #if CONFIG_IS_ENABLED(CLK_CCF) + struct clk clk_ccf; const char *clkname; int clkid, i; #endif /* Get the device using the clk device */ ut_assertok(uclass_get_device_by_name(UCLASS_CLK, "clk-ccf", &dev)); + ut_assertok(uclass_get_device_by_name(UCLASS_MISC, "clk-test", &test_dev)); /* Test for clk_get_by_id() */ ret = clk_get_by_id(SANDBOX_CLK_ECSPI_ROOT, &clk); @@ -63,6 +65,9 @@ static int dm_test_clk_ccf(struct unit_test_state *uts) rate = clk_get_parent_rate(clk); ut_asserteq(rate, 60000000); + rate = clk_set_rate(clk, 60000000); + ut_asserteq(rate, -ENOSYS); + rate = clk_get_rate(clk); ut_asserteq(rate, 60000000); @@ -87,6 +92,9 @@ static int dm_test_clk_ccf(struct unit_test_state *uts) ut_asserteq_str("pll3_80m", pclk->dev->name); ut_asserteq(CLK_SET_RATE_PARENT, pclk->flags); + rate = clk_set_rate(clk, 80000000); + ut_asserteq(rate, -ENOSYS); + rate = clk_get_rate(clk); ut_asserteq(rate, 80000000); @@ -108,13 +116,23 @@ static int dm_test_clk_ccf(struct unit_test_state *uts) rate = clk_get_rate(clk); ut_asserteq(rate, 60000000); + rate = clk_set_rate(clk, 60000000); + ut_asserteq(rate, 60000000); + #if CONFIG_IS_ENABLED(CLK_CCF) /* Test clk tree enable/disable */ + + ret = clk_get_by_index(test_dev, SANDBOX_CLK_TEST_ID_I2C_ROOT, &clk_ccf); + ut_assertok(ret); + ut_asserteq_str("clk-ccf", clk_ccf.dev->name); + ut_asserteq(clk_ccf.id, SANDBOX_CLK_I2C_ROOT); + ret = clk_get_by_id(SANDBOX_CLK_I2C_ROOT, &clk); ut_assertok(ret); ut_asserteq_str("i2c_root", clk->dev->name); + ut_asserteq(clk->id, SANDBOX_CLK_I2C_ROOT); - ret = clk_enable(clk); + ret = clk_enable(&clk_ccf); ut_assertok(ret); ret = sandbox_clk_enable_count(clk); diff --git a/test/dm/scmi.c b/test/dm/scmi.c index e80667ef72a..adf36ffaab1 100644 --- a/test/dm/scmi.c +++ b/test/dm/scmi.c @@ -23,7 +23,6 @@ #include <asm/scmi_test.h> #include <dm/device-internal.h> #include <dm/test.h> -#include <linux/kconfig.h> #include <power/regulator.h> #include <test/ut.h> diff --git a/test/py/tests/test_fit.py b/test/py/tests/test_fit.py index 04f64fd4bc6..8f9c4b26411 100755 --- a/test/py/tests/test_fit.py +++ b/test/py/tests/test_fit.py @@ -339,6 +339,14 @@ def test_fit(u_boot_console): 'U-Boot loaded FDT from offset %#x, FDT is actually at %#x' % (fit_offset, real_fit_offset)) + # Check if bootargs strings substitution works + output = cons.run_command_list([ + 'env set bootargs \\\"\'my_boot_var=${foo}\'\\\"', + 'env set foo bar', + 'bootm prep', + 'env print bootargs']) + assert 'bootargs="my_boot_var=bar"' in output, "Bootargs strings not substituted" + # Now a kernel and an FDT with cons.log.section('Kernel + FDT load'): params['fdt_load'] = 'load = <%#x>;' % params['fdt_addr'] |