Re: [kvm-unit-tests PATCH v8 03/35] migration: Add a migrate_skip command

Thomas Huth
2024-04-16T04:50:55Z

On 16/04/2024 05.22, Nicholas Piggin wrote:
> On Tue Apr 9, 2024 at 1:59 AM AEST, Nico Boehr wrote:
>> Quoting Nicholas Piggin (2024-04-05 10:35:04)
>> [...]
>>> diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
>>> index 39419d4e2..4a1aab48d 100644
>>> --- a/scripts/arch-run.bash
>>> +++ b/scripts/arch-run.bash
>> [...]
>>> @@ -179,8 +189,11 @@ run_migration ()
>>> # Wait for test exit or further migration messages.
>>> if ! seen_migrate_msg ${src_out} ; then
>>> sleep 0.1
>>> - else
>>> + elif grep -q "Now migrate the VM" < ${src_out} ; then
>>> do_migration || return $?
>>> + elif [ $skip_migration -eq 0 ] && grep -q "Skipped VM migration" < ${src_out} ; then
>>> + echo > ${src_infifo} # Resume src and carry on.
>>> + break;
>>
>> If I understand the code correctly, this simply makes the test PASS when
>> migration is skipped, am I wrong?
>
> This just gets the harness past the wait-for-migration phase, it
> otherwise should not change behaviour.
>
>> If so, can we set ret=77 here so we get a nice SKIP?
>
> The harness _should_ still scan the status value printed by the
> test case when it exits. Is it not working as expected? We
> certainly should be able to make it SKIP.

I just gave it a try (by modifying the selftest-migration-skip test
accordingly), and it seems to work fine, so I think this patch here should
be ok.

Thomas