From patchwork Thu Apr 15 21:51:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 12206055 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9294C433ED for ; Thu, 15 Apr 2021 21:55:18 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5AF18610CD for ; Thu, 15 Apr 2021 21:55:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5AF18610CD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:39650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lX9xF-0004GM-Cr for qemu-devel@archiver.kernel.org; Thu, 15 Apr 2021 17:55:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX9u7-0008Uh-Dz for qemu-devel@nongnu.org; Thu, 15 Apr 2021 17:52:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:29029) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX9u3-0001jt-FQ for qemu-devel@nongnu.org; Thu, 15 Apr 2021 17:52:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618523518; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y9OGowvaoZBBPxDSpW8ptIo4rlckU9RUNrvcFw0nqJM=; b=Ua/7Pq9qcYqrbF/wTuSZ2YMx0bMM83eyLj3iKBweI0Oqjw7q/j8ZDREYjt0Iy12NbDxOmd YnRewRvS6XatkcEVS28dKpoopKkJZYdpow+dvF/wnfdltjW4CTEeK3MHu5hz6NYZ6Y4NJz r0LDsqQkXR2gfcnp71QVaTe6stReZrY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-377-RXNahQYVPEeo0bCoJWWZvw-1; Thu, 15 Apr 2021 17:51:57 -0400 X-MC-Unique: RXNahQYVPEeo0bCoJWWZvw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E714A10054F6; Thu, 15 Apr 2021 21:51:55 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.rdu2.redhat.com [10.10.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 14A185D9E3; Thu, 15 Apr 2021 21:51:53 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 1/8] Acceptance Jobs: preserve the cache for pip on GitLab CI Date: Thu, 15 Apr 2021 17:51:34 -0400 Message-Id: <20210415215141.1865467-2-crosa@redhat.com> In-Reply-To: <20210415215141.1865467-1-crosa@redhat.com> References: <20210415215141.1865467-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Cornelia Huck , Thomas Huth , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Willian Rampazzo , Auger Eric , qemu-s390x@nongnu.org, Willian Rampazzo , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The acceptance jobs (via `make check-venv`) will setup a virtual environment, and after that install packages defined in tests/requirements.txt via pip. Let's enable pip's default cache directory, so that we can save a bit on time/bandwidth. Signed-off-by: Cleber Rosa --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52d65d6c04..9cc4676912 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -53,6 +53,7 @@ include: key: "${CI_JOB_NAME}-cache" paths: - ${CI_PROJECT_DIR}/avocado-cache + - ~/.cache/pip policy: pull-push artifacts: name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" From patchwork Thu Apr 15 21:51:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 12206051 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69C22C433B4 for ; Thu, 15 Apr 2021 21:53:03 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E8DF9610F7 for ; Thu, 15 Apr 2021 21:53:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E8DF9610F7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:60850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lX9v3-0001NK-WE for qemu-devel@archiver.kernel.org; Thu, 15 Apr 2021 17:53:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX9u7-0008UM-8t for qemu-devel@nongnu.org; Thu, 15 Apr 2021 17:52:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51177) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX9u5-0001lY-A7 for qemu-devel@nongnu.org; Thu, 15 Apr 2021 17:52:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618523520; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Cs/kLNgNkeDbLh1grSLljbD6CyQ7rE9SFnE8q5xJgIs=; b=SEVOO8mU8yxQ6pPmIkv3hMfai7giLf20uUUpOgfLTTXtt5ZE7wi15iJ+WOMdP7YntZmML3 ea41PQRkn45iHTX+yEGEckZY0s+Z8q8uFS7olU5gK8H0gRQtMI15lEFOAbD5C+yFnlJuQM 0X4/jUAekIRGjNEgXw5t5xhn7AIkHt8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-221-4-vBxGN1M46Efw00axB-FA-1; Thu, 15 Apr 2021 17:51:59 -0400 X-MC-Unique: 4-vBxGN1M46Efw00axB-FA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BD7091854E25; Thu, 15 Apr 2021 21:51:57 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.rdu2.redhat.com [10.10.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 18CA45D9DE; Thu, 15 Apr 2021 21:51:56 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 2/8] Acceptance tests: do not try to reuse packages from the system Date: Thu, 15 Apr 2021 17:51:35 -0400 Message-Id: <20210415215141.1865467-3-crosa@redhat.com> In-Reply-To: <20210415215141.1865467-1-crosa@redhat.com> References: <20210415215141.1865467-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Cornelia Huck , Thomas Huth , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Willian Rampazzo , Auger Eric , qemu-s390x@nongnu.org, Willian Rampazzo , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The premise behind the original behavior is that it would save people from downloading Avocado (and other dependencies) if already installed on the system. To be honest, I think it's extremely rare that the same versions described as dependencies will be available on most systems. But, the biggest motivations here are that: 1) Hacking on QEMU in the same system used to develop Avocado leads to confusion with regards to the exact bits that are being used; 2) Not reusing Python packages from system wide installations gives extra assurance that the same behavior will be seen from tests run on different machines; With regards to downloads, pip already caches the downloaded wheels and tarballs under ~/.cache/pip, so there should not be more than one download even if the venv is destroyed and recreated. Signed-off-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Willian Rampazzo Reviewed-by: Wainer dos Santos Moschetta --- tests/Makefile.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 8f220e15d1..63477c8b4b 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -96,7 +96,7 @@ AVOCADO_TAGS=$(patsubst %-softmmu,-t arch:%, $(filter %-softmmu,$(TARGETS))) $(TESTS_VENV_DIR): $(TESTS_VENV_REQ) $(call quiet-command, \ - $(PYTHON) -m venv --system-site-packages $@, \ + $(PYTHON) -m venv $@, \ VENV, $@) $(call quiet-command, \ $(TESTS_VENV_DIR)/bin/python -m pip -q install -r $(TESTS_VENV_REQ), \ From patchwork Thu Apr 15 21:51:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 12206053 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18417C433B4 for ; Thu, 15 Apr 2021 21:53:09 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 78AC8610F7 for ; Thu, 15 Apr 2021 21:53:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 78AC8610F7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lX9v9-0001YD-9r for qemu-devel@archiver.kernel.org; Thu, 15 Apr 2021 17:53:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX9uC-0000Cx-KS for qemu-devel@nongnu.org; Thu, 15 Apr 2021 17:52:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53922) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX9uA-0001pt-T1 for qemu-devel@nongnu.org; Thu, 15 Apr 2021 17:52:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618523526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cWF88+9izMmNB3cplcpKdc7cQcAQI8b0+wpkLtTonIo=; b=FLB1q+/zffA1Mtw5FcmQ/P250eMPB7HkDT4Hc+sWFATuc6ZiIc82pkpT1xQi6GhXM11aG2 hdn0p07KfjhwFidN5I8GPiHwhSf7Nmpa+nAA0ybCYjbQRPhbz37d2OgymfcT2juJd+Qxep ewmC9RUJWbZJFeGy6JKpilSRykyXWnY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-471-U1Ewz4QZOQ23O7ymfXAp_w-1; Thu, 15 Apr 2021 17:52:04 -0400 X-MC-Unique: U1Ewz4QZOQ23O7ymfXAp_w-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A4122EC1A2; Thu, 15 Apr 2021 21:52:02 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.rdu2.redhat.com [10.10.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E40B75D9DE; Thu, 15 Apr 2021 21:51:57 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 3/8] tests/acceptance/linux_ssh_mips_malta.py: drop identical setUp Date: Thu, 15 Apr 2021 17:51:36 -0400 Message-Id: <20210415215141.1865467-4-crosa@redhat.com> In-Reply-To: <20210415215141.1865467-1-crosa@redhat.com> References: <20210415215141.1865467-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Cornelia Huck , Thomas Huth , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Willian Rampazzo , Auger Eric , qemu-s390x@nongnu.org, Willian Rampazzo , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" These tests' setUp do not do anything beyong what their base class do. And while they do decorate the setUp() we can decorate the classes instead, so no functionality is lost here. Signed-off-by: Cleber Rosa Reviewed-by: Willian Rampazzo Reviewed-by: Philippe Mathieu-Daudé --- tests/acceptance/linux_ssh_mips_malta.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptance/linux_ssh_mips_malta.py index 6dbd02d49d..e309a1105c 100644 --- a/tests/acceptance/linux_ssh_mips_malta.py +++ b/tests/acceptance/linux_ssh_mips_malta.py @@ -19,6 +19,8 @@ from avocado.utils import ssh +@skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout') +@skipUnless(ssh.SSH_CLIENT_BINARY, 'No SSH client available') class LinuxSSH(Test): timeout = 150 # Not for 'configure --enable-debug --enable-debug-tcg' @@ -65,11 +67,6 @@ def get_kernel_info(self, endianess, wordsize): kernel_hash = self.IMAGE_INFO[endianess]['kernel_hash'][wordsize] return kernel_url, kernel_hash - @skipUnless(ssh.SSH_CLIENT_BINARY, 'No SSH client available') - @skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout') - def setUp(self): - super(LinuxSSH, self).setUp() - def get_portfwd(self): res = self.vm.command('human-monitor-command', command_line='info usernet') From patchwork Thu Apr 15 21:51:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 12206059 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 712DCC433B4 for ; Thu, 15 Apr 2021 21:55:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3310A610CD for ; Thu, 15 Apr 2021 21:55:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3310A610CD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:40264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lX9xY-0004Ws-CR for qemu-devel@archiver.kernel.org; Thu, 15 Apr 2021 17:55:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX9uQ-0000cz-7V for qemu-devel@nongnu.org; Thu, 15 Apr 2021 17:52:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:46404) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX9uN-0001xv-7G for qemu-devel@nongnu.org; Thu, 15 Apr 2021 17:52:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618523538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+NfWOz55xxZzpQYzc0k/q704CVd37G4rSeYOrY2kess=; b=HayvYKR9eMwfYScHsqw5MZGcZWBejtLNrntIGgmW847shVATpWePgfhLy1aUouRU3rn2gz N0Varf1/IynmyJ3x7WhCJPHO9F80FErDOvnL8zsC0Q2KAaX0SzT0VoB+qPZpsOyhLDhrUa qOMkizzpAYD07rIiK3gWxpdbJrlvAH8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-228-Xdz7CnQrOzux20LBqxClcA-1; Thu, 15 Apr 2021 17:52:14 -0400 X-MC-Unique: Xdz7CnQrOzux20LBqxClcA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AC74E81744F; Thu, 15 Apr 2021 21:52:13 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.rdu2.redhat.com [10.10.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CA3855D9DE; Thu, 15 Apr 2021 21:52:02 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 4/8] tests/acceptance/migration.py: cancel test if migration is not supported Date: Thu, 15 Apr 2021 17:51:37 -0400 Message-Id: <20210415215141.1865467-5-crosa@redhat.com> In-Reply-To: <20210415215141.1865467-1-crosa@redhat.com> References: <20210415215141.1865467-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Cornelia Huck , Thomas Huth , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Willian Rampazzo , Auger Eric , qemu-s390x@nongnu.org, Willian Rampazzo , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" FIXME: check if there's a way to query migration support before actually requesting migration. Some targets/machines contain devices that do not support migration. Let's acknowledge that and cancel the test as early as possible. Signed-off-by: Cleber Rosa Reviewed-by: Willian Rampazzo --- tests/acceptance/migration.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py index 792639cb69..25ee55f36a 100644 --- a/tests/acceptance/migration.py +++ b/tests/acceptance/migration.py @@ -53,7 +53,11 @@ def do_migrate(self, dest_uri, src_uri=None): source_vm = self.get_vm() source_vm.add_args('-nodefaults') source_vm.launch() - source_vm.qmp('migrate', uri=src_uri) + response = source_vm.qmp('migrate', uri=src_uri) + if 'error' in response: + if 'desc' in response['error']: + msg = response['error']['desc'] + self.cancel('Migration does not seem to be supported: %s' % msg) self.assert_migration(source_vm, dest_vm) def _get_free_port(self): From patchwork Thu Apr 15 21:51:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 12206057 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AFA5C433ED for ; Thu, 15 Apr 2021 21:55:26 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 59FC5610F7 for ; Thu, 15 Apr 2021 21:55:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 59FC5610F7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:39846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lX9xN-0004LB-4G for qemu-devel@archiver.kernel.org; Thu, 15 Apr 2021 17:55:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX9uS-0000gC-1l for qemu-devel@nongnu.org; Thu, 15 Apr 2021 17:52:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28155) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX9uN-0001yD-TD for qemu-devel@nongnu.org; Thu, 15 Apr 2021 17:52:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618523539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vm06+2+Ea/hlkjRzQEKPtb/wn1adVwmS884rgA2yYKI=; b=RlwcIuy7KTm/rkB2zYmcBiCcJSjswcRsk+qY37+ijEPfdYE8dcNffSCQXznMAYlRmHEGCz G1rsyb42UcprK1M/Xv3okvwcO9EGf54fHSG9+zjsMxikJ6n32dN9mgZmbKA8B6XZtSNOM9 pg4pfg8jJGxekjukCFDsuuQV1rqrKiA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-78-CmFTrq1HMEG1sSeS1poTJA-1; Thu, 15 Apr 2021 17:52:16 -0400 X-MC-Unique: CmFTrq1HMEG1sSeS1poTJA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7F8018030A0; Thu, 15 Apr 2021 21:52:15 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.rdu2.redhat.com [10.10.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D1D275D9DE; Thu, 15 Apr 2021 21:52:13 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 5/8] tests/acceptance/cpu_queries.py: use the proper logging channels Date: Thu, 15 Apr 2021 17:51:38 -0400 Message-Id: <20210415215141.1865467-6-crosa@redhat.com> In-Reply-To: <20210415215141.1865467-1-crosa@redhat.com> References: <20210415215141.1865467-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Cornelia Huck , Thomas Huth , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Willian Rampazzo , Auger Eric , qemu-s390x@nongnu.org, Willian Rampazzo , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The test contains methods for the proper log of test related information. Let's use that and remove the print and the unused logging import. Reference: https://avocado-framework.readthedocs.io/en/87.0/api/test/avocado.html#avocado.Test.log Signed-off-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Willian Rampazzo Reviewed-by: Wainer dos Santos Moschetta --- tests/acceptance/cpu_queries.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/acceptance/cpu_queries.py b/tests/acceptance/cpu_queries.py index 293dccb89a..cc9e380cc7 100644 --- a/tests/acceptance/cpu_queries.py +++ b/tests/acceptance/cpu_queries.py @@ -8,8 +8,6 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. -import logging - from avocado_qemu import Test class QueryCPUModelExpansion(Test): @@ -27,7 +25,7 @@ def test(self): cpus = self.vm.command('query-cpu-definitions') for c in cpus: - print(repr(c)) + self.log.info("Checking CPU: %s", c) self.assertNotIn('', c['unavailable-features'], c['name']) for c in cpus: From patchwork Thu Apr 15 21:51:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 12206065 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21705C433B4 for ; Thu, 15 Apr 2021 21:57:40 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B8CDC610F7 for ; Thu, 15 Apr 2021 21:57:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B8CDC610F7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lX9zW-0006qE-Rx for qemu-devel@archiver.kernel.org; Thu, 15 Apr 2021 17:57:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX9uT-0000j2-Kf for qemu-devel@nongnu.org; Thu, 15 Apr 2021 17:52:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:37204) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX9uR-0001zp-Dl for qemu-devel@nongnu.org; Thu, 15 Apr 2021 17:52:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618523542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/fhLbR5K3HyCkI+hULT4nKQTRoKHc8/uItuX0msEvnY=; b=ZqmHTeNJXKfc/rRT2OkasBiVVfq95uwVwfnxUu1H+LaKp4KuBnd//U/cj8bEM17ttKHEIz 281G0N5o+XB2TWJJ8eHABrRWwi9ZI4e69f08zGb18TQkXjTl+Gfbq08walEJdD6JDw1NPZ i3r0xwUCFH1qyVbeUKFM/mrXVzSZERc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-201-bl4RYgleN7WHcFkzv2AnDA-1; Thu, 15 Apr 2021 17:52:18 -0400 X-MC-Unique: bl4RYgleN7WHcFkzv2AnDA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6AC3C107ACC7; Thu, 15 Apr 2021 21:52:17 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.rdu2.redhat.com [10.10.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A569B5D9DE; Thu, 15 Apr 2021 21:52:15 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 6/8] Acceptance tests: prevent shutdown on non-specific target tests Date: Thu, 15 Apr 2021 17:51:39 -0400 Message-Id: <20210415215141.1865467-7-crosa@redhat.com> In-Reply-To: <20210415215141.1865467-1-crosa@redhat.com> References: <20210415215141.1865467-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Cornelia Huck , Thomas Huth , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Willian Rampazzo , Auger Eric , qemu-s390x@nongnu.org, Willian Rampazzo , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" When running tests that are not target specific with various target binaries, some specific behavior appears. For s390x, when there's no guest code running, it will produce GUEST_PANICKED events as the firmware will shutdown the machine. With this change, no GUEST_PANICKED *event* will be generated. For some QMP commands, such as "query-migrate", a proper response ("guest-panicked" for the s390x target) will still be given. Signed-off-by: Cleber Rosa Reviewed-by: Willian Rampazzo --- tests/acceptance/migration.py | 4 ++-- tests/acceptance/version.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py index 25ee55f36a..b4d46becc6 100644 --- a/tests/acceptance/migration.py +++ b/tests/acceptance/migration.py @@ -46,12 +46,12 @@ def assert_migration(self, src_vm, dst_vm): def do_migrate(self, dest_uri, src_uri=None): dest_vm = self.get_vm('-incoming', dest_uri) - dest_vm.add_args('-nodefaults') + dest_vm.add_args('-nodefaults', '-no-shutdown') dest_vm.launch() if src_uri is None: src_uri = dest_uri source_vm = self.get_vm() - source_vm.add_args('-nodefaults') + source_vm.add_args('-nodefaults', '-no-shutdown') source_vm.launch() response = source_vm.qmp('migrate', uri=src_uri) if 'error' in response: diff --git a/tests/acceptance/version.py b/tests/acceptance/version.py index 79b923d4fc..3cf18c9878 100644 --- a/tests/acceptance/version.py +++ b/tests/acceptance/version.py @@ -17,7 +17,7 @@ class Version(Test): :avocado: tags=quick """ def test_qmp_human_info_version(self): - self.vm.add_args('-nodefaults') + self.vm.add_args('-nodefaults', '-no-shutdown') self.vm.launch() res = self.vm.command('human-monitor-command', command_line='info version') From patchwork Thu Apr 15 21:51:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 12206063 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EEC4C433ED for ; Thu, 15 Apr 2021 21:57:34 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 156E4610F7 for ; Thu, 15 Apr 2021 21:57:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 156E4610F7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lX9zR-0006hO-61 for qemu-devel@archiver.kernel.org; Thu, 15 Apr 2021 17:57:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX9uV-0000kt-Ld for qemu-devel@nongnu.org; Thu, 15 Apr 2021 17:52:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:47199) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX9uR-0001zn-E2 for qemu-devel@nongnu.org; Thu, 15 Apr 2021 17:52:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618523542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dY2PHxhgV0UwiOC39r7ALvr6lsd4xAizu2vDZ7OF7xM=; b=JTvgvdeqc7jGFPuoWvdvYX0VGCeI3pObRWcod2je/ZXySTFP2yN/P+3CsYnjkS40C0c4LJ TN7upKxKNy8qetwJHPqC7OvaupGpOX91qokDVvwgLoNa0IMOjDdS1yF8IkssjqRbOdRJp9 jOMyBckaIhszge0li7KcHMWgbY9Ml3w= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-470-t_XziZBZO--I_C5f_80FWw-1; Thu, 15 Apr 2021 17:52:20 -0400 X-MC-Unique: t_XziZBZO--I_C5f_80FWw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3FFEBEC1A0; Thu, 15 Apr 2021 21:52:19 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.rdu2.redhat.com [10.10.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 902D85D9DE; Thu, 15 Apr 2021 21:52:17 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 7/8] tests/acceptance/migration.py: cancel test on s390x Date: Thu, 15 Apr 2021 17:51:40 -0400 Message-Id: <20210415215141.1865467-8-crosa@redhat.com> In-Reply-To: <20210415215141.1865467-1-crosa@redhat.com> References: <20210415215141.1865467-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Cornelia Huck , Thomas Huth , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Willian Rampazzo , Auger Eric , qemu-s390x@nongnu.org, Willian Rampazzo , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Because s390x targets it can not currently migrate without a guest running. Future work may provide a proper guest, but for now, it's safer to cancel the test. Signed-off-by: Cleber Rosa Reviewed-by: Wainer dos Santos Moschetta Reviewed-by: Willian Rampazzo --- tests/acceptance/migration.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py index b4d46becc6..4174d55c81 100644 --- a/tests/acceptance/migration.py +++ b/tests/acceptance/migration.py @@ -48,6 +48,12 @@ def do_migrate(self, dest_uri, src_uri=None): dest_vm = self.get_vm('-incoming', dest_uri) dest_vm.add_args('-nodefaults', '-no-shutdown') dest_vm.launch() + + cpus = dest_vm.command('query-cpus-fast') + if cpus: + if cpus[0].get('target') == 's390x': + self.cancel('Migration without a guest not possible on s390') + if src_uri is None: src_uri = dest_uri source_vm = self.get_vm() From patchwork Thu Apr 15 21:51:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 12206067 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 945DFC433B4 for ; Thu, 15 Apr 2021 21:59:52 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A5256610F7 for ; Thu, 15 Apr 2021 21:59:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A5256610F7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:50102 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXA1e-0000EK-LY for qemu-devel@archiver.kernel.org; Thu, 15 Apr 2021 17:59:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43744) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX9uX-0000pJ-KW for qemu-devel@nongnu.org; Thu, 15 Apr 2021 17:52:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:25311) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX9uV-00021N-Cc for qemu-devel@nongnu.org; Thu, 15 Apr 2021 17:52:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618523546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LkWMv7xUMu8MY3LOt1r2rePtPYwoeOS7Bqa0X8F7UbA=; b=iryLRAblehau4IIVr02mDHPt/1UuKXCBPjKy6Mq3+Jdyt3A5n1K7rogQFKT8JBiRyBU5RJ DfOVf0NVbqAxH5m5HcCihREEHpKVjuo6Cd+ScTDwRAKYVom7gFjLXmVRTcGis5itsoVFw5 6dFhqsNekJ9McwEIKRQSbVY9pQ9eVUk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-10-cwzBeyHaPSKuhDI5w1-D5g-1; Thu, 15 Apr 2021 17:52:22 -0400 X-MC-Unique: cwzBeyHaPSKuhDI5w1-D5g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 380451854E23; Thu, 15 Apr 2021 21:52:21 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-207.rdu2.redhat.com [10.10.116.207]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 71C685D9DE; Thu, 15 Apr 2021 21:52:19 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 8/8] Tests: add custom test jobs Date: Thu, 15 Apr 2021 17:51:41 -0400 Message-Id: <20210415215141.1865467-9-crosa@redhat.com> In-Reply-To: <20210415215141.1865467-1-crosa@redhat.com> References: <20210415215141.1865467-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Cornelia Huck , Thomas Huth , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Willian Rampazzo , Auger Eric , qemu-s390x@nongnu.org, Willian Rampazzo , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Different users (or even companies) have different interests, and may want to run a reduced set of tests during development, or a larger set of tests during QE. To cover these use cases, some example (but functional) jobs are introduced here: 1) acceptance-all-targets.py: runs all arch agnostic tests on all built targets, unless there are conditions that make them not work out of the box ATM, then run all tests that are specific to predefined targets. 2) acceptance-kvm-only.py: runs only tests that require KVM and are specific to the host architecture. 3) qtest-unit.py: runs a combination of qtest and unit tests (in parallel). 4) qtest-unit-acceptance.py: runs a combineation of qtest, unit tests and acceptance tests (all of them in parallel) To run the first two manually, follow the example bellow: $ cd build $ make check-venv $ ./tests/venv/bin/python3 tests/jobs/acceptance-all-targets.py $ ./tests/venv/bin/python3 tests/jobs/acceptance-kvm-only.py The third and fouth example depends on information coming from Meson, so the easiest way to run it is: $ cd build $ make check-qtest-unit $ make check-qtest-unit-acceptance These are based on Avocado's Job API, a way to customize an Avocado job execution beyond the possibilities of command line arguments. For more Job API resources, please refer to: a) Job API Examples: - https://github.com/avocado-framework/avocado/tree/master/examples/jobs b) Documentation about configurable features at the Job Level: - https://avocado-framework.readthedocs.io/en/87.0/config/index.html c) Documentation about the TestSuite class - https://avocado-framework.readthedocs.io/en/87.0/api/core/avocado.core.html#avocado.core.suite.TestSuite d) Documentation about the Job class - https://avocado-framework.readthedocs.io/en/87.0/api/core/avocado.core.html#avocado.core.job.Job Signed-off-by: Cleber Rosa --- configure | 2 +- tests/Makefile.include | 8 ++++ tests/jobs/acceptance-all-targets.py | 67 ++++++++++++++++++++++++++++ tests/jobs/acceptance-kvm-only.py | 35 +++++++++++++++ tests/jobs/qtest-unit-acceptance.py | 31 +++++++++++++ tests/jobs/qtest-unit.py | 24 ++++++++++ tests/jobs/utils.py | 22 +++++++++ 7 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 tests/jobs/acceptance-all-targets.py create mode 100644 tests/jobs/acceptance-kvm-only.py create mode 100644 tests/jobs/qtest-unit-acceptance.py create mode 100644 tests/jobs/qtest-unit.py create mode 100644 tests/jobs/utils.py diff --git a/configure b/configure index 4f374b4889..23273262e5 100755 --- a/configure +++ b/configure @@ -6265,7 +6265,7 @@ LINKS="$LINKS pc-bios/s390-ccw/Makefile" LINKS="$LINKS roms/seabios/Makefile" LINKS="$LINKS pc-bios/qemu-icon.bmp" LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit -LINKS="$LINKS tests/acceptance tests/data" +LINKS="$LINKS tests/acceptance tests/data tests/jobs" LINKS="$LINKS tests/qemu-iotests/check" LINKS="$LINKS python" LINKS="$LINKS contrib/plugins/Makefile " diff --git a/tests/Makefile.include b/tests/Makefile.include index 63477c8b4b..03443dd0e8 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -133,6 +133,14 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vm-images $(if $(GITLAB_CI),,--failfast) tests/acceptance, \ "AVOCADO", "tests/acceptance") +# Runs qtest and unit tests on a custom Avocado job +check-qtest-unit: check-venv $(TESTS_RESULTS_DIR) + $(MESON) introspect --tests | $(TESTS_VENV_DIR)/bin/python $(SRC_PATH)/tests/jobs/qtest-unit.py $(TESTS_RESULTS_DIR) + +# Runs qtest and unit and accpetance tests on a custom Avocado job +check-qtest-unit-acceptance: check-venv $(TESTS_RESULTS_DIR) + $(MESON) introspect --tests | $(TESTS_VENV_DIR)/bin/python $(SRC_PATH)/tests/jobs/qtest-unit-acceptance.py $(TESTS_RESULTS_DIR) + # Consolidated targets .PHONY: check-block check check-clean get-vm-images diff --git a/tests/jobs/acceptance-all-targets.py b/tests/jobs/acceptance-all-targets.py new file mode 100644 index 0000000000..96703824e6 --- /dev/null +++ b/tests/jobs/acceptance-all-targets.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 + +import glob +import os +import sys + +from avocado.core.job import Job +from avocado.core.suite import TestSuite + + +def filter_out_currently_broken(variants): + """Filter out targets that can not be currently used transparently.""" + result = [] + for variant in variants: + if (# qemu-system-m68k: Kernel image must be specified + variant['qemu_bin'].endswith('qemu-system-m68k') or + # qemu-system-sh4: Could not load SHIX bios 'shix_bios.bin' + variant['qemu_bin'].endswith('qemu-system-sh4')): + continue + result.append(variant) + return result + + +def add_machine_type(variants): + """Add default machine type parameters to targets that require one.""" + for variant in variants: + if (variant['qemu_bin'].endswith('-arm') or + variant['qemu_bin'].endswith('-aarch64')): + variant['machine'] = 'virt' + if variant['qemu_bin'].endswith('-rx'): + variant['machine'] = 'none' + if variant['qemu_bin'].endswith('-avr'): + variant['machine'] = 'none' + + +def all_system_binaries(): + """Looks for all system binaries and creates dict variants.""" + binaries = [target for target in glob.glob('./qemu-system-*') + if (os.path.isfile(target) and + os.access(target, os.R_OK | os.X_OK))] + variants = [] + for target in binaries: + variants.append({'qemu_bin': target}) + variants = filter_out_currently_broken(variants) + add_machine_type(variants) + return variants + + +def main(): + suite1 = TestSuite.from_config( + {'run.references': ['tests/acceptance/'], + 'filter.by_tags.tags': ['-arch'], + 'run.dict_variants': all_system_binaries()}, + name='non-arch-specific') + + suite2 = TestSuite.from_config( + {'run.references': ['tests/acceptance/'], + 'filter.by_tags.tags': ['arch']}, + name='arch-specific') + + with Job({'job.run.result.html.enabled': 'on'}, + [suite1, suite2]) as job: + return job.run() + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/tests/jobs/acceptance-kvm-only.py b/tests/jobs/acceptance-kvm-only.py new file mode 100644 index 0000000000..acdcbbe087 --- /dev/null +++ b/tests/jobs/acceptance-kvm-only.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 + +import os +import sys + +# This comes from tests/acceptance/avocado_qemu/__init__.py and should +# not be duplicated here. The solution is to have the "avocado_qemu" +# code and "python/qemu" available during build +BUILD_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) +if os.path.islink(os.path.dirname(os.path.dirname(__file__))): + # The link to the acceptance tests dir in the source code directory + lnk = os.path.dirname(os.path.dirname(__file__)) + #: The QEMU root source directory + SOURCE_DIR = os.path.dirname(os.path.dirname(os.readlink(lnk))) +else: + SOURCE_DIR = BUILD_DIR +sys.path.append(os.path.join(SOURCE_DIR, 'python')) + +from avocado.core.job import Job + +from qemu.accel import kvm_available + + +def main(): + if not kvm_available(): + sys.exit(0) + + config = {'run.references': ['tests/acceptance/'], + 'filter.by_tags.tags': ['accel:kvm,arch:%s' % os.uname()[4]]} + with Job.from_config(config) as job: + return job.run() + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/tests/jobs/qtest-unit-acceptance.py b/tests/jobs/qtest-unit-acceptance.py new file mode 100644 index 0000000000..67a25c93f5 --- /dev/null +++ b/tests/jobs/qtest-unit-acceptance.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 + +import json +import random +import sys + +from avocado.core.job import Job +from avocado.core.resolver import resolve +from avocado.core.suite import resolutions_to_runnables + +from utils import meson_introspect_to_avocado_suite + + +def main(): + config = {'run.test_runner': 'nrunner'} + if len(sys.argv) > 1: + config['run.results_dir'] = sys.argv[1] + + suite = meson_introspect_to_avocado_suite(json.load(sys.stdin), + 'qtest-unit-acceptance', + config) + acceptance = resolutions_to_runnables(resolve(["tests/acceptance"]), + config) + suite.tests += acceptance + random.shuffle(suite.tests) + with Job(config, [suite]) as j: + return j.run() + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/tests/jobs/qtest-unit.py b/tests/jobs/qtest-unit.py new file mode 100644 index 0000000000..6f4d1b40c6 --- /dev/null +++ b/tests/jobs/qtest-unit.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 + +import sys +import json + +from avocado.core.job import Job + +from utils import meson_introspect_to_avocado_suite + + +def main(): + config = {'run.test_runner': 'nrunner'} + if len(sys.argv) > 1: + config['run.results_dir'] = sys.argv[1] + + suite = meson_introspect_to_avocado_suite(json.load(sys.stdin), + 'qtest-unit', + config) + with Job(config, [suite]) as j: + return j.run() + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/tests/jobs/utils.py b/tests/jobs/utils.py new file mode 100644 index 0000000000..79ac129231 --- /dev/null +++ b/tests/jobs/utils.py @@ -0,0 +1,22 @@ +from avocado.core.suite import TestSuite +from avocado.core.nrunner import Runnable + + +def protocol_tap_to_runnable(entry): + runnable = Runnable('tap', + entry['cmd'][0], + *entry['cmd'][1:], + **entry['env']) + return runnable + + +def meson_introspect_to_avocado_suite(introspect, suite_name, config): + tests = [] + for entry in introspect: + if entry['protocol'] != 'tap': + continue + runnable = protocol_tap_to_runnable(entry) + tests.append(runnable) + + suite = TestSuite(name=suite_name, config=config, tests=tests) + return suite