Re: [PATCH] selftests/liveupdate: Preserve VM workspaces with run-vmtests.sh -k

From: Mukesh Pilaniya

Date: Mon Nov 02 2026 - 13:44:28 EST


Hi George,

On 29/10/26 2:35 pm, George Guo wrote:
> From: George Guo <guodongtai@xxxxxxxxxx>
>
> run-vmtests.sh -k keeps the test output logs, but vmtest.sh still
> removes its workspace and qemu.serial, losing the guest output needed
> to debug failures.
>
> Forward -k to vmtest.sh when keeping logs and update the help texts to
> match.
>
> Signed-off-by: George Guo <guodongtai@xxxxxxxxxx>
Please feel free to use Reviewed-by: Mukesh Pilaniya
<mpilaniy@xxxxxxxxxx> for this patch.

> ---
> tools/testing/selftests/liveupdate/run-vmtests.sh | 7 +++++--
> tools/testing/selftests/liveupdate/vmtest.sh | 2 +-
> 2 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/tools/testing/selftests/liveupdate/run-vmtests.sh b/tools/testing/selftests/liveupdate/run-vmtests.sh
> index d656ce58c5a7..6f592aec0f85 100755
> --- a/tools/testing/selftests/liveupdate/run-vmtests.sh
> +++ b/tools/testing/selftests/liveupdate/run-vmtests.sh
> @@ -26,7 +26,7 @@ function usage() {
> cat <<EOF
> $0 [-k] [-o output_dir] [-h]
> Options:
> - -k) keep logs
> + -k) keep logs and VM workspaces, including guest serial logs
> -o) specify output directory
> -h) display this help
> EOF
> @@ -48,6 +48,8 @@ function fail() {
> }
>
> function main() {
> + local -a vmtest_args=()
> +
> while getopts 'hko:' opt; do
> case $opt in
> k) keep_logs=1 ;;
> @@ -59,6 +61,7 @@ function main() {
> done
>
> if [ -n "$keep_logs" ]; then
> + vmtest_args+=(-k)
> if [ -z "$output_dir" ]; then
> output_dir="$SCRIPT_DIR/results_$(date +%Y%m%d_%H%M%S)"
> fi;
> @@ -74,7 +77,7 @@ function main() {
>
> printf " -> %-8s %-24s ... " "$arch" "$test_name"
>
> - "$TEST_RUNNER" -t "$arch" -T "$test_name" &> "$log"
> + "$TEST_RUNNER" "${vmtest_args[@]}" -t "$arch" -T "$test_name" &> "$log"
> exit_code=$?
>
> case $exit_code in
> diff --git a/tools/testing/selftests/liveupdate/vmtest.sh b/tools/testing/selftests/liveupdate/vmtest.sh
> index 69beda6c961d..bd7032c4b122 100755
> --- a/tools/testing/selftests/liveupdate/vmtest.sh
> +++ b/tools/testing/selftests/liveupdate/vmtest.sh
> @@ -40,7 +40,7 @@ Options:
> -t) run test for target_arch (aarch64, x86_64)
> -T) test name to run (default: luo_kexec_simple)
> -w) custom workspace directory (default: creates temp dir)
> - -k) keep workspace directory after successful test
> + -k) keep workspace directory
> -h) display this help
> EOF
> }
>
> base-commit: 9a6a70aefe77f6fb9ff2b3037dcf87f6dff65c8c

--
Regards,
Mukesh Pilaniya