Skip to content

Commit

Permalink
selftest: Add test for the u-boot crc32 workaround
Browse files Browse the repository at this point in the history
Signed-off-by: Rahix <[email protected]>
  • Loading branch information
Rahix committed Nov 1, 2024
1 parent edb2d5b commit 4bb67cf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions selftest/testmachines.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,11 @@ def _init_pre_connect(self) -> Iterator:
shift
eval "$var=\\"$*\\""
}
function crc32() {
printf "crc32 for %s ... %s ==> " "$1" "$1"
sleep 0.2
echo "deadb33f"
}
function boot() {
echo "Pretending to boot Linux..."
echo ""
Expand Down
8 changes: 8 additions & 0 deletions selftest/tests/test_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ def test_uboot_simple_control(tbot_context: tbot.Context) -> None:
assert out == "FOO"


def test_uboot_crc32_workaround(tbot_context: tbot.Context) -> None:
with tbot_context.request(testmachines.MockhwBoardUBoot) as ub:
if ub.prompt != "=> ":
pytest.skip("Wrong U-Boot prompt for crc32 workaround test.")
ub.exec0("crc32", "0x10000008", "0x42")
assert ub.exec0("echo", "Hello World") == "Hello World\n"


def test_linux_boot(tbot_context: tbot.Context) -> None:
with tbot_context.request(testmachines.MockhwBoardLinux) as lnx:
out = lnx.exec0("echo", "Hello World")
Expand Down

0 comments on commit 4bb67cf

Please sign in to comment.