qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH  v2 0/9] testing/next (buildvm and re-greening tweeks)
@ 2020-03-03 15:06 Alex Bennée
  2020-03-03 15:06 ` [PATCH v2 1/9] tests/vm: use $(PYTHON) consistently Alex Bennée
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Alex Bennée @ 2020-03-03 15:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée

Hi,

The main change from v1 was bumping avocado up a version instead of
moving the skipUnless() decorators. I also dropped the configure
--exists patch as that just broke the build.

The following still need review:
 - travis.yml: install python3 numpy and opencv libraries
 - tests/acceptance: bump avocado requirements to 76.0
 - configure: detect and report genisoimage

Alex Bennée (3):
  configure: detect and report genisoimage
  tests/acceptance: bump avocado requirements to 76.0
  travis.yml: install python3 numpy and opencv libraries

Laurent Vivier (1):
  travis: enable tools build on OS X

Robert Foley (5):
  tests/vm: use $(PYTHON) consistently
  tests/vm: Debug mode shows ssh output.
  tests/vm: increased max timeout for vm boot.
  tests/vm: give wait_ssh() option to wait for root
  tests/vm: Added gen_cloud_init_iso() to basevm.py

 configure                 | 13 +++++++++
 .travis.yml               |  6 +++-
 tests/requirements.txt    |  2 +-
 tests/vm/Makefile.include | 16 +++++++---
 tests/vm/basevm.py        | 61 +++++++++++++++++++++++++++++++++++++--
 tests/vm/centos           | 33 +--------------------
 tests/vm/ubuntu.i386      | 37 +-----------------------
 7 files changed, 91 insertions(+), 77 deletions(-)

-- 
2.20.1



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH  v2 1/9] tests/vm: use $(PYTHON) consistently
  2020-03-03 15:06 [PATCH v2 0/9] testing/next (buildvm and re-greening tweeks) Alex Bennée
@ 2020-03-03 15:06 ` Alex Bennée
  2020-03-03 15:06 ` [PATCH v2 2/9] tests/vm: Debug mode shows ssh output Alex Bennée
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2020-03-03 15:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Peter Puhov, Alex Bennée, Robert Foley,
	Philippe Mathieu-Daudé

From: Robert Foley <robert.foley@linaro.org>

Change Makefile.include to use $(PYTHON) so for vm-boot-ssh to be
consistent with other cases like vm-build.

Signed-off-by: Robert Foley <robert.foley@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Peter Puhov <peter.puhov@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200219163537.22098-2-robert.foley@linaro.org>
---
 tests/vm/Makefile.include | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include
index 9e7c46a4735..778e5067554 100644
--- a/tests/vm/Makefile.include
+++ b/tests/vm/Makefile.include
@@ -80,7 +80,7 @@ vm-boot-serial-%: $(IMAGES_DIR)/%.img
 
 vm-boot-ssh-%: $(IMAGES_DIR)/%.img
 	$(call quiet-command, \
-		$(SRC_PATH)/tests/vm/$* \
+		$(PYTHON) $(SRC_PATH)/tests/vm/$* \
 		$(if $(J),--jobs $(J)) \
 		--image "$<" \
 		--interactive \
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH  v2 2/9] tests/vm: Debug mode shows ssh output.
  2020-03-03 15:06 [PATCH v2 0/9] testing/next (buildvm and re-greening tweeks) Alex Bennée
  2020-03-03 15:06 ` [PATCH v2 1/9] tests/vm: use $(PYTHON) consistently Alex Bennée
@ 2020-03-03 15:06 ` Alex Bennée
  2020-03-03 15:06 ` [PATCH v2 3/9] tests/vm: increased max timeout for vm boot Alex Bennée
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2020-03-03 15:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Peter Puhov, Alex Bennée, Robert Foley,
	Philippe Mathieu-Daudé

From: Robert Foley <robert.foley@linaro.org>

Add changes to tests/vm/basevm.py so that during debug mode we show ssh output.

Signed-off-by: Robert Foley <robert.foley@linaro.org>
Reviewed-by: Peter Puhov <peter.puhov@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200219163537.22098-3-robert.foley@linaro.org>
---
 tests/vm/basevm.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 4dee6647e6e..c99725b8c0d 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -120,11 +120,16 @@ class BaseVM(object):
         return fname
 
     def _ssh_do(self, user, cmd, check):
