Re: [PATCH v4 4/4] tests/functional/ppc64/pseries: Remove custom migration routine

2026-03-03 Thread Peter Xu
On Tue, Mar 03, 2026 at 02:33:20PM -0300, Fabiano Rosas wrote:
> Don't implement a custom migration routine at PpcMigrationTest and
> instead reuse the generic one from MigrationTest.
> 
> This removes the dependency of PpcMigrationTest from
> PseriesMachine. Having one test import another causes unittest code to
> instantiate the imported test, resulting in the setup and teardown
> methods being invoked for the imported test class, even if no test
> from that class will be executed.
> 
> If run in parallel, the extra setup/teardown methods that result from
> importing can race with the ones from the actual test being executed
> and cause the following error:
> 
> File "/tests/functional/qemu_test/testcase.py", line 238, in tearDown
> shutil.rmtree(self.workdir)
> ...
> FileNotFoundError: [Errno 2] No such file or directory:
> '/build/tests/functional/ppc64/.../test_migration_with_exec/scratch'
> 
> The PseriesMachine class is changed to inherit from MigrationTest so
> both the migration routines and the class attributes of PseriesMachine
> can be accessed without the need to instantiate another object.
> 
> Fixes: f4e34d0fd5 ("tests/functional: Add a OS level migration test for 
> pseries")
> Reported-by: Aditya Gupta 
> Reviewed-by: Thomas Huth 
> Signed-off-by: Fabiano Rosas 

Reviewed-by: Peter Xu 

-- 
Peter Xu




Re: [PATCH v4 4/4] tests/functional/ppc64/pseries: Remove custom migration routine

2026-03-03 Thread Aditya Gupta
On 26/03/03 02:33PM, Fabiano Rosas wrote:
> Don't implement a custom migration routine at PpcMigrationTest and
> instead reuse the generic one from MigrationTest.
> 
> This removes the dependency of PpcMigrationTest from
> PseriesMachine. Having one test import another causes unittest code to
> instantiate the imported test, resulting in the setup and teardown
> methods being invoked for the imported test class, even if no test
> from that class will be executed.
> 
> If run in parallel, the extra setup/teardown methods that result from
> importing can race with the ones from the actual test being executed
> and cause the following error:
> 
> File "/tests/functional/qemu_test/testcase.py", line 238, in tearDown
> shutil.rmtree(self.workdir)
> ...
> FileNotFoundError: [Errno 2] No such file or directory:
> '/build/tests/functional/ppc64/.../test_migration_with_exec/scratch'
> 
> The PseriesMachine class is changed to inherit from MigrationTest so
> both the migration routines and the class attributes of PseriesMachine
> can be accessed without the need to instantiate another object.
> 
> Fixes: f4e34d0fd5 ("tests/functional: Add a OS level migration test for 
> pseries")
> Reported-by: Aditya Gupta 
> Reviewed-by: Thomas Huth 
> Signed-off-by: Fabiano Rosas 

I don't see any issues with the tests now, and able to run them
parallely, thanks for fixing it !

Tested-by: Aditya Gupta 

>  timeout = 90
>  KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 console=hvc0 '
> @@ -116,11 +116,11 @@ def test_ppc64_linux_migration(self):
>  wait_for_console_pattern(self, console_pattern, self.panic_message,
>   vm=source_vm)
>  
> -PpcMigrationTest().do_migrate_ppc64_linux(source_vm, dest_vm);
> +self.migration_with_tcp_localhost_vms(dest_vm, source_vm);

nit: the ';', can ignore though

Thanks,
- Aditya G