[PATCH 14/22] tests/functional: remove redundant 'rmtree' call

Daniel P. Berrangé posted 22 patches 3 weeks, 5 days ago
There is a newer version of this series
[PATCH 14/22] tests/functional: remove redundant 'rmtree' call
Posted by Daniel P. Berrangé 3 weeks, 5 days ago
Everything in the scratch directory is automatically purged. Calling
'rmtree' again breaks the ability to optionally preserve the scratch
directory contents.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/functional/test_sh4eb_r2d.py | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/tests/functional/test_sh4eb_r2d.py b/tests/functional/test_sh4eb_r2d.py
index dd2500dc33..38ee55cf4c 100755
--- a/tests/functional/test_sh4eb_r2d.py
+++ b/tests/functional/test_sh4eb_r2d.py
@@ -4,8 +4,6 @@
 #
 # SPDX-License-Identifier: GPL-2.0-or-later
 
-import shutil
-
 from qemu_test import (LinuxKernelTest, Asset,
                        exec_command_and_wait_for_pattern)
 from qemu_test.utils import archive_extract
@@ -25,7 +23,6 @@ def test_sh4eb_r2d(self):
                            initrd=self.scratch_file('sh4eb', 'initramfs.cpio.gz'),
                            console_index=1, wait_for='Type exit when done')
         exec_command_and_wait_for_pattern(self, 'exit', 'Restarting system')
-        shutil.rmtree(self.scratch_file('sh4eb'))
 
 if __name__ == '__main__':
     LinuxKernelTest.main()
-- 
2.46.0


Re: [PATCH 14/22] tests/functional: remove redundant 'rmtree' call
Posted by Thomas Huth 3 weeks, 5 days ago
On 29/11/2024 18.31, Daniel P. Berrangé wrote:
> Everything in the scratch directory is automatically purged. Calling
> 'rmtree' again breaks the ability to optionally preserve the scratch
> directory contents.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   tests/functional/test_sh4eb_r2d.py | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/tests/functional/test_sh4eb_r2d.py b/tests/functional/test_sh4eb_r2d.py
> index dd2500dc33..38ee55cf4c 100755
> --- a/tests/functional/test_sh4eb_r2d.py
> +++ b/tests/functional/test_sh4eb_r2d.py
> @@ -4,8 +4,6 @@
>   #
>   # SPDX-License-Identifier: GPL-2.0-or-later
>   
> -import shutil
> -
>   from qemu_test import (LinuxKernelTest, Asset,
>                          exec_command_and_wait_for_pattern)
>   from qemu_test.utils import archive_extract
> @@ -25,7 +23,6 @@ def test_sh4eb_r2d(self):
>                              initrd=self.scratch_file('sh4eb', 'initramfs.cpio.gz'),
>                              console_index=1, wait_for='Type exit when done')
>           exec_command_and_wait_for_pattern(self, 'exit', 'Restarting system')
> -        shutil.rmtree(self.scratch_file('sh4eb'))

Reviewed-by: Thomas Huth <thuth@redhat.com>