-        ssh_cmd = ["ssh", "-q", "-t",
+        ssh_cmd = ["ssh",
+                   "-t",
                    "-o", "StrictHostKeyChecking=no",
                    "-o", "UserKnownHostsFile=" + os.devnull,
                    "-o", "ConnectTimeout=1",
                    "-p", self.ssh_port, "-i", self._ssh_key_file]
+        # If not in debug mode, set ssh to quiet mode to
+        # avoid printing the results of commands.
+        if not self.debug:
+            ssh_cmd.append("-q")
         for var in self.envvars:
             ssh_cmd += ['-o', "SendEnv=%s" % var ]
         assert not isinstance(cmd, str)
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH  v2 3/9] tests/vm: increased max timeout for vm boot.
  2020-03-03 15:06 [PATCH v2 0/9] testing/next (buildvm and re-greening tweeks) Alex Bennée
  2020-03-03 15:06 ` [PATCH v2 1/9] tests/vm: use $(PYTHON) consistently Alex Bennée
  2020-03-03 15:06 ` [PATCH v2 2/9] tests/vm: Debug mode shows ssh output Alex Bennée
@ 2020-03-03 15:06 ` Alex Bennée
  2020-03-03 15:06 ` [PATCH v2 4/9] tests/vm: give wait_ssh() option to wait for root Alex Bennée
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2020-03-03 15:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Peter Puhov, Alex Bennée, Robert Foley,
	Philippe Mathieu-Daudé

From: Robert Foley <robert.foley@linaro.org>

Add change to increase timeout waiting for VM to boot.
Needed for some emulation cases where it can take longer
than 5 minutes to boot.

Signed-off-by: Robert Foley <robert.foley@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Peter Puhov <peter.puhov@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20200219163537.22098-4-robert.foley@linaro.org>
---
 tests/vm/basevm.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index c99725b8c0d..5ca445e29af 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -57,6 +57,10 @@ class BaseVM(object):
     poweroff = "poweroff"
     # enable IPv6 networking
     ipv6 = True
+    # Scale up some timeouts under TCG.
+    # 4 is arbitrary, but greater than 2,
+    # since we found we need to wait more than twice as long.
+    tcg_ssh_timeout_multiplier = 4
     def __init__(self, debug=False, vcpus=None):
         self._guest = None
         self._tmpdir = os.path.realpath(tempfile.mkdtemp(prefix="vm-test-",
@@ -309,6 +313,9 @@ class BaseVM(object):
         sys.stderr.write("### %s ...\n" % text)
 
     def wait_ssh(self, seconds=300):
+        # Allow more time for VM to boot under TCG.
+        if not kvm_available(self.arch):
+            seconds *= self.tcg_ssh_timeout_multiplier
         starttime = datetime.datetime.now()
         endtime = starttime + datetime.timedelta(seconds=seconds)
         guest_up = False
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH  v2 4/9] tests/vm: give wait_ssh() option to wait for root
  2020-03-03 15:06 [PATCH v2 0/9] testing/next (buildvm and re-greening tweeks) Alex Bennée
                   ` (2 preceding siblings ...)
  2020-03-03 15:06 ` [PATCH v2 3/9] tests/vm: increased max timeout for vm boot Alex Bennée
@ 2020-03-03 15:06 ` Alex Bennée
  2020-03-03 15:06 ` [PATCH v2 5/9] tests/vm: Added gen_cloud_init_iso() to basevm.py Alex Bennée
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2020-03-03 15:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Peter Puhov, Alex Bennée, Robert Foley,
	Philippe Mathieu-Daudé

From: Robert Foley <robert.foley@linaro.org>

Allow wait_ssh to wait for root user to be ready.
This solves the issue where we perform a wait_ssh()
successfully, but the root user is not yet ready
to be logged in.

Signed-off-by: Robert Foley <robert.foley@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Peter Puhov <peter.puhov@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20200219163537.22098-5-robert.foley@linaro.org>
---
 tests/vm/basevm.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 5ca445e29af..7f268922685 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -312,7 +312,7 @@ class BaseVM(object):
     def print_step(self, text):
         sys.stderr.write("### %s ...\n" % text)
 
-    def wait_ssh(self, seconds=300):
+    def wait_ssh(self, wait_root=False, seconds=300):
         # Allow more time for VM to boot under TCG.
         if not kvm_available(self.arch):
             seconds *= self.tcg_ssh_timeout_multiplier
@@ -320,7 +320,10 @@ class BaseVM(object):
         endtime = starttime + datetime.timedelta(seconds=seconds)
         guest_up = False
         while datetime.datetime.now() < endtime:
-            if self.ssh("exit 0") == 0:
+            if wait_root and self.ssh_root("exit 0") == 0:
+                guest_up = True
+                break
+            elif self.ssh("exit 0") == 0:
                 guest_up = True
                 break
             seconds = (endtime - datetime.datetime.now()).total_seconds()
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH  v2 5/9] tests/vm: Added gen_cloud_init_iso() to basevm.py
  2020-03-03 15:06 [PATCH v2 0/9] testing/next (buildvm and re-greening tweeks) Alex Bennée
                   ` (3 preceding siblings ...)
  2020-03-03 15:06 ` [PATCH v2 4/9] tests/vm: give wait_ssh() option to wait for root Alex Bennée
@ 2020-03-03 15:06 ` Alex Bennée
  2020-03-03 15:06 ` [PATCH v2 6/9] travis: enable tools build on OS X Alex Bennée
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2020-03-03 15:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Peter Puhov, Alex Bennée, Robert Foley,
	Philippe Mathieu-Daudé

From: Robert Foley <robert.foley@linaro.org>

This method was located in both centos and ubuntu.i386.

Signed-off-by: Robert Foley <robert.foley@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Peter Puhov <peter.puhov@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200219163537.22098-6-robert.foley@linaro.org>
---
 tests/vm/basevm.py   | 40 ++++++++++++++++++++++++++++++++++++++++
 tests/vm/centos      | 33 +--------------------------------
 tests/vm/ubuntu.i386 | 37 +------------------------------------
 3 files changed, 42 insertions(+), 68 deletions(-)

diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 7f268922685..8400b0e07f6 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -345,6 +345,46 @@ class BaseVM(object):
     def qmp(self, *args, **kwargs):
         return self._guest.qmp(*args, **kwargs)
 
+    def gen_cloud_init_iso(self):
+        cidir = self._tmpdir
+        mdata = open(os.path.join(cidir, "meta-data"), "w")
+        name = self.name.replace(".","-")
+        mdata.writelines(["instance-id: {}-vm-0\n".format(name),
+                          "local-hostname: {}-guest\n".format(name)])
+        mdata.close()
+        udata = open(os.path.join(cidir, "user-data"), "w")
+        print("guest user:pw {}:{}".format(self._config['guest_user'],
+                                           self._config['guest_pass']))
+        udata.writelines(["#cloud-config\n",
+                          "chpasswd:\n",
+                          "  list: |\n",
+                          "    root:%s\n" % self._config['root_pass'],
+                          "    %s:%s\n" % (self._config['guest_user'],
+                                           self._config['guest_pass']),
+                          "  expire: False\n",
+                          "users:\n",
+                          "  - name: %s\n" % self._config['guest_user'],
+                          "    sudo: ALL=(ALL) NOPASSWD:ALL\n",
+                          "    ssh-authorized-keys:\n",
+                          "    - %s\n" % self._config['ssh_pub_key'],
+                          "  - name: root\n",
+                          "    ssh-authorized-keys:\n",
+                          "    - %s\n" % self._config['ssh_pub_key'],
+                          "locale: en_US.UTF-8\n"])
+        proxy = os.environ.get("http_proxy")
+        if not proxy is None:
+            udata.writelines(["apt:\n",
+                              "  proxy: %s" % proxy])
+        udata.close()
+        subprocess.check_call(["genisoimage", "-output", "cloud-init.iso",
+                               "-volid", "cidata", "-joliet", "-rock",
+                               "user-data", "meta-data"],
+                               cwd=cidir,
+                               stdin=self._devnull, stdout=self._stdout,
+                               stderr=self._stdout)
+
+        return os.path.join(cidir, "cloud-init.iso")
+
 def parse_args(vmcls):
 
     def get_default_jobs():
