From 0c39b21ff6b343a06624b89e9f863d01463b00a3 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Mon, 25 Apr 2022 18:41:44 +0200 Subject: 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 --- mbuto | 8 ++++++-- 1 file 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 -- cgit v1.2.3