-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit aims to automate the validation process by utilizing the 'expect' tool to verify if semu can successfully boot the Linux kernel and run BusyBox as anticipated. Currently, only the "uname" command is executed and its output is checked.
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
pkill -9 semu | ||
|
||
expect <<DONE | ||
set timeout 120 | ||
spawn make check | ||
expect "buildroot login:" { send "root\n" } timeout { exit 1 } | ||
expect "# " { send "uname -a\n" } timeout { exit 2 } | ||
expect "riscv32 GNU/Linux" { send "\x01"; send "x" } timeout { exit 3 } | ||
DONE | ||
|
||
ret=$? | ||
pkill -9 semu | ||
echo | ||
|
||
MESSAGES=("OK!" \ | ||
"Fail to boot" \ | ||
"Fail to login" \ | ||
"Fail to run commands" \ | ||
) | ||
|
||
echo "${MESSAGES[$ret]}" | ||
exit ${ret} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters