[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 19/26] tests/boot_linux_console: Use Avocado archive::gzip_uncomp
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 19/26] tests/boot_linux_console: Use Avocado archive::gzip_uncompress() |
Date: |
Mon, 28 Oct 2019 08:34:34 +0100 |
From: Philippe Mathieu-Daudé <address@hidden>
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 67b396169b..a689c09cfe 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -146,10 +146,7 @@ class BootLinuxConsole(MachineTest):
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
- Re: [PATCH 14/26] tests/acceptance: Test Open Firmware on the PReP/40p, (continued)
- [PATCH 15/26] tests/acceptance: Test OpenBIOS on the PReP/40p, Philippe Mathieu-Daudé, 2019/10/28
- [PATCH 16/26] tests/acceptance: Test Sandalfoot initrd on the PReP/40p, Philippe Mathieu-Daudé, 2019/10/28
- [PATCH 17/26] .travis.yml: Let the avocado job run the 40p tests, Philippe Mathieu-Daudé, 2019/10/28
- [PATCH 18/26] tests/boot_console: Test booting HP-UX firmware upgrade, Philippe Mathieu-Daudé, 2019/10/28
- [PATCH 19/26] tests/boot_linux_console: Use Avocado archive::gzip_uncompress(),
Philippe Mathieu-Daudé <=
- [PATCH 20/26] tests/boot_linux_console: Add a test for the Raspberry Pi 2, Philippe Mathieu-Daudé, 2019/10/28
- [PATCH 21/26] tests/boot_linux_console: Test the raspi2 UART1 (16550 based), Philippe Mathieu-Daudé, 2019/10/28
- [PATCH 22/26] tests/boot_linux_console: Boot Linux and run few commands on raspi3, Philippe Mathieu-Daudé, 2019/10/28
- [PATCH 23/26] tests/boot_linux_console: Test SDHCI and termal sensor on raspi3, Philippe Mathieu-Daudé, 2019/10/28