From patchwork Wed Aug 28 19:36:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1154827 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com 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 ozlabs.org (Postfix) with ESMTPS id 46Jcdk67j4z9sDB for ; Thu, 29 Aug 2019 06:23:54 +1000 (AEST) Received: from localhost ([::1]:42268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i34Tw-00072p-7F for incoming@patchwork.ozlabs.org; Wed, 28 Aug 2019 16:23:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44151) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i33kG-0008VU-4A for qemu-devel@nongnu.org; Wed, 28 Aug 2019 15:36:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i33kE-0001nc-DS for qemu-devel@nongnu.org; Wed, 28 Aug 2019 15:36:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35416) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i33kE-0001nK-5w for qemu-devel@nongnu.org; Wed, 28 Aug 2019 15:36:38 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7339118C4266 for ; Wed, 28 Aug 2019 19:36:37 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-123-242.rdu2.redhat.com [10.10.123.242]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9664760CD0; Wed, 28 Aug 2019 19:36:36 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Date: Wed, 28 Aug 2019 15:36:26 -0400 Message-Id: <20190828193628.7687-2-crosa@redhat.com> In-Reply-To: <20190828193628.7687-1-crosa@redhat.com> References: <20190828193628.7687-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Wed, 28 Aug 2019 19:36:37 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/3] Acceptance test x86_cpu_model_versions: shutdown VMs 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: Willian Rampazzo , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , Eduardo Habkost , Wainer dos Santos Moschetta , Cleber Rosa Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This shuts down the VMs that won't be used any longer during the remainder of the test. It's debatable if the very last one should also be shutdown manually, and my opinion is that it shouldn't because that's taken care by the immediately following tearDown(). Signed-off-by: Cleber Rosa --- tests/acceptance/x86_cpu_model_versions.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/acceptance/x86_cpu_model_versions.py b/tests/acceptance/x86_cpu_model_versions.py index 1c9fd6a56e..e6c76b0d4c 100644 --- a/tests/acceptance/x86_cpu_model_versions.py +++ b/tests/acceptance/x86_cpu_model_versions.py @@ -243,6 +243,7 @@ class X86CPUModelAliases(avocado_qemu.Test): vm.launch() self.assertFalse(get_cpu_prop(vm, 'arch-capabilities'), 'pc-i440fx-4.1 + Cascadelake-Server should not have arch-capabilities') + vm.shutdown() vm = self.get_vm() vm.add_args('-S') @@ -251,6 +252,7 @@ class X86CPUModelAliases(avocado_qemu.Test): vm.launch() self.assertFalse(get_cpu_prop(vm, 'arch-capabilities'), 'pc-i440fx-4.0 + Cascadelake-Server should not have arch-capabilities') + vm.shutdown() # command line must override machine-type if CPU model is not versioned: vm = self.get_vm() @@ -260,6 +262,7 @@ class X86CPUModelAliases(avocado_qemu.Test): vm.launch() self.assertTrue(get_cpu_prop(vm, 'arch-capabilities'), 'pc-i440fx-4.0 + Cascadelake-Server,+arch-capabilities should have arch-capabilities') + vm.shutdown() vm = self.get_vm() vm.add_args('-S') @@ -268,6 +271,7 @@ class X86CPUModelAliases(avocado_qemu.Test): vm.launch() self.assertFalse(get_cpu_prop(vm, 'arch-capabilities'), 'pc-i440fx-4.1 + Cascadelake-Server,-arch-capabilities should not have arch-capabilities') + vm.shutdown() # versioned CPU model overrides machine-type: vm = self.get_vm() @@ -277,6 +281,7 @@ class X86CPUModelAliases(avocado_qemu.Test): vm.launch() self.assertFalse(get_cpu_prop(vm, 'arch-capabilities'), 'pc-i440fx-4.1 + Cascadelake-Server-v1 should not have arch-capabilities') + vm.shutdown() vm = self.get_vm() vm.add_args('-S') @@ -285,6 +290,7 @@ class X86CPUModelAliases(avocado_qemu.Test): vm.launch() self.assertTrue(get_cpu_prop(vm, 'arch-capabilities'), 'pc-i440fx-4.1 + Cascadelake-Server-v1 should have arch-capabilities') + vm.shutdown() # command line must override machine-type and versioned CPU model: vm = self.get_vm() @@ -294,6 +300,7 @@ class X86CPUModelAliases(avocado_qemu.Test): vm.launch() self.assertTrue(get_cpu_prop(vm, 'arch-capabilities'), 'pc-i440fx-4.0 + Cascadelake-Server-v1,+arch-capabilities should have arch-capabilities') + vm.shutdown() vm = self.get_vm() vm.add_args('-S') From patchwork Wed Aug 28 19:36:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1154846 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com 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 ozlabs.org (Postfix) with ESMTPS id 46JcqQ4dlXz9sMr for ; Thu, 29 Aug 2019 06:32:18 +1000 (AEST) Received: from localhost ([::1]:42440 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i34c3-0007lc-Kw for incoming@patchwork.ozlabs.org; Wed, 28 Aug 2019 16:32:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44158) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i33kG-0008WQ-EW for qemu-devel@nongnu.org; Wed, 28 Aug 2019 15:36:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i33kF-0001o6-9L for qemu-devel@nongnu.org; Wed, 28 Aug 2019 15:36:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43682) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i33kF-0001nm-4i for qemu-devel@nongnu.org; Wed, 28 Aug 2019 15:36:39 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7D196C0021D7 for ; Wed, 28 Aug 2019 19:36:38 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-123-242.rdu2.redhat.com [10.10.123.242]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F6DE6107E; Wed, 28 Aug 2019 19:36:37 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Date: Wed, 28 Aug 2019 15:36:27 -0400 Message-Id: <20190828193628.7687-3-crosa@redhat.com> In-Reply-To: <20190828193628.7687-1-crosa@redhat.com> References: <20190828193628.7687-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 28 Aug 2019 19:36:38 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/3] Acceptance test x86_cpu_model_versions: fix mismatches between test and messages 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: Willian Rampazzo , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , Eduardo Habkost , Wainer dos Santos Moschetta , Cleber Rosa Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This fixes a few mismatches between the test and the error messages produced in case of failures. Signed-off-by: Cleber Rosa --- tests/acceptance/x86_cpu_model_versions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/acceptance/x86_cpu_model_versions.py b/tests/acceptance/x86_cpu_model_versions.py index e6c76b0d4c..220d18f68d 100644 --- a/tests/acceptance/x86_cpu_model_versions.py +++ b/tests/acceptance/x86_cpu_model_versions.py @@ -280,7 +280,7 @@ class X86CPUModelAliases(avocado_qemu.Test): vm.add_args('-cpu', 'Cascadelake-Server-v1,x-force-features=on,check=off,enforce=off') vm.launch() self.assertFalse(get_cpu_prop(vm, 'arch-capabilities'), - 'pc-i440fx-4.1 + Cascadelake-Server-v1 should not have arch-capabilities') + 'pc-i440fx-4.0 + Cascadelake-Server-v1 should not have arch-capabilities') vm.shutdown() vm = self.get_vm() @@ -289,14 +289,14 @@ class X86CPUModelAliases(avocado_qemu.Test): vm.add_args('-cpu', 'Cascadelake-Server-v2,x-force-features=on,check=off,enforce=off') vm.launch() self.assertTrue(get_cpu_prop(vm, 'arch-capabilities'), - 'pc-i440fx-4.1 + Cascadelake-Server-v1 should have arch-capabilities') + 'pc-i440fx-4.0 + Cascadelake-Server-v2 should have arch-capabilities') vm.shutdown() # command line must override machine-type and versioned CPU model: vm = self.get_vm() vm.add_args('-S') vm.set_machine('pc-i440fx-4.0') - vm.add_args('-cpu', 'Cascadelake-Server,x-force-features=on,check=off,enforce=off,+arch-capabilities') + vm.add_args('-cpu', 'Cascadelake-Server-v1,x-force-features=on,check=off,enforce=off,+arch-capabilities') vm.launch() self.assertTrue(get_cpu_prop(vm, 'arch-capabilities'), 'pc-i440fx-4.0 + Cascadelake-Server-v1,+arch-capabilities should have arch-capabilities') From patchwork Wed Aug 28 19:36:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1154828 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com 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 ozlabs.org (Postfix) with ESMTPS id 46Jch61kP0z9sDB for ; Thu, 29 Aug 2019 06:25:57 +1000 (AEST) Received: from localhost ([::1]:42310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i34Vt-0001b9-TZ for incoming@patchwork.ozlabs.org; Wed, 28 Aug 2019 16:25:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44192) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i33kK-0000AE-E4 for qemu-devel@nongnu.org; Wed, 28 Aug 2019 15:36:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i33kJ-0001pP-1r for qemu-devel@nongnu.org; Wed, 28 Aug 2019 15:36:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52524) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i33kI-0001p4-QX for qemu-devel@nongnu.org; Wed, 28 Aug 2019 15:36:43 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 290EE308FC20 for ; Wed, 28 Aug 2019 19:36:42 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-123-242.rdu2.redhat.com [10.10.123.242]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7D6260F82; Wed, 28 Aug 2019 19:36:38 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Date: Wed, 28 Aug 2019 15:36:28 -0400 Message-Id: <20190828193628.7687-4-crosa@redhat.com> In-Reply-To: <20190828193628.7687-1-crosa@redhat.com> References: <20190828193628.7687-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 28 Aug 2019 19:36:42 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/3] Acceptance test x86_cpu_model_versions: split into smaller tests 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: Willian Rampazzo , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , Eduardo Habkost , Wainer dos Santos Moschetta , Cleber Rosa Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The justifications being automatic destruction of the vm instances when no longer needed and more compact test naming under a common class. Besides those, a smaller test makes the one and only assertion rather obvious, which suggests that we could even get rid of the more verbose (and manual) error messages (to be decided). Naming of the tests tries to follow the following pattern: test_($cpu_version)_($no_arch_capabitilies_set_or_unset)_($machine_version) The presence of each naming component is optional, depending on whether the test manually sets it or not. Signed-off-by: Cleber Rosa --- tests/acceptance/x86_cpu_model_versions.py | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/tests/acceptance/x86_cpu_model_versions.py b/tests/acceptance/x86_cpu_model_versions.py index 220d18f68d..5fc9ca4bc6 100644 --- a/tests/acceptance/x86_cpu_model_versions.py +++ b/tests/acceptance/x86_cpu_model_versions.py @@ -234,7 +234,14 @@ class X86CPUModelAliases(avocado_qemu.Test): self.validate_aliases(cpus) - def test_Cascadelake_arch_capabilities_result(self): + +class CascadelakeArchCapabilities(avocado_qemu.Test): + """ + Validation of Cascadelake arch-capabilities + + :avocado: tags=arch:x86_64 + """ + def test_4_1(self): # machine-type only: vm = self.get_vm() vm.add_args('-S') @@ -243,8 +250,8 @@ class X86CPUModelAliases(avocado_qemu.Test): vm.launch() self.assertFalse(get_cpu_prop(vm, 'arch-capabilities'), 'pc-i440fx-4.1 + Cascadelake-Server should not have arch-capabilities') - vm.shutdown() + def test_4_0(self): vm = self.get_vm() vm.add_args('-S') vm.set_machine('pc-i440fx-4.0') @@ -252,8 +259,8 @@ class X86CPUModelAliases(avocado_qemu.Test): vm.launch() self.assertFalse(get_cpu_prop(vm, 'arch-capabilities'), 'pc-i440fx-4.0 + Cascadelake-Server should not have arch-capabilities') - vm.shutdown() + def test_set_4_0(self): # command line must override machine-type if CPU model is not versioned: vm = self.get_vm() vm.add_args('-S') @@ -262,8 +269,8 @@ class X86CPUModelAliases(avocado_qemu.Test): vm.launch() self.assertTrue(get_cpu_prop(vm, 'arch-capabilities'), 'pc-i440fx-4.0 + Cascadelake-Server,+arch-capabilities should have arch-capabilities') - vm.shutdown() + def test_unset_4_1(self): vm = self.get_vm() vm.add_args('-S') vm.set_machine('pc-i440fx-4.1') @@ -271,8 +278,8 @@ class X86CPUModelAliases(avocado_qemu.Test): vm.launch() self.assertFalse(get_cpu_prop(vm, 'arch-capabilities'), 'pc-i440fx-4.1 + Cascadelake-Server,-arch-capabilities should not have arch-capabilities') - vm.shutdown() + def test_v1_4_0(self): # versioned CPU model overrides machine-type: vm = self.get_vm() vm.add_args('-S') @@ -281,8 +288,8 @@ class X86CPUModelAliases(avocado_qemu.Test): vm.launch() self.assertFalse(get_cpu_prop(vm, 'arch-capabilities'), 'pc-i440fx-4.0 + Cascadelake-Server-v1 should not have arch-capabilities') - vm.shutdown() + def test_v2_4_0(self): vm = self.get_vm() vm.add_args('-S') vm.set_machine('pc-i440fx-4.0') @@ -290,8 +297,8 @@ class X86CPUModelAliases(avocado_qemu.Test): vm.launch() self.assertTrue(get_cpu_prop(vm, 'arch-capabilities'), 'pc-i440fx-4.0 + Cascadelake-Server-v2 should have arch-capabilities') - vm.shutdown() + def test_v1_set_4_0(self): # command line must override machine-type and versioned CPU model: vm = self.get_vm() vm.add_args('-S') @@ -300,8 +307,8 @@ class X86CPUModelAliases(avocado_qemu.Test): vm.launch() self.assertTrue(get_cpu_prop(vm, 'arch-capabilities'), 'pc-i440fx-4.0 + Cascadelake-Server-v1,+arch-capabilities should have arch-capabilities') - vm.shutdown() + def test_v2_unset_4_1(self): vm = self.get_vm() vm.add_args('-S') vm.set_machine('pc-i440fx-4.1')