diff --git a/tests/vm/centos b/tests/vm/centos
index a41ff109eb5..0ad4ecf4190 100755
--- a/tests/vm/centos
+++ b/tests/vm/centos
@@ -31,37 +31,6 @@ class CentosVM(basevm.BaseVM):
         make docker-test-mingw@fedora  {verbose} J={jobs} NETWORK=1;
     """
 
-    def _gen_cloud_init_iso(self):
-        cidir = self._tmpdir
-        mdata = open(os.path.join(cidir, "meta-data"), "w")
-        mdata.writelines(["instance-id: centos-vm-0\n",
-                          "local-hostname: centos-guest\n"])
-        mdata.close()
-        udata = open(os.path.join(cidir, "user-data"), "w")
-        udata.writelines(["#cloud-config\n",
-                          "chpasswd:\n",
-                          "  list: |\n",
-                          "    root:%s\n" % self.ROOT_PASS,
-                          "    %s:%s\n" % (self.GUEST_USER, self.GUEST_PASS),
-                          "  expire: False\n",
-                          "users:\n",
-                          "  - name: %s\n" % self.GUEST_USER,
-                          "    sudo: ALL=(ALL) NOPASSWD:ALL\n",
-                          "    ssh-authorized-keys:\n",
-                          "    - %s\n" % basevm.SSH_PUB_KEY,
-                          "  - name: root\n",
-                          "    ssh-authorized-keys:\n",
-                          "    - %s\n" % basevm.SSH_PUB_KEY,
-                          "locale: en_US.UTF-8\n"])
-        udata.close()
-        subprocess.check_call(["genisoimage", "-output", "cloud-init.iso",
-                               "-volid", "cidata", "-joliet", "-rock",
-                               "user-data", "meta-data"],
-                               cwd=cidir,
-                               stdin=self._devnull, stdout=self._stdout,
-                               stderr=self._stdout)
-        return os.path.join(cidir, "cloud-init.iso")
-
     def build_image(self, img):
         cimg = self._download_with_cache("https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1802.qcow2.xz")
         img_tmp = img + ".tmp"
@@ -69,7 +38,7 @@ class CentosVM(basevm.BaseVM):
         subprocess.check_call(["ln", "-f", cimg, img_tmp + ".xz"])
         subprocess.check_call(["xz", "--keep", "-dvf", img_tmp + ".xz"])
         self.exec_qemu_img("resize", img_tmp, "50G")
-        self.boot(img_tmp, extra_args = ["-cdrom", self._gen_cloud_init_iso()])
+        self.boot(img_tmp, extra_args = ["-cdrom", self.gen_cloud_init_iso()])
         self.wait_ssh()
         self.ssh_root_check("touch /etc/cloud/cloud-init.disabled")
         self.ssh_root_check("yum update -y")
diff --git a/tests/vm/ubuntu.i386 b/tests/vm/ubuntu.i386
index 48e9cb1ad3d..3266038fbde 100755
--- a/tests/vm/ubuntu.i386
+++ b/tests/vm/ubuntu.i386
@@ -29,41 +29,6 @@ class UbuntuX86VM(basevm.BaseVM):
         make --output-sync {target} -j{jobs} {verbose};
     """
 
