[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/16] tests/boot_linux_console: Use Avocado archive::gzip_uncompr
From: |
Cleber Rosa |
Subject: |
[PULL 13/16] tests/boot_linux_console: Use Avocado archive::gzip_uncompress() |
Date: |
Mon, 28 Oct 2019 19:49:59 -0400 |
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>
Message-Id: <address@hidden>
Reviewed-by: Cleber Rosa <address@hidden>
Tested-by: Cleber Rosa <address@hidden>
Signed-off-by: Cleber Rosa <address@hidden>
---
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
- [PULL 0/16] Python (acceptance tests) queue, 2019-10-28, Cleber Rosa, 2019/10/28
- [PULL 13/16] tests/boot_linux_console: Use Avocado archive::gzip_uncompress(),
Cleber Rosa <=
- [PULL 14/16] tests/boot_linux_console: Add a test for the Raspberry Pi 2, Cleber Rosa, 2019/10/28
- [PULL 12/16] .travis.yml: Let the avocado job run the 40p tests, Cleber Rosa, 2019/10/28
- [PULL 11/16] tests/acceptance: Test OpenBIOS on the PReP/40p, Cleber Rosa, 2019/10/28
- [PULL 10/16] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p, Cleber Rosa, 2019/10/28
- [PULL 9/16] .travis.yml: Let the avocado job run the Leon3 test, Cleber Rosa, 2019/10/28
- [PULL 7/16] tests/acceptance: Refactor exec_command_and_wait_for_pattern(), Cleber Rosa, 2019/10/28
- [PULL 5/16] tests/acceptance: Fix wait_for_console_pattern() hangs, Cleber Rosa, 2019/10/28
- [PULL 8/16] tests/acceptance: Add test that boots the HelenOS microkernel on Leon3, Cleber Rosa, 2019/10/28
- [PULL 6/16] tests/acceptance: Send <carriage return> on serial lines, Cleber Rosa, 2019/10/28
- [PULL 15/16] tests/boot_linux_console: Add initrd test for the Exynos4210, Cleber Rosa, 2019/10/28