[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 05/11] tests/boot_linux_console: Use Avocado archive::gzip_unc
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 05/11] tests/boot_linux_console: Use Avocado archive::gzip_uncompress() |
Date: |
Sat, 19 Oct 2019 17:34:31 +0200 |
Avocado 67.0 [*] introduced the avocado.utils.archive module which
provides handling of gzip files. Use the gzip_uncompress() method.
[*]
https://avocado-framework.readthedocs.io/en/67.0/api/utils/avocado.utils.html#avocado.utils.archive.gzip_uncompress
Suggested-by: Cleber Rosa <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
v2: New patch replacing the gunzip() refactor
---
tests/acceptance/boot_linux_console.py | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/tests/acceptance/boot_linux_console.py
b/tests/acceptance/boot_linux_console.py
index 4b419b0559..67d7e96d98 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -145,10 +145,7 @@ class BootLinuxConsole(Test):
initrd_hash = 'bf806e17009360a866bf537f6de66590de349a99'
initrd_path_gz = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
initrd_path = self.workdir + "rootfs.cpio"
-
- with gzip.open(initrd_path_gz, 'rb') as f_in:
- with open(initrd_path, 'wb') as f_out:
- shutil.copyfileobj(f_in, f_out)
+ archive.gzip_uncompress(initrd_path_gz, initrd_path)
self.vm.set_machine('malta')
self.vm.set_console()
--
2.21.0
- [PATCH v2 00/11] tests/acceptance: Fix 64-bit MIPS target tests, Philippe Mathieu-Daudé, 2019/10/19
- [PATCH v2 01/11] Acceptance tests: refactor wait_for_console_pattern, Philippe Mathieu-Daudé, 2019/10/19
- [PATCH v2 02/11] tests/acceptance: Fixe wait_for_console_pattern() hangs, Philippe Mathieu-Daudé, 2019/10/19
- [PATCH v2 03/11] tests/acceptance: Send <carriage return> on serial lines, Philippe Mathieu-Daudé, 2019/10/19
- [PATCH v2 04/11] tests/acceptance: Refactor exec_command_and_wait_for_pattern(), Philippe Mathieu-Daudé, 2019/10/19
- [PATCH v2 05/11] tests/boot_linux_console: Use Avocado archive::gzip_uncompress(),
Philippe Mathieu-Daudé <=
- [PATCH v2 07/11] tests/ssh_linux_malta: Run tests using a snapshot image, Philippe Mathieu-Daudé, 2019/10/19
- [PATCH v2 06/11] tests/boot_linux_console: Run BusyBox on 5KEc 64-bit cpu, Philippe Mathieu-Daudé, 2019/10/19
- [PATCH v2 08/11] tests/ssh_linux_malta: Remove duplicated test, Philippe Mathieu-Daudé, 2019/10/19
- [PATCH v2 09/11] tests/ssh_linux_malta: Match stricter console output, Philippe Mathieu-Daudé, 2019/10/19
- [PATCH v2 10/11] tests/ssh_linux_malta: Refactor how to get image/kernel info, Philippe Mathieu-Daudé, 2019/10/19
- [PATCH v2 11/11] tests/ssh_linux_malta: Fix 64-bit target tests, Philippe Mathieu-Daudé, 2019/10/19