-    def _gen_cloud_init_iso(self):
-        cidir = self._tmpdir
-        mdata = open(os.path.join(cidir, "meta-data"), "w")
-        mdata.writelines(["instance-id: ubuntu-vm-0\n",
-                          "local-hostname: ubuntu-guest\n"])
-        mdata.close()
-        udata = open(os.path.join(cidir, "user-data"), "w")
-        udata.writelines(["#cloud-config\n",
-                          "chpasswd:\n",
-                          "  list: |\n",
-                          "    root:%s\n" % self.ROOT_PASS,
-                          "    %s:%s\n" % (self.GUEST_USER, self.GUEST_PASS),
-                          "  expire: False\n",
-                          "users:\n",
-                          "  - name: %s\n" % self.GUEST_USER,
-                          "    sudo: ALL=(ALL) NOPASSWD:ALL\n",
-                          "    ssh-authorized-keys:\n",
-                          "    - %s\n" % basevm.SSH_PUB_KEY,
-                          "  - name: root\n",
-                          "    ssh-authorized-keys:\n",
-                          "    - %s\n" % basevm.SSH_PUB_KEY,
-                          "locale: en_US.UTF-8\n"])
-        proxy = os.environ.get("http_proxy")
-        if not proxy is None:
-            udata.writelines(["apt:\n",
-                              "  proxy: %s" % proxy])
-        udata.close()
-        subprocess.check_call(["genisoimage", "-output", "cloud-init.iso",
-                               "-volid", "cidata", "-joliet", "-rock",
-                               "user-data", "meta-data"],
-                               cwd=cidir,
-                               stdin=self._devnull, stdout=self._stdout,
-                               stderr=self._stdout)
-        return os.path.join(cidir, "cloud-init.iso")
-
     def build_image(self, img):
         cimg = self._download_with_cache(
             "https://cloud-images.ubuntu.com/releases/bionic/release-20191114/ubuntu-18.04-server-cloudimg-i386.img",
@@ -71,7 +36,7 @@ class UbuntuX86VM(basevm.BaseVM):
         img_tmp = img + ".tmp"
         subprocess.check_call(["cp", "-f", cimg, img_tmp])
         self.exec_qemu_img("resize", img_tmp, "50G")
-        self.boot(img_tmp, extra_args = ["-cdrom", self._gen_cloud_init_iso()])
+        self.boot(img_tmp, extra_args = ["-cdrom", self.gen_cloud_init_iso()])
         self.wait_ssh()
         self.ssh_root_check("touch /etc/cloud/cloud-init.disabled")
         self.ssh_root_check("apt-get update")
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH  v2 6/9] travis: enable tools build on OS X
  2020-03-03 15:06 [PATCH v2 0/9] testing/next (buildvm and re-greening tweeks) Alex Bennée
                   ` (4 preceding siblings ...)
  2020-03-03 15:06 ` [PATCH v2 5/9] tests/vm: Added gen_cloud_init_iso() to basevm.py Alex Bennée
@ 2020-03-03 15:06 ` Alex Bennée
  2020-03-03 15:06 ` [PATCH v2 7/9] configure: detect and report genisoimage Alex Bennée
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2020-03-03 15:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Philippe Mathieu-Daudé, Fam Zheng,
	Alex Bennée

From: Laurent Vivier <lvivier@redhat.com>

As we can build tools on OS X we should check we don't break build
when we submit new codes.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200302154630.45620-3-lvivier@redhat.com>
---
 .travis.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.travis.yml b/.travis.yml
index 9867272177d..70a24bf2fc8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -273,6 +273,7 @@ jobs:
 
     - name: "OSX Xcode 10.3"
       env:
+        - BASE_CONFIG="--disable-docs --enable-tools"
         - CONFIG="--target-list=i386-softmmu,ppc-softmmu,ppc64-softmmu,m68k-softmmu,x86_64-softmmu"
       os: osx
       osx_image: xcode10.3
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH  v2 7/9] configure: detect and report genisoimage
  2020-03-03 15:06 [PATCH v2 0/9] testing/next (buildvm and re-greening tweeks) Alex Bennée
                   ` (5 preceding siblings ...)
  2020-03-03 15:06 ` [PATCH v2 6/9] travis: enable tools build on OS X Alex Bennée
@ 2020-03-03 15:06 ` Alex Bennée
  2020-03-03 18:44   ` Richard Henderson
  2020-03-03 15:06 ` [PATCH v2 8/9] tests/acceptance: bump avocado requirements to 76.0 Alex Bennée
  2020-03-03 15:06 ` [PATCH v2 9/9] travis.yml: install python3 numpy and opencv libraries Alex Bennée
  8 siblings, 1 reply; 12+ messages in thread
From: Alex Bennée @ 2020-03-03 15:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Fam Zheng, Philippe Mathieu-Daudé, Alex Bennée

This is used for some of the vm-build tests so lets detect it and
behave sanely when it is not installed.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 configure                 | 13 +++++++++++++
 tests/vm/Makefile.include | 14 +++++++++++---
 2 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 7b373bc0bb8..fab6281eb70 100755
--- a/configure
+++ b/configure
@@ -936,6 +936,17 @@ do
     fi
 done
 
+# Check for ancillary tools used in testing
+genisoimage=
+for binary in genisoimage
+do
+    if has $binary
+    then
+        genisoimage=$(command -v "$binary")
+        break
+    fi
+done
+
 : ${smbd=${SMBD-/usr/sbin/smbd}}
 
 # Default objcc to clang if available, otherwise use CC
