1 // SPDX-License-Identifier: GPL-2.0+
3 * Executes tests for SEAMA (SEAttle iMAge) command
10 #include <test/suites.h>
11 #include <test/test.h>
14 #define SEAMA_TEST(_name, _flags) UNIT_TEST(_name, _flags, seama)
16 static int seama_test_noargs(struct unit_test_state *uts)
18 /* Test that 'seama' with no arguments fails gracefully */
19 run_command("seama", 0);
20 ut_assert_nextlinen("seama - Load the SEAMA image and sets envs");
25 ut_assert_console_end();
28 SEAMA_TEST(seama_test_noargs, UTF_CONSOLE);
30 static int seama_test_addr(struct unit_test_state *uts)
32 /* Test that loads SEAMA image 0 to address 0x01000000 */
33 run_command("seama 0x01000000", 0);
34 ut_assert_nextlinen("Loading SEAMA image 0 from nand0");
35 ut_assert_nextlinen("SEMA IMAGE:");
36 ut_assert_nextlinen(" metadata size ");
37 ut_assert_nextlinen(" image size ");
38 ut_assert_nextlinen(" checksum ");
39 ut_assert_nextlinen("Decoding SEAMA image 0x01000040..");
40 ut_assert_console_end();
43 SEAMA_TEST(seama_test_addr, UTF_CONSOLE);
45 static int seama_test_index(struct unit_test_state *uts)
47 /* Test that loads SEAMA image 0 exlicitly specified */
48 run_command("seama 0x01000000 0", 0);
49 ut_assert_nextlinen("Loading SEAMA image 0 from nand0");
50 ut_assert_nextlinen("SEMA IMAGE:");
51 ut_assert_nextlinen(" metadata size ");
52 ut_assert_nextlinen(" image size ");
53 ut_assert_nextlinen(" checksum ");
54 ut_assert_nextlinen("Decoding SEAMA image 0x01000040..");
55 ut_assert_console_end();
58 SEAMA_TEST(seama_test_index, UTF_CONSOLE);