aboutgitcode
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2022-04-25 18:41:44 +0200
committerStefano Brivio <sbrivio@redhat.com>2022-04-25 18:41:44 +0200
commit0c39b21ff6b343a06624b89e9f863d01463b00a3 (patch)
tree81d0ae493a1f124867f52b731aeebb3a70f439bc
parente4da23da1e1239c5cca575c4a5689d0f7397c6c8 (diff)
downloadmbuto-0c39b21ff6b343a06624b89e9f863d01463b00a3.tar
mbuto-0c39b21ff6b343a06624b89e9f863d01463b00a3.tar.gz
mbuto-0c39b21ff6b343a06624b89e9f863d01463b00a3.tar.bz2
mbuto-0c39b21ff6b343a06624b89e9f863d01463b00a3.tar.lz
mbuto-0c39b21ff6b343a06624b89e9f863d01463b00a3.tar.xz
mbuto-0c39b21ff6b343a06624b89e9f863d01463b00a3.tar.zst
mbuto-0c39b21ff6b343a06624b89e9f863d01463b00a3.zip
mbuto: kselftests: If all tests pass, terminate the guest
This is nice for demos but should also be quite practical. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rwxr-xr-xmbuto8
1 files changed, 6 insertions, 2 deletions
diff --git a/mbuto b/mbuto
index 88c99ad..ad95efc 100755
--- a/mbuto
+++ b/mbuto
@@ -309,8 +309,12 @@ profile_kselftests() {
echo 3 > /proc/sys/kernel/printk
echo "Press s for shell, any other key to run selftests"
read a
- [ "${a}" != "s" ] && ./run_kselftest.sh '"${__run_args}"'
- echo o > /proc/sysrq-trigger
+ if [ "${a}" != "s" ]; then
+ if ./run_kselftest.sh '"${__run_args}"'; then
+ echo "All tests passed, shutting down guest..."
+ echo o > /proc/sysrq-trigger
+ fi
+ fi
'
for __f in $(${FIND} ${__testpath}kselftest_install/ -executable); do