[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/19] tests/vm: avoid extra compressed image copy
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PULL 01/19] tests/vm: avoid extra compressed image copy |
Date: |
Mon, 24 Jun 2019 14:43:19 +0100 |
From: Cleber Rosa <address@hidden>
The image copy is only really needed because xz doesn't know to
properly decompress a file not named properly. Instead of
decompressing to stdout, and having to rely on a shell, let's just
create a link instead of copying the file.
Signed-off-by: Cleber Rosa <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Alex Bennée <address@hidden>
diff --git a/tests/vm/centos b/tests/vm/centos
index 7417b50af4..b00b46a8dc 100755
--- a/tests/vm/centos
+++ b/tests/vm/centos
@@ -66,8 +66,8 @@ class CentosVM(basevm.BaseVM):
cimg =
self._download_with_cache("https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1802.qcow2.xz")
img_tmp = img + ".tmp"
sys.stderr.write("Extracting the image...\n")
- subprocess.check_call(["cp", "-f", cimg, img_tmp + ".xz"])
- subprocess.check_call(["xz", "-dvf", img_tmp + ".xz"])
+ subprocess.check_call(["ln", "-f", cimg, img_tmp + ".xz"])
+ subprocess.check_call(["xz", "--keep", "-dvf", img_tmp + ".xz"])
subprocess.check_call(["qemu-img", "resize", img_tmp, "50G"])
self.boot(img_tmp, extra_args = ["-cdrom", self._gen_cloud_init_iso()])
self.wait_ssh()
diff --git a/tests/vm/freebsd b/tests/vm/freebsd
index b0066017a6..5575c23a6f 100755
--- a/tests/vm/freebsd
+++ b/tests/vm/freebsd
@@ -34,8 +34,8 @@ class FreeBSDVM(basevm.BaseVM):
img_tmp_xz = img + ".tmp.xz"
img_tmp = img + ".tmp"
sys.stderr.write("Extracting the image...\n")
- subprocess.check_call(["cp", "-f", cimg, img_tmp_xz])
- subprocess.check_call(["xz", "-dvf", img_tmp_xz])
+ subprocess.check_call(["ln", "-f", cimg, img_tmp_xz])
+ subprocess.check_call(["xz", "--keep", "-dvf", img_tmp_xz])
if os.path.exists(img):
os.remove(img)
os.rename(img_tmp, img)
diff --git a/tests/vm/netbsd b/tests/vm/netbsd
index 4c6624ea5e..d0508f4465 100755
--- a/tests/vm/netbsd
+++ b/tests/vm/netbsd
@@ -34,8 +34,8 @@ class NetBSDVM(basevm.BaseVM):
img_tmp_xz = img + ".tmp.xz"
img_tmp = img + ".tmp"
sys.stderr.write("Extracting the image...\n")
- subprocess.check_call(["cp", "-f", cimg, img_tmp_xz])
- subprocess.check_call(["xz", "-dvf", img_tmp_xz])
+ subprocess.check_call(["ln", "-f", cimg, img_tmp_xz])
+ subprocess.check_call(["xz", "--keep", "-dvf", img_tmp_xz])
if os.path.exists(img):
os.remove(img)
os.rename(img_tmp, img)
diff --git a/tests/vm/openbsd b/tests/vm/openbsd
index 2105c01a26..87ec982489 100755
--- a/tests/vm/openbsd
+++ b/tests/vm/openbsd
@@ -36,8 +36,8 @@ class OpenBSDVM(basevm.BaseVM):
img_tmp_xz = img + ".tmp.xz"
img_tmp = img + ".tmp"
sys.stderr.write("Extracting the image...\n")
- subprocess.check_call(["cp", "-f", cimg, img_tmp_xz])
- subprocess.check_call(["xz", "-dvf", img_tmp_xz])
+ subprocess.check_call(["ln", "-f", cimg, img_tmp_xz])
+ subprocess.check_call(["xz", "--keep", "-dvf", img_tmp_xz])
if os.path.exists(img):
os.remove(img)
os.rename(img_tmp, img)
--
2.20.1
- [Qemu-devel] [PULL 00/19] testing/next (tests/vm, Travis and hyperv build fix), Alex Bennée, 2019/06/24
- [Qemu-devel] [PULL 06/19] tests/vm: use ssh with pty unconditionally, Alex Bennée, 2019/06/24
- [Qemu-devel] [PULL 03/19] tests/vm: pin ubuntu.i386 image, Alex Bennée, 2019/06/24
- [Qemu-devel] [PULL 05/19] tests/vm: send proxy environment variables over ssh, Alex Bennée, 2019/06/24
- [Qemu-devel] [PULL 08/19] tests/vm: proper guest shutdown, Alex Bennée, 2019/06/24
- [Qemu-devel] [PULL 19/19] target/i386: fix feature check in hyperv-stub.c, Alex Bennée, 2019/06/24
- [Qemu-devel] [PULL 10/19] tests/vm: serial console support helpers, Alex Bennée, 2019/06/24
- [Qemu-devel] [PULL 11/19] tests/vm: openbsd autoinstall, using serial console, Alex Bennée, 2019/06/24
- [Qemu-devel] [PULL 04/19] tests/vm: add source repos on ubuntu.i386, Alex Bennée, 2019/06/24
- [Qemu-devel] [PULL 18/19] Makefile: Rename the 'vm-test' target as 'vm-help', Alex Bennée, 2019/06/24
- [Qemu-devel] [PULL 01/19] tests/vm: avoid extra compressed image copy,
Alex Bennée <=
- [Qemu-devel] [PULL 07/19] tests/vm: run test builds on snapshot, Alex Bennée, 2019/06/24
- [Qemu-devel] [PULL 12/19] tests/vm: freebsd autoinstall, using serial console, Alex Bennée, 2019/06/24
- [Qemu-devel] [PULL 09/19] tests/vm: add vm-boot-{ssh, serial}-<guest> targets, Alex Bennée, 2019/06/24
- [Qemu-devel] [PULL 17/19] .travis.yml: force a brew update for MacOS builds, Alex Bennée, 2019/06/24
- [Qemu-devel] [PULL 02/19] tests/vm: avoid image presence check and removal, Alex Bennée, 2019/06/24
- [Qemu-devel] [PULL 14/19] tests/vm: fedora autoinstall, using serial console, Alex Bennée, 2019/06/24
- [Qemu-devel] [PULL 16/19] .travis.yml: default the --disable-system build to --static, Alex Bennée, 2019/06/24
- [Qemu-devel] [PULL 13/19] tests/vm: netbsd autoinstall, using serial console, Alex Bennée, 2019/06/24
- [Qemu-devel] [PULL 15/19] tests/vm: ubuntu.i386: apt proxy setup, Alex Bennée, 2019/06/24