@@ -6567,6 +6578,7 @@ echo "python            $python ($python_version)"
 if test "$docs" != "no"; then
     echo "sphinx-build      $sphinx_build"
 fi
+echo "genisoimage       $genisoimage"
 echo "slirp support     $slirp $(echo_version $slirp $slirp_version)"
 if test "$slirp" != "no" ; then
     echo "smbd              $smbd"
@@ -7616,6 +7628,7 @@ echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak
 echo "INSTALL_LIB=$install -c -m 0644" >> $config_host_mak
 echo "PYTHON=$python" >> $config_host_mak
 echo "SPHINX_BUILD=$sphinx_build" >> $config_host_mak
+echo "GENISOIMAGE=$genisoimage" >> $config_host_mak
 echo "CC=$cc" >> $config_host_mak
 if $iasl -h > /dev/null 2>&1; then
   echo "IASL=$iasl" >> $config_host_mak
diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include
index 778e5067554..1bf9693d195 100644
--- a/tests/vm/Makefile.include
+++ b/tests/vm/Makefile.include
@@ -2,7 +2,11 @@
 
 .PHONY: vm-build-all vm-clean-all
 
-IMAGES := ubuntu.i386 freebsd netbsd openbsd centos fedora
+IMAGES := freebsd netbsd openbsd centos fedora
+ifneq ($(GENISOIMAGE),)
+IMAGES += ubuntu.i386 centos
+endif
+
 IMAGES_DIR := $(HOME)/.cache/qemu-vm/images
 IMAGE_FILES := $(patsubst %, $(IMAGES_DIR)/%.img, $(IMAGES))
 
@@ -12,12 +16,16 @@ IMAGE_FILES := $(patsubst %, $(IMAGES_DIR)/%.img, $(IMAGES))
 vm-help vm-test:
 	@echo "vm-help: Test QEMU in preconfigured virtual machines"
 	@echo
-	@echo "  vm-build-ubuntu.i386            - Build QEMU in ubuntu i386 VM"
 	@echo "  vm-build-freebsd                - Build QEMU in FreeBSD VM"
 	@echo "  vm-build-netbsd                 - Build QEMU in NetBSD VM"
 	@echo "  vm-build-openbsd                - Build QEMU in OpenBSD VM"
-	@echo "  vm-build-centos                 - Build QEMU in CentOS VM, with Docker"
 	@echo "  vm-build-fedora                 - Build QEMU in Fedora VM"
+ifneq ($(GENISOIMAGE),)
+	@echo "  vm-build-centos                 - Build QEMU in CentOS VM, with Docker"
+	@echo "  vm-build-ubuntu.i386            - Build QEMU in ubuntu i386 VM"
+else
+	@echo "  (install genisoimage to build centos/ubuntu images)"
+endif
 	@echo ""
 	@echo "  vm-build-all                    - Build QEMU in all VMs"
 	@echo "  vm-clean-all                    - Clean up VM images"
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH  v2 8/9] tests/acceptance: bump avocado requirements to 76.0
  2020-03-03 15:06 [PATCH v2 0/9] testing/next (buildvm and re-greening tweeks) Alex Bennée
                   ` (6 preceding siblings ...)
  2020-03-03 15:06 ` [PATCH v2 7/9] configure: detect and report genisoimage Alex Bennée
@ 2020-03-03 15:06 ` Alex Bennée
  2020-03-03 18:45   ` Richard Henderson
  2020-03-03 15:06 ` [PATCH v2 9/9] travis.yml: install python3 numpy and opencv libraries Alex Bennée
  8 siblings, 1 reply; 12+ messages in thread
From: Alex Bennée @ 2020-03-03 15:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée

If we want to use @skipUnless decorations on the class we need a
newer version of avocado.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/requirements.txt b/tests/requirements.txt
index a2a587223a9..f4f1736a086 100644
--- a/tests/requirements.txt
+++ b/tests/requirements.txt
@@ -1,4 +1,4 @@
 # Add Python module requirements, one per line, to be installed
 # in the tests/venv Python virtual environment. For more info,
 # refer to: https://pip.pypa.io/en/stable/user_guide/#id1
-avocado-framework==72.0
+avocado-framework==76.0
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 9/9] travis.yml: install python3 numpy and opencv libraries
  2020-03-03 15:06 [PATCH v2 0/9] testing/next (buildvm and re-greening tweeks) Alex Bennée
                   ` (7 preceding siblings ...)
  2020-03-03 15:06 ` [PATCH v2 8/9] tests/acceptance: bump avocado requirements to 76.0 Alex Bennée
@ 2020-03-03 15:06 ` Alex Bennée
  8 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2020-03-03 15:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Fam Zheng, Philippe Mathieu-Daudé, Alex Bennée

These are used for the acceptance framebuffer tests to count Tux. As
we need slightly newer python3 for opencv we bump up to bionic.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
v2
  - bump to bionic
---
 .travis.yml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 70a24bf2fc8..b92798ac3b9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -313,6 +313,7 @@ jobs:
 
     # Acceptance (Functional) tests
     - name: "GCC check-acceptance"
+      dist: bionic
       env:
         - CONFIG="--target-list=aarch64-softmmu,alpha-softmmu,arm-softmmu,m68k-softmmu,microblaze-softmmu,mips-softmmu,mips64el-softmmu,nios2-softmmu,or1k-softmmu,ppc-softmmu,ppc64-softmmu,s390x-softmmu,sparc-softmmu,x86_64-softmmu,xtensa-softmmu"
         - TEST_CMD="make check-acceptance"
@@ -323,7 +324,9 @@ jobs:
           packages:
             - python3-pil
             - python3-pip
-            - python3.5-venv
+            - python3-numpy
+            - python3-opencv
+            - python3-venv
             - rpm2cpio
             - tesseract-ocr
             - tesseract-ocr-eng
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 7/9] configure: detect and report genisoimage
  2020-03-03 15:06 ` [PATCH v2 7/9] configure: detect and report genisoimage Alex Bennée
@ 2020-03-03 18:44   ` Richard Henderson
  0 siblings, 0 replies; 12+ messages in thread
From: Richard Henderson @ 2020-03-03 18:44 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel; +Cc: Fam Zheng, Philippe Mathieu-Daudé

On 3/3/20 7:06 AM, Alex Bennée wrote:
> This is used for some of the vm-build tests so lets detect it and
> behave sanely when it is not installed.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  configure                 | 13 +++++++++++++
>  tests/vm/Makefile.include | 14 +++++++++++---
>  2 files changed, 24 insertions(+), 3 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 8/9] tests/acceptance: bump avocado requirements to 76.0
  2020-03-03 15:06 ` [PATCH v2 8/9] tests/acceptance: bump avocado requirements to 76.0 Alex Bennée
@ 2020-03-03 18:45   ` Richard Henderson
  0 siblings, 0 replies; 12+ messages in thread
From: Richard Henderson @ 2020-03-03 18:45 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel

On 3/3/20 7:06 AM, Alex Bennée wrote:
> If we want to use @skipUnless decorations on the class we need a
> newer version of avocado.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  tests/requirements.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-03-03 18:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-03 15:06 [PATCH v2 0/9] testing/next (buildvm and re-greening tweeks) Alex Bennée
2020-03-03 15:06 ` [PATCH v2 1/9] tests/vm: use $(PYTHON) consistently Alex Bennée
2020-03-03 15:06 ` [PATCH v2 2/9] tests/vm: Debug mode shows ssh output Alex Bennée
2020-03-03 15:06 ` [PATCH v2 3/9] tests/vm: increased max timeout for vm boot Alex Bennée
2020-03-03 15:06 ` [PATCH v2 4/9] tests/vm: give wait_ssh() option to wait for root Alex Bennée
2020-03-03 15:06 ` [PATCH v2 5/9] tests/vm: Added gen_cloud_init_iso() to basevm.py Alex Bennée
2020-03-03 15:06 ` [PATCH v2 6/9] travis: enable tools build on OS X Alex Bennée
2020-03-03 15:06 ` [PATCH v2 7/9] configure: detect and report genisoimage Alex Bennée
2020-03-03 18:44   ` Richard Henderson
2020-03-03 15:06 ` [PATCH v2 8/9] tests/acceptance: bump avocado requirements to 76.0 Alex Bennée
2020-03-03 18:45   ` Richard Henderson
2020-03-03 15:06 ` [PATCH v2 9/9] travis.yml: install python3 numpy and opencv libraries Alex Bennée

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).