From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843698; cv=none; d=zohomail.com; s=zohoarc; b=HcZPhQAjkck8xyeICWYdH/HK3UMNudVPH3YUtH7G3R1fl1h76MwUlExobYACmHbhrBKJGUm/fCmYCy5ekYRNw/DEYC4WAHqXhQPIhibHXXA2Mh9qRo33ZlVkYiGKxzxINGC7UFoZixOojaJDWOeTjbnZQXvUApOaLCqHm+5+Iqo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843698; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bFlCPERrA8XbHL2WbrXxbY4UFojl/kmqfg7LiLdQJco=; b=FfAFzbhJenulDHAbvMnBKd6IVQslVUB7lloK5IQNg4bcHgArteKLPCs8nYKL6izUCUqgHKFWkiZ9oxCjsNi/aWm6CMUlGMugFGvKwFCHDxSST9hvZ+S3+2XX+n22QIF0QQkxgiwndOTeisl+YOC6L8ak9ZfwN8mjprLP1fHGToU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721843698798674.0839389517644; Wed, 24 Jul 2024 10:54:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgAt-0000k5-6E; Wed, 24 Jul 2024 13:53:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgAs-0000gF-5y for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:53:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgAm-0005cj-GD for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:53:13 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-628-jsbfeNnWM3S371C9ilHCXg-1; Wed, 24 Jul 2024 13:53:05 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D5CDE1955D55; Wed, 24 Jul 2024 17:53:03 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D87A91955D42; Wed, 24 Jul 2024 17:52:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bFlCPERrA8XbHL2WbrXxbY4UFojl/kmqfg7LiLdQJco=; b=WJjWXjqlaV961f567bobSJkc0IEm7/ep0VDf+pdpdNt3/h+umBBIEdLfUAlOEaV82TeNqW PigxwTLvOF9uhasX6nbpQSTh9BVHCBxCbFMdAGSMbedjQM1LeWQFAcBQwViwgy/k8mBikf lcuRjS7VyxkwKo/4yYEGBR2hfWIBNSw= X-MC-Unique: jsbfeNnWM3S371C9ilHCXg-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 01/23] python: Install pycotap in our venv if necessary Date: Wed, 24 Jul 2024 19:52:19 +0200 Message-ID: <20240724175248.1389201-2-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843700094116600 Content-Type: text/plain; charset="utf-8" The upcoming functional tests will require pycotap for providing TAP output from the python-based tests. Since we want to be able to run some of the tests offline by default, too, let's install it along with meson in our venv if necessary (it's size is only 5 kB, so adding the wheel here should not really be a problem). The wheel file has been obtained with: pip download --only-binary :all: --dest . --no-cache pycotap Signed-off-by: Thomas Huth Tested-by: Philippe Mathieu-Daud=C3=A9 --- python/wheels/pycotap-1.3.1-py3-none-any.whl | Bin 0 -> 5119 bytes pythondeps.toml | 1 + 2 files changed, 1 insertion(+) create mode 100644 python/wheels/pycotap-1.3.1-py3-none-any.whl diff --git a/python/wheels/pycotap-1.3.1-py3-none-any.whl b/python/wheels/p= ycotap-1.3.1-py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..9c2c7d259365c8a0487228c6878= e2c0b10ba6bdd GIT binary patch literal 5119 zcmeI0c{r49-^VX&3}X-3cO#7@+t|t4j6saOFm|%Vlq5p-b*v*b+!#WUElXPLTgIN! zWLF9yOO}-P=3Dzd?_J-zqc^Y8P=3D^F5C1I?g|?>vNoc{Jy{6`8`b$6qIZL0MG#GGI+~H zES3$R0sv1|0AK|Gz(3g84}8-dSoQbO2%udjK9nR1 zX@Mw7zRZ{mFv|`)4NPytMe=3DeP5h(K}-@36c__dlrZxYgrbFtHmU$`UJ-juerPK0GR zshPauoDlZTdy!Dv>PW-C`_4w>c^0|S#!PJQr&Rx&%f}eZTPHMc1X8cU%aYZ2Q)PK2 zm@9*23{tU5IZhDSn50gKRt1xkbO~0B`EYJDWa1^0xIIV#bxv{|)IIpNc11RFU$I6~(T)|;Gf1>iao+q>y8Qu&AR zX&ZGcxw#t-3T;Z$&qQX^FO{VmvdcLPNNXO?UxY^wdnFsSo`}Ojht)qBW)R#y&_6pLsGnx#HyZ>EF1+wb6y9RGk}| zm|OSaNVkTPnmS*=3D!%K8^w1vs;6Ns#%7*MoHUtf9N>mJwo_){ZBm9}~XK?Na2=3DL8ds ziyM~BIXK2LGrDWYR?Js<&cYIA4VTCR^oo`(vRq1Uid<2D0I!6n9V5Vs#*|i-snEN6nLM3LEgwhU2dxNUtb%K^JAaFZe0iU1Gur}{wa*q5c6a@yHteQ+%(2J>nTbYw0soAc zGzp7E(+$gN)nkBfmNxcqBpa`}?Nj(bK71 zeA%e>r%@xv#hCfu#H-)c?JC5kq@H~t-wu09ER5T4Nqp@_VX0&s$fo}4!Yz?aeMh`D z<^;?zR(m{Wz~?cHVVN%HF*on@H1D*XMlUXr;-1eNgKNHS+_+Io!?~G%d5|vy>`kiZmn1pNZ3=3D@w%o|a%K`xB<_aHhsaF%ICb4Jqcy>+>z7lj6t$07eM_{C{8 zS*_R&5^>ee_h78y;Qml@k&aVFH|!v+ryrm9M170dm!!J8zxQ0p^xf|Bh|j(UU%He1 zN!?dLj5|ASyKJF>m|A=3DjBE4_72;3^vM*Tinso5R2>y}i4K(8f}HN@8Y9kdddc;)Bi z?j$k7X0B9M7x6Lio2u_f6Ds8$;0?a&!}!_b0Z3lMM^wNwfFURR zdWk;8O)`#y$R8P>MA@%A06to-;ocOykBG*IKwHv3$FkR%hI#Zs_U- z<_~SfK?b{6N~=3D1}FU+Du`BCNbHo1SynT+a}GhJVcX}tikUG5q%D_qBlaM=3D+DzABn$ zjyGXbWxADZydWKL50Mw5*qJQ&dTx*9c~`{snkGopR7n++t&n>S}&WMm5 zhmrO}OADL8%)vBEP?KqCo7MTH6Xj0eT~>`h>}v{h2(P#%@AW!ZTH1;7;kdG0(*jQo zD62ScMz)JY7t}L{w2^q&=3DAIyt^-c2; zvw}&4#JSNk?B%-GY{iWQbPel7MQ@-BEZSoe1)`>wbDstGDobMTm2|AN)-Le>Rm3bN zc*}oN#GZi|sHd-+-+znvzeW6?Tg1coH;Yk$Na?U2T+hv;`@J zTZuk2|AD{|4(XVBo1H2_+jMO5kB{{eF6Wx5HpbFKUl*+;LEhJ_ZpH2k?p0%RtI-tP zTb=3Dc~X=3D-X}gf&@-qIBDD(So)C;Opkk%BRZ6xYvtH2-hzwJ}H0ZIxog}6XZ;B(QrH& zDTOWiUe&7UhTF{3|FTQLl?^a$z*zi?aB=3D?63OM$Yc(C*u{EWjs?QojtOmYt zS@F$HW~Dk4gX8PvDf&*Uk)S(g85o6G-_PVNfA~Z<^pwp*HBhn0`kQx%*xu)_?Xk^4 z&rlXG28b71^-Y;R&V;DBK1LDq$m>3qarlHli^{WftFEl{e26;G&AoONT86IPE@pg4^_N*mcYB7tp4T^K6pEDFtjqc2sps?vNDcR9O!DQtk!Z29<`jlH}Kz zo9&2zue)Xg(s{i!ch?UZfpG^ z$*(=3D{veXW|;7#=3DJB@B(-_VmD-$vnyDKyF>Z@6Kf;2G6)Bnk85=3DjIr97&%j)G&VM=3D4fY2LqdAAKc5YBLk8(S22@nC?-k8WsJ5#1!XIf~vI5PLCs`abP|JJ7 z)T=3DBQQsP{Q(i*H(@-kbCZYS5czc$@gDGn_Sriq%%%v^QZ5Dp4`4$!Y!ppg)v{1wMT z*Ke*KY<15HLfB%A<@PVBNIz6ZzBksB=3DLsH6aOaxB4zSqwT0)P{YQovO#%g&7XHl>M6%@;^o(BNn`@{Pi2U{8H=3D^4=3Dt8X}3qUuK^ znar5nOn?ay0fnFHm98-}g!i73ikCiCc5X;!NUnZJZg>IIHz+;4eQF#Gfx?NsMm1&- ziId2;ptD8|W{^_(apLnq#0zBqy@fgQpN@Fnr{e`JAp_8#ksSa;f3q!&pTC2*>lIgT zDa=3D)jWU0}B^x0E0zrr-`+Nrpc0f0X_0Py_=3DW~QfOVy63WsL8iT3kaXp7>uNq(cqhYPaMMk;8^*&b*M+^C$`)@pVbSOFZ9_6lWl_C-OZK^;fpzvL%)1ya9h=3D~5 z_mCtLnrQEvj%hK;#R_gS4g$VjVv4tW^Ok}W4ia4g(n~xTw@6;HAHu9vo03mezljm* zGf;hI_f>z#@&)=3Dv9zsIHKGE#3gbBb!6>@pMwh09$sLhZa%5fsbYn!-=3D1.1.0", installed =3D "1.2.3", canary =3D "m= eson" } +pycotap =3D { accepted =3D ">=3D1.1.0", installed =3D "1.3.1" } =20 [docs] # Please keep the installed versions in sync with docs/requirements.txt --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843698; cv=none; d=zohomail.com; s=zohoarc; b=LxgZl3M8E9eSXValuo2h/YIxXoH6mnQWjfouA1KeL4hTNOI3AXnSYXXtPh4gY7XN/uN11JoyAo51fP/TDfR+v9W45xQXKHh/3qL1zKqsvDdu+xFBq0iV1PTl3inpW34zGChLGJiHmkBT1ke/CDSpt2atWUHv+ziaP3zS7rcEyrQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843698; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DmQsgSX7jl7NTuJIloLRRrenRMGjIKlxkwYa1Gv9huk=; b=E3CJ4jEezI6sZL9JL5T2jxWpnuLj39U9B26ht3bv83nE4QixDaiNjEFu4D2mDdBGm5LaD8i2fKI+Eikir2LMr8If0T6H1zGu86kijXJ/VO9MmL928JkM7zdP/l71dBumyoC3UL8i/yafE6QFgGbDTNTQH6Hi4cD6aE62DuESnn4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721843698873757.8426993353241; Wed, 24 Jul 2024 10:54:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgAy-00011S-Gq; Wed, 24 Jul 2024 13:53:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgAx-0000zZ-2G for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:53:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgAu-0005eX-Nr for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:53:18 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-562-BepPRmVVOXeYR8Mb25b_FQ-1; Wed, 24 Jul 2024 13:53:13 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8449D1955D56; Wed, 24 Jul 2024 17:53:09 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 742FB1955D42; Wed, 24 Jul 2024 17:53:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DmQsgSX7jl7NTuJIloLRRrenRMGjIKlxkwYa1Gv9huk=; b=dy+Xvf+qkVH/yVawIrI6vy9oa3RLXls6249qQxyag0UjmacEmrxdqUx2+dUTCiNXB9B367 UOf24zSJcoHN9Izdt7K9VOMPSbTKy/+DsWBWmMlp4TBUs73XB3WLMeBHRvIVlEyCAQtF8b UeyIQY9Wf+rBZW9WXYomW8nRk0FS6sE= X-MC-Unique: BepPRmVVOXeYR8Mb25b_FQ-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 02/23] tests/functional: Add base classes for the upcoming pytest-based tests Date: Wed, 24 Jul 2024 19:52:20 +0200 Message-ID: <20240724175248.1389201-3-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843700139116600 Content-Type: text/plain; charset="utf-8" The file is mostly a copy of the tests/avocado/avocado_qemu/__init__.py file with some adjustments to get rid of the Avocado dependencies (i.e. we also have to drop the LinuxSSHMixIn and LinuxTest for now). The emulator binary and build directory are now passed via environment variables that will be set via meson.build later. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- tests/functional/qemu_test/__init__.py | 328 +++++++++++++++++++++++++ 1 file changed, 328 insertions(+) create mode 100644 tests/functional/qemu_test/__init__.py diff --git a/tests/functional/qemu_test/__init__.py b/tests/functional/qemu= _test/__init__.py new file mode 100644 index 0000000000..fc98222c52 --- /dev/null +++ b/tests/functional/qemu_test/__init__.py @@ -0,0 +1,328 @@ +# Test class and utilities for functional tests +# +# Copyright 2018, 2024 Red Hat, Inc. +# +# Original Author (Avocado-based tests): +# Cleber Rosa +# +# Adaption for standalone version: +# Thomas Huth +# +# 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 +import os +import pycotap +import shutil +import subprocess +import sys +import tempfile +import time +import uuid +import unittest + +from pathlib import Path +from qemu.machine import QEMUMachine +from qemu.utils import kvm_available, tcg_available + +def _source_dir(): + # Determine top-level directory of the QEMU sources + return Path(__file__).parent.parent.parent.parent + +def _build_dir(): + root =3D os.getenv('QEMU_BUILD_ROOT') + if root is not None: + return Path(root) + # Makefile.mtest only exists in build dir, so if it is available, use = CWD + if os.path.exists('Makefile.mtest'): + return Path(os.getcwd()) + + root =3D os.path.join(_source_dir(), 'build') + if os.path.exists(root): + return Path(root) + + raise Exception("Cannot identify build dir, set QEMU_BUILD_ROOT") + +BUILD_DIR =3D _build_dir() + +def has_cmd(name, args=3DNone): + """ + This function is for use in a @skipUnless decorator, e.g.: + + @skipUnless(*has_cmd('sudo -n', ('sudo', '-n', 'true'))) + def test_something_that_needs_sudo(self): + ... + """ + + if args is None: + args =3D ('which', name) + + try: + _, stderr, exitcode =3D run_cmd(args) + except Exception as e: + exitcode =3D -1 + stderr =3D str(e) + + if exitcode !=3D 0: + cmd_line =3D ' '.join(args) + err =3D f'{name} required, but "{cmd_line}" failed: {stderr.strip(= )}' + return (False, err) + else: + return (True, '') + +def has_cmds(*cmds): + """ + This function is for use in a @skipUnless decorator and + allows checking for the availability of multiple commands, e.g.: + + @skipUnless(*has_cmds(('cmd1', ('cmd1', '--some-parameter')), + 'cmd2', 'cmd3')) + def test_something_that_needs_cmd1_and_cmd2(self): + ... + """ + + for cmd in cmds: + if isinstance(cmd, str): + cmd =3D (cmd,) + + ok, errstr =3D has_cmd(*cmd) + if not ok: + return (False, errstr) + + return (True, '') + +def run_cmd(args): + subp =3D subprocess.Popen(args, + stdout=3Dsubprocess.PIPE, + stderr=3Dsubprocess.PIPE, + universal_newlines=3DTrue) + stdout, stderr =3D subp.communicate() + ret =3D subp.returncode + + return (stdout, stderr, ret) + +def is_readable_executable_file(path): + return os.path.isfile(path) and os.access(path, os.R_OK | os.X_OK) + +def _console_interaction(test, success_message, failure_message, + send_string, keep_sending=3DFalse, vm=3DNone): + assert not keep_sending or send_string + if vm is None: + vm =3D test.vm + console =3D vm.console_file + console_logger =3D logging.getLogger('console') + while True: + if send_string: + vm.console_socket.sendall(send_string.encode()) + if not keep_sending: + send_string =3D None # send only once + try: + msg =3D console.readline().decode().strip() + except UnicodeDecodeError: + msg =3D None + if not msg: + continue + console_logger.debug(msg) + if success_message is None or success_message in msg: + break + if failure_message and failure_message in msg: + console.close() + fail =3D 'Failure message found in console: "%s". Expected: "%= s"' % \ + (failure_message, success_message) + test.fail(fail) + +def interrupt_interactive_console_until_pattern(test, success_message, + failure_message=3DNone, + interrupt_string=3D'\r'): + """ + Keep sending a string to interrupt a console prompt, while logging the + console output. Typical use case is to break a boot loader prompt, suc= h: + + Press a key within 5 seconds to interrupt boot process. + 5 + 4 + 3 + 2 + 1 + Booting default image... + + :param test: a test containing a VM that will have its console + read and probed for a success or failure message + :type test: :class:`qemu_test.QemuSystemTest` + :param success_message: if this message appears, test succeeds + :param failure_message: if this message appears, test fails + :param interrupt_string: a string to send to the console before trying + to read a new line + """ + _console_interaction(test, success_message, failure_message, + interrupt_string, True) + +def wait_for_console_pattern(test, success_message, failure_message=3DNone, + vm=3DNone): + """ + Waits for messages to appear on the console, while logging the content + + :param test: a test containing a VM that will have its console + read and probed for a success or failure message + :type test: :class:`qemu_test.QemuSystemTest` + :param success_message: if this message appears, test succeeds + :param failure_message: if this message appears, test fails + """ + _console_interaction(test, success_message, failure_message, None, vm= =3Dvm) + +def exec_command(test, command): + """ + Send a command to a console (appending CRLF characters), while logging + the content. + + :param test: a test containing a VM. + :type test: :class:`qemu_test.QemuSystemTest` + :param command: the command to send + :type command: str + """ + _console_interaction(test, None, None, command + '\r') + +def exec_command_and_wait_for_pattern(test, command, + success_message, failure_message=3DN= one): + """ + Send a command to a console (appending CRLF characters), then wait + for success_message to appear on the console, while logging the. + content. Mark the test as failed if failure_message is found instead. + + :param test: a test containing a VM that will have its console + read and probed for a success or failure message + :type test: :class:`qemu_test.QemuSystemTest` + :param command: the command to send + :param success_message: if this message appears, test succeeds + :param failure_message: if this message appears, test fails + """ + _console_interaction(test, success_message, failure_message, command += '\r') + +class QemuBaseTest(unittest.TestCase): + + qemu_bin =3D os.getenv('QEMU_TEST_QEMU_BINARY') + arch =3D None + + workdir =3D None + log =3D logging.getLogger('qemu-test') + + def setUp(self, bin_prefix): + self.assertIsNotNone(self.qemu_bin, 'QEMU_TEST_QEMU_BINARY must be= set') + self.arch =3D self.qemu_bin.split('-')[-1] + + self.workdir =3D os.path.join(BUILD_DIR, 'tests/functional', self.= arch, + self.id()) + if not os.path.exists(self.workdir): + os.makedirs(self.workdir) + + def main(): + tr =3D pycotap.TAPTestRunner(message_log =3D pycotap.LogMode.LogTo= Error, + test_output_log =3D pycotap.LogMode.Log= ToError) + path =3D os.path.basename(sys.argv[0])[:-3] + unittest.main(module =3D None, testRunner =3D tr, argv=3D["__dummy= __", path]) + + +class QemuSystemTest(QemuBaseTest): + """Facilitates system emulation tests.""" + + cpu =3D None + machine =3D None + _machinehelp =3D None + + def setUp(self): + self._vms =3D {} + + super().setUp('qemu-system-') + + def set_machine(self, machinename): + # TODO: We should use QMP to get the list of available machines + if not self._machinehelp: + self._machinehelp =3D run_cmd([self.qemu_bin, '-M', 'help'])[0= ]; + if self._machinehelp.find(machinename) < 0: + self.skipTest('no support for machine ' + machinename) + self.machine =3D machinename + + def require_accelerator(self, accelerator): + """ + Requires an accelerator to be available for the test to continue + + It takes into account the currently set qemu binary. + + If the check fails, the test is canceled. If the check itself + for the given accelerator is not available, the test is also + canceled. + + :param accelerator: name of the accelerator, such as "kvm" or "tcg" + :type accelerator: str + """ + checker =3D {'tcg': tcg_available, + 'kvm': kvm_available}.get(accelerator) + if checker is None: + self.skipTest("Don't know how to check for the presence " + "of accelerator %s" % accelerator) + if not checker(qemu_bin=3Dself.qemu_bin): + self.skipTest("%s accelerator does not seem to be " + "available" % accelerator) + + def require_netdev(self, netdevname): + netdevhelp =3D run_cmd([self.qemu_bin, + '-M', 'none', '-netdev', 'help'])[0]; + if netdevhelp.find('\n' + netdevname + '\n') < 0: + self.skipTest('no support for " + netdevname + " networking') + + def require_device(self, devicename): + devhelp =3D run_cmd([self.qemu_bin, + '-M', 'none', '-device', 'help'])[0]; + if devhelp.find(devicename) < 0: + self.skipTest('no support for device ' + devicename) + + def _new_vm(self, name, *args): + vm =3D QEMUMachine(self.qemu_bin, base_temp_dir=3Dself.workdir) + self.log.debug('QEMUMachine "%s" created', name) + self.log.debug('QEMUMachine "%s" temp_dir: %s', name, vm.temp_dir) + self.log.debug('QEMUMachine "%s" log_dir: %s', name, vm.log_dir) + if args: + vm.add_args(*args) + return vm + + @property + def vm(self): + return self.get_vm(name=3D'default') + + def get_vm(self, *args, name=3DNone): + if not name: + name =3D str(uuid.uuid4()) + if self._vms.get(name) is None: + self._vms[name] =3D self._new_vm(name, *args) + if self.cpu is not None: + self._vms[name].add_args('-cpu', self.cpu) + if self.machine is not None: + self._vms[name].set_machine(self.machine) + return self._vms[name] + + def set_vm_arg(self, arg, value): + """ + Set an argument to list of extra arguments to be given to the QEMU + binary. If the argument already exists then its value is replaced. + + :param arg: the QEMU argument, such as "-cpu" in "-cpu host" + :type arg: str + :param value: the argument value, such as "host" in "-cpu host" + :type value: str + """ + if not arg or not value: + return + if arg not in self.vm.args: + self.vm.args.extend([arg, value]) + else: + idx =3D self.vm.args.index(arg) + 1 + if idx < len(self.vm.args): + self.vm.args[idx] =3D value + else: + self.vm.args.append(value) + + def tearDown(self): + for vm in self._vms.values(): + vm.shutdown() + super().tearDown() --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843841; cv=none; d=zohomail.com; s=zohoarc; b=DtW1Qd0Hvz1MzIP5oSKJIru0QP++L16u1IjwGyS95KEqD17qDDilbgS+rHJ24d2FMdFETeqzRWORZQto+LmZC9qyQeiNS0L7fiqgEAGHtuHcAjHRdIvcQ7cvwdyKsSGhjXm1L2E3fKXroN1OoaxVVFCpxEotm+vs798bZOv5hVE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843841; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mAr9RkSQ/TlDrHQIuOuBwAG9DU0XsigMyP0M9+fJhxg=; b=R/rYzf8ixe+TbaBrIRXmBj+XNXuj5z7KckC2mdxRmMwAMMWBzB0r7vKPHC8/C7SRseVKOhAFkpfsOfifsKMkg1v3ctHo2j/4Aa+P5XZQfPOvNjHKk0eIAFnHIAhOUgh1vMH8L0S5BFsdJB7+qfI/zE/9IN6kjGRGHpJDXxjH56U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17218438409994.823906890093895; Wed, 24 Jul 2024 10:57:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgB6-0001MP-2v; Wed, 24 Jul 2024 13:53:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgB5-0001Le-15 for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:53:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgB3-0005hW-ER for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:53:26 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-128-WZyPATfLN0KgmdxF7rrvjg-1; Wed, 24 Jul 2024 13:53:17 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F41421955D42; Wed, 24 Jul 2024 17:53:13 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CE8F01955D45; Wed, 24 Jul 2024 17:53:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mAr9RkSQ/TlDrHQIuOuBwAG9DU0XsigMyP0M9+fJhxg=; b=SYu6UV3zGG6A2CFUjbrYd92dyJXPOkcH74+RsDPnIXw+QEubPPhrlzD47DT3lj0RXHRzb6 ZgFufyWMxeIA8XwRWJN6D1MnKxzG8T0oT5hJPhSsvBowbVQAKfCgYne+2ReaRZNjOfY/qE PxgzPto8IbutUHcG2rgy6XJTOehu6+Y= X-MC-Unique: WZyPATfLN0KgmdxF7rrvjg-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 03/23] tests/Makefile.include: Increase the level of indentation in the help text Date: Wed, 24 Jul 2024 19:52:21 +0200 Message-ID: <20240724175248.1389201-4-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843842650116600 Content-Type: text/plain; charset="utf-8" The next patch is going to add some entries that need more space between the command and the help text, so let's increase the indentation here first. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/Makefile.include | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 6618bfed70..167d8f29a4 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -3,28 +3,28 @@ .PHONY: check-help check-help: @echo "Regression testing targets:" - @echo " $(MAKE) check Run block, qapi-schema, unit, soft= float, qtest and decodetree tests" - @echo " $(MAKE) bench Run speed tests" + @echo " $(MAKE) check Run block, qapi-schema, unit, so= ftfloat, qtest and decodetree tests" + @echo " $(MAKE) bench Run speed tests" @echo @echo "Individual test suites:" - @echo " $(MAKE) check-qtest-TARGET Run qtest tests for given target" - @echo " $(MAKE) check-qtest Run qtest tests" - @echo " $(MAKE) check-unit Run qobject tests" - @echo " $(MAKE) check-qapi-schema Run QAPI schema tests" - @echo " $(MAKE) check-block Run block tests" + @echo " $(MAKE) check-qtest-TARGET Run qtest tests for given target" + @echo " $(MAKE) check-qtest Run qtest tests" + @echo " $(MAKE) check-unit Run qobject tests" + @echo " $(MAKE) check-qapi-schema Run QAPI schema tests" + @echo " $(MAKE) check-block Run block tests" ifneq ($(filter $(all-check-targets), check-softfloat),) - @echo " $(MAKE) check-tcg Run TCG tests" - @echo " $(MAKE) check-softfloat Run FPU emulation tests" + @echo " $(MAKE) check-tcg Run TCG tests" + @echo " $(MAKE) check-softfloat Run FPU emulation tests" endif - @echo " $(MAKE) check-avocado Run avocado (integration) tests fo= r currently configured targets" + @echo " $(MAKE) check-avocado Run avocado (integration) tests = for currently configured targets" @echo - @echo " $(MAKE) check-report.junit.xml Generates an aggregated XML test r= eport" - @echo " $(MAKE) check-venv Creates a Python venv for tests" - @echo " $(MAKE) check-clean Clean the tests and related data" + @echo " $(MAKE) check-report.junit.xml Generates an aggregated XML test= report" + @echo " $(MAKE) check-venv Creates a Python venv for tests" + @echo " $(MAKE) check-clean Clean the tests and related data" @echo @echo "The following are useful for CI builds" - @echo " $(MAKE) check-build Build most test binaries" - @echo " $(MAKE) get-vm-images Downloads all images used by avoca= do tests, according to configured targets (~350 MB each, 1.5 GB max)" + @echo " $(MAKE) check-build Build most test binaries" + @echo " $(MAKE) get-vm-images Downloads all images used by avo= cado tests, according to configured targets (~350 MB each, 1.5 GB max)" @echo @echo @echo "The variable SPEED can be set to control the gtester speed setting= ." --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843770; cv=none; d=zohomail.com; s=zohoarc; b=VMAlSpBsEUZoIbJXcDcCxDuLOjhZN/yooAibLZbL+OGhJiqa2d08z5TbgCW+2ZloFTARRM20/FsKI+49L3RhCI8unziwuC18xmc6pehMINB7ocTiINUc4UwXJ3Z1eSvIoAjuHqwseVulxOxB2h2nk0O3Vggdkzn8v/p8HLsc4yM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843770; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=IBwCifFDyg2cfSspDtA5tXBEj1UYMed4PdQo3Lq/dik=; b=N4iLXDZITV3pX418pZ1JjTpTuJiFu00q595U17G2NaUk0Nrs9FRGv05Tm3SzFnd4qNSoCfLMgeNAkJZzmH6Rw0ASgFgnrDMtpCNvdRFfum/rXAV/7RdHiK/CaxiVkBq19AVAanyDzpDY37fEaVg9uZPPQjM+AtXa6I1yshn+ZJ8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721843770145382.4261511246792; Wed, 24 Jul 2024 10:56:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgBC-0001dn-FK; Wed, 24 Jul 2024 13:53:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgBA-0001bl-RJ for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:53:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgB9-0005iD-1n for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:53:32 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-112-GnWHAo4BNNiXNrvrMsfVUg-1; Wed, 24 Jul 2024 13:53:23 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8B15C1955BE6; Wed, 24 Jul 2024 17:53:19 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 688B51955D42; Wed, 24 Jul 2024 17:53:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IBwCifFDyg2cfSspDtA5tXBEj1UYMed4PdQo3Lq/dik=; b=ExnSHhe4QpViEdD+RRkGSi1gIw8YR0WyOrm6OM3ppFKK+475X0kT5CMupnAD0Jpb4SVM6E Oz5u/BUBEj+19e+e39xCM/a7rlivG41eIXR2/fOM28E4zfwFkpLGoX1lbVLAIH2MmD4SqB XaxlMPVM8lw3XuSsaf9Knf6E0YvZGoY= X-MC-Unique: GnWHAo4BNNiXNrvrMsfVUg-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 04/23] tests/functional: Prepare the meson build system for the functional tests Date: Wed, 24 Jul 2024 19:52:22 +0200 Message-ID: <20240724175248.1389201-5-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843770365116600 Content-Type: text/plain; charset="utf-8" Provide a meson.build file for the upcoming python-based functional tests, and add some wrapper glue targets to the tests/Makefile.include file. We are going to use two "speed" modes for the functional tests: The "quick" tests can be run at any time (i.e. also during "make check"), while the "thorough" tests should only be run when running a "make check-functional" test run (since these tests might download additional assets from the internet). The changes to the meson.build files are partly based on an earlier patch by Ani Sinha. Signed-off-by: Thomas Huth Tested-by: Philippe Mathieu-Daud=C3=A9 --- tests/Makefile.include | 11 ++++++ tests/functional/meson.build | 66 ++++++++++++++++++++++++++++++++++++ tests/meson.build | 1 + 3 files changed, 78 insertions(+) create mode 100644 tests/functional/meson.build diff --git a/tests/Makefile.include b/tests/Makefile.include index 167d8f29a4..d0c2ae30b7 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -9,6 +9,8 @@ check-help: @echo "Individual test suites:" @echo " $(MAKE) check-qtest-TARGET Run qtest tests for given target" @echo " $(MAKE) check-qtest Run qtest tests" + @echo " $(MAKE) check-functional Run python-based functional test= s" + @echo " $(MAKE) check-functional-TARGET Run functional tests for a given= target" @echo " $(MAKE) check-unit Run qobject tests" @echo " $(MAKE) check-qapi-schema Run QAPI schema tests" @echo " $(MAKE) check-block Run block tests" @@ -152,6 +154,15 @@ check-acceptance-deprecated-warning: =20 check-acceptance: check-acceptance-deprecated-warning | check-avocado =20 +FUNCTIONAL_TARGETS=3D$(patsubst %-softmmu,check-functional-%, $(filter %-s= oftmmu,$(TARGETS))) +.PHONY: $(FUNCTIONAL_TARGETS) +$(FUNCTIONAL_TARGETS): + @$(MAKE) SPEED=3Dthorough $(subst -functional,-func,$@) + +.PHONY: check-functional +check-functional: + @$(MAKE) SPEED=3Dthorough check-func check-func-quick + # Consolidated targets =20 .PHONY: check check-clean get-vm-images diff --git a/tests/functional/meson.build b/tests/functional/meson.build new file mode 100644 index 0000000000..7fc9c4e513 --- /dev/null +++ b/tests/functional/meson.build @@ -0,0 +1,66 @@ +# QEMU functional tests: +# Tests that are put in the 'quick' category are run by default during +# 'make check'. Everything that should not be run during 'make check' +# (e.g. tests that fetch assets from the internet) should be put into +# the 'thorough' category instead. + +# Most tests run too slow with TCI enabled, so skip the functional tests t= here +if get_option('tcg_interpreter') + subdir_done() +endif + +# Timeouts for individual tests that can be slow e.g. with debugging enabl= ed +test_timeouts =3D { +} + +tests_generic =3D [ +] + +tests_x86_64_quick =3D [ +] + +tests_x86_64_thorough =3D [ +] + +foreach speed : ['quick', 'thorough'] + foreach dir : target_dirs + if not dir.endswith('-softmmu') + continue + endif + + target_base =3D dir.split('-')[0] + test_emulator =3D emulators['qemu-system-' + target_base] + + if speed =3D=3D 'quick' + suites =3D ['func-quick', 'func-' + target_base] + target_tests =3D get_variable('tests_' + target_base + '_quick', [])= + tests_generic + else + suites =3D ['func-' + speed, 'func-' + target_base + '-' + speed, sp= eed] + target_tests =3D get_variable('tests_' + target_base + '_' + speed, = []) + endif + + test_deps =3D roms + test_env =3D environment() + if have_tools + test_env.set('QEMU_TEST_QEMU_IMG', meson.global_build_root() / 'qemu= -img') + test_deps +=3D [qemu_img] + endif + test_env.set('QEMU_TEST_QEMU_BINARY', + meson.global_build_root() / 'qemu-system-' + target_base) + test_env.set('QEMU_BUILD_ROOT', meson.project_build_root()) + test_env.set('PYTHONPATH', meson.project_source_root() / 'python:' + + meson.current_source_dir()) + + foreach test : target_tests + test('func-@0@/@1@'.format(target_base, test), + python, + depends: [test_deps, test_emulator, emulator_modules], + env: test_env, + args: [meson.current_source_dir() / 'test_' + test + '.py'], + protocol: 'tap', + timeout: test_timeouts.get(test, 60), + priority: test_timeouts.get(test, 60), + suite: suites) + endforeach + endforeach +endforeach diff --git a/tests/meson.build b/tests/meson.build index acb6807094..3345ad2098 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -85,3 +85,4 @@ subdir('unit') subdir('qapi-schema') subdir('qtest') subdir('migration') +subdir('functional') --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843698; cv=none; d=zohomail.com; s=zohoarc; b=YhsP5YZu41WA6XE0wLbEibTAZN/iBqC8/wtGynS7gBUbvlQ+KJDYDQ7na+NR3dYUM4K710ZmtT+8w8h70ANNTCO6EmXyVZhEGlo1kR93uvC6P5IcR5m2FHe9WPPCkSD2GJ+puns0bzelgwKX1jkiYepat3a70c8bibOzLcOpKOQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843698; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HeZWgxpbVL9Kd+oEfmtTt5bE7D+IKlCryWpytvp/8Ik=; b=nnhapWXm8jECbIJwDXK3061eVI5l/CKOYBrxEsifr2+apNMqTyGX+cns8tGBya4/SGhHm8DmrBTSHfFU88AEsn1Uk27nv2gOg/kGMNw7p4I4VgaFdVuDRiLvGJ46OnVajrZh76+zJqiqR6P8uAKcZFl8+rWRU2HyJuMLNQRNVX8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721843698842245.39168082493143; Wed, 24 Jul 2024 10:54:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgBF-0001pf-3p; Wed, 24 Jul 2024 13:53:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgBD-0001hK-64 for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:53:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgB9-0005iI-JX for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:53:34 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-135-mHF-MV6kO5ed4Qx_UK6pCg-1; Wed, 24 Jul 2024 13:53:28 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AE2661944B33; Wed, 24 Jul 2024 17:53:24 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 21FF61955D4A; Wed, 24 Jul 2024 17:53:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843610; 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=HeZWgxpbVL9Kd+oEfmtTt5bE7D+IKlCryWpytvp/8Ik=; b=BPayGv+RIRReqdeOG0/SQyW+6WyIUnNrQ0UA9kTT/84UYbT0O35wwrZWGq4DJBOFj2LHCu QqONvH8LgnXpQIfni/y8VRSLFhyBoEsrCJVQbdN1aE8geCiXEAf/0mrt1U2mh58Yfb9Zwl NTBwfUf773zi4I1RqzzJRk+BxaLcYuM= X-MC-Unique: mHF-MV6kO5ed4Qx_UK6pCg-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 05/23] tests/functional: Convert simple avocado tests into standalone python tests Date: Wed, 24 Jul 2024 19:52:23 +0200 Message-ID: <20240724175248.1389201-6-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843700132116600 These test are rather simple and don't need any modifications apart from adjusting the "from avocado_qemu" line. To ease debugging, make the files executable and add a shebang line and Python '__main__' handling, too, so that these tests can now be run by executing them directly. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- tests/functional/meson.build | 5 ++ .../test_cpu_queries.py} | 7 ++- .../test_empty_cpu_model.py} | 7 ++- .../test_mem_addr_space.py} | 52 +++---------------- .../test_pc_cpu_hotplug_props.py} | 11 ++-- .../test_virtio_version.py} | 8 +-- 6 files changed, 34 insertions(+), 56 deletions(-) rename tests/{avocado/cpu_queries.py =3D> functional/test_cpu_queries.py} = (89%) mode change 100644 =3D> 100755 rename tests/{avocado/empty_cpu_model.py =3D> functional/test_empty_cpu_mo= del.py} (84%) mode change 100644 =3D> 100755 rename tests/{avocado/mem-addr-space-check.py =3D> functional/test_mem_add= r_space.py} (93%) mode change 100644 =3D> 100755 rename tests/{avocado/pc_cpu_hotplug_props.py =3D> functional/test_pc_cpu_= hotplug_props.py} (90%) mode change 100644 =3D> 100755 rename tests/{avocado/virtio_version.py =3D> functional/test_virtio_versio= n.py} (98%) mode change 100644 =3D> 100755 diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 7fc9c4e513..a8cc0e6330 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -14,9 +14,14 @@ test_timeouts =3D { } =20 tests_generic =3D [ + 'empty_cpu_model', ] =20 tests_x86_64_quick =3D [ + 'cpu_queries', + 'mem_addr_space', + 'pc_cpu_hotplug_props', + 'virtio_version', ] =20 tests_x86_64_thorough =3D [ diff --git a/tests/avocado/cpu_queries.py b/tests/functional/test_cpu_queri= es.py old mode 100644 new mode 100755 similarity index 89% rename from tests/avocado/cpu_queries.py rename to tests/functional/test_cpu_queries.py index d3faa14720..97dd600c01 --- a/tests/avocado/cpu_queries.py +++ b/tests/functional/test_cpu_queries.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Sanity check of query-cpu-* results # # Copyright (c) 2019 Red Hat, Inc. @@ -8,7 +10,7 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. =20 -from avocado_qemu import QemuSystemTest +from qemu_test import QemuSystemTest =20 class QueryCPUModelExpansion(QemuSystemTest): """ @@ -33,3 +35,6 @@ def test(self): e =3D self.vm.cmd('query-cpu-model-expansion', model=3Dmodel, type=3D'full') self.assertEqual(e['model']['name'], c['name']) + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() diff --git a/tests/avocado/empty_cpu_model.py b/tests/functional/test_empty= _cpu_model.py old mode 100644 new mode 100755 similarity index 84% rename from tests/avocado/empty_cpu_model.py rename to tests/functional/test_empty_cpu_model.py index d906ef3d3c..0081b06d85 --- a/tests/avocado/empty_cpu_model.py +++ b/tests/functional/test_empty_cpu_model.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Check for crash when using empty -cpu option # # Copyright (c) 2019 Red Hat, Inc. @@ -7,7 +9,7 @@ # # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. -from avocado_qemu import QemuSystemTest +from qemu_test import QemuSystemTest =20 class EmptyCPUModel(QemuSystemTest): def test(self): @@ -17,3 +19,6 @@ def test(self): self.vm.wait() self.assertEqual(self.vm.exitcode(), 1, "QEMU exit code should be = 1") self.assertRegex(self.vm.get_log(), r'-cpu option cannot be empty') + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() diff --git a/tests/avocado/mem-addr-space-check.py b/tests/functional/test_= mem_addr_space.py old mode 100644 new mode 100755 similarity index 93% rename from tests/avocado/mem-addr-space-check.py rename to tests/functional/test_mem_addr_space.py index d3974599f4..bb0cf062ca --- a/tests/avocado/mem-addr-space-check.py +++ b/tests/functional/test_mem_addr_space.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Check for crash when using memory beyond the available guest processor # address space. # @@ -8,7 +10,7 @@ # # SPDX-License-Identifier: GPL-2.0-or-later =20 -from avocado_qemu import QemuSystemTest +from qemu_test import QemuSystemTest import time =20 class MemAddrCheck(QemuSystemTest): @@ -22,9 +24,6 @@ class MemAddrCheck(QemuSystemTest): # for all 32-bit cases, pci64_hole_size is 0. def test_phybits_low_pse36(self): """ - :avocado: tags=3Dmachine:q35 - :avocado: tags=3Darch:x86_64 - With pse36 feature ON, a processor has 36 bits of addressing. So i= t can access up to a maximum of 64GiB of memory. Memory hotplug region b= egins at 4 GiB boundary when "above_4g_mem_size" is 0 (this would be tru= e when @@ -52,9 +51,6 @@ def test_phybits_low_pse36(self): =20 def test_phybits_low_pae(self): """ - :avocado: tags=3Dmachine:q35 - :avocado: tags=3Darch:x86_64 - With pae feature ON, a processor has 36 bits of addressing. So it = can access up to a maximum of 64GiB of memory. Rest is the same as the= case with pse36 above. @@ -72,9 +68,6 @@ def test_phybits_low_pae(self): =20 def test_phybits_ok_pentium_pse36(self): """ - :avocado: tags=3Dmachine:q35 - :avocado: tags=3Darch:x86_64 - Setting maxmem to 59.5G and making sure that QEMU can start with t= he same options as the failing case above with pse36 cpu feature. """ @@ -91,9 +84,6 @@ def test_phybits_ok_pentium_pse36(self): =20 def test_phybits_ok_pentium_pae(self): """ - :avocado: tags=3Dmachine:q35 - :avocado: tags=3Darch:x86_64 - Test is same as above but now with pae cpu feature turned on. Setting maxmem to 59.5G and making sure that QEMU can start fine with the same options as the case above. @@ -111,9 +101,6 @@ def test_phybits_ok_pentium_pae(self): =20 def test_phybits_ok_pentium2(self): """ - :avocado: tags=3Dmachine:q35 - :avocado: tags=3Darch:x86_64 - Pentium2 has 36 bits of addressing, so its same as pentium with pse36 ON. """ @@ -130,9 +117,6 @@ def test_phybits_ok_pentium2(self): =20 def test_phybits_low_nonpse36(self): """ - :avocado: tags=3Dmachine:q35 - :avocado: tags=3Darch:x86_64 - Pentium processor has 32 bits of addressing without pse36 or pae so it can access physical address up to 4 GiB. Setting maxmem to 4 GiB should make QEMU fail to start with "phys-bits too low" @@ -153,9 +137,6 @@ def test_phybits_low_nonpse36(self): # now lets test some 64-bit CPU cases. def test_phybits_low_tcg_q35_70_amd(self): """ - :avocado: tags=3Dmachine:q35 - :avocado: tags=3Darch:x86_64 - For q35 7.1 machines and above, there is a HT window that starts at 1024 GiB and ends at 1 TiB - 1. If the max GPA falls in this range, "above_4G" memory is adjusted to start at 1 TiB boundary for AMD c= pus @@ -182,9 +163,6 @@ def test_phybits_low_tcg_q35_70_amd(self): =20 def test_phybits_low_tcg_q35_71_amd(self): """ - :avocado: tags=3Dmachine:q35 - :avocado: tags=3Darch:x86_64 - AMD_HT_START is defined to be at 1012 GiB. So for q35 machines version > 7.0 and AMD cpus, instead of 1024 GiB limit for 40 bit processor address space, it has to be 1012 GiB , that is 12 GiB @@ -205,9 +183,6 @@ def test_phybits_low_tcg_q35_71_amd(self): =20 def test_phybits_ok_tcg_q35_70_amd(self): """ - :avocado: tags=3Dmachine:q35 - :avocado: tags=3Darch:x86_64 - Same as q35-7.0 AMD case except that here we check that QEMU can successfully start when maxmem is < 988G. """ @@ -224,9 +199,6 @@ def test_phybits_ok_tcg_q35_70_amd(self): =20 def test_phybits_ok_tcg_q35_71_amd(self): """ - :avocado: tags=3Dmachine:q35 - :avocado: tags=3Darch:x86_64 - Same as q35-7.1 AMD case except that here we check that QEMU can successfully start when maxmem is < 976G. """ @@ -243,9 +215,6 @@ def test_phybits_ok_tcg_q35_71_amd(self): =20 def test_phybits_ok_tcg_q35_71_intel(self): """ - :avocado: tags=3Dmachine:q35 - :avocado: tags=3Darch:x86_64 - Same parameters as test_phybits_low_tcg_q35_71_amd() but use Intel cpu instead. QEMU should start fine in this case as "above_4G" memory starts at 4G. @@ -264,9 +233,6 @@ def test_phybits_ok_tcg_q35_71_intel(self): =20 def test_phybits_low_tcg_q35_71_amd_41bits(self): """ - :avocado: tags=3Dmachine:q35 - :avocado: tags=3Darch:x86_64 - AMD processor with 41 bits. Max cpu hw address =3D 2 TiB. By setting maxram above 1012 GiB - 32 GiB - 4 GiB =3D 976 GiB, we= can force "above_4G" memory to start at 1 TiB for q35-7.1 machines @@ -291,9 +257,6 @@ def test_phybits_low_tcg_q35_71_amd_41bits(self): =20 def test_phybits_ok_tcg_q35_71_amd_41bits(self): """ - :avocado: tags=3Dmachine:q35 - :avocado: tags=3Darch:x86_64 - AMD processor with 41 bits. Max cpu hw address =3D 2 TiB. Same as above but by setting maxram between 976 GiB and 992 Gib, QEMU should start fine. @@ -312,9 +275,6 @@ def test_phybits_ok_tcg_q35_71_amd_41bits(self): =20 def test_phybits_low_tcg_q35_intel_cxl(self): """ - :avocado: tags=3Dmachine:q35 - :avocado: tags=3Darch:x86_64 - cxl memory window starts after memory device range. Here, we use 1= GiB of cxl window memory. 4G_mem end aligns at 4G. pci64_hole is 32 Gi= B and starts after the cxl memory window. @@ -335,9 +295,6 @@ def test_phybits_low_tcg_q35_intel_cxl(self): =20 def test_phybits_ok_tcg_q35_intel_cxl(self): """ - :avocado: tags=3Dmachine:q35 - :avocado: tags=3Darch:x86_64 - Same as above but here we do not reserve any cxl memory window. He= nce, with the exact same parameters as above, QEMU should start fine ev= en with cxl enabled. @@ -352,3 +309,6 @@ def test_phybits_ok_tcg_q35_intel_cxl(self): time.sleep(self.DELAY_Q35_BOOT_SEQUENCE) self.vm.shutdown() self.assertNotRegex(self.vm.get_log(), r'phys-bits too low') + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() diff --git a/tests/avocado/pc_cpu_hotplug_props.py b/tests/functional/test_= pc_cpu_hotplug_props.py old mode 100644 new mode 100755 similarity index 90% rename from tests/avocado/pc_cpu_hotplug_props.py rename to tests/functional/test_pc_cpu_hotplug_props.py index 4bd3e02665..9d5a37cb17 --- a/tests/avocado/pc_cpu_hotplug_props.py +++ b/tests/functional/test_pc_cpu_hotplug_props.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 # # Ensure CPU die-id can be omitted on -device # @@ -20,16 +21,16 @@ # License along with this library; if not, see . # =20 -from avocado_qemu import QemuSystemTest +from qemu_test import QemuSystemTest =20 class OmittedCPUProps(QemuSystemTest): - """ - :avocado: tags=3Darch:x86_64 - :avocado: tags=3Dcpu:qemu64 - """ + def test_no_die_id(self): self.vm.add_args('-nodefaults', '-S') self.vm.add_args('-smp', '1,sockets=3D2,cores=3D2,threads=3D2,maxc= pus=3D8') self.vm.add_args('-device', 'qemu64-x86_64-cpu,socket-id=3D1,core-= id=3D0,thread-id=3D0') self.vm.launch() self.assertEqual(len(self.vm.cmd('query-cpus-fast')), 2) + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() diff --git a/tests/avocado/virtio_version.py b/tests/functional/test_virtio= _version.py old mode 100644 new mode 100755 similarity index 98% rename from tests/avocado/virtio_version.py rename to tests/functional/test_virtio_version.py index afe5e828b5..eb23060564 --- a/tests/avocado/virtio_version.py +++ b/tests/functional/test_virtio_version.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 """ Check compatibility of virtio device types """ @@ -12,7 +13,7 @@ import os =20 from qemu.machine import QEMUMachine -from avocado_qemu import QemuSystemTest +from qemu_test import QemuSystemTest =20 # Virtio Device IDs: VIRTIO_NET =3D 1 @@ -60,8 +61,6 @@ class VirtioVersionCheck(QemuSystemTest): Check if virtio-version-specific device types result in the same device tree created by `disable-modern` and `disable-legacy`. - - :avocado: tags=3Darch:x86_64 """ =20 # just in case there are failures, show larger diff: @@ -173,3 +172,6 @@ def test_modern_only_devs(self): self.check_modern_only('virtio-mouse-pci', VIRTIO_INPUT) self.check_modern_only('virtio-tablet-pci', VIRTIO_INPUT) self.check_modern_only('virtio-keyboard-pci', VIRTIO_INPUT) + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843808; cv=none; d=zohomail.com; s=zohoarc; b=Evy8ezWw2hD0JGGTGNYlwmrJXvGiMi6ijeY4Z4CIe76mxbQbTs48g47tY0JXmPXv/JMHn3dMff9a90zt/IulZUVchyarFhugyL/uRtrLZHzzafw09uEBgV+AeZWn2KQTXNSONgCjxY+He2gwV760aPngTf7ysyAAhDC4sArpKn8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843808; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=adcy77QGexpN5Xn573j6Zi6GtFnqRLSJs4vRgceZwJs=; b=Elsh3604z3BPicJSyarbXm9V0sueFNsi4ZxtuG3gRrRiZW3hHE7JhuFZ5xREtBLYAadleYOjLTQhsW20wytwzLDzuqkCBHvlGVF28DdBw74UMqSPs75AdQ7MYYhAIvMS97MgFVot1Tence6EQkxBZYIsi4lrO37ipHXqSmfbPGM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721843808444925.6699416866261; Wed, 24 Jul 2024 10:56:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgBI-00024z-Vp; Wed, 24 Jul 2024 13:53:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgBH-000206-Fj for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:53:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgBF-0005ls-0L for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:53:39 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-250-QZCadcXuM32fAmFC0aJ85A-1; Wed, 24 Jul 2024 13:53:33 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 487AF1955D4D; Wed, 24 Jul 2024 17:53:29 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 24DA01955D45; Wed, 24 Jul 2024 17:53:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843616; 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=adcy77QGexpN5Xn573j6Zi6GtFnqRLSJs4vRgceZwJs=; b=QPnyY1x1Ju1otd/VORgJ6Wx8sVLpCkflJqckZpG8eEM+RE4VjuF0QwX5gPNsOTJd0BABHh sMfa8PPrkMSwjBQOmvMPkWwf2X8N6ickMhmMtKaORNCS9Zvb3A9V4CNWE1FdcwCHcE3p32 RzdeqVwl1Agf7VpAGg4rMAdFYvZyoe8= X-MC-Unique: QZCadcXuM32fAmFC0aJ85A-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 06/23] tests/functional: Convert avocado tests that just need a small adjustment Date: Wed, 24 Jul 2024 19:52:24 +0200 Message-ID: <20240724175248.1389201-7-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843810563116600 These simple tests can be converted to stand-alone tests quite easily, e.g. by just setting the machine to 'none' now manually or by adding "-cpu" command line parameters, since we don't support the corresponding avocado tags in the new python test framework. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- tests/functional/meson.build | 6 ++ .../test_info_usernet.py} | 11 ++- .../test_ppc_74xx.py} | 74 ++++++++----------- .../version.py =3D> functional/test_version.py} | 13 ++-- 4 files changed, 53 insertions(+), 51 deletions(-) rename tests/{avocado/info_usernet.py =3D> functional/test_info_usernet.py= } (87%) mode change 100644 =3D> 100755 rename tests/{avocado/ppc_74xx.py =3D> functional/test_ppc_74xx.py} (74%) mode change 100644 =3D> 100755 rename tests/{avocado/version.py =3D> functional/test_version.py} (78%) mode change 100644 =3D> 100755 diff --git a/tests/functional/meson.build b/tests/functional/meson.build index a8cc0e6330..8a8fa0ab99 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -15,6 +15,12 @@ test_timeouts =3D { =20 tests_generic =3D [ 'empty_cpu_model', + 'info_usernet', + 'version', +] + +tests_ppc_quick =3D [ + 'ppc_74xx', ] =20 tests_x86_64_quick =3D [ diff --git a/tests/avocado/info_usernet.py b/tests/functional/test_info_use= rnet.py old mode 100644 new mode 100755 similarity index 87% rename from tests/avocado/info_usernet.py rename to tests/functional/test_info_usernet.py index e1aa7a6e0a..ded973253a --- a/tests/avocado/info_usernet.py +++ b/tests/functional/test_info_usernet.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Test for the hmp command "info usernet" # # Copyright (c) 2021 Red Hat, Inc. @@ -8,18 +10,16 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. =20 -from avocado_qemu import QemuSystemTest +from qemu_test import QemuSystemTest =20 from qemu.utils import get_info_usernet_hostfwd_port =20 =20 class InfoUsernet(QemuSystemTest): - """ - :avocado: tags=3Dmachine:none - """ =20 def test_hostfwd(self): self.require_netdev('user') + self.machine =3D 'none' self.vm.add_args('-netdev', 'user,id=3Dvnet,hostfwd=3D:127.0.0.1:0= -:22') self.vm.launch() res =3D self.vm.cmd('human-monitor-command', @@ -31,3 +31,6 @@ def test_hostfwd(self): self.assertGreater(port, 0, ('Found a redirected port that is not greater t= han' ' zero')) + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() diff --git a/tests/avocado/ppc_74xx.py b/tests/functional/test_ppc_74xx.py old mode 100644 new mode 100755 similarity index 74% rename from tests/avocado/ppc_74xx.py rename to tests/functional/test_ppc_74xx.py index f54757c243..5386016f26 --- a/tests/avocado/ppc_74xx.py +++ b/tests/functional/test_ppc_74xx.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Smoke tests for 74xx cpus (aka G4). # # Copyright (c) 2021, IBM Corp. @@ -5,132 +7,120 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. =20 -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern =20 class ppc74xxCpu(QemuSystemTest): - """ - :avocado: tags=3Darch:ppc - :avocado: tags=3Daccel:tcg - """ + timeout =3D 5 =20 def test_ppc_7400(self): - """ - :avocado: tags=3Dcpu:7400 - """ self.require_accelerator("tcg") + self.set_machine('g3beige') self.vm.set_console() + self.vm.add_args('-cpu', '7400') self.vm.launch() wait_for_console_pattern(self, '>> OpenBIOS') wait_for_console_pattern(self, '>> CPU type PowerPC,G4') =20 def test_ppc_7410(self): - """ - :avocado: tags=3Dcpu:7410 - """ self.require_accelerator("tcg") + self.set_machine('g3beige') self.vm.set_console() + self.vm.add_args('-cpu', '7410') self.vm.launch() wait_for_console_pattern(self, '>> OpenBIOS') wait_for_console_pattern(self, '>> CPU type PowerPC,74xx') =20 def test_ppc_7441(self): - """ - :avocado: tags=3Dcpu:7441 - """ self.require_accelerator("tcg") + self.set_machine('g3beige') self.vm.set_console() + self.vm.add_args('-cpu', '7441') self.vm.launch() wait_for_console_pattern(self, '>> OpenBIOS') wait_for_console_pattern(self, '>> CPU type PowerPC,G4') =20 def test_ppc_7445(self): - """ - :avocado: tags=3Dcpu:7445 - """ self.require_accelerator("tcg") + self.set_machine('g3beige') self.vm.set_console() + self.vm.add_args('-cpu', '7445') self.vm.launch() wait_for_console_pattern(self, '>> OpenBIOS') wait_for_console_pattern(self, '>> CPU type PowerPC,G4') =20 def test_ppc_7447(self): - """ - :avocado: tags=3Dcpu:7447 - """ self.require_accelerator("tcg") + self.set_machine('g3beige') self.vm.set_console() + self.vm.add_args('-cpu', '7447') self.vm.launch() wait_for_console_pattern(self, '>> OpenBIOS') wait_for_console_pattern(self, '>> CPU type PowerPC,G4') =20 def test_ppc_7447a(self): - """ - :avocado: tags=3Dcpu:7447a - """ self.require_accelerator("tcg") + self.set_machine('g3beige') self.vm.set_console() + self.vm.add_args('-cpu', '7447a') self.vm.launch() wait_for_console_pattern(self, '>> OpenBIOS') wait_for_console_pattern(self, '>> CPU type PowerPC,G4') =20 def test_ppc_7448(self): - """ - :avocado: tags=3Dcpu:7448 - """ self.require_accelerator("tcg") + self.set_machine('g3beige') self.vm.set_console() + self.vm.add_args('-cpu', '7448') self.vm.launch() wait_for_console_pattern(self, '>> OpenBIOS') wait_for_console_pattern(self, '>> CPU type PowerPC,MPC86xx') =20 def test_ppc_7450(self): - """ - :avocado: tags=3Dcpu:7450 - """ self.require_accelerator("tcg") + self.set_machine('g3beige') self.vm.set_console() + self.vm.add_args('-cpu', '7450') self.vm.launch() wait_for_console_pattern(self, '>> OpenBIOS') wait_for_console_pattern(self, '>> CPU type PowerPC,G4') =20 def test_ppc_7451(self): - """ - :avocado: tags=3Dcpu:7451 - """ self.require_accelerator("tcg") + self.set_machine('g3beige') self.vm.set_console() + self.vm.add_args('-cpu', '7451') self.vm.launch() wait_for_console_pattern(self, '>> OpenBIOS') wait_for_console_pattern(self, '>> CPU type PowerPC,G4') =20 def test_ppc_7455(self): - """ - :avocado: tags=3Dcpu:7455 - """ self.require_accelerator("tcg") + self.set_machine('g3beige') self.vm.set_console() + self.vm.add_args('-cpu', '7455') self.vm.launch() wait_for_console_pattern(self, '>> OpenBIOS') wait_for_console_pattern(self, '>> CPU type PowerPC,G4') =20 def test_ppc_7457(self): - """ - :avocado: tags=3Dcpu:7457 - """ self.require_accelerator("tcg") + self.set_machine('g3beige') self.vm.set_console() + self.vm.add_args('-cpu', '7457') self.vm.launch() wait_for_console_pattern(self, '>> OpenBIOS') wait_for_console_pattern(self, '>> CPU type PowerPC,G4') =20 def test_ppc_7457a(self): - """ - :avocado: tags=3Dcpu:7457a - """ self.require_accelerator("tcg") + self.set_machine('g3beige') self.vm.set_console() + self.vm.add_args('-cpu', '7457a') self.vm.launch() wait_for_console_pattern(self, '>> OpenBIOS') wait_for_console_pattern(self, '>> CPU type PowerPC,G4') + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() diff --git a/tests/avocado/version.py b/tests/functional/test_version.py old mode 100644 new mode 100755 similarity index 78% rename from tests/avocado/version.py rename to tests/functional/test_version.py index c6139568a1..5e566d76b1 --- a/tests/avocado/version.py +++ b/tests/functional/test_version.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Version check example test # # Copyright (c) 2018 Red Hat, Inc. @@ -9,17 +11,18 @@ # later. See the COPYING file in the top-level directory. =20 =20 -from avocado_qemu import QemuSystemTest +from qemu_test import QemuSystemTest =20 =20 class Version(QemuSystemTest): - """ - :avocado: tags=3Dquick - :avocado: tags=3Dmachine:none - """ + def test_qmp_human_info_version(self): + self.machine =3D 'none' self.vm.add_args('-nodefaults') self.vm.launch() res =3D self.vm.cmd('human-monitor-command', command_line=3D'info version') self.assertRegex(res, r'^(\d+\.\d+\.\d)') + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843698; cv=none; d=zohomail.com; s=zohoarc; b=OJtK8BnbLylMR2rmN/SR29TbVThNxLmBqeUYbRJ3j/T6u3gawmoXASzqwBRN+IjjfDsNVaE1KqhlF80XbVrBKzHDH9YQRMnS4Rsu8yjquTBrmnYmpdaAh0MjU4ODG7EEJWxfsM6gyzFNMfUS1ONZm7Xc/MZ3pFDt5CszJfuEivE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843698; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4uh5HIE7LxeUMRDV8ia87pDEPYeNXwYlljr6cCuptJo=; b=R+dvkstl7Rvjy/xcwjUhwvu+hoW2X9Tb1nl4Zrc2wV4/lxScQgvgEV2vt9DGccFGO+AQzStsoS4p7o5Gjg5zJOmyjMx7cWaLKb3tUtB2xCxybQw8M9rFHaivXiSgWNml15MOfFrAuibKHTUMOwwDTov/Vyflcv9Q/1PBWB6BYpU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721843698601774.6956575726209; Wed, 24 Jul 2024 10:54:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgBL-0002DT-6i; Wed, 24 Jul 2024 13:53:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgBJ-00025m-3b for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:53:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgBH-0005pY-3k for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:53:40 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-641-Uh7lMIMxMGyQ8M0M7-JUsQ-1; Wed, 24 Jul 2024 13:53:35 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BDE631955F66; Wed, 24 Jul 2024 17:53:33 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CE8241955D48; Wed, 24 Jul 2024 17:53:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843618; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4uh5HIE7LxeUMRDV8ia87pDEPYeNXwYlljr6cCuptJo=; b=Ky49JwjvN3knT5ZaGGvf/7NaiXZYxqL43THmiZjUQKC1kuS/ZcOXM7lZFkgTycXra1Pp8g sLLCCYOhUYuE2BIGKvFxOKVMBd288GmIYKl3tzGSas19PweF0inrd+TreZFPWn6UnifFZM QhH2H0R2wW/f19P6CNPygFptd5jnwBw= X-MC-Unique: Uh7lMIMxMGyQ8M0M7-JUsQ-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 07/23] tests/functional: Implement fetch_asset() method for downloading assets Date: Wed, 24 Jul 2024 19:52:25 +0200 Message-ID: <20240724175248.1389201-8-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843700106116600 Content-Type: text/plain; charset="utf-8" In the new python test framework, we cannot use the fetch_asset() function from Avocado anymore, so we have to provide our own implementation now instead. Thus add such a function based on the urllib python module for this purpose. Signed-off-by: Thomas Huth --- tests/functional/qemu_test/__init__.py | 41 ++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/functional/qemu_test/__init__.py b/tests/functional/qemu= _test/__init__.py index fc98222c52..40a81c3927 100644 --- a/tests/functional/qemu_test/__init__.py +++ b/tests/functional/qemu_test/__init__.py @@ -11,6 +11,8 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. =20 +import hashlib +import urllib.request import logging import os import pycotap @@ -23,6 +25,7 @@ import unittest =20 from pathlib import Path +from shutil import copyfileobj from qemu.machine import QEMUMachine from qemu.utils import kvm_available, tcg_available =20 @@ -216,6 +219,44 @@ def setUp(self, bin_prefix): if not os.path.exists(self.workdir): os.makedirs(self.workdir) =20 + def check_hash(self, file_name, expected_hash): + if not expected_hash: + return True + if len(expected_hash) =3D=3D 40: + sum_prog =3D 'sha1sum' + elif len(expected_hash) =3D=3D 64: + sum_prog =3D 'sha256sum' + elif len(expected_hash) =3D=3D 128: + sum_prog =3D 'sha512sum' + else: + raise Exception("unknown hash type") + checksum =3D subprocess.check_output([sum_prog, file_name]).split(= )[0] + return expected_hash =3D=3D checksum.decode("utf-8") + + def fetch_asset(self, url, asset_hash): + cache_dir =3D os.path.expanduser("~/.cache/qemu/download") + if not os.path.exists(cache_dir): + os.makedirs(cache_dir) + fname =3D os.path.join(cache_dir, + hashlib.sha256(url.encode("utf-8")).hexdigest= ()) + if os.path.exists(fname) and self.check_hash(fname, asset_hash): + self.log.debug("Using cached assed %s for %s", fname, url) + return fname + self.log.info("Downloading %s to %s...", url, fname) + dl_fname =3D fname + ".download" + with urllib.request.urlopen(url) as src: + try: + with open(dl_fname, "wb+") as dst: + copyfileobj(src, dst) + except: + os.remove(dl_fname) + raise + if not self.check_hash(dl_fname, asset_hash): + os.remove(dl_fname) + raise Exception("Hash of " + url + " does not match") + os.rename(dl_fname, fname) + return fname + def main(): tr =3D pycotap.TAPTestRunner(message_log =3D pycotap.LogMode.LogTo= Error, test_output_log =3D pycotap.LogMode.Log= ToError) --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843714; cv=none; d=zohomail.com; s=zohoarc; b=O0MSr5Twcs8t3/6j6zzMbMi+/aUez6nRnjiNKbie1OiQXjldk01noAbJtllDedfU/twpqxceizU1LJxx9HXcnXbpyovkzX2g5Cwmd4aE1ZW98T2aI+6rRN/eMYpuRavy9sc4R0/YSHl3FFY7HQQKF0TF2Ih5QKjzZV+9QCUrhfc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843714; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=17UMQK5kf3N6bpcwBCqkiO/abnN+i7/ZXXlyCB1AGEQ=; b=Xi8MaT1q94kvkQOkm7Pomy4g6tSbcC+jUi7PCuBfjafbA95jfh7egiu6ET+N0aBTq3GUH3fdtyeK1NRM/RhYV37+mUJ6q40pBcGkEw9CvaCCDzYt5N2UgJR4ri4W8aHJzuWxshtPzatnvks/DcvblrN0XwdGCnbA3Ebd2ZKRf4o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 172184371457522.908915297262297; Wed, 24 Jul 2024 10:55:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgBh-0003G6-KL; Wed, 24 Jul 2024 13:54:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgBS-0002gL-8i for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:53:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgBP-0005qn-QF for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:53:49 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-307-fMhF-bhCPPOqhTlkCIFsqw-1; Wed, 24 Jul 2024 13:53:41 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 258D81956095; Wed, 24 Jul 2024 17:53:39 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 39C3F1955D42; Wed, 24 Jul 2024 17:53:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843627; 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=17UMQK5kf3N6bpcwBCqkiO/abnN+i7/ZXXlyCB1AGEQ=; b=gyp/A3j8PT9IKO2AqbdjfH9Ht2wqWxWtaoqSsDzjBJ9t/EyvRmRwLdPLHTuNUtChUnfZbi a91+FIzZbR1tf80Ty/HDCSPx4mQmVGl7KSKRvJUILVrteDLCpDQDSQtNLXl9QtxndtlECw BEdLpUe1lyTbcX1ynWTdD6nRf/8FLrs= X-MC-Unique: fMhF-bhCPPOqhTlkCIFsqw-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 08/23] tests/functional: Convert some tests that download files via fetch_asset() Date: Wed, 24 Jul 2024 19:52:26 +0200 Message-ID: <20240724175248.1389201-9-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843716312116600 Now that we've got a working fetch_asset() function, we can convert some Avocado tests that use this function for downloading their required files. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- MAINTAINERS | 12 +++---- tests/functional/meson.build | 22 +++++++++++++ .../test_arm_n8x0.py} | 25 +++++++-------- .../test_avr_mega2560.py} | 11 ++++--- .../test_loongarch64_virt.py} | 16 ++++++---- .../test_mips64el_loongson3v.py} | 26 +++++++-------- .../test_netdev_ethtool.py} | 32 ++++++------------- .../ppc_405.py =3D> functional/test_ppc_405.py} | 19 ++++++----- 8 files changed, 86 insertions(+), 77 deletions(-) rename tests/{avocado/machine_arm_n8x0.py =3D> functional/test_arm_n8x0.py= } (71%) mode change 100644 =3D> 100755 rename tests/{avocado/machine_avr6.py =3D> functional/test_avr_mega2560.py= } (90%) mode change 100644 =3D> 100755 rename tests/{avocado/machine_loongarch.py =3D> functional/test_loongarch6= 4_virt.py} (89%) mode change 100644 =3D> 100755 rename tests/{avocado/machine_mips_loongson3v.py =3D> functional/test_mips= 64el_loongson3v.py} (55%) mode change 100644 =3D> 100755 rename tests/{avocado/netdev-ethtool.py =3D> functional/test_netdev_ethtoo= l.py} (81%) mode change 100644 =3D> 100755 rename tests/{avocado/ppc_405.py =3D> functional/test_ppc_405.py} (73%) mode change 100644 =3D> 100755 diff --git a/MAINTAINERS b/MAINTAINERS index dd01288992..d69de11cfc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -222,7 +222,7 @@ S: Maintained F: docs/system/target-avr.rst F: gdb-xml/avr-cpu.xml F: target/avr/ -F: tests/avocado/machine_avr6.py +F: tests/functional/test_avr_mega2560.py =20 CRIS TCG CPUs M: Edgar E. Iglesias @@ -265,7 +265,7 @@ M: Song Gao S: Maintained F: target/loongarch/ F: tests/tcg/loongarch64/ -F: tests/avocado/machine_loongarch.py +F: tests/functional/test_loongarch64_virt.py =20 M68K TCG CPUs M: Laurent Vivier @@ -884,7 +884,7 @@ F: include/hw/display/blizzard.h F: include/hw/input/lm832x.h F: include/hw/input/tsc2xxx.h F: include/hw/misc/cbus.h -F: tests/avocado/machine_arm_n8x0.py +F: tests/functional/test_arm_n8x0.py F: docs/system/arm/nseries.rst =20 Palm @@ -1393,7 +1393,7 @@ F: hw/mips/loongson3_bootp.h F: hw/mips/loongson3_virt.c F: include/hw/intc/loongson_ipi.h F: include/hw/intc/loongson_liointc.h -F: tests/avocado/machine_mips_loongson3v.py +F: tests/functional/test_mips64el_loongson3v.py =20 Boston M: Paul Burton @@ -1419,7 +1419,7 @@ PowerPC Machines L: qemu-ppc@nongnu.org S: Orphan F: hw/ppc/ppc405* -F: tests/avocado/ppc_405.py +F: tests/functional/test_ppc_405.py =20 Bamboo L: qemu-ppc@nongnu.org @@ -2486,7 +2486,7 @@ R: Sriram Yagnaraman S: Maintained F: docs/system/devices/igb.rst F: hw/net/igb* -F: tests/avocado/netdev-ethtool.py +F: tests/functional/test_netdev_ethtool.py F: tests/qtest/igb-test.c F: tests/qtest/libqos/igb.c =20 diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 8a8fa0ab99..7eb5dbfe31 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -11,6 +11,7 @@ endif =20 # Timeouts for individual tests that can be slow e.g. with debugging enabl= ed test_timeouts =3D { + 'netdev_ethtool' : 180, } =20 tests_generic =3D [ @@ -19,10 +20,30 @@ tests_generic =3D [ 'version', ] =20 +tests_arm_thorough =3D [ + 'arm_n8x0', +] + +tests_avr_thorough =3D [ + 'avr_mega2560', +] + +tests_loongarch64_thorough =3D [ + 'loongarch64_virt', +] + +tests_mips64el_thorough =3D [ + 'mips64el_loongson3v', +] + tests_ppc_quick =3D [ 'ppc_74xx', ] =20 +tests_ppc_thorough =3D [ + 'ppc_405', +] + tests_x86_64_quick =3D [ 'cpu_queries', 'mem_addr_space', @@ -31,6 +52,7 @@ tests_x86_64_quick =3D [ ] =20 tests_x86_64_thorough =3D [ + 'netdev_ethtool', ] =20 foreach speed : ['quick', 'thorough'] diff --git a/tests/avocado/machine_arm_n8x0.py b/tests/functional/test_arm_= n8x0.py old mode 100644 new mode 100755 similarity index 71% rename from tests/avocado/machine_arm_n8x0.py rename to tests/functional/test_arm_n8x0.py index 12e9a6803b..d451c80a73 --- a/tests/avocado/machine_arm_n8x0.py +++ b/tests/functional/test_arm_n8x0.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Functional test that boots a Linux kernel and checks the console # # Copyright (c) 2020 Red Hat, Inc. @@ -10,9 +12,9 @@ =20 import os =20 -from avocado import skipUnless -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern +from unittest import skipUnless +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern =20 class N8x0Machine(QemuSystemTest): """Boots the Linux kernel and checks that the console is operational""" @@ -32,18 +34,15 @@ def __do_test_n8x0(self): self.vm.launch() wait_for_console_pattern(self, 'TSC2005 driver initializing') =20 - @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code= ') + @skipUnless(os.getenv('QEMU_TEST_ALLOW_UNTRUSTED_CODE'), 'untrusted co= de') def test_n800(self): - """ - :avocado: tags=3Darch:arm - :avocado: tags=3Dmachine:n800 - """ + self.set_machine('n800') self.__do_test_n8x0() =20 - @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code= ') + @skipUnless(os.getenv('QEMU_TEST_ALLOW_UNTRUSTED_CODE'), 'untrusted co= de') def test_n810(self): - """ - :avocado: tags=3Darch:arm - :avocado: tags=3Dmachine:n810 - """ + self.set_machine('n810') self.__do_test_n8x0() + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() diff --git a/tests/avocado/machine_avr6.py b/tests/functional/test_avr_mega= 2560.py old mode 100644 new mode 100755 similarity index 90% rename from tests/avocado/machine_avr6.py rename to tests/functional/test_avr_mega2560.py index 5485db79c6..b9b89367c6 --- a/tests/avocado/machine_avr6.py +++ b/tests/functional/test_avr_mega2560.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 # # QEMU AVR integration tests # @@ -19,16 +20,12 @@ =20 import time =20 -from avocado_qemu import QemuSystemTest +from qemu_test import QemuSystemTest =20 class AVR6Machine(QemuSystemTest): timeout =3D 5 =20 def test_freertos(self): - """ - :avocado: tags=3Darch:avr - :avocado: tags=3Dmachine:arduino-mega-2560-v3 - """ """ https://github.com/seharris/qemu-avr-tests/raw/master/free-rtos/De= mo/AVR_ATMega2560_GCC/demo.elf constantly prints out 'ABCDEFGHIJKLMNOPQRSTUVWXABCDEFGHIJKLMNOPQRS= TUVWX' @@ -39,6 +36,7 @@ def test_freertos(self): rom_hash =3D '7eb521f511ca8f2622e0a3c5e8dd686efbb911d4' rom_path =3D self.fetch_asset(rom_url, asset_hash=3Drom_hash) =20 + self.set_machine('arduino-mega-2560-v3') self.vm.add_args('-bios', rom_path) self.vm.add_args('-nographic') self.vm.launch() @@ -48,3 +46,6 @@ def test_freertos(self): =20 self.assertIn('ABCDEFGHIJKLMNOPQRSTUVWXABCDEFGHIJKLMNOPQRSTUVWX', self.vm.get_log()) + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() diff --git a/tests/avocado/machine_loongarch.py b/tests/functional/test_loo= ngarch64_virt.py old mode 100644 new mode 100755 similarity index 89% rename from tests/avocado/machine_loongarch.py rename to tests/functional/test_loongarch64_virt.py index 8de308f2d6..3dc8bb3516 --- a/tests/avocado/machine_loongarch.py +++ b/tests/functional/test_loongarch64_virt.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # SPDX-License-Identifier: GPL-2.0-or-later # # LoongArch virt test. @@ -5,9 +7,9 @@ # Copyright (c) 2023 Loongson Technology Corporation Limited # =20 -from avocado_qemu import QemuSystemTest -from avocado_qemu import exec_command_and_wait_for_pattern -from avocado_qemu import wait_for_console_pattern +from qemu_test import QemuSystemTest +from qemu_test import exec_command_and_wait_for_pattern +from qemu_test import wait_for_console_pattern =20 class LoongArchMachine(QemuSystemTest): KERNEL_COMMON_COMMAND_LINE =3D 'printk.time=3D0 ' @@ -21,10 +23,7 @@ def wait_for_console_pattern(self, success_message, vm= =3DNone): =20 def test_loongarch64_devices(self): =20 - """ - :avocado: tags=3Darch:loongarch64 - :avocado: tags=3Dmachine:virt - """ + self.set_machine('virt') =20 kernel_url =3D ('https://github.com/yangxiaojuan-loongson/qemu-bin= ary/' 'releases/download/2024-05-30/vmlinuz.efi') @@ -56,3 +55,6 @@ def test_loongarch64_devices(self): self.wait_for_console_pattern('Run /sbin/init as init process') exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', 'processor : 3') + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() diff --git a/tests/avocado/machine_mips_loongson3v.py b/tests/functional/te= st_mips64el_loongson3v.py old mode 100644 new mode 100755 similarity index 55% rename from tests/avocado/machine_mips_loongson3v.py rename to tests/functional/test_mips64el_loongson3v.py index 5194cf18c9..f8d40b48a9 --- a/tests/avocado/machine_mips_loongson3v.py +++ b/tests/functional/test_mips64el_loongson3v.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Functional tests for the Generic Loongson-3 Platform. # # Copyright (c) 2021 Jiaxun Yang @@ -10,30 +12,26 @@ import os import time =20 -from avocado import skipUnless -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern +from unittest import skipUnless +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern =20 class MipsLoongson3v(QemuSystemTest): timeout =3D 60 =20 - @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code= ') + @skipUnless(os.getenv('QEMU_TEST_ALLOW_UNTRUSTED_CODE'), 'untrusted co= de') def test_pmon_serial_console(self): - """ - :avocado: tags=3Darch:mips64el - :avocado: tags=3Dendian:little - :avocado: tags=3Dmachine:loongson3-virt - :avocado: tags=3Dcpu:Loongson-3A1000 - :avocado: tags=3Ddevice:liointc - :avocado: tags=3Ddevice:goldfish_rtc - """ + self.set_machine('loongson3-virt') =20 - pmon_hash =3D '7c8b45dd81ccfc55ff28f5aa267a41c3' + pmon_hash =3D 'fcdf6bb2cb7885a4a62f31fcb0d5e368bac7b6cea28f40c6dfa= 678af22fea20a' pmon_path =3D self.fetch_asset('https://github.com/loongson-commun= ity/pmon/' 'releases/download/20210112/pmon-3avir= t.bin', - asset_hash=3Dpmon_hash, algorithm=3D'= md5') + asset_hash=3Dpmon_hash) =20 self.vm.set_console() self.vm.add_args('-bios', pmon_path) self.vm.launch() wait_for_console_pattern(self, 'CPU GODSON3 BogoMIPS:') + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() diff --git a/tests/avocado/netdev-ethtool.py b/tests/functional/test_netdev= _ethtool.py old mode 100644 new mode 100755 similarity index 81% rename from tests/avocado/netdev-ethtool.py rename to tests/functional/test_netdev_ethtool.py index 5f33288f81..341c087e36 --- a/tests/avocado/netdev-ethtool.py +++ b/tests/functional/test_netdev_ethtool.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # ethtool tests for emulated network devices # # This test leverages ethtool's --test sequence to validate network @@ -5,15 +7,11 @@ # # SPDX-License-Identifier: GPL-2.0-or-late =20 -from avocado import skip -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern +from unittest import skip +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern =20 class NetDevEthtool(QemuSystemTest): - """ - :avocado: tags=3Darch:x86_64 - :avocado: tags=3Dmachine:q35 - """ =20 # Runs in about 17s under KVM, 19s under TCG, 25s under GCOV timeout =3D 45 @@ -25,11 +23,10 @@ def get_asset(self, name, sha1): 'kE4nCFLdQcoBF9t/download?' 'path=3D%2Fnetdev-ethtool&files=3D' ) url =3D base_url + name - # use explicit name rather than failing to neatly parse the - # URL into a unique one - return self.fetch_asset(name=3Dname, locations=3D(url), asset_hash= =3Dsha1) + return self.fetch_asset(url, asset_hash=3Dsha1) =20 def common_test_code(self, netdev, extra_args=3DNone): + self.set_machine('q35') =20 # This custom kernel has drivers for all the supported network # devices we can emulate in QEMU @@ -68,15 +65,9 @@ def common_test_code(self, netdev, extra_args=3DNone): self.vm.kill() =20 def test_igb(self): - """ - :avocado: tags=3Ddevice:igb - """ self.common_test_code("igb") =20 def test_igb_nomsi(self): - """ - :avocado: tags=3Ddevice:igb - """ self.common_test_code("igb", "pci=3Dnomsi") =20 # It seems the other popular cards we model in QEMU currently fail @@ -88,14 +79,11 @@ def test_igb_nomsi(self): =20 @skip("Incomplete reg 0x00178 support") def test_e1000(self): - """ - :avocado: tags=3Ddevice:e1000 - """ self.common_test_code("e1000") =20 @skip("Incomplete reg 0x00178 support") def test_i82550(self): - """ - :avocado: tags=3Ddevice:i82550 - """ self.common_test_code("i82550") + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() diff --git a/tests/avocado/ppc_405.py b/tests/functional/test_ppc_405.py old mode 100644 new mode 100755 similarity index 73% rename from tests/avocado/ppc_405.py rename to tests/functional/test_ppc_405.py index 4e7e01aa76..f2368ada80 --- a/tests/avocado/ppc_405.py +++ b/tests/functional/test_ppc_405.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Test that the U-Boot firmware boots on ppc 405 machines and check the co= nsole # # Copyright (c) 2021 Red Hat, Inc. @@ -5,10 +7,9 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. =20 -from avocado.utils import archive -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern -from avocado_qemu import exec_command_and_wait_for_pattern +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern +from qemu_test import exec_command_and_wait_for_pattern =20 class Ppc405Machine(QemuSystemTest): =20 @@ -26,11 +27,9 @@ def do_test_ppc405(self): exec_command_and_wait_for_pattern(self, 'reset', 'AMCC PowerPC 405= EP') =20 def test_ppc_ref405ep(self): - """ - :avocado: tags=3Darch:ppc - :avocado: tags=3Dmachine:ref405ep - :avocado: tags=3Dcpu:405ep - :avocado: tags=3Daccel:tcg - """ self.require_accelerator("tcg") + self.set_machine('ref405ep') self.do_test_ppc405() + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843831; cv=none; d=zohomail.com; s=zohoarc; b=S5XyUWNawHwjGMDjexN1iIvGR6/F3LTQHjEO2H3hfVjLk+7K7MkP+IY0HeVCKZIHpmj90hVP1IsXGXUQL7ZDKRrfVmkyZ5YSHBG2R/OIqOD02GrETyr6uYlPX19yxtW3+TAsEgrGlxE5UnzrpvwgXdFC8oE+zxJkzX4yVHrCuX0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843831; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HQIS8bwTvrgdt8CTSEetRJcLdJDqzV0r8tTh7Jq6yhc=; b=XApSVKOAwyuVYsr4HOUlrl+OeZReAgqSVHFBw1iWfMRDASyFVNWTMvzENCiypM/DZjt5GtUCqIUgheM70EqVkePt/eFV8ME+9Lw/npq5orVnCmczGBb0Cqhj/TQgpbDdLx0QH4Iv45ZwhTUALtN8F2pAlolWkpffIl8btSLa+7E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721843831805293.7553758820379; Wed, 24 Jul 2024 10:57:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgBj-0003Sd-Ko; Wed, 24 Jul 2024 13:54:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgBf-0003He-MS for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgBS-0005rD-UJ for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:53:53 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-437-0-J7FM58O3yOMAc19ul0tg-1; Wed, 24 Jul 2024 13:53:46 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6D6971955D4F; Wed, 24 Jul 2024 17:53:45 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C6EA71955D42; Wed, 24 Jul 2024 17:53:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843630; 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=HQIS8bwTvrgdt8CTSEetRJcLdJDqzV0r8tTh7Jq6yhc=; b=iUotQp8SJf6+xwNhnqr6/eLr84Fl5734edtZMEuVEsKqW94YxXvX3j8on3ZJYsbMdO7xs1 fsbKVtprG24rPycMe+SIEBMudLPeEs371Qr2yTCGPawcIuGrYnk7T25Ew+VIdL3qIyT0Sp ZLP9E3dT2M2dx7XMkDICDKRu0/TscnU= X-MC-Unique: 0-J7FM58O3yOMAc19ul0tg-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 09/23] tests/functional: Add a function for extracting files from an archive Date: Wed, 24 Jul 2024 19:52:27 +0200 Message-ID: <20240724175248.1389201-10-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843832585116600 Some Avocado-based tests use the "archive" module from avocado.utils to extract files from an archive. To be able to use these tests without Avocado, we have to provide our own function for extracting files. Fortunately, there is already the tarfile module that will provide us with this functionality, so let's just add a nice wrapper function around that. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/functional/qemu_test/utils.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/functional/qemu_test/utils.py diff --git a/tests/functional/qemu_test/utils.py b/tests/functional/qemu_te= st/utils.py new file mode 100644 index 0000000000..4eb5e5d5e5 --- /dev/null +++ b/tests/functional/qemu_test/utils.py @@ -0,0 +1,21 @@ +# Utilities for python-based QEMU tests +# +# Copyright 2024 Red Hat, Inc. +# +# Authors: +# Thomas Huth +# +# 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 tarfile + +def archive_extract(archive, dest_dir, member=3DNone): + with tarfile.open(archive) as tf: + if hasattr(tarfile, 'data_filter'): + tf.extraction_filter =3D getattr(tarfile, 'data_filter', + (lambda member, path: member)) + if member: + tf.extract(member=3Dmember, path=3Ddest_dir) + else: + tf.extractall(path=3Ddest_dir) --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843699; cv=none; d=zohomail.com; s=zohoarc; b=Lbt6bh+JAy/oAwJIF4eSrIasom5NPQNqoHexwT666XFYxz1yYJ5qXSPBLo8fk+AJi5dgIdIp6+Z+kMjmEvUbPRCb8zoTcD19i+csJapvVt+QDx0fXb9u8dD9n6Cjv/kjpN/rqstVbGapIXY3pC9I5lSTgwDhH+FaMxjeZS0PCjU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843699; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+XuTW8Ao+XIoScQbRISoTirwp9hBXxJEBT7EwH/L7pw=; b=njqsIZePkTtyj3ck/Ob/8BxHsTqW71vS/k3JJPFnico47EtzNPBzVG9JxQSM74aujtOtrG1tIaKsg5XlmtZTaZJDSVXkqyS67E5txTyJprYVE6xUb9rACRFqKK+zM7ODfJaPf80HcjTTCievL/HmiMRMMoANIFX+9NePCuiSrHk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721843699098157.51868299661328; Wed, 24 Jul 2024 10:54:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgC3-0004sG-B0; Wed, 24 Jul 2024 13:54:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgBk-0003aD-V2 for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgBh-0005s2-6I for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:07 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-2-UH0W75QmOia7Q3CWGrxl7w-1; Wed, 24 Jul 2024 13:53:54 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A2C581955D52; Wed, 24 Jul 2024 17:53:51 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B60531955D42; Wed, 24 Jul 2024 17:53:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843637; 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=+XuTW8Ao+XIoScQbRISoTirwp9hBXxJEBT7EwH/L7pw=; b=L82Zlesl+LM6+MGoY5gwQHdcL5tzzwONKFqgHv11JKZbkzhl1qZmPEdAunCeE2hxd0lzOZ 3yJm++qz2Jn6FGpDKggJamhG0/r/BVgt6U/0hnyKHDo7rnfDEdJCT77iOoGTKOCOjQIk1A o4T1Uo0jx/PonKKlS3SDybhuFcUTTac= X-MC-Unique: UH0W75QmOia7Q3CWGrxl7w-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 10/23] tests/functional: Convert some avocado tests that needed avocado.utils.archive Date: Wed, 24 Jul 2024 19:52:28 +0200 Message-ID: <20240724175248.1389201-11-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843700365116600 Instead of using the "archive" module from avocado.utils, switch these tests to use the new wrapper function that is based on the "tarfile" module instead. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Thomas Huth --- MAINTAINERS | 6 ++--- tests/functional/meson.build | 6 +++++ .../test_arm_canona1100.py} | 21 +++++++++------- .../test_ppc_bamboo.py} | 23 ++++++++--------- .../test_sparc64_sun4u.py} | 25 +++++++++++-------- 5 files changed, 46 insertions(+), 35 deletions(-) rename tests/{avocado/machine_arm_canona1100.py =3D> functional/test_arm_c= anona1100.py} (71%) mode change 100644 =3D> 100755 rename tests/{avocado/ppc_bamboo.py =3D> functional/test_ppc_bamboo.py} (7= 5%) mode change 100644 =3D> 100755 rename tests/{avocado/machine_sparc64_sun4u.py =3D> functional/test_sparc6= 4_sun4u.py} (60%) mode change 100644 =3D> 100755 diff --git a/MAINTAINERS b/MAINTAINERS index d69de11cfc..f107b8eb20 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -731,7 +731,7 @@ S: Odd Fixes F: include/hw/arm/digic.h F: hw/*/digic* F: include/hw/*/digic* -F: tests/avocado/machine_arm_canona1100.py +F: tests/functional/test_arm_canona1100.py F: docs/system/arm/digic.rst =20 Goldfish RTC @@ -1426,7 +1426,7 @@ L: qemu-ppc@nongnu.org S: Orphan F: hw/ppc/ppc440_bamboo.c F: hw/pci-host/ppc4xx_pci.c -F: tests/avocado/ppc_bamboo.py +F: tests/functional/test_ppc_bamboo.py =20 e500 L: qemu-ppc@nongnu.org @@ -1712,7 +1712,7 @@ F: include/hw/pci-host/sabre.h F: hw/pci-bridge/simba.c F: include/hw/pci-bridge/simba.h F: pc-bios/openbios-sparc64 -F: tests/avocado/machine_sparc64_sun4u.py +F: tests/functional/test_sparc64_sun4u.py =20 Sun4v M: Artyom Tarasenko diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 7eb5dbfe31..5615a5b2fd 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -21,6 +21,7 @@ tests_generic =3D [ ] =20 tests_arm_thorough =3D [ + 'arm_canona1100', 'arm_n8x0', ] =20 @@ -42,6 +43,11 @@ tests_ppc_quick =3D [ =20 tests_ppc_thorough =3D [ 'ppc_405', + 'ppc_bamboo', +] + +tests_sparc64_thorough =3D [ + 'sparc64_sun4u', ] =20 tests_x86_64_quick =3D [ diff --git a/tests/avocado/machine_arm_canona1100.py b/tests/functional/tes= t_arm_canona1100.py old mode 100644 new mode 100755 similarity index 71% rename from tests/avocado/machine_arm_canona1100.py rename to tests/functional/test_arm_canona1100.py index a42d8b0f2b..de6169f2af --- a/tests/avocado/machine_arm_canona1100.py +++ b/tests/functional/test_arm_canona1100.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Functional test that boots the canon-a1100 machine with firmware # # Copyright (c) 2020 Red Hat, Inc. @@ -8,9 +10,9 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. =20 -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern -from avocado.utils import archive +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern +from qemu_test.utils import archive_extract =20 class CanonA1100Machine(QemuSystemTest): """Boots the barebox firmware and checks that the console is operation= al""" @@ -18,18 +20,19 @@ class CanonA1100Machine(QemuSystemTest): timeout =3D 90 =20 def test_arm_canona1100(self): - """ - :avocado: tags=3Darch:arm - :avocado: tags=3Dmachine:canon-a1100 - :avocado: tags=3Ddevice:pflash_cfi02 - """ + self.set_machine('canon-a1100') + tar_url =3D ('https://qemu-advcal.gitlab.io' '/qac-best-of-multiarch/download/day18.tar.xz') tar_hash =3D '068b5fc4242b29381acee94713509f8a876e9db6' file_path =3D self.fetch_asset(tar_url, asset_hash=3Dtar_hash) - archive.extract(file_path, self.workdir) + archive_extract(file_path, dest_dir=3Dself.workdir, + member=3D"day18/barebox.canon-a1100.bin") self.vm.set_console() self.vm.add_args('-bios', self.workdir + '/day18/barebox.canon-a1100.bin') self.vm.launch() wait_for_console_pattern(self, 'running /env/bin/init') + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() diff --git a/tests/avocado/ppc_bamboo.py b/tests/functional/test_ppc_bamboo= .py old mode 100644 new mode 100755 similarity index 75% rename from tests/avocado/ppc_bamboo.py rename to tests/functional/test_ppc_bamboo.py index a81be3d608..652b31e95a --- a/tests/avocado/ppc_bamboo.py +++ b/tests/functional/test_ppc_bamboo.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Test that Linux kernel boots on the ppc bamboo board and check the conso= le # # Copyright (c) 2021 Red Hat @@ -5,30 +7,24 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. =20 -from avocado.utils import archive -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern -from avocado_qemu import exec_command_and_wait_for_pattern +from qemu_test.utils import archive_extract +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern +from qemu_test import exec_command_and_wait_for_pattern =20 class BambooMachine(QemuSystemTest): =20 timeout =3D 90 =20 def test_ppc_bamboo(self): - """ - :avocado: tags=3Darch:ppc - :avocado: tags=3Dmachine:bamboo - :avocado: tags=3Dcpu:440epb - :avocado: tags=3Ddevice:rtl8139 - :avocado: tags=3Daccel:tcg - """ + self.set_machine('bamboo') self.require_accelerator("tcg") self.require_netdev('user') tar_url =3D ('http://landley.net/aboriginal/downloads/binaries/' 'system-image-powerpc-440fp.tar.gz') tar_hash =3D '53e5f16414b195b82d2c70272f81c2eedb39bad9' file_path =3D self.fetch_asset(tar_url, asset_hash=3Dtar_hash) - archive.extract(file_path, self.workdir) + archive_extract(file_path, self.workdir) self.vm.set_console() self.vm.add_args('-kernel', self.workdir + '/system-image-powerpc-440fp/linux', @@ -40,3 +36,6 @@ def test_ppc_bamboo(self): exec_command_and_wait_for_pattern(self, 'ping 10.0.2.2', '10.0.2.2 is alive!') exec_command_and_wait_for_pattern(self, 'halt', 'System Halted') + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() diff --git a/tests/avocado/machine_sparc64_sun4u.py b/tests/functional/test= _sparc64_sun4u.py old mode 100644 new mode 100755 similarity index 60% rename from tests/avocado/machine_sparc64_sun4u.py rename to tests/functional/test_sparc64_sun4u.py index d333c0ae91..cd89d4a1d6 --- a/tests/avocado/machine_sparc64_sun4u.py +++ b/tests/functional/test_sparc64_sun4u.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Functional test that boots a Linux kernel and checks the console # # Copyright (c) 2020 Red Hat, Inc. @@ -10,27 +12,28 @@ =20 import os =20 -from avocado_qemu import wait_for_console_pattern -from avocado.utils import archive -from boot_linux_console import LinuxKernelTest +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern +from qemu_test.utils import archive_extract =20 -class Sun4uMachine(LinuxKernelTest): +class Sun4uMachine(QemuSystemTest): """Boots the Linux kernel and checks that the console is operational""" =20 timeout =3D 90 =20 def test_sparc64_sun4u(self): - """ - :avocado: tags=3Darch:sparc64 - :avocado: tags=3Dmachine:sun4u - """ + self.set_machine('sun4u') tar_url =3D ('https://qemu-advcal.gitlab.io' '/qac-best-of-multiarch/download/day23.tar.xz') tar_hash =3D '142db83cd974ffadc4f75c8a5cad5bcc5722c240' file_path =3D self.fetch_asset(tar_url, asset_hash=3Dtar_hash) - archive.extract(file_path, self.workdir) + kernel_name =3D 'day23/vmlinux' + archive_extract(file_path, self.workdir, kernel_name) self.vm.set_console() - self.vm.add_args('-kernel', self.workdir + '/day23/vmlinux', - '-append', self.KERNEL_COMMON_COMMAND_LINE) + self.vm.add_args('-kernel', os.path.join(self.workdir, kernel_name= ), + '-append', 'printk.time=3D0') self.vm.launch() wait_for_console_pattern(self, 'Starting logging: OK') + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843850; cv=none; d=zohomail.com; s=zohoarc; b=ZwSNbXq0OnvOk+WzxYJ/gmbyBlmoo5ojAnVCeIPWiQQO1UuyPinidoqd4hhS+/7iyXAUuYBpuaIlD/cs4wCdC+Vn9jJbk3mNkSrdbwXlt01WDvjoJ4+MdlQGKYLv7vAZ6owI6D+oCBEufN3neozRtRBXPAlstwDBJsWyTCS6Lf8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843850; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eth+CvCi7bKcE6Qpidj3t/3RHGtRn2KMni/v7ZY4kRg=; b=YvpLVjGDiZLQBIi0ttAQDJJKFvwHz/dkDJIWrmcb5acoF8oFlJXTISmKDIrhkQZDzKfT7IIa39HtuNpa0lHiCzNihsG8wk1kzqcFP9g9FNir8Rj/K/A1Vxnbz+N8dLtetdOE+ZrecikeYrpBhWyq2SlyN7Rjn7at650C0X8miI4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17218438503398.201421108199611; Wed, 24 Jul 2024 10:57:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgC6-00056Z-8r; Wed, 24 Jul 2024 13:54:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgBk-0003aJ-Up for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgBh-0005sN-Lw for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:08 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-313-6ebTzBHXMPCtjWv7Eu6YAQ-1; Wed, 24 Jul 2024 13:53:57 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 70CA31944B30; Wed, 24 Jul 2024 17:53:56 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1893D1955D42; Wed, 24 Jul 2024 17:53:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843642; 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=eth+CvCi7bKcE6Qpidj3t/3RHGtRn2KMni/v7ZY4kRg=; b=hx53SOLMyGBP644L9N9uMu0Kq3pUIGwRzk2TlBaivq5jMO4pUrhoHyHMjZjL6JzBpIC66D qS4AUIjPPuCI9Joht7pnX5jM9Rrs6MhQ/WBih3yCxSkixvkhGAp7a7XPTd/H9X8ulZgguG WBb8vI/uJ7cwq10accKR0yEuGTXOoc8= X-MC-Unique: 6ebTzBHXMPCtjWv7Eu6YAQ-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 11/23] tests/functional: Set up logging Date: Wed, 24 Jul 2024 19:52:29 +0200 Message-ID: <20240724175248.1389201-12-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843850664116600 Create log files for each test separately, one file that contains the basic logging and one that contains the console output. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Thomas Huth --- tests/functional/qemu_test/__init__.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/tests/functional/qemu_test/__init__.py b/tests/functional/qemu= _test/__init__.py index 40a81c3927..49cce620ab 100644 --- a/tests/functional/qemu_test/__init__.py +++ b/tests/functional/qemu_test/__init__.py @@ -208,7 +208,8 @@ class QemuBaseTest(unittest.TestCase): arch =3D None =20 workdir =3D None - log =3D logging.getLogger('qemu-test') + log =3D None + logdir =3D None =20 def setUp(self, bin_prefix): self.assertIsNotNone(self.qemu_bin, 'QEMU_TEST_QEMU_BINARY must be= set') @@ -219,6 +220,19 @@ def setUp(self, bin_prefix): if not os.path.exists(self.workdir): os.makedirs(self.workdir) =20 + self.logdir =3D self.workdir + self.log =3D logging.getLogger('qemu-test') + self.log.setLevel(logging.DEBUG) + self._log_fh =3D logging.FileHandler(os.path.join(self.logdir, + 'base.log'), mode= =3D'w') + self._log_fh.setLevel(logging.DEBUG) + fileFormatter =3D logging.Formatter('%(asctime)s - %(levelname)s: = %(message)s') + self._log_fh.setFormatter(fileFormatter) + self.log.addHandler(self._log_fh) + + def tearDown(self): + self.log.removeHandler(self._log_fh) + def check_hash(self, file_name, expected_hash): if not expected_hash: return True @@ -276,6 +290,15 @@ def setUp(self): =20 super().setUp('qemu-system-') =20 + console_log =3D logging.getLogger('console') + console_log.setLevel(logging.DEBUG) + self._console_log_fh =3D logging.FileHandler(os.path.join(self.wor= kdir, + 'console.log'), mode=3D= 'w') + self._console_log_fh.setLevel(logging.DEBUG) + fileFormatter =3D logging.Formatter('%(asctime)s: %(message)s') + self._console_log_fh.setFormatter(fileFormatter) + console_log.addHandler(self._console_log_fh) + def set_machine(self, machinename): # TODO: We should use QMP to get the list of available machines if not self._machinehelp: @@ -366,4 +389,5 @@ def set_vm_arg(self, arg, value): def tearDown(self): for vm in self._vms.values(): vm.shutdown() + logging.getLogger('console').removeHandler(self._console_log_fh) super().tearDown() --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843791; cv=none; d=zohomail.com; s=zohoarc; b=cmsQwjVi+fTuPzUyDUkITW/pUtvmiz9gQudiGH7dh7dEO703QNNIL3fJJEc77d3wH2Tj/Sc8A2/3/ZYG/XG1ZmBwQRXwtsQZ95gac3zyGfkS9lWRZ8wugtR0u1OeUwVANam267MkL7SiNXzWA23ebKM3bGePXGvHTMlj5SWP8Mc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843791; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gdqvsjUKcWdH1tPK679PEDrN1Tih06VHUDQPpYRXTm8=; b=DZPOIAghkkkyOVNkOre7H76sARH/fXVzYDXP8kTg8XgpA0iVUXs15IsOJ1kiwotOkwSurHncLYKESKwP7+YbaaESjftUbRP5d7UQlqd3KSKX/jRuu2PlggTOf+q74fVncHnHnoYevziVjx+nI+S/oCzSGTLhRP/3gHG9Ynucd7U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721843791751203.22021668067077; Wed, 24 Jul 2024 10:56:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgCN-0006c1-LH; Wed, 24 Jul 2024 13:54:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgBq-0003ys-52 for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgBh-0005sk-Jm for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:09 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-609-t4gKU7T1O-qEoEdFpqxQmA-1; Wed, 24 Jul 2024 13:54:03 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F14811955BF4; Wed, 24 Jul 2024 17:54:01 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B60D81955D42; Wed, 24 Jul 2024 17:53:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gdqvsjUKcWdH1tPK679PEDrN1Tih06VHUDQPpYRXTm8=; b=SnhYectATObk1fYmuTVAFhMqYeNr9nqHsvwuGTVbfJca7VM19a1RAA9CeQoeFH8xkav9R3 DVzPTpbNZpuE65Z4vtemnovMTkAWpoc5yIcp7mQ+yiC/a4be6E5hnN6BtzFZNTZN24nlys QNZ/G/n9a2vQptLr99VAqqJyO0xWq1o= X-MC-Unique: t4gKU7T1O-qEoEdFpqxQmA-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 12/23] tests/functional: Convert the s390x avocado tests into standalone tests Date: Wed, 24 Jul 2024 19:52:30 +0200 Message-ID: <20240724175248.1389201-13-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843792498116600 Content-Type: text/plain; charset="utf-8" These tests use archive.lzma_uncompress() from the Avocado utils, so provide a small helper function for this, based on the standard lzma module from Python instead. And while we're at it, replace the MD5 hashes in the topology test with proper SHA256 hashes, since MD5 should not be used anymore nowadays. Signed-off-by: Thomas Huth --- MAINTAINERS | 4 +- tests/functional/meson.build | 6 ++ tests/functional/qemu_test/utils.py | 14 ++++ .../test_s390x_ccw_virtio.py} | 32 ++++----- .../test_s390x_topology.py} | 70 +++++++------------ 5 files changed, 59 insertions(+), 67 deletions(-) rename tests/{avocado/machine_s390_ccw_virtio.py =3D> functional/test_s390= x_ccw_virtio.py} (95%) mode change 100644 =3D> 100755 rename tests/{avocado/s390_topology.py =3D> functional/test_s390x_topology= .py} (90%) mode change 100644 =3D> 100755 diff --git a/MAINTAINERS b/MAINTAINERS index f107b8eb20..209fe0f728 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1739,7 +1739,7 @@ S: Supported F: hw/s390x/ F: include/hw/s390x/ F: configs/devices/s390x-softmmu/default.mak -F: tests/avocado/machine_s390_ccw_virtio.py +F: tests/functional/test_s390x_ccw_virtio.py T: git https://github.com/borntraeger/qemu.git s390-next L: qemu-s390x@nongnu.org =20 @@ -1802,7 +1802,7 @@ F: hw/s390x/cpu-topology.c F: target/s390x/kvm/stsi-topology.c F: docs/devel/s390-cpu-topology.rst F: docs/system/s390x/cpu-topology.rst -F: tests/avocado/s390_topology.py +F: tests/functional/test_s390x_topology.py =20 X86 Machines ------------ diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 5615a5b2fd..ddbb59604b 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -12,6 +12,7 @@ endif # Timeouts for individual tests that can be slow e.g. with debugging enabl= ed test_timeouts =3D { 'netdev_ethtool' : 180, + 's390x_ccw_virtio' : 180, } =20 tests_generic =3D [ @@ -46,6 +47,11 @@ tests_ppc_thorough =3D [ 'ppc_bamboo', ] =20 +tests_s390x_thorough =3D [ + 's390x_ccw_virtio', + 's390x_topology', +] + tests_sparc64_thorough =3D [ 'sparc64_sun4u', ] diff --git a/tests/functional/qemu_test/utils.py b/tests/functional/qemu_te= st/utils.py index 4eb5e5d5e5..a12dac51b6 100644 --- a/tests/functional/qemu_test/utils.py +++ b/tests/functional/qemu_test/utils.py @@ -8,6 +8,9 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. =20 +import lzma +import os +import shutil import tarfile =20 def archive_extract(archive, dest_dir, member=3DNone): @@ -19,3 +22,14 @@ def archive_extract(archive, dest_dir, member=3DNone): tf.extract(member=3Dmember, path=3Ddest_dir) else: tf.extractall(path=3Ddest_dir) + +def lzma_uncompress(xz_path, output_path): + if os.path.exists(output_path): + return + with lzma.open(xz_path, 'rb') as lzma_in: + try: + with open(output_path, 'wb') as raw_out: + shutil.copyfileobj(lzma_in, raw_out) + except: + os.remove(output_path) + raise diff --git a/tests/avocado/machine_s390_ccw_virtio.py b/tests/functional/te= st_s390x_ccw_virtio.py old mode 100644 new mode 100755 similarity index 95% rename from tests/avocado/machine_s390_ccw_virtio.py rename to tests/functional/test_s390x_ccw_virtio.py index 26e938c9e9..b2cbaacd21 --- a/tests/avocado/machine_s390_ccw_virtio.py +++ b/tests/functional/test_s390x_ccw_virtio.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Functional test that boots an s390x Linux guest with ccw and PCI devices # attached and checks whether the devices are recognized by Linux # @@ -12,11 +14,10 @@ import os import tempfile =20 -from avocado import skipUnless -from avocado_qemu import QemuSystemTest -from avocado_qemu import exec_command_and_wait_for_pattern -from avocado_qemu import wait_for_console_pattern -from avocado.utils import archive +from qemu_test import QemuSystemTest +from qemu_test import exec_command_and_wait_for_pattern +from qemu_test import wait_for_console_pattern +from qemu_test.utils import lzma_uncompress =20 class S390CCWVirtioMachine(QemuSystemTest): KERNEL_COMMON_COMMAND_LINE =3D 'printk.time=3D0 ' @@ -41,11 +42,7 @@ def clear_guest_dmesg(self): self.dmesg_clear_count +=3D 1 =20 def test_s390x_devices(self): - - """ - :avocado: tags=3Darch:s390x - :avocado: tags=3Dmachine:s390-ccw-virtio - """ + self.set_machine('s390-ccw-virtio') =20 kernel_url =3D ('https://snapshot.debian.org/archive/debian/' '20201126T092837Z/dists/buster/main/installer-s390x/' @@ -160,15 +157,7 @@ def test_s390x_devices(self): =20 =20 def test_s390x_fedora(self): - - """ - :avocado: tags=3Darch:s390x - :avocado: tags=3Dmachine:s390-ccw-virtio - :avocado: tags=3Ddevice:virtio-gpu - :avocado: tags=3Ddevice:virtio-crypto - :avocado: tags=3Ddevice:virtio-net - :avocado: tags=3Dflaky - """ + self.set_machine('s390-ccw-virtio') =20 kernel_url =3D ('https://archives.fedoraproject.org/pub/archive' '/fedora-secondary/releases/31/Server/s390x/os' @@ -182,7 +171,7 @@ def test_s390x_fedora(self): initrd_hash =3D '3de45d411df5624b8d8ef21cd0b44419ab59b12f' initrd_path_xz =3D self.fetch_asset(initrd_url, asset_hash=3Dinitr= d_hash) initrd_path =3D os.path.join(self.workdir, 'initrd-raw.img') - archive.lzma_uncompress(initrd_path_xz, initrd_path) + lzma_uncompress(initrd_path_xz, initrd_path) =20 self.vm.set_console() kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + ' audit= =3D0 ' @@ -275,3 +264,6 @@ def test_s390x_fedora(self): exec_command_and_wait_for_pattern(self, 'while ! (dmesg -c | grep Start.virtcrypto_remove)= ; do' ' sleep 1 ; done', 'Start virtcrypto_remove.') + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() diff --git a/tests/avocado/s390_topology.py b/tests/functional/test_s390x_t= opology.py old mode 100644 new mode 100755 similarity index 90% rename from tests/avocado/s390_topology.py rename to tests/functional/test_s390x_topology.py index 9154ac8776..39c5ce0b3d --- a/tests/avocado/s390_topology.py +++ b/tests/functional/test_s390x_topology.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Functional test that boots a Linux kernel and checks the console # # Copyright IBM Corp. 2023 @@ -9,16 +11,13 @@ # later. See the COPYING file in the top-level directory. =20 import os -import shutil import time =20 -from avocado_qemu import QemuSystemTest -from avocado_qemu import exec_command -from avocado_qemu import exec_command_and_wait_for_pattern -from avocado_qemu import interrupt_interactive_console_until_pattern -from avocado_qemu import wait_for_console_pattern -from avocado.utils import process -from avocado.utils import archive +from qemu_test import QemuSystemTest +from qemu_test import exec_command +from qemu_test import exec_command_and_wait_for_pattern +from qemu_test import wait_for_console_pattern +from qemu_test.utils import lzma_uncompress =20 =20 class S390CPUTopology(QemuSystemTest): @@ -81,18 +80,16 @@ def kernel_init(self): kernel_url =3D ('https://archives.fedoraproject.org/pub/archive' '/fedora-secondary/releases/35/Server/s390x/os' '/images/kernel.img') - kernel_hash =3D '0d1aaaf303f07cf0160c8c48e56fe638' - kernel_path =3D self.fetch_asset(kernel_url, algorithm=3D'md5', - asset_hash=3Dkernel_hash) + kernel_hash =3D '1f2dddfd11bb1393dd2eb2e784036fbf6fc11057a6d7d27f9= eb12d3edc67ef73' + kernel_path =3D self.fetch_asset(kernel_url, asset_hash=3Dkernel_h= ash) =20 initrd_url =3D ('https://archives.fedoraproject.org/pub/archive' '/fedora-secondary/releases/35/Server/s390x/os' '/images/initrd.img') - initrd_hash =3D 'a122057d95725ac030e2ec51df46e172' - initrd_path_xz =3D self.fetch_asset(initrd_url, algorithm=3D'md5', - asset_hash=3Dinitrd_hash) + initrd_hash =3D '1100145fbca00240c8c372ae4b89b48c99844bc189b3dfbc3= f481dc60055ca46' + initrd_path_xz =3D self.fetch_asset(initrd_url, asset_hash=3Dinitr= d_hash) initrd_path =3D os.path.join(self.workdir, 'initrd-raw.img') - archive.lzma_uncompress(initrd_path_xz, initrd_path) + lzma_uncompress(initrd_path_xz, initrd_path) =20 self.vm.set_console() kernel_command_line =3D self.KERNEL_COMMON_COMMAND_LINE @@ -115,10 +112,8 @@ def system_init(self): def test_single(self): """ This test checks the simplest topology with a single CPU. - - :avocado: tags=3Darch:s390x - :avocado: tags=3Dmachine:s390-ccw-virtio """ + self.set_machine('s390-ccw-virtio') self.kernel_init() self.vm.launch() self.wait_until_booted() @@ -127,10 +122,8 @@ def test_single(self): def test_default(self): """ This test checks the implicit topology. - - :avocado: tags=3Darch:s390x - :avocado: tags=3Dmachine:s390-ccw-virtio """ + self.set_machine('s390-ccw-virtio') self.kernel_init() self.vm.add_args('-smp', '13,drawers=3D2,books=3D2,sockets=3D3,cores=3D2,m= axcpus=3D24') @@ -154,10 +147,8 @@ def test_move(self): """ This test checks the topology modification by moving a CPU to another socket: CPU 0 is moved from socket 0 to socket 2. - - :avocado: tags=3Darch:s390x - :avocado: tags=3Dmachine:s390-ccw-virtio """ + self.set_machine('s390-ccw-virtio') self.kernel_init() self.vm.add_args('-smp', '1,drawers=3D2,books=3D2,sockets=3D3,cores=3D2,ma= xcpus=3D24') @@ -174,10 +165,8 @@ def test_dash_device(self): """ This test verifies that a CPU defined with the '-device' command line option finds its right place inside the topology. - - :avocado: tags=3Darch:s390x - :avocado: tags=3Dmachine:s390-ccw-virtio """ + self.set_machine('s390-ccw-virtio') self.kernel_init() self.vm.add_args('-smp', '1,drawers=3D2,books=3D2,sockets=3D3,cores=3D2,ma= xcpus=3D24') @@ -221,10 +210,8 @@ def test_polarization(self): """ This test verifies that QEMU modifies the entitlement change after several guest polarization change requests. - - :avocado: tags=3Darch:s390x - :avocado: tags=3Dmachine:s390-ccw-virtio """ + self.set_machine('s390-ccw-virtio') self.kernel_init() self.vm.launch() self.wait_until_booted() @@ -267,10 +254,8 @@ def test_entitlement(self): """ This test verifies that QEMU modifies the entitlement after a guest request and that the guest sees the change. - - :avocado: tags=3Darch:s390x - :avocado: tags=3Dmachine:s390-ccw-virtio """ + self.set_machine('s390-ccw-virtio') self.kernel_init() self.vm.launch() self.wait_until_booted() @@ -313,10 +298,8 @@ def test_dedicated(self): CPU is made dedicated. QEMU retains the entitlement value when horizontal polarization is= in effect. For the guest, the field shows the effective value of the entitlem= ent. - - :avocado: tags=3Darch:s390x - :avocado: tags=3Dmachine:s390-ccw-virtio """ + self.set_machine('s390-ccw-virtio') self.kernel_init() self.vm.launch() self.wait_until_booted() @@ -345,10 +328,8 @@ def test_socket_full(self): This test verifies that QEMU does not accept to overload a socket. The socket-id 0 on book-id 0 already contains CPUs 0 and 1 and can not accept any new CPU while socket-id 0 on book-id 1 is free. - - :avocado: tags=3Darch:s390x - :avocado: tags=3Dmachine:s390-ccw-virtio """ + self.set_machine('s390-ccw-virtio') self.kernel_init() self.vm.add_args('-smp', '3,drawers=3D2,books=3D2,sockets=3D3,cores=3D2,ma= xcpus=3D24') @@ -369,10 +350,8 @@ def test_dedicated_error(self): """ This test verifies that QEMU refuses to lower the entitlement of a dedicated CPU - - :avocado: tags=3Darch:s390x - :avocado: tags=3Dmachine:s390-ccw-virtio """ + self.set_machine('s390-ccw-virtio') self.kernel_init() self.vm.launch() self.wait_until_booted() @@ -417,10 +396,8 @@ def test_move_error(self): """ This test verifies that QEMU refuses to move a CPU to an nonexistent location - - :avocado: tags=3Darch:s390x - :avocado: tags=3Dmachine:s390-ccw-virtio """ + self.set_machine('s390-ccw-virtio') self.kernel_init() self.vm.launch() self.wait_until_booted() @@ -437,3 +414,6 @@ def test_move_error(self): self.assertEqual(res['error']['class'], 'GenericError') =20 self.check_topology(0, 0, 0, 0, 'medium', False) + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843800; cv=none; d=zohomail.com; s=zohoarc; b=mh52Xj7xbQr+OKU1BYI2+939A8V2xooM+nz/pO51WECcL+STMxsMd1z+0tZUXgNN/dTnvcDyKS8JyV6Gta9Q0RQzwA2S0+ODtGoN4+AmR1cVC52jAh6JO+Nq7mnlIWokB2ayqFFsSu9uS4H5NHE+IPs6wDsiJKuhMRuwH8IyTB4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843800; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=IZyXbAeInyanfn1CZX7iF6MCbmruHNabZvQrlRPYx7c=; b=dIceTD+u5o5aTfY6LaGtoytzmHYPko+Cty3dudjZNRGZjyrBlZ9jz6bfc/M8wwO9CRwIZ6gAxUbGpWIDGz7EDv+ERJrBMXvXTLglkFFWBsAMqqKgp97mYf3R88NKnG/L5Ww+cfikE0SL4F5cS3KkzfYmbYolPGM9zOA/rSWWzRk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17218438005364.383014046509857; Wed, 24 Jul 2024 10:56:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgCU-0007WU-TX; Wed, 24 Jul 2024 13:54:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCC-0005mt-Ll for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgC0-0005wK-HJ for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:28 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-151-LiJxUvtNOR2oFDc7I6FEdg-1; Wed, 24 Jul 2024 13:54:15 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 06B731944B30; Wed, 24 Jul 2024 17:54:08 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 905961955D42; Wed, 24 Jul 2024 17:54:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IZyXbAeInyanfn1CZX7iF6MCbmruHNabZvQrlRPYx7c=; b=fmLiAFfCnxoSpOqJxRUvF291vMpldspd4mFZTR90uX8YVAN/KLqfSN9+4T6d2zte2JiojG FkqD0C+FpdXzdN2p2IFRtpVH2ZJHLNHnKRp6ByEqgZE4sagNx3yjz1kzFNDkkdIPO+g0Et kpwseKoK89zk+Kq4alnZaQDNgo2QS2M= X-MC-Unique: LiJxUvtNOR2oFDc7I6FEdg-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 13/23] tests/functional: Convert the x86_cpu_model_versions test Date: Wed, 24 Jul 2024 19:52:31 +0200 Message-ID: <20240724175248.1389201-14-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843802477116600 Content-Type: text/plain; charset="utf-8" Nothing thrilling in here, it's just a straight forward conversion. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- tests/functional/meson.build | 1 + .../test_x86_cpu_model_versions.py} | 63 ++++++------------- 2 files changed, 20 insertions(+), 44 deletions(-) rename tests/{avocado/x86_cpu_model_versions.py =3D> functional/test_x86_c= pu_model_versions.py} (92%) mode change 100644 =3D> 100755 diff --git a/tests/functional/meson.build b/tests/functional/meson.build index ddbb59604b..e0e1be68bb 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -61,6 +61,7 @@ tests_x86_64_quick =3D [ 'mem_addr_space', 'pc_cpu_hotplug_props', 'virtio_version', + 'x86_cpu_model_versions', ] =20 tests_x86_64_thorough =3D [ diff --git a/tests/avocado/x86_cpu_model_versions.py b/tests/functional/tes= t_x86_cpu_model_versions.py old mode 100644 new mode 100755 similarity index 92% rename from tests/avocado/x86_cpu_model_versions.py rename to tests/functional/test_x86_cpu_model_versions.py index 11101e02b9..a5f27c737d --- a/tests/avocado/x86_cpu_model_versions.py +++ b/tests/functional/test_x86_cpu_model_versions.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 # # Basic validation of x86 versioned CPU models and CPU model aliases # @@ -20,11 +21,11 @@ # License along with this library; if not, see . # =20 - -import avocado_qemu import re =20 -class X86CPUModelAliases(avocado_qemu.QemuSystemTest): +from qemu_test import QemuSystemTest + +class X86CPUModelAliases(QemuSystemTest): """ Validation of PC CPU model versions and CPU model aliases =20 @@ -76,9 +77,8 @@ def validate_variant_aliases(self, cpus): def test_4_0_alias_compatibility(self): """ Check if pc-*-4.0 unversioned CPU model won't be reported as alias= es - - :avocado: tags=3Dmachine:pc-i440fx-4.0 """ + self.set_machine('pc-i440fx-4.0') # pc-*-4.0 won't expose non-versioned CPU models as aliases # We do this to help management software to keep compatibility # with older QEMU versions that didn't have the versioned CPU model @@ -110,9 +110,8 @@ def test_4_0_alias_compatibility(self): def test_4_1_alias(self): """ Check if unversioned CPU model is an alias pointing to right versi= on - - :avocado: tags=3Dmachine:pc-i440fx-4.1 """ + self.set_machine('pc-i440fx-4.1') self.vm.add_args('-S') self.vm.launch() =20 @@ -217,9 +216,8 @@ def test_4_1_alias(self): def test_none_alias(self): """ Check if unversioned CPU model is an alias pointing to some version - - :avocado: tags=3Dmachine:none """ + self.machine =3D 'none' self.vm.add_args('-S') self.vm.launch() =20 @@ -243,21 +241,16 @@ def test_none_alias(self): self.validate_aliases(cpus) =20 =20 -class CascadelakeArchCapabilities(avocado_qemu.QemuSystemTest): +class CascadelakeArchCapabilities(QemuSystemTest): """ Validation of Cascadelake arch-capabilities - - :avocado: tags=3Darch:x86_64 """ def get_cpu_prop(self, prop): cpu_path =3D self.vm.cmd('query-cpus-fast')[0].get('qom-path') return self.vm.cmd('qom-get', path=3Dcpu_path, property=3Dprop) =20 def test_4_1(self): - """ - :avocado: tags=3Dmachine:pc-i440fx-4.1 - :avocado: tags=3Dcpu:Cascadelake-Server - """ + self.set_machine('pc-i440fx-4.1') # machine-type only: self.vm.add_args('-S') self.set_vm_arg('-cpu', @@ -268,10 +261,7 @@ def test_4_1(self): 'pc-i440fx-4.1 + Cascadelake-Server should not ha= ve arch-capabilities') =20 def test_4_0(self): - """ - :avocado: tags=3Dmachine:pc-i440fx-4.0 - :avocado: tags=3Dcpu:Cascadelake-Server - """ + self.set_machine('pc-i440fx-4.0') self.vm.add_args('-S') self.set_vm_arg('-cpu', 'Cascadelake-Server,x-force-features=3Don,check=3D= off,' @@ -281,10 +271,7 @@ def test_4_0(self): 'pc-i440fx-4.0 + Cascadelake-Server should not ha= ve arch-capabilities') =20 def test_set_4_0(self): - """ - :avocado: tags=3Dmachine:pc-i440fx-4.0 - :avocado: tags=3Dcpu:Cascadelake-Server - """ + self.set_machine('pc-i440fx-4.0') # command line must override machine-type if CPU model is not vers= ioned: self.vm.add_args('-S') self.set_vm_arg('-cpu', @@ -295,10 +282,7 @@ def test_set_4_0(self): 'pc-i440fx-4.0 + Cascadelake-Server,+arch-capabili= ties should have arch-capabilities') =20 def test_unset_4_1(self): - """ - :avocado: tags=3Dmachine:pc-i440fx-4.1 - :avocado: tags=3Dcpu:Cascadelake-Server - """ + self.set_machine('pc-i440fx-4.1') self.vm.add_args('-S') self.set_vm_arg('-cpu', 'Cascadelake-Server,x-force-features=3Don,check=3D= off,' @@ -308,10 +292,7 @@ def test_unset_4_1(self): 'pc-i440fx-4.1 + Cascadelake-Server,-arch-capabil= ities should not have arch-capabilities') =20 def test_v1_4_0(self): - """ - :avocado: tags=3Dmachine:pc-i440fx-4.0 - :avocado: tags=3Dcpu:Cascadelake-Server - """ + self.set_machine('pc-i440fx-4.0') # versioned CPU model overrides machine-type: self.vm.add_args('-S') self.set_vm_arg('-cpu', @@ -322,10 +303,7 @@ def test_v1_4_0(self): 'pc-i440fx-4.0 + Cascadelake-Server-v1 should not= have arch-capabilities') =20 def test_v2_4_0(self): - """ - :avocado: tags=3Dmachine:pc-i440fx-4.0 - :avocado: tags=3Dcpu:Cascadelake-Server - """ + self.set_machine('pc-i440fx-4.0') self.vm.add_args('-S') self.set_vm_arg('-cpu', 'Cascadelake-Server-v2,x-force-features=3Don,check= =3Doff,' @@ -335,10 +313,7 @@ def test_v2_4_0(self): 'pc-i440fx-4.0 + Cascadelake-Server-v2 should have= arch-capabilities') =20 def test_v1_set_4_0(self): - """ - :avocado: tags=3Dmachine:pc-i440fx-4.0 - :avocado: tags=3Dcpu:Cascadelake-Server - """ + self.set_machine('pc-i440fx-4.0') # command line must override machine-type and versioned CPU model: self.vm.add_args('-S') self.set_vm_arg('-cpu', @@ -349,10 +324,7 @@ def test_v1_set_4_0(self): 'pc-i440fx-4.0 + Cascadelake-Server-v1,+arch-capab= ilities should have arch-capabilities') =20 def test_v2_unset_4_1(self): - """ - :avocado: tags=3Dmachine:pc-i440fx-4.1 - :avocado: tags=3Dcpu:Cascadelake-Server - """ + self.set_machine('pc-i440fx-4.1') self.vm.add_args('-S') self.set_vm_arg('-cpu', 'Cascadelake-Server-v2,x-force-features=3Don,check= =3Doff,' @@ -360,3 +332,6 @@ def test_v2_unset_4_1(self): self.vm.launch() self.assertFalse(self.get_cpu_prop('arch-capabilities'), 'pc-i440fx-4.1 + Cascadelake-Server-v2,-arch-capa= bilities should not have arch-capabilities') + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843753; cv=none; d=zohomail.com; s=zohoarc; b=H1GR7u3hftiXjiDiNUcEPMMOykGQq/Fwf261gNaY4KPIuMumUml+uMe+UYBjIfYHXkJUvGT0N9HL8y84MIVpB9tLY+exrDeBM0snoxLHfeh2k76aYXTbp6yNl+RDGPk8ezC5QvhxLhgDdM0rSTEVvFyoOvZRNUGDJadMMhKkDXc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843753; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7fQ8gZbWh4Enhh7BTzUsWyevQnHlCtto6qzj/sj5Ygo=; b=bz5FWju4A93as3iaQzV/LQ3w/WGt2JUrOgqy0EYSwflfI0NtMq+A89gXaCM4vYCGyk670Fz1GymoOXPBdRA1IBeiUljyYo8bhTuPhsXwSxWc8Xd56IqAd0ZV9Ddy4yqfdoamc+Okm5wg1bH43iZz/OU3oTf15Lx/y7+cx18x6cc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721843753644327.01553461290905; Wed, 24 Jul 2024 10:55:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgCJ-0006Jt-GE; Wed, 24 Jul 2024 13:54:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCC-0005mu-LI for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgC1-0005wU-Ry for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:29 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-619-004kloNGM1aU8Mzy1Wbjsw-1; Wed, 24 Jul 2024 13:54:16 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E3FE719540F1; Wed, 24 Jul 2024 17:54:13 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D0AB81955D45; Wed, 24 Jul 2024 17:54:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843664; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7fQ8gZbWh4Enhh7BTzUsWyevQnHlCtto6qzj/sj5Ygo=; b=AuvNBFTkYbj4VnyCeE+MurGUIsQlmF0bJZtVwhwc/fAhR1rgAOO5rf7Rc+ew+qleMpJvj7 0eboQ3o1OZgMP3LGwQVMvReOsPUg+l7Ts/N/RF7n2z3ooCSmtWYXGlXPJuZ6NypocFmT8e A/ksDYASPTNxyK73Td11Y9e7hstJev4= X-MC-Unique: 004kloNGM1aU8Mzy1Wbjsw-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 14/23] tests/functional: Convert the microblaze avocado tests into standalone tests Date: Wed, 24 Jul 2024 19:52:32 +0200 Message-ID: <20240724175248.1389201-15-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843754414116600 Content-Type: text/plain; charset="utf-8" The machine_microblaze.py file contained two tests, one for each endianess. Since we only support one QEMU target binary per file in the new functional test environment, we have to split this file up into two files now. Signed-off-by: Thomas Huth --- MAINTAINERS | 2 +- tests/avocado/machine_microblaze.py | 61 ------------------- tests/functional/meson.build | 8 +++ .../functional/test_microblaze_s3adsp1800.py | 38 ++++++++++++ .../test_microblazeel_s3adsp1800.py | 41 +++++++++++++ 5 files changed, 88 insertions(+), 62 deletions(-) delete mode 100644 tests/avocado/machine_microblaze.py create mode 100755 tests/functional/test_microblaze_s3adsp1800.py create mode 100755 tests/functional/test_microblazeel_s3adsp1800.py diff --git a/MAINTAINERS b/MAINTAINERS index 209fe0f728..02cf39e94d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1327,7 +1327,7 @@ M: Edgar E. Iglesias S: Maintained F: hw/microblaze/petalogix_s3adsp1800_mmu.c F: include/hw/char/xilinx_uartlite.h -F: tests/avocado/machine_microblaze.py +F: tests/functional/test_microblaze*.py =20 petalogix_ml605 M: Edgar E. Iglesias diff --git a/tests/avocado/machine_microblaze.py b/tests/avocado/machine_mi= croblaze.py deleted file mode 100644 index 807709cd11..0000000000 --- a/tests/avocado/machine_microblaze.py +++ /dev/null @@ -1,61 +0,0 @@ -# Functional test that boots a microblaze Linux kernel and checks the cons= ole -# -# Copyright (c) 2018, 2021 Red Hat, Inc. -# -# 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 time -from avocado_qemu import exec_command, exec_command_and_wait_for_pattern -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern -from avocado.utils import archive - -class MicroblazeMachine(QemuSystemTest): - - timeout =3D 90 - - def test_microblaze_s3adsp1800(self): - """ - :avocado: tags=3Darch:microblaze - :avocado: tags=3Dmachine:petalogix-s3adsp1800 - """ - - tar_url =3D ('https://qemu-advcal.gitlab.io' - '/qac-best-of-multiarch/download/day17.tar.xz') - tar_hash =3D '08bf3e3bfb6b6c7ce1e54ab65d54e189f2caf13f' - file_path =3D self.fetch_asset(tar_url, asset_hash=3Dtar_hash) - archive.extract(file_path, self.workdir) - self.vm.set_console() - self.vm.add_args('-kernel', self.workdir + '/day17/ballerina.bin') - self.vm.launch() - wait_for_console_pattern(self, 'This architecture does not have ' - 'kernel memory protection') - # Note: - # The kernel sometimes gets stuck after the "This architecture ..." - # message, that's why we don't test for a later string here. This - # needs some investigation by a microblaze wizard one day... - - def test_microblazeel_s3adsp1800(self): - """ - :avocado: tags=3Darch:microblazeel - :avocado: tags=3Dmachine:petalogix-s3adsp1800 - """ - - self.require_netdev('user') - tar_url =3D ('http://www.qemu-advent-calendar.org/2023/download/' - 'day13.tar.gz') - tar_hash =3D '6623d5fff5f84cfa8f34e286f32eff6a26546f44' - file_path =3D self.fetch_asset(tar_url, asset_hash=3Dtar_hash) - archive.extract(file_path, self.workdir) - self.vm.set_console() - self.vm.add_args('-kernel', self.workdir + '/day13/xmaton.bin') - self.vm.add_args('-nic', 'user,tftp=3D' + self.workdir + '/day13/') - self.vm.launch() - wait_for_console_pattern(self, 'QEMU Advent Calendar 2023') - time.sleep(0.1) - exec_command(self, 'root') - time.sleep(0.1) - exec_command_and_wait_for_pattern(self, - 'tftp -g -r xmaton.png 10.0.2.2 ; md5sum xmaton.png', - '821cd3cab8efd16ad6ee5acc3642a8ea') diff --git a/tests/functional/meson.build b/tests/functional/meson.build index e0e1be68bb..a2c0398b03 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -34,6 +34,14 @@ tests_loongarch64_thorough =3D [ 'loongarch64_virt', ] =20 +tests_microblaze_thorough =3D [ + 'microblaze_s3adsp1800' +] + +tests_microblazeel_thorough =3D [ + 'microblazeel_s3adsp1800' +] + tests_mips64el_thorough =3D [ 'mips64el_loongson3v', ] diff --git a/tests/functional/test_microblaze_s3adsp1800.py b/tests/functio= nal/test_microblaze_s3adsp1800.py new file mode 100755 index 0000000000..3e46fa7453 --- /dev/null +++ b/tests/functional/test_microblaze_s3adsp1800.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 +# +# Functional test that boots a microblaze Linux kernel and checks the cons= ole +# +# Copyright (c) 2018, 2021 Red Hat, Inc. +# +# 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 time +from qemu_test import exec_command, exec_command_and_wait_for_pattern +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern +from qemu_test.utils import archive_extract + +class MicroblazeMachine(QemuSystemTest): + + timeout =3D 90 + + def test_microblaze_s3adsp1800(self): + self.set_machine('petalogix-s3adsp1800') + tar_url =3D ('https://qemu-advcal.gitlab.io' + '/qac-best-of-multiarch/download/day17.tar.xz') + tar_hash =3D '08bf3e3bfb6b6c7ce1e54ab65d54e189f2caf13f' + file_path =3D self.fetch_asset(tar_url, asset_hash=3Dtar_hash) + archive_extract(file_path, self.workdir) + self.vm.set_console() + self.vm.add_args('-kernel', self.workdir + '/day17/ballerina.bin') + self.vm.launch() + wait_for_console_pattern(self, 'This architecture does not have ' + 'kernel memory protection') + # Note: + # The kernel sometimes gets stuck after the "This architecture ..." + # message, that's why we don't test for a later string here. This + # needs some investigation by a microblaze wizard one day... + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() diff --git a/tests/functional/test_microblazeel_s3adsp1800.py b/tests/funct= ional/test_microblazeel_s3adsp1800.py new file mode 100755 index 0000000000..3ec694db69 --- /dev/null +++ b/tests/functional/test_microblazeel_s3adsp1800.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 +# +# Functional test that boots a microblaze Linux kernel and checks the cons= ole +# +# Copyright (c) 2018, 2021 Red Hat, Inc. +# +# 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 time +from qemu_test import exec_command, exec_command_and_wait_for_pattern +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern +from qemu_test.utils import archive_extract + +class MicroblazeelMachine(QemuSystemTest): + + timeout =3D 90 + + def test_microblazeel_s3adsp1800(self): + self.require_netdev('user') + self.set_machine('petalogix-s3adsp1800') + tar_url =3D ('http://www.qemu-advent-calendar.org/2023/download/' + 'day13.tar.gz') + tar_hash =3D '6623d5fff5f84cfa8f34e286f32eff6a26546f44' + file_path =3D self.fetch_asset(tar_url, asset_hash=3Dtar_hash) + archive_extract(file_path, self.workdir) + self.vm.set_console() + self.vm.add_args('-kernel', self.workdir + '/day13/xmaton.bin') + self.vm.add_args('-nic', 'user,tftp=3D' + self.workdir + '/day13/') + self.vm.launch() + wait_for_console_pattern(self, 'QEMU Advent Calendar 2023') + time.sleep(0.1) + exec_command(self, 'root') + time.sleep(0.1) + exec_command_and_wait_for_pattern(self, + 'tftp -g -r xmaton.png 10.0.2.2 ; md5sum xmaton.png', + '821cd3cab8efd16ad6ee5acc3642a8ea') + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843785; cv=none; d=zohomail.com; s=zohoarc; b=aD4sEcAzLw0DBeQVlYwhlEoya/etnmwPSGUlnw25w80ryG/o5FcE0UdZgaXnZDyquN+ZKXbcdYps11Jb4+pNjfvQYUJLevA6KqU4FH3Eka8ochIfzMYhmS7yP8+2nwdakFDHo1///ui7W8GOrWPxjwJqoQ2Mn8Eou1MgDNMIE3c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843785; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hBuoNMb0p53f+igy4hoUhXr3MTd0MR+eNTjlv+xhpCY=; b=WH5IhKa+t8qh1ig5NZzeYZ6tttpAUbfiTxWT7xQ6WliclZI8Il0kKN/gqlM9XWduzr6guFYqIVnX+o1GlzUrvQgBd27cyTZoXL9Cvn/0pMLeDN8Kbh1VlJC8Y0yXXMHRZGwW8hEiNwQIdoCqihxVucWRQHHlr3KlJpPt4/Yac8c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721843785400886.2705701272129; Wed, 24 Jul 2024 10:56:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgD3-0001r8-GL; Wed, 24 Jul 2024 13:55:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCG-00068K-V7 for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCB-0005x2-Qa for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:38 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-284-qED_bEFsMK6ytxiMdGpHzA-1; Wed, 24 Jul 2024 13:54:26 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 27EBF1955F49; Wed, 24 Jul 2024 17:54:19 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 778781955D45; Wed, 24 Jul 2024 17:54:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hBuoNMb0p53f+igy4hoUhXr3MTd0MR+eNTjlv+xhpCY=; b=h9ypHlCO29IZCvJSw+C6LjwBQFf/bgzhy4E3nnpg5FbaSc/ltRmRestVqj9d34BhhiUtdJ RbDkQTOqNqECUwMcrmzZVt7WqeeUCgYmXup4qpc/IMx+7dlEADWDuSeBhsgZlEkTaWTUKE 4W/XwsqxvzIXgCzDIOnPfUJVHl7tWhQ= X-MC-Unique: qED_bEFsMK6ytxiMdGpHzA-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 15/23] tests/functional: Convert the riscv_opensbi avocado test into a standalone test Date: Wed, 24 Jul 2024 19:52:33 +0200 Message-ID: <20240724175248.1389201-16-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843786559116600 Content-Type: text/plain; charset="utf-8" The avocado test defined test functions for both, riscv32 and riscv64. Since we can run the whole file with multiple targets in the new framework, we can now consolidate the functions so we have to only define one function per machine now. Signed-off-by: Thomas Huth Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- tests/avocado/riscv_opensbi.py | 63 -------------------------- tests/functional/meson.build | 8 ++++ tests/functional/test_riscv_opensbi.py | 36 +++++++++++++++ 3 files changed, 44 insertions(+), 63 deletions(-) delete mode 100644 tests/avocado/riscv_opensbi.py create mode 100755 tests/functional/test_riscv_opensbi.py diff --git a/tests/avocado/riscv_opensbi.py b/tests/avocado/riscv_opensbi.py deleted file mode 100644 index bfff9cc3c3..0000000000 --- a/tests/avocado/riscv_opensbi.py +++ /dev/null @@ -1,63 +0,0 @@ -# OpenSBI boot test for RISC-V machines -# -# Copyright (c) 2022, Ventana Micro -# -# This work is licensed under the terms of the GNU GPL, version 2 or -# later. See the COPYING file in the top-level directory. - -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern - -class RiscvOpenSBI(QemuSystemTest): - """ - :avocado: tags=3Daccel:tcg - """ - timeout =3D 5 - - def boot_opensbi(self): - self.vm.set_console() - self.vm.launch() - wait_for_console_pattern(self, 'Platform Name') - wait_for_console_pattern(self, 'Boot HART MEDELEG') - - def test_riscv32_spike(self): - """ - :avocado: tags=3Darch:riscv32 - :avocado: tags=3Dmachine:spike - """ - self.boot_opensbi() - - def test_riscv64_spike(self): - """ - :avocado: tags=3Darch:riscv64 - :avocado: tags=3Dmachine:spike - """ - self.boot_opensbi() - - def test_riscv32_sifive_u(self): - """ - :avocado: tags=3Darch:riscv32 - :avocado: tags=3Dmachine:sifive_u - """ - self.boot_opensbi() - - def test_riscv64_sifive_u(self): - """ - :avocado: tags=3Darch:riscv64 - :avocado: tags=3Dmachine:sifive_u - """ - self.boot_opensbi() - - def test_riscv32_virt(self): - """ - :avocado: tags=3Darch:riscv32 - :avocado: tags=3Dmachine:virt - """ - self.boot_opensbi() - - def test_riscv64_virt(self): - """ - :avocado: tags=3Darch:riscv64 - :avocado: tags=3Dmachine:virt - """ - self.boot_opensbi() diff --git a/tests/functional/meson.build b/tests/functional/meson.build index a2c0398b03..ebc6e2d1c6 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -55,6 +55,14 @@ tests_ppc_thorough =3D [ 'ppc_bamboo', ] =20 +tests_riscv32_quick =3D [ + 'riscv_opensbi', +] + +tests_riscv64_quick =3D [ + 'riscv_opensbi', +] + tests_s390x_thorough =3D [ 's390x_ccw_virtio', 's390x_topology', diff --git a/tests/functional/test_riscv_opensbi.py b/tests/functional/test= _riscv_opensbi.py new file mode 100755 index 0000000000..d077e40f42 --- /dev/null +++ b/tests/functional/test_riscv_opensbi.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python3 +# +# OpenSBI boot test for RISC-V machines +# +# Copyright (c) 2022, Ventana Micro +# +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. + +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern + +class RiscvOpenSBI(QemuSystemTest): + + timeout =3D 5 + + def boot_opensbi(self): + self.vm.set_console() + self.vm.launch() + wait_for_console_pattern(self, 'Platform Name') + wait_for_console_pattern(self, 'Boot HART MEDELEG') + + def test_riscv_spike(self): + self.set_machine('spike') + self.boot_opensbi() + + def test_riscv_sifive_u(self): + self.set_machine('sifive_u') + self.boot_opensbi() + + def test_riscv_virt(self): + self.set_machine('virt') + self.boot_opensbi() + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843754; cv=none; d=zohomail.com; s=zohoarc; b=PSWCWNqCc/k8aN0spR+pMSxWp5kwfd2ijYosq8r8fcPM3zYR2lUh5QLMC/gW65bJtF6yjuZaP3cgmUFPZG457oztw1kHF9ccFPwJsH7PRO2OcHFSrHt2O7aBIv5hrwzZGhuP42inIU57dQXbFYxJglm3Wz3y4Bx25RCov+OafCw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843754; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hUe7Q96P9b55uMJqmEeKA60XBXRo4Xodz951JEg/wy4=; b=hsSUHBqun+5NR058qM/nUvrVf70hwFxRi9SudfnkpfwG1wo6XKlnRBJJQDTq85JyXovfj+TXfe118nDFcGuS4YVFe7jDckLj5rp6o3Es0xAXZTrvNKI5IMk8TspLCG99q4ZmiYJkaUvJPASV5QSzAOUGnBmUB2XrBCLdSOGlKCg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721843754592675.8152452741118; Wed, 24 Jul 2024 10:55:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgCx-0001F6-V3; Wed, 24 Jul 2024 13:55:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCH-00068V-09 for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCC-0005xK-Ke for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:39 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-519-rCinRGmHOfOBDZbleE5iDw-1; Wed, 24 Jul 2024 13:54:30 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E6A331955BF1; Wed, 24 Jul 2024 17:54:25 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3E8931955D45; Wed, 24 Jul 2024 17:54:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hUe7Q96P9b55uMJqmEeKA60XBXRo4Xodz951JEg/wy4=; b=VyiplDIlGynbOKiW+QOSqGrBn4/rmtpGeS7e0MSfIP4k0vRViV8+n/fuGCz2sNdI7U8AVx w/DO8ZZsmuZJOY/rQjhou/ehOP3NoRRbAoz8frcUTxwte9P9nbhsNCiuIEmrmU3Hqm/CQP scwXNmSiuYL8YkpVkj9hXWVq4NCkSz4= X-MC-Unique: rCinRGmHOfOBDZbleE5iDw-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 16/23] tests/functional: Convert the virtio_gpu avocado test into a standalone test Date: Wed, 24 Jul 2024 19:52:34 +0200 Message-ID: <20240724175248.1389201-17-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843756341116600 Content-Type: text/plain; charset="utf-8" Nothing thrilling in here, it's just a straight forward conversion. Signed-off-by: Thomas Huth --- tests/functional/meson.build | 1 + .../test_virtio_gpu.py} | 34 ++++++++----------- 2 files changed, 16 insertions(+), 19 deletions(-) rename tests/{avocado/virtio-gpu.py =3D> functional/test_virtio_gpu.py} (8= 8%) mode change 100644 =3D> 100755 diff --git a/tests/functional/meson.build b/tests/functional/meson.build index ebc6e2d1c6..91fe835e8f 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -82,6 +82,7 @@ tests_x86_64_quick =3D [ =20 tests_x86_64_thorough =3D [ 'netdev_ethtool', + 'virtio_gpu', ] =20 foreach speed : ['quick', 'thorough'] diff --git a/tests/avocado/virtio-gpu.py b/tests/functional/test_virtio_gpu= .py old mode 100644 new mode 100755 similarity index 88% rename from tests/avocado/virtio-gpu.py rename to tests/functional/test_virtio_gpu.py index 6091f614a4..911b4119c6 --- a/tests/avocado/virtio-gpu.py +++ b/tests/functional/test_virtio_gpu.py @@ -1,14 +1,16 @@ +#!/usr/bin/env python3 +# # virtio-gpu tests # # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. =20 =20 -from avocado_qemu import BUILD_DIR -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern -from avocado_qemu import exec_command_and_wait_for_pattern -from avocado_qemu import is_readable_executable_file +from qemu_test import BUILD_DIR +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern +from qemu_test import exec_command_and_wait_for_pattern +from qemu_test import is_readable_executable_file =20 from qemu.utils import kvm_available =20 @@ -28,11 +30,6 @@ def pick_default_vug_bin(): =20 =20 class VirtioGPUx86(QemuSystemTest): - """ - :avocado: tags=3Dvirtio-gpu - :avocado: tags=3Darch:x86_64 - :avocado: tags=3Dcpu:host - """ =20 KERNEL_COMMAND_LINE =3D "printk.time=3D0 console=3DttyS0 rdinit=3D/bin= /bash" KERNEL_URL =3D ( @@ -57,9 +54,6 @@ def wait_for_console_pattern(self, success_message, vm=3D= None): ) =20 def test_virtio_vga_virgl(self): - """ - :avocado: tags=3Ddevice:virtio-vga-gl - """ # FIXME: should check presence of virtio, virgl etc self.require_accelerator('kvm') =20 @@ -67,6 +61,7 @@ def test_virtio_vga_virgl(self): initrd_path =3D self.fetch_asset(self.INITRD_URL, self.INITRD_HASH) =20 self.vm.set_console() + self.vm.add_args("-cpu", "host") self.vm.add_args("-m", "2G") self.vm.add_args("-machine", "pc,accel=3Dkvm") self.vm.add_args("-device", "virtio-vga-gl") @@ -83,7 +78,7 @@ def test_virtio_vga_virgl(self): self.vm.launch() except: # TODO: probably fails because we are missing the VirGL featur= es - self.cancel("VirGL not enabled?") + self.skipTest("VirGL not enabled?") =20 self.wait_for_console_pattern("as init process") exec_command_and_wait_for_pattern( @@ -92,15 +87,12 @@ def test_virtio_vga_virgl(self): self.wait_for_console_pattern("features: +virgl +edid") =20 def test_vhost_user_vga_virgl(self): - """ - :avocado: tags=3Ddevice:vhost-user-vga - """ # FIXME: should check presence of vhost-user-gpu, virgl, memfd etc self.require_accelerator('kvm') =20 vug =3D pick_default_vug_bin() if not vug: - self.cancel("Could not find vhost-user-gpu") + self.skipTest("Could not find vhost-user-gpu") =20 kernel_path =3D self.fetch_asset(self.KERNEL_URL, self.KERNEL_HASH) initrd_path =3D self.fetch_asset(self.INITRD_URL, self.INITRD_HASH) @@ -129,6 +121,7 @@ def test_vhost_user_vga_virgl(self): ) =20 self.vm.set_console() + self.vm.add_args("-cpu", "host") self.vm.add_args("-m", "2G") self.vm.add_args("-object", "memory-backend-memfd,id=3Dmem,size=3D= 2G") self.vm.add_args("-machine", "pc,memory-backend=3Dmem,accel=3Dkvm") @@ -147,7 +140,7 @@ def test_vhost_user_vga_virgl(self): self.vm.launch() except: # TODO: probably fails because we are missing the VirGL featur= es - self.cancel("VirGL not enabled?") + self.skipTest("VirGL not enabled?") self.wait_for_console_pattern("as init process") exec_command_and_wait_for_pattern(self, "/usr/sbin/modprobe virtio= _gpu", "features: +virgl +edid") @@ -155,3 +148,6 @@ def test_vhost_user_vga_virgl(self): qemu_sock.close() vugp.terminate() vugp.wait() + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843764; cv=none; d=zohomail.com; s=zohoarc; b=Z3NdboQwYqtP0DVmsqUn14YjQF99VkX7Ckc68bQhP61Mo2qkregZIF0rRRV9uoKGJDSkvEyPlut3TPwFDWr1jCr6+lCXczBXoSmqaNyhEFUV2Q2SjvFRnUh0gytAsbiSr+Ygnj7dCO7FZomLORe48nt0tBwz0w5Jn91fHXTJ2VY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843764; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Wf8X5omgUCDws1rOtaLrgrsexFOXN3/9UU728c0iMCo=; b=K3fHUponx2o4zHhiTLGDlHTivMWrBPQaSHNnd06cBmgjdctFkmSFIn9Z8Bhr8ViqZgVQc4s2LXk9swva3fUtkmKwE7zFjWbrqBQDQ7VdtS+n+Q+eIb4rjU1rpZMPHhlPPb7TEMN4Pm0QB4oQmQJpckVe8Bu1954409ifHLasojQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721843764975499.5869414173625; Wed, 24 Jul 2024 10:56:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgCS-00077e-5V; Wed, 24 Jul 2024 13:54:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCL-0006Yl-EK for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCE-0005xw-Sc for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:43 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-475-YtVkMZwNP-WuL4DdxrAK8g-1; Wed, 24 Jul 2024 13:54:33 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B33711955BEE; Wed, 24 Jul 2024 17:54:31 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2A8631955D48; Wed, 24 Jul 2024 17:54:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843676; 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=Wf8X5omgUCDws1rOtaLrgrsexFOXN3/9UU728c0iMCo=; b=G9k7SX8+x0yvzTeYjRhce+rgw6vPA4QTwR7408zCxFckOBYJBpOT62jR2CElEUc+FIKe1x ukgb9sDdd+p1AJXlAReaDftNk9YkWuVhIhlc4RLs5afjKMYclyGMHr7xah6Ye/PVme7QTq y01HEcnL0wGR7BtY2JsSsb0p2Oi0cJU= X-MC-Unique: YtVkMZwNP-WuL4DdxrAK8g-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 17/23] tests/functional: Convert most ppc avocado tests into standalone tests Date: Wed, 24 Jul 2024 19:52:35 +0200 Message-ID: <20240724175248.1389201-18-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843766400116600 Nothing thrilling in here, just straight forward conversions. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- MAINTAINERS | 8 ++-- tests/functional/meson.build | 10 +++++ .../test_ppc64_powernv.py} | 45 +++++-------------- .../test_ppc64_pseries.py} | 45 +++++-------------- .../test_ppc_40p.py} | 37 ++++++--------- .../test_ppc_mpc8544ds.py} | 19 ++++---- .../test_ppc_virtex_ml507.py} | 19 ++++---- 7 files changed, 71 insertions(+), 112 deletions(-) rename tests/{avocado/ppc_powernv.py =3D> functional/test_ppc64_powernv.py= } (80%) mode change 100644 =3D> 100755 rename tests/{avocado/ppc_pseries.py =3D> functional/test_ppc64_pseries.py= } (83%) mode change 100644 =3D> 100755 rename tests/{avocado/ppc_prep_40p.py =3D> functional/test_ppc_40p.py} (78= %) mode change 100644 =3D> 100755 rename tests/{avocado/ppc_mpc8544ds.py =3D> functional/test_ppc_mpc8544ds.= py} (75%) mode change 100644 =3D> 100755 rename tests/{avocado/ppc_virtex_ml507.py =3D> functional/test_ppc_virtex_= ml507.py} (78%) mode change 100644 =3D> 100755 diff --git a/MAINTAINERS b/MAINTAINERS index 02cf39e94d..cec9a209a9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1449,7 +1449,7 @@ L: qemu-ppc@nongnu.org S: Orphan F: hw/ppc/mpc8544ds.c F: hw/ppc/mpc8544_guts.c -F: tests/avocado/ppc_mpc8544ds.py +F: tests/functional/test_ppc_mpc8544ds.py =20 New World (mac99) M: Mark Cave-Ayland @@ -1502,7 +1502,7 @@ F: hw/dma/i82374.c F: hw/rtc/m48t59-isa.c F: include/hw/isa/pc87312.h F: include/hw/rtc/m48t59.h -F: tests/avocado/ppc_prep_40p.py +F: tests/functional/test_ppc_40p.py =20 sPAPR (pseries) M: Nicholas Piggin @@ -1526,7 +1526,7 @@ F: tests/qtest/spapr* F: tests/qtest/libqos/*spapr* F: tests/qtest/rtas* F: tests/qtest/libqos/rtas* -F: tests/avocado/ppc_pseries.py +F: tests/functional/test_ppc64_pseries.py F: tests/avocado/ppc_hv_tests.py =20 PowerNV (Non-Virtualized) @@ -1558,7 +1558,7 @@ M: Edgar E. Iglesias L: qemu-ppc@nongnu.org S: Odd Fixes F: hw/ppc/virtex_ml507.c -F: tests/avocado/ppc_virtex_ml507.py +F: tests/functional/test_ppc_virtex_ml507.py =20 sam460ex M: BALATON Zoltan diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 91fe835e8f..510dddfc49 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -12,6 +12,8 @@ endif # Timeouts for individual tests that can be slow e.g. with debugging enabl= ed test_timeouts =3D { 'netdev_ethtool' : 180, + 'ppc_40p' : 240, + 'ppc64_powernv' : 120, 's390x_ccw_virtio' : 180, } =20 @@ -52,7 +54,15 @@ tests_ppc_quick =3D [ =20 tests_ppc_thorough =3D [ 'ppc_405', + 'ppc_40p', 'ppc_bamboo', + 'ppc_mpc8544ds', + 'ppc_virtex_ml507', +] + +tests_ppc64_thorough =3D [ + 'ppc64_powernv', + 'ppc64_pseries', ] =20 tests_riscv32_quick =3D [ diff --git a/tests/avocado/ppc_powernv.py b/tests/functional/test_ppc64_pow= ernv.py old mode 100644 new mode 100755 similarity index 80% rename from tests/avocado/ppc_powernv.py rename to tests/functional/test_ppc64_powernv.py index 4342941d5d..f3203e5609 --- a/tests/avocado/ppc_powernv.py +++ b/tests/functional/test_ppc64_powernv.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Test that Linux kernel boots on ppc powernv machines and check the conso= le # # Copyright (c) 2018, 2020 Red Hat, Inc. @@ -5,9 +7,8 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. =20 -from avocado.utils import archive -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern =20 class powernvMachine(QemuSystemTest): =20 @@ -30,23 +31,13 @@ def do_test_linux_boot(self, command_line =3D KERNEL_CO= MMON_COMMAND_LINE): self.vm.launch() =20 def test_linux_boot(self): - """ - :avocado: tags=3Darch:ppc64 - :avocado: tags=3Dmachine:powernv - :avocado: tags=3Daccel:tcg - """ - + self.set_machine('powernv') self.do_test_linux_boot() console_pattern =3D 'VFS: Cannot open root device' wait_for_console_pattern(self, console_pattern, self.panic_message) =20 def test_linux_smp_boot(self): - """ - :avocado: tags=3Darch:ppc64 - :avocado: tags=3Dmachine:powernv - :avocado: tags=3Daccel:tcg - """ - + self.set_machine('powernv') self.vm.add_args('-smp', '4') self.do_test_linux_boot() console_pattern =3D 'smp: Brought up 1 node, 4 CPUs' @@ -54,12 +45,7 @@ def test_linux_smp_boot(self): wait_for_console_pattern(self, self.good_message, self.panic_messa= ge) =20 def test_linux_smp_hpt_boot(self): - """ - :avocado: tags=3Darch:ppc64 - :avocado: tags=3Dmachine:powernv - :avocado: tags=3Daccel:tcg - """ - + self.set_machine('powernv') self.vm.add_args('-smp', '4') self.do_test_linux_boot(self.KERNEL_COMMON_COMMAND_LINE + 'disable_radix') @@ -70,12 +56,7 @@ def test_linux_smp_hpt_boot(self): wait_for_console_pattern(self, self.good_message, self.panic_messa= ge) =20 def test_linux_smt_boot(self): - """ - :avocado: tags=3Darch:ppc64 - :avocado: tags=3Dmachine:powernv - :avocado: tags=3Daccel:tcg - """ - + self.set_machine('powernv') self.vm.add_args('-smp', '4,threads=3D4') self.do_test_linux_boot() console_pattern =3D 'CPU maps initialized for 4 threads per core' @@ -85,12 +66,7 @@ def test_linux_smt_boot(self): wait_for_console_pattern(self, self.good_message, self.panic_messa= ge) =20 def test_linux_big_boot(self): - """ - :avocado: tags=3Darch:ppc64 - :avocado: tags=3Dmachine:powernv - :avocado: tags=3Daccel:tcg - """ - + self.set_machine('powernv') self.vm.add_args('-smp', '16,threads=3D4,cores=3D2,sockets=3D2') =20 # powernv does not support NUMA @@ -100,3 +76,6 @@ def test_linux_big_boot(self): console_pattern =3D 'smp: Brought up 2 nodes, 16 CPUs' wait_for_console_pattern(self, console_pattern, self.panic_message) wait_for_console_pattern(self, self.good_message, self.panic_messa= ge) + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() diff --git a/tests/avocado/ppc_pseries.py b/tests/functional/test_ppc64_pse= ries.py old mode 100644 new mode 100755 similarity index 83% rename from tests/avocado/ppc_pseries.py rename to tests/functional/test_ppc64_pseries.py index 74aaa4ac4a..9521ed80a5 --- a/tests/avocado/ppc_pseries.py +++ b/tests/functional/test_ppc64_pseries.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Test that Linux kernel boots on ppc machines and check the console # # Copyright (c) 2018, 2020 Red Hat, Inc. @@ -5,9 +7,8 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. =20 -from avocado.utils import archive -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern =20 class pseriesMachine(QemuSystemTest): =20 @@ -29,32 +30,20 @@ def do_test_ppc64_linux_boot(self, kernel_command_line = =3D KERNEL_COMMON_COMMAND_L self.vm.launch() =20 def test_ppc64_vof_linux_boot(self): - """ - :avocado: tags=3Darch:ppc64 - :avocado: tags=3Dmachine:pseries - """ - + self.set_machine('pseries') self.vm.add_args('-machine', 'x-vof=3Don') self.do_test_ppc64_linux_boot() console_pattern =3D 'VFS: Cannot open root device' wait_for_console_pattern(self, console_pattern, self.panic_message) =20 def test_ppc64_linux_boot(self): - """ - :avocado: tags=3Darch:ppc64 - :avocado: tags=3Dmachine:pseries - """ - + self.set_machine('pseries') self.do_test_ppc64_linux_boot() console_pattern =3D 'VFS: Cannot open root device' wait_for_console_pattern(self, console_pattern, self.panic_message) =20 def test_ppc64_linux_smp_boot(self): - """ - :avocado: tags=3Darch:ppc64 - :avocado: tags=3Dmachine:pseries - """ - + self.set_machine('pseries') self.vm.add_args('-smp', '4') self.do_test_ppc64_linux_boot() console_pattern =3D 'smp: Brought up 1 node, 4 CPUs' @@ -62,11 +51,7 @@ def test_ppc64_linux_smp_boot(self): wait_for_console_pattern(self, self.good_message, self.panic_messa= ge) =20 def test_ppc64_linux_hpt_smp_boot(self): - """ - :avocado: tags=3Darch:ppc64 - :avocado: tags=3Dmachine:pseries - """ - + self.set_machine('pseries') self.vm.add_args('-smp', '4') self.do_test_ppc64_linux_boot(self.KERNEL_COMMON_COMMAND_LINE + 'disable_radix') @@ -77,11 +62,6 @@ def test_ppc64_linux_hpt_smp_boot(self): wait_for_console_pattern(self, self.good_message, self.panic_messa= ge) =20 def test_ppc64_linux_smt_boot(self): - """ - :avocado: tags=3Darch:ppc64 - :avocado: tags=3Dmachine:pseries - """ - self.vm.add_args('-smp', '4,threads=3D4') self.do_test_ppc64_linux_boot() console_pattern =3D 'CPU maps initialized for 4 threads per core' @@ -91,11 +71,7 @@ def test_ppc64_linux_smt_boot(self): wait_for_console_pattern(self, self.good_message, self.panic_messa= ge) =20 def test_ppc64_linux_big_boot(self): - """ - :avocado: tags=3Darch:ppc64 - :avocado: tags=3Dmachine:pseries - """ - + self.set_machine('pseries') self.vm.add_args('-smp', '16,threads=3D4,cores=3D2,sockets=3D2') self.vm.add_args('-m', '512M', '-object', 'memory-backend-ram,size=3D256M,id=3Dm= 0', @@ -108,3 +84,6 @@ def test_ppc64_linux_big_boot(self): console_pattern =3D 'smp: Brought up 2 nodes, 16 CPUs' wait_for_console_pattern(self, console_pattern, self.panic_message) wait_for_console_pattern(self, self.good_message, self.panic_messa= ge) + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() diff --git a/tests/avocado/ppc_prep_40p.py b/tests/functional/test_ppc_40p.= py old mode 100644 new mode 100755 similarity index 78% rename from tests/avocado/ppc_prep_40p.py rename to tests/functional/test_ppc_40p.py index d4f1eb7e1d..c3f713dc51 --- a/tests/avocado/ppc_prep_40p.py +++ b/tests/functional/test_ppc_40p.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Functional test that boots a PReP/40p machine and checks its serial cons= ole. # # Copyright (c) Philippe Mathieu-Daud=C3=A9 @@ -7,9 +9,9 @@ =20 import os =20 -from avocado import skipUnless -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern +from unittest import skipUnless +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern =20 =20 class IbmPrep40pMachine(QemuSystemTest): @@ -23,13 +25,7 @@ class IbmPrep40pMachine(QemuSystemTest): # restricted by GSA ADP Schedule Contract with IBM Corp. @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code= ') def test_factory_firmware_and_netbsd(self): - """ - :avocado: tags=3Darch:ppc - :avocado: tags=3Dmachine:40p - :avocado: tags=3Dos:netbsd - :avocado: tags=3Dslowness:high - :avocado: tags=3Daccel:tcg - """ + self.set_machine('40p') self.require_accelerator("tcg") bios_url =3D ('http://ftpmirror.your.org/pub/misc/' 'ftp.software.ibm.com/rs6000/firmware/' @@ -50,11 +46,7 @@ def test_factory_firmware_and_netbsd(self): wait_for_console_pattern(self, 'Model: IBM PPS Model 6015') =20 def test_openbios_192m(self): - """ - :avocado: tags=3Darch:ppc - :avocado: tags=3Dmachine:40p - :avocado: tags=3Daccel:tcg - """ + self.set_machine('40p') self.require_accelerator("tcg") self.vm.set_console() self.vm.add_args('-m', '192') # test fw_cfg @@ -65,21 +57,18 @@ def test_openbios_192m(self): wait_for_console_pattern(self, '>> CPU type PowerPC,604') =20 def test_openbios_and_netbsd(self): - """ - :avocado: tags=3Darch:ppc - :avocado: tags=3Dmachine:40p - :avocado: tags=3Dos:netbsd - :avocado: tags=3Daccel:tcg - """ + self.set_machine('40p') self.require_accelerator("tcg") drive_url =3D ('https://archive.netbsd.org/pub/NetBSD-archive/' 'NetBSD-7.1.2/iso/NetBSD-7.1.2-prep.iso') - drive_hash =3D 'ac6fa2707d888b36d6fa64de6e7fe48e' - drive_path =3D self.fetch_asset(drive_url, asset_hash=3Ddrive_hash, - algorithm=3D'md5') + drive_hash =3D 'cc7cb290b06aaa839362deb7bd9f417ac5015557db24088508= 330f76c3f825ec' + drive_path =3D self.fetch_asset(drive_url, asset_hash=3Ddrive_hash) self.vm.set_console() self.vm.add_args('-cdrom', drive_path, '-boot', 'd') =20 self.vm.launch() wait_for_console_pattern(self, 'NetBSD/prep BOOT, Revision 1.9') + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() diff --git a/tests/avocado/ppc_mpc8544ds.py b/tests/functional/test_ppc_mpc= 8544ds.py old mode 100644 new mode 100755 similarity index 75% rename from tests/avocado/ppc_mpc8544ds.py rename to tests/functional/test_ppc_mpc8544ds.py index b599fb1cc9..6817ed8091 --- a/tests/avocado/ppc_mpc8544ds.py +++ b/tests/functional/test_ppc_mpc8544ds.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Test that Linux kernel boots on ppc machines and check the console # # Copyright (c) 2018, 2020 Red Hat, Inc. @@ -5,9 +7,9 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. =20 -from avocado.utils import archive -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern +from qemu_test.utils import archive_extract +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern =20 class Mpc8544dsMachine(QemuSystemTest): =20 @@ -16,19 +18,18 @@ class Mpc8544dsMachine(QemuSystemTest): panic_message =3D 'Kernel panic - not syncing' =20 def test_ppc_mpc8544ds(self): - """ - :avocado: tags=3Darch:ppc - :avocado: tags=3Dmachine:mpc8544ds - :avocado: tags=3Daccel:tcg - """ self.require_accelerator("tcg") + self.set_machine('mpc8544ds') tar_url =3D ('https://qemu-advcal.gitlab.io' '/qac-best-of-multiarch/download/day04.tar.xz') tar_hash =3D 'f46724d281a9f30fa892d458be7beb7d34dc25f9' file_path =3D self.fetch_asset(tar_url, asset_hash=3Dtar_hash) - archive.extract(file_path, self.workdir) + archive_extract(file_path, self.workdir, member=3D'creek/creek.bin= ') self.vm.set_console() self.vm.add_args('-kernel', self.workdir + '/creek/creek.bin') self.vm.launch() wait_for_console_pattern(self, 'QEMU advent calendar 2020', self.panic_message) + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() diff --git a/tests/avocado/ppc_virtex_ml507.py b/tests/functional/test_ppc_= virtex_ml507.py old mode 100644 new mode 100755 similarity index 78% rename from tests/avocado/ppc_virtex_ml507.py rename to tests/functional/test_ppc_virtex_ml507.py index a73f8ae396..6d1f1455be --- a/tests/avocado/ppc_virtex_ml507.py +++ b/tests/functional/test_ppc_virtex_ml507.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Test that Linux kernel boots on ppc machines and check the console # # Copyright (c) 2018, 2020 Red Hat, Inc. @@ -5,9 +7,9 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. =20 -from avocado.utils import archive -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern +from qemu_test.utils import archive_extract +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern =20 class VirtexMl507Machine(QemuSystemTest): =20 @@ -16,17 +18,13 @@ class VirtexMl507Machine(QemuSystemTest): panic_message =3D 'Kernel panic - not syncing' =20 def test_ppc_virtex_ml507(self): - """ - :avocado: tags=3Darch:ppc - :avocado: tags=3Dmachine:virtex-ml507 - :avocado: tags=3Daccel:tcg - """ self.require_accelerator("tcg") + self.set_machine('virtex-ml507') tar_url =3D ('https://qemu-advcal.gitlab.io' '/qac-best-of-multiarch/download/day08.tar.xz') tar_hash =3D '74c68f5af7a7b8f21c03097b298f3bb77ff52c1f' file_path =3D self.fetch_asset(tar_url, asset_hash=3Dtar_hash) - archive.extract(file_path, self.workdir) + archive_extract(file_path, self.workdir) self.vm.set_console() self.vm.add_args('-kernel', self.workdir + '/hippo/hippo.linux', '-dtb', self.workdir + '/hippo/virtex440-ml507.dt= b', @@ -34,3 +32,6 @@ def test_ppc_virtex_ml507(self): self.vm.launch() wait_for_console_pattern(self, 'QEMU advent calendar 2020', self.panic_message) + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843847; cv=none; d=zohomail.com; s=zohoarc; b=dipcZfmslcCCg/Dsn7F6YT00vSvt9VrXTlkGuclBS2oEaku0FeV2XcZ1WzZ5wFgfhqcWzYEUrqMJsunsXYmKwUoT8UKeEZsXzma99C1UZXN6sIo0/oPgXf8CoCiro4qSwYIhIRYUjxSHjhNb/OfU/1E0UEmSy/P8JLAJwQxW1mg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843847; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SBPnFHA3/SvhdcYJ5iUG96GiCxN1rPqAFZwl1MsgMXY=; b=j0KYVda1rdOnzo2kTjw5PDkHGE3JoSs2ICB1xOnIUVisb0ncDzmcOhfTntjPklDA3E554HEtU6o8uutTceWx0aoFf5Jsc+wE00Cv7XVh37aP6BY6SjsEOsVmtRPpjPh0WeMenazY4w71tU/65Z7YwegWsVt4xxQUXzmXLJN7jpo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721843847862376.4887986862001; Wed, 24 Jul 2024 10:57:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgDZ-0004nY-5q; Wed, 24 Jul 2024 13:56:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCQ-00073k-Il for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCL-0005zX-Ug for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:49 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-154-pAsZrwHvO6SC4KcXw92fXA-1; Wed, 24 Jul 2024 13:54:39 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7AEFB1956080; Wed, 24 Jul 2024 17:54:37 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 469371955D42; Wed, 24 Jul 2024 17:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SBPnFHA3/SvhdcYJ5iUG96GiCxN1rPqAFZwl1MsgMXY=; b=g0bZW351IPjhA/AV9Q/0QyjCEJLZTq8l2mFh8aRNxRj4f9fBHXzdOvC6KJJsyvTwBWE6sV XUxbj9XkpCBxIcak5hAh8kPsqFa8wjqMf+K/8jcaO/WqLpfmVdSL4hTiM9ABM8Hh/vajWj gVyGK7NAnJsu9vD9RKoBxvQsM6aG1NA= X-MC-Unique: pAsZrwHvO6SC4KcXw92fXA-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 18/23] tests/functional: Convert the ppc_amiga avocado test into a standalone test Date: Wed, 24 Jul 2024 19:52:36 +0200 Message-ID: <20240724175248.1389201-19-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843848730116600 Content-Type: text/plain; charset="utf-8" Use the Python standard zipfile module instead of avocado.utils for extracting the ZIP file that we download here, and use the standard subprocess module for running the "tail" command. Signed-off-by: Thomas Huth --- tests/functional/meson.build | 1 + .../test_ppc_amiga.py} | 33 ++++++++++--------- 2 files changed, 19 insertions(+), 15 deletions(-) rename tests/{avocado/ppc_amiga.py =3D> functional/test_ppc_amiga.py} (54%) mode change 100644 =3D> 100755 diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 510dddfc49..74347cf545 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -55,6 +55,7 @@ tests_ppc_quick =3D [ tests_ppc_thorough =3D [ 'ppc_405', 'ppc_40p', + 'ppc_amiga', 'ppc_bamboo', 'ppc_mpc8544ds', 'ppc_virtex_ml507', diff --git a/tests/avocado/ppc_amiga.py b/tests/functional/test_ppc_amiga.py old mode 100644 new mode 100755 similarity index 54% rename from tests/avocado/ppc_amiga.py rename to tests/functional/test_ppc_amiga.py index b6f866f91d..6fdb334346 --- a/tests/avocado/ppc_amiga.py +++ b/tests/functional/test_ppc_amiga.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Test AmigaNG boards # # Copyright (c) 2023 BALATON Zoltan @@ -5,34 +7,35 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. =20 -from avocado.utils import archive -from avocado.utils import process -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern +import subprocess + +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern, run_cmd +from zipfile import ZipFile =20 class AmigaOneMachine(QemuSystemTest): =20 timeout =3D 90 =20 def test_ppc_amigaone(self): - """ - :avocado: tags=3Darch:ppc - :avocado: tags=3Dmachine:amigaone - :avocado: tags=3Ddevice:articia - :avocado: tags=3Daccel:tcg - """ self.require_accelerator("tcg") + self.set_machine('amigaone') tar_name =3D 'A1Firmware_Floppy_05-Mar-2005.zip' tar_url =3D ('https://www.hyperion-entertainment.com/index.php/' 'downloads?view=3Ddownload&format=3Draw&file=3D25') tar_hash =3D 'c52e59bc73e31d8bcc3cc2106778f7ac84f6c755' - zip_file =3D self.fetch_asset(tar_name, locations=3Dtar_url, - asset_hash=3Dtar_hash) - archive.extract(zip_file, self.workdir) - cmd =3D f"tail -c 524288 {self.workdir}/floppy_edition/updater.ima= ge >{self.workdir}/u-boot-amigaone.bin" - process.run(cmd, shell=3DTrue) + zip_file =3D self.fetch_asset(tar_url, asset_hash=3Dtar_hash) + with ZipFile(zip_file, 'r') as zf: + zf.extractall(path=3Dself.workdir) + bios_fh =3D open(self.workdir + "/u-boot-amigaone.bin", "wb") + subprocess.run(['tail', '-c', '524288', + self.workdir + "/floppy_edition/updater.image"], + stdout=3Dbios_fh) =20 self.vm.set_console() self.vm.add_args('-bios', self.workdir + '/u-boot-amigaone.bin') self.vm.launch() wait_for_console_pattern(self, 'FLASH:') + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843811; cv=none; d=zohomail.com; s=zohoarc; b=EPoTw2L4jyO9jkTTJHfJKrw2lBnG5DXw8qesDuQyDKkcg7EWFCbaxSdexNDvhDMTJRnVRf0UEOBlx+gCBA3s8s4BGTUSV9HG9jVx7oRWyVTqNUzxfy74oNYfA33kuxLCCdCrngF778H4xBsB3QWQ5ElHIJ5ctj4qsINE508HMOY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843811; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SMvhKTE2qsY+wTNyXs0fBA34JiorTFeyb34Ousut7VU=; b=i1WdoJNDawrYryFBi3OHwxMRgWXtmObjIqgEA9A/wCPqG0ZCyGri0Nio4gD13eKqaMaQ6TXO+b98GtChmXR3L1TtsxdpfqMAOTFZ50mgm7ttQUq55+5NO9ope5COW53m0JCwoCcBJUlGy5hVUSzyyyMScyfu+N6jXR9MyVyg6/k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17218438116431004.6919200695733; Wed, 24 Jul 2024 10:56:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgD0-0001Xy-Ix; Wed, 24 Jul 2024 13:55:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCS-0007FI-14 for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCO-000603-PY for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:54:50 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-130-FTFiEbJyN9StYKXoO29StQ-1; Wed, 24 Jul 2024 13:54:44 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7C98F1944B29; Wed, 24 Jul 2024 17:54:43 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2E49C1955D42; Wed, 24 Jul 2024 17:54:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SMvhKTE2qsY+wTNyXs0fBA34JiorTFeyb34Ousut7VU=; b=OqZm9SNMJ4Wn2qRl2f3AlhEtGjlQ41VEoi3tHGr010aouIyhQbCSbu9ZzAWH80e9FTmso9 Bi1a4YRKcpHudCuo4z8Au1cWzG9+SBvastGmUYID6ursZT62h5Yi7yyYxCUmpJ2tXocwSs a/HCrBkWGG1vJ3kg9A1lUre5dpOSXzw= X-MC-Unique: FTFiEbJyN9StYKXoO29StQ-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 19/23] tests/functional: Convert the ppc_hv avocado test into a standalone test Date: Wed, 24 Jul 2024 19:52:37 +0200 Message-ID: <20240724175248.1389201-20-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843812495116600 Content-Type: text/plain; charset="utf-8" Note: The original Avocado test seems currently to be broken, it hangs when the guest is trying to install additional packages. So mark it as broken for now until it gets fixed. Signed-off-by: Thomas Huth --- .../test_ppc64_hv.py} | 36 ++++++++----------- 1 file changed, 14 insertions(+), 22 deletions(-) rename tests/{avocado/ppc_hv_tests.py =3D> functional/test_ppc64_hv.py} (9= 2%) mode change 100644 =3D> 100755 diff --git a/tests/avocado/ppc_hv_tests.py b/tests/functional/test_ppc64_hv= .py old mode 100644 new mode 100755 similarity index 92% rename from tests/avocado/ppc_hv_tests.py rename to tests/functional/test_ppc64_hv.py index bf8822bb97..acba3e01b9 --- a/tests/avocado/ppc_hv_tests.py +++ b/tests/functional/test_ppc64_hv.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Tests that specifically try to exercise hypervisor features of the # target machines. powernv supports the Power hypervisor ISA, and # pseries supports the nested-HV hypervisor spec. @@ -7,10 +9,10 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. =20 -from avocado import skipIf, skipUnless -from avocado.utils import archive -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern, exec_command +from unittest import skipIf, skipUnless +from qemu_test.utils import archive_extract +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern, exec_command import os import time import subprocess @@ -47,7 +49,7 @@ def missing_deps(): @skipIf(missing_deps(), 'dependencies (%s) not installed' % ','.join(deps)) @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test sometimes gets stuck= due to console handling problem') @skipUnless(os.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage limited') -@skipUnless(os.getenv('SPEED') =3D=3D 'slow', 'runtime limited') +@skip('broken test - guest fails to install packages') class HypervisorTest(QemuSystemTest): =20 timeout =3D 1000 @@ -88,8 +90,7 @@ def setUp(self): =20 # Alpine use sha256 so I recalculated this myself iso_sha256 =3D 'c26b8d3e17c2f3f0fed02b4b1296589c2390e6d5548610099a= f75300edd7b3ff' - iso_path =3D self.fetch_asset(iso_url, asset_hash=3Diso_sha256, - algorithm =3D "sha256") + iso_path =3D self.fetch_asset(iso_url, asset_hash=3Diso_sha256) =20 self.iso_path =3D iso_path self.vmlinuz =3D self.extract_from_iso(iso_path, '/boot/vmlinuz-lt= s') @@ -159,12 +160,8 @@ def do_test_kvm(self, hpt=3DFalse): wait_for_console_pattern(self, 'alpine:~#') =20 def test_hv_pseries(self): - """ - :avocado: tags=3Darch:ppc64 - :avocado: tags=3Dmachine:pseries - :avocado: tags=3Daccel:tcg - """ self.require_accelerator("tcg") + self.set_machine('pseries') self.vm.add_args("-accel", "tcg,thread=3Dmulti") self.vm.add_args('-device', 'nvme,serial=3D1234,drive=3Ddrive0') self.vm.add_args("-machine", "x-vof=3Don,cap-nested-hv=3Don") @@ -174,12 +171,8 @@ def test_hv_pseries(self): self.do_stop_alpine() =20 def test_hv_pseries_kvm(self): - """ - :avocado: tags=3Darch:ppc64 - :avocado: tags=3Dmachine:pseries - :avocado: tags=3Daccel:kvm - """ self.require_accelerator("kvm") + self.set_machine('pseries') self.vm.add_args("-accel", "kvm") self.vm.add_args('-device', 'nvme,serial=3D1234,drive=3Ddrive0') self.vm.add_args("-machine", "x-vof=3Don,cap-nested-hv=3Don,cap-cc= f-assist=3Doff") @@ -189,12 +182,8 @@ def test_hv_pseries_kvm(self): self.do_stop_alpine() =20 def test_hv_powernv(self): - """ - :avocado: tags=3Darch:ppc64 - :avocado: tags=3Dmachine:powernv - :avocado: tags=3Daccel:tcg - """ self.require_accelerator("tcg") + self.set_machine('powernv') self.vm.add_args("-accel", "tcg,thread=3Dmulti") self.vm.add_args('-device', 'nvme,bus=3Dpcie.2,addr=3D0x0,serial= =3D1234,drive=3Ddrive0', '-device', 'e1000e,netdev=3Dnet0,mac=3DC0:FF:EE:0= 0:00:02,bus=3Dpcie.0,addr=3D0x0', @@ -204,3 +193,6 @@ def test_hv_powernv(self): self.do_test_kvm() self.do_test_kvm(True) self.do_stop_alpine() + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843795; cv=none; d=zohomail.com; s=zohoarc; b=Tz2KHRHSbGDZv9kgwJmfKWoWqDsjDYibThwtZobYRXlXCdJ1t5Yl5G544mCNrN1B713wSg5juBkKiir/DjCf5Mus4n/Q4YuFu3BnO1DB4Sx2s2nRd9UqpOTv7cO0ZZSbxfC2NNV+UDfPMReyxFzczxbJxfQxZ8K68wwE2R3Oj+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843795; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HG7eUfDGlcxerSL0HZi4cDvZ7LNvLXtyR8x7NMPMCLg=; b=Q5c9VwZ37R7zqBg/su+YERiV8J2mbxKeqb2eIuJ++fSzCFwoLleBnjZWZqAYDLbCICpfPu6+qivZODdczernET3f+Elz7VcM4pe6GTn5ZMf9jh/V7CMJv9zhpRVBisjJKvPgXJOxslKBmCZ27hcc+K/rgOP0vd/b1jBwh16rxoE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721843795265132.90982823721322; Wed, 24 Jul 2024 10:56:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgDP-00033l-Vm; Wed, 24 Jul 2024 13:55:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCi-0000B2-D8 for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:55:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCa-00061A-Fd for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:55:08 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-424-U809HdEuN3uKshoVw5vnZw-1; Wed, 24 Jul 2024 13:54:50 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 00AC01979201; Wed, 24 Jul 2024 17:54:49 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 262721955D42; Wed, 24 Jul 2024 17:54:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843697; 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=HG7eUfDGlcxerSL0HZi4cDvZ7LNvLXtyR8x7NMPMCLg=; b=ZeQbAm3knNZPLgXpr7R5QXQf1xC0lZdmekc8JUBbSwNUVMfTBRCqtBL/dG8gcgmNX9sVtA DiNstpUblO7Q76ErPcpIpra1HXvZOE1r/0yoo15ig+sJPDGu0sYXYV97X5lpA1ssfmA9Gc uEXSluRLsp51MBsQCjcXvXTSfPyk3tE= X-MC-Unique: U809HdEuN3uKshoVw5vnZw-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 20/23] tests/functional: Convert the m68k nextcube test with tesseract Date: Wed, 24 Jul 2024 19:52:38 +0200 Message-ID: <20240724175248.1389201-21-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843796559116600 The code that handles running of tesseract needs to be tweaked a little bit to be able to run without the functions from avocado.utils, and while we're at it, drop some legacy stuff that was still there due to Tesseract 3 support that we already dropped a while ago. Signed-off-by: Thomas Huth --- tests/avocado/tesseract_utils.py | 46 ------------------- tests/functional/meson.build | 4 ++ tests/functional/qemu_test/tesseract.py | 35 ++++++++++++++ .../test_m68k_nextcube.py} | 20 ++++---- 4 files changed, 50 insertions(+), 55 deletions(-) delete mode 100644 tests/avocado/tesseract_utils.py create mode 100644 tests/functional/qemu_test/tesseract.py rename tests/{avocado/machine_m68k_nextcube.py =3D> functional/test_m68k_n= extcube.py} (86%) mode change 100644 =3D> 100755 diff --git a/tests/avocado/tesseract_utils.py b/tests/avocado/tesseract_uti= ls.py deleted file mode 100644 index 476f528147..0000000000 --- a/tests/avocado/tesseract_utils.py +++ /dev/null @@ -1,46 +0,0 @@ -# ... -# -# Copyright (c) 2019 Philippe Mathieu-Daud=C3=A9 -# -# 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 re -import logging - -from avocado.utils import process -from avocado.utils.path import find_command, CmdNotFoundError - -def tesseract_available(expected_version): - try: - find_command('tesseract') - except CmdNotFoundError: - return False - res =3D process.run('tesseract --version') - try: - version =3D res.stdout_text.split()[1] - except IndexError: - version =3D res.stderr_text.split()[1] - return int(version.split('.')[0]) >=3D expected_version - - match =3D re.match(r'tesseract\s(\d)', res) - if match is None: - return False - # now this is guaranteed to be a digit - return int(match.groups()[0]) >=3D expected_version - - -def tesseract_ocr(image_path, tesseract_args=3D'', tesseract_version=3D3): - console_logger =3D logging.getLogger('tesseract') - console_logger.debug(image_path) - if tesseract_version =3D=3D 4: - tesseract_args +=3D ' --oem 1' - proc =3D process.run("tesseract {} {} stdout".format(tesseract_args, - image_path)) - lines =3D [] - for line in proc.stdout_text.split('\n'): - sline =3D line.strip() - if len(sline): - console_logger.debug(sline) - lines +=3D [sline] - return lines diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 74347cf545..109e0408e4 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -36,6 +36,10 @@ tests_loongarch64_thorough =3D [ 'loongarch64_virt', ] =20 +tests_m68k_thorough =3D [ + 'm68k_nextcube' +] + tests_microblaze_thorough =3D [ 'microblaze_s3adsp1800' ] diff --git a/tests/functional/qemu_test/tesseract.py b/tests/functional/qem= u_test/tesseract.py new file mode 100644 index 0000000000..c4087b7c11 --- /dev/null +++ b/tests/functional/qemu_test/tesseract.py @@ -0,0 +1,35 @@ +# ... +# +# Copyright (c) 2019 Philippe Mathieu-Daud=C3=A9 +# +# 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 re +import logging + +from . import has_cmd, run_cmd + +def tesseract_available(expected_version): + if not has_cmd('tesseract'): + return False + (stdout, stderr, ret) =3D run_cmd([ 'tesseract', '--version']) + if ret: + return False + version =3D stdout.split()[1] + return int(version.split('.')[0]) >=3D expected_version + +def tesseract_ocr(image_path, tesseract_args=3D''): + console_logger =3D logging.getLogger('console') + console_logger.debug(image_path) + (stdout, stderr, ret) =3D run_cmd(['tesseract', image_path, + 'stdout']) + if ret: + return None + lines =3D [] + for line in stdout.split('\n'): + sline =3D line.strip() + if len(sline): + console_logger.debug(sline) + lines +=3D [sline] + return lines diff --git a/tests/avocado/machine_m68k_nextcube.py b/tests/functional/test= _m68k_nextcube.py old mode 100644 new mode 100755 similarity index 86% rename from tests/avocado/machine_m68k_nextcube.py rename to tests/functional/test_m68k_nextcube.py index 1f3c883910..4595032af5 --- a/tests/avocado/machine_m68k_nextcube.py +++ b/tests/functional/test_m68k_nextcube.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Functional test that boots a VM and run OCR on the framebuffer # # Copyright (c) 2019 Philippe Mathieu-Daud=C3=A9 @@ -8,10 +10,10 @@ import os import time =20 -from avocado_qemu import QemuSystemTest -from avocado import skipUnless +from qemu_test import QemuSystemTest +from unittest import skipUnless =20 -from tesseract_utils import tesseract_available, tesseract_ocr +from qemu_test.tesseract import tesseract_available, tesseract_ocr =20 PIL_AVAILABLE =3D True try: @@ -21,11 +23,6 @@ =20 =20 class NextCubeMachine(QemuSystemTest): - """ - :avocado: tags=3Darch:m68k - :avocado: tags=3Dmachine:next-cube - :avocado: tags=3Ddevice:framebuffer - """ =20 timeout =3D 15 =20 @@ -48,6 +45,7 @@ def check_bootrom_framebuffer(self, screenshot_path): =20 @skipUnless(PIL_AVAILABLE, 'Python PIL not installed') def test_bootrom_framebuffer_size(self): + self.set_machine('next-cube') screenshot_path =3D os.path.join(self.workdir, "dump.ppm") self.check_bootrom_framebuffer(screenshot_path) =20 @@ -60,11 +58,15 @@ def test_bootrom_framebuffer_size(self): # that it is still alpha-level software. @skipUnless(tesseract_available(4), 'tesseract OCR tool not available') def test_bootrom_framebuffer_ocr_with_tesseract(self): + self.set_machine('next-cube') screenshot_path =3D os.path.join(self.workdir, "dump.ppm") self.check_bootrom_framebuffer(screenshot_path) - lines =3D tesseract_ocr(screenshot_path, tesseract_version=3D4) + lines =3D tesseract_ocr(screenshot_path) text =3D '\n'.join(lines) self.assertIn('Testing the FPU', text) self.assertIn('System test failed. Error code', text) self.assertIn('Boot command', text) self.assertIn('Next>', text) + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843763; cv=none; d=zohomail.com; s=zohoarc; b=hISOSzhSOzHo85bfV4aIqbtkJN/fMXmH6Jn4Ajm2RsTeYPQRXjgS7CiN46Ml3xetd6JM9tgIQgVYkqhccWNGRsyQCwqjArJhWn1zxjKC1n+RVmJkmi49jeFjQvm6ypJncOaqNuLGijJ3wc04JRxxwGdM9WqUEmYRRXkUqZXOnmk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843763; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+SD5m8qQwNcVObfcscMhGfK6HWkYOwHdm2EdrUNkLD8=; b=QYBfFljoHQUwjncxxKP+CbiI57UlV7itWT7jnA87BCYLxHsVZ3OQAPu2hnY1c+TRSrnpUIVkJtQPD5i77xPuostLI12btKShS/XWFVBVRuZ0F5eFu6zIrReC3B5ns7FqS3v7d6+rtIglrOULzBJNz9Bq0BL5LOYHBI2QzxxEdRE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721843763857551.9836144834976; Wed, 24 Jul 2024 10:56:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgDN-0002ik-GQ; Wed, 24 Jul 2024 13:55:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCq-0000lH-1C for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:55:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCg-00061J-Ic for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:55:09 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-661-qbgQK-4BNTWv5V00bgo0Kw-1; Wed, 24 Jul 2024 13:54:56 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A09141944B29; Wed, 24 Jul 2024 17:54:54 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7068B1955D48; Wed, 24 Jul 2024 17:54:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+SD5m8qQwNcVObfcscMhGfK6HWkYOwHdm2EdrUNkLD8=; b=fuQSdBrvuIXnRT6/lRqckynnk0WCxWSbwxAlk+rgZLl+hNCh6glrK35j0tl2vB1YXVSq7z ocSvuQo7veU8sU3kHx1lk6ZZ4OY9kiJXkkYbskDtaOXmGJsKFBwuUvbVCYsIrEtkMTkUS0 Qo5J2in/wpi2+VxlpfAjaL72xUjBRyA= X-MC-Unique: qbgQK-4BNTWv5V00bgo0Kw-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 21/23] tests/functional: Convert the acpi-bits test into a standalone test Date: Wed, 24 Jul 2024 19:52:39 +0200 Message-ID: <20240724175248.1389201-22-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843764364116600 Content-Type: text/plain; charset="utf-8" Mostly a straight-forward conversion. Looks like we can simply drop the avocado datadrainer stuff when not using the avocado framework anymore. Signed-off-by: Thomas Huth --- .../acpi-bits/bits-config/bits-cfg.txt | 0 .../acpi-bits/bits-tests/smbios.py2 | 0 .../acpi-bits/bits-tests/smilatency.py2 | 0 .../acpi-bits/bits-tests/testacpi.py2 | 0 .../acpi-bits/bits-tests/testcpuid.py2 | 0 tests/functional/meson.build | 2 ++ .../test_acpi_bits.py} | 29 ++++++++----------- 7 files changed, 14 insertions(+), 17 deletions(-) rename tests/{avocado =3D> functional}/acpi-bits/bits-config/bits-cfg.txt = (100%) rename tests/{avocado =3D> functional}/acpi-bits/bits-tests/smbios.py2 (10= 0%) rename tests/{avocado =3D> functional}/acpi-bits/bits-tests/smilatency.py2= (100%) rename tests/{avocado =3D> functional}/acpi-bits/bits-tests/testacpi.py2 (= 100%) rename tests/{avocado =3D> functional}/acpi-bits/bits-tests/testcpuid.py2 = (100%) rename tests/{avocado/acpi-bits.py =3D> functional/test_acpi_bits.py} (95%) mode change 100644 =3D> 100755 diff --git a/tests/avocado/acpi-bits/bits-config/bits-cfg.txt b/tests/funct= ional/acpi-bits/bits-config/bits-cfg.txt similarity index 100% rename from tests/avocado/acpi-bits/bits-config/bits-cfg.txt rename to tests/functional/acpi-bits/bits-config/bits-cfg.txt diff --git a/tests/avocado/acpi-bits/bits-tests/smbios.py2 b/tests/function= al/acpi-bits/bits-tests/smbios.py2 similarity index 100% rename from tests/avocado/acpi-bits/bits-tests/smbios.py2 rename to tests/functional/acpi-bits/bits-tests/smbios.py2 diff --git a/tests/avocado/acpi-bits/bits-tests/smilatency.py2 b/tests/func= tional/acpi-bits/bits-tests/smilatency.py2 similarity index 100% rename from tests/avocado/acpi-bits/bits-tests/smilatency.py2 rename to tests/functional/acpi-bits/bits-tests/smilatency.py2 diff --git a/tests/avocado/acpi-bits/bits-tests/testacpi.py2 b/tests/functi= onal/acpi-bits/bits-tests/testacpi.py2 similarity index 100% rename from tests/avocado/acpi-bits/bits-tests/testacpi.py2 rename to tests/functional/acpi-bits/bits-tests/testacpi.py2 diff --git a/tests/avocado/acpi-bits/bits-tests/testcpuid.py2 b/tests/funct= ional/acpi-bits/bits-tests/testcpuid.py2 similarity index 100% rename from tests/avocado/acpi-bits/bits-tests/testcpuid.py2 rename to tests/functional/acpi-bits/bits-tests/testcpuid.py2 diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 109e0408e4..52328f44b6 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -11,6 +11,7 @@ endif =20 # Timeouts for individual tests that can be slow e.g. with debugging enabl= ed test_timeouts =3D { + 'acpi_bits' : 240, 'netdev_ethtool' : 180, 'ppc_40p' : 240, 'ppc64_powernv' : 120, @@ -96,6 +97,7 @@ tests_x86_64_quick =3D [ ] =20 tests_x86_64_thorough =3D [ + 'acpi_bits', 'netdev_ethtool', 'virtio_gpu', ] diff --git a/tests/avocado/acpi-bits.py b/tests/functional/test_acpi_bits.py old mode 100644 new mode 100755 similarity index 95% rename from tests/avocado/acpi-bits.py rename to tests/functional/test_acpi_bits.py index efe4f52ee0..697fa4e768 --- a/tests/avocado/acpi-bits.py +++ b/tests/functional/test_acpi_bits.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# group: rw quick +# # Exercise QEMU generated ACPI/SMBIOS tables using biosbits, # https://biosbits.org/ # @@ -41,15 +41,16 @@ import tempfile import time import zipfile + +from pathlib import Path from typing import ( List, Optional, Sequence, ) from qemu.machine import QEMUMachine -from avocado import skipIf -from avocado.utils import datadrainer as drainer -from avocado_qemu import QemuBaseTest +from unittest import skipIf +from qemu_test import QemuBaseTest =20 deps =3D ["xorriso", "mformat"] # dependent tools needed in the test setup= /box. supported_platforms =3D ['x86_64'] # supported test platforms. @@ -129,10 +130,6 @@ def base_args(self): class AcpiBitsTest(QemuBaseTest): #pylint: disable=3Dtoo-many-instance-att= ributes """ ACPI and SMBIOS tests using biosbits. - - :avocado: tags=3Darch:x86_64 - :avocado: tags=3Dacpi - """ # in slower systems the test can take as long as 3 minutes to complete. timeout =3D BITS_TIMEOUT @@ -155,8 +152,7 @@ def __init__(self, *args, **kwargs): "download?job=3Dqemu-bits-build" %self._bitsTa= g) self._debugcon_addr =3D '0x403' self._debugcon_log =3D 'debugcon-log.txt' - logging.basicConfig(level=3Dlogging.INFO) - self.logger =3D logging.getLogger('acpi-bits') + self.logger =3D self.log =20 def _print_log(self, log): self.logger.info('\nlogs from biosbits follows:') @@ -282,8 +278,9 @@ def generate_bits_iso(self): =20 def setUp(self): # pylint: disable=3Darguments-differ super().setUp('qemu-system-') + self.logger =3D self.log =20 - self._baseDir =3D os.getenv('AVOCADO_TEST_BASEDIR') + self._baseDir =3D Path(__file__).parent =20 # workdir could also be avocado's own workdir in self.workdir. # At present, I prefer to maintain my own temporary working @@ -393,12 +390,6 @@ def test_acpi_smbios_bits(self): self._vm.set_console() self._vm.launch() =20 - self.logger.debug("Console output from bits VM follows ...") - c_drainer =3D drainer.LineLogger(self._vm.console_socket.fileno(), - logger=3Dself.logger.getChild("cons= ole"), - stop_check=3D(lambda : - not self._vm.is_running= ())) - c_drainer.start() =20 # biosbits has been configured to run all the specified test suites # in batch mode and then automatically initiate a vm shutdown. @@ -406,4 +397,8 @@ def test_acpi_smbios_bits(self): # with the avocado test timeout. self._vm.event_wait('SHUTDOWN', timeout=3DBITS_TIMEOUT) self._vm.wait(timeout=3DNone) + self.logger.debug("Checking console output ...") self.parse_log() + +if __name__ =3D=3D '__main__': + QemuBaseTest.main() --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843859; cv=none; d=zohomail.com; s=zohoarc; b=cE0YIlJBY6fEf2LBNUd3+YV8T+uiXEqBHRBXzLWK2iJFoMZncTBeVEPTacKeg8xYS7oj5Gfz19oS5YkPh2qI6WhC8d2M7iRIaccCUetABpr5EoDFFkj0+BAREvKYuf3vsX2jn12NC7x0SWsX2vA5ko5VhmnFHp2CqxALf2SL5DA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843859; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/iVwrkfmrnEA9+FpEN+ehUGiwQgBnydQFBz8T0Xrytk=; b=Fo3lVV3wIoprS2DaQ/uVVxVmmVUMJ68X/6l6VuUKNw5ks9ZTUmPclMChf7xUhEULFU1yTjji6c//tHDO963TYQbwcTkeUO8/TDEvfDZh2dINW+I6+/rbvvfQxVV4Z33oCxR9B8InBdDzYEN6jOaVdPgvquzDKkrHDH9buZGZ/+8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721843859058152.35866541990003; Wed, 24 Jul 2024 10:57:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgDY-0004bm-62; Wed, 24 Jul 2024 13:56:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCq-0000lM-1u for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:55:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCg-0006CX-J8 for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:55:10 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-203-bXfHVF7dMeKDgxMY40a6oQ-1; Wed, 24 Jul 2024 13:55:02 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DF163195421A; Wed, 24 Jul 2024 17:55:00 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 795141955D42; Wed, 24 Jul 2024 17:54:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/iVwrkfmrnEA9+FpEN+ehUGiwQgBnydQFBz8T0Xrytk=; b=gqRmFTBOPgJYVdAF0u++Fx0Db9lttVoX5ENtmVRXrxjsJ/BQe+1LHaf2bMtRafCmqTwRq7 b2oE3kVTZQZH6OwUKuckkwpQagFcHACZ8Xa5myRA4h+stuzsJUWcfRmpLUsGODVfhdz+Gd oDzvfOA3eUixbgZKnytD88kFnETnLP4= X-MC-Unique: bXfHVF7dMeKDgxMY40a6oQ-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 22/23] tests/functional: Convert the rx_gdbsim avocado test into a standalone test Date: Wed, 24 Jul 2024 19:52:40 +0200 Message-ID: <20240724175248.1389201-23-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843860726116600 Content-Type: text/plain; charset="utf-8" Provide a "gzip_uncompress" function based on the standard "gzip" module to avoid the usage of avocado.utils here. Signed-off-by: Thomas Huth --- Note: Make sure to apply this fix first before running this test: https://lore.kernel.org/qemu-devel/20240724045659.160684-1-richard.henders= on@linaro.org/ tests/functional/meson.build | 4 +++ tests/functional/qemu_test/utils.py | 12 +++++++ .../test_rx_gdbsim.py} | 34 +++++++++---------- 3 files changed, 33 insertions(+), 17 deletions(-) rename tests/{avocado/machine_rx_gdbsim.py =3D> functional/test_rx_gdbsim.= py} (78%) mode change 100644 =3D> 100755 diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 52328f44b6..3ae169897f 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -79,6 +79,10 @@ tests_riscv64_quick =3D [ 'riscv_opensbi', ] =20 +tests_rx_thorough =3D [ + 'rx_gdbsim', +] + tests_s390x_thorough =3D [ 's390x_ccw_virtio', 's390x_topology', diff --git a/tests/functional/qemu_test/utils.py b/tests/functional/qemu_te= st/utils.py index a12dac51b6..99eae5fc45 100644 --- a/tests/functional/qemu_test/utils.py +++ b/tests/functional/qemu_test/utils.py @@ -8,6 +8,7 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. =20 +import gzip import lzma import os import shutil @@ -23,6 +24,17 @@ def archive_extract(archive, dest_dir, member=3DNone): else: tf.extractall(path=3Ddest_dir) =20 +def gzip_uncompress(gz_path, output_path): + if os.path.exists(output_path): + return + with gzip.open(gz_path, 'rb') as gz_in: + try: + with open(output_path, 'wb') as raw_out: + shutil.copyfileobj(gz_in, raw_out) + except: + os.remove(output_path) + raise + def lzma_uncompress(xz_path, output_path): if os.path.exists(output_path): return diff --git a/tests/avocado/machine_rx_gdbsim.py b/tests/functional/test_rx_= gdbsim.py old mode 100644 new mode 100755 similarity index 78% rename from tests/avocado/machine_rx_gdbsim.py rename to tests/functional/test_rx_gdbsim.py index 412a7a5089..ebb8bd5631 --- a/tests/avocado/machine_rx_gdbsim.py +++ b/tests/functional/test_rx_gdbsim.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Functional test that boots a Linux kernel and checks the console # # Copyright (c) 2018 Red Hat, Inc. @@ -10,11 +12,11 @@ =20 import os =20 -from avocado import skipUnless -from avocado_qemu import QemuSystemTest -from avocado_qemu import exec_command_and_wait_for_pattern -from avocado_qemu import wait_for_console_pattern -from avocado.utils import archive +from unittest import skipUnless +from qemu_test import QemuSystemTest +from qemu_test import exec_command_and_wait_for_pattern +from qemu_test import wait_for_console_pattern +from qemu_test.utils import gzip_uncompress =20 =20 class RxGdbSimMachine(QemuSystemTest): @@ -27,16 +29,14 @@ class RxGdbSimMachine(QemuSystemTest): def test_uboot(self): """ U-Boot and checks that the console is operational. - - :avocado: tags=3Darch:rx - :avocado: tags=3Dmachine:gdbsim-r5f562n8 - :avocado: tags=3Dendian:little - :avocado: tags=3Dflaky """ + self.set_machine('gdbsim-r5f562n8') + uboot_url =3D ('https://acc.dl.osdn.jp/users/23/23888/u-boot.bin.g= z') uboot_hash =3D '9b78dbd43b40b2526848c0b1ce9de02c24f4dcdb' - uboot_path =3D self.fetch_asset(uboot_url, asset_hash=3Duboot_hash) - uboot_path =3D archive.uncompress(uboot_path, self.workdir) + uboot_path_gz =3D self.fetch_asset(uboot_url, asset_hash=3Duboot_h= ash) + uboot_path =3D os.path.join(self.workdir, 'u-boot.bin') + gzip_uncompress(uboot_path_gz, uboot_path) =20 self.vm.set_console() self.vm.add_args('-bios', uboot_path, @@ -53,12 +53,9 @@ def test_uboot(self): def test_linux_sash(self): """ Boots a Linux kernel and checks that the console is operational. - - :avocado: tags=3Darch:rx - :avocado: tags=3Dmachine:gdbsim-r5f562n7 - :avocado: tags=3Dendian:little - :avocado: tags=3Dflaky """ + self.set_machine('gdbsim-r5f562n7') + dtb_url =3D ('https://acc.dl.osdn.jp/users/23/23887/rx-virt.dtb') dtb_hash =3D '7b4e4e2c71905da44e86ce47adee2210b026ac18' dtb_path =3D self.fetch_asset(dtb_url, asset_hash=3Ddtb_hash) @@ -75,3 +72,6 @@ def test_linux_sash(self): wait_for_console_pattern(self, 'Sash command shell (version 1.1.1)= ', failure_message=3D'Kernel panic - not syn= cing') exec_command_and_wait_for_pattern(self, 'printenv', 'TERM=3Dlinux') + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() --=20 2.45.2 From nobody Mon Sep 16 19:04:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721843803; cv=none; d=zohomail.com; s=zohoarc; b=oHbF4a5bCv1WnZG7Rz4hWlBAIz0qljbHpc+5zlbllt1GJR+jcwWaaksWgKiEnFsk5D7PbP12fQPu4s05cLP7tT/oNI+PY5142rxH/KwMfvbpsR7ahHOO692FqgcYOHhbyuvxl/e9nfp/LhN9CHjqdhMwixX3GNsUdXnAQT42v2s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843803; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bK6CvPa1X+f80U/jjtLSazz/18cuyl9V9PAYQOcc5FA=; b=mcf3gii2iQKqw+oQA1Zqqye062hjhJyTlV1D3QqeK4GhMVj9Wt9tphDOr7KhV6IkwWm5UiEAF5H3jnWJUdJhoyawzxXs8ZHwdYRv6rgUB/w2qWEDZfHLgxpqIdqqzybgxOpSMbsmQz1XlYfmdf1x0AXYUgrYLQap7Htnhi/0H6k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721843803577255.1714453159982; Wed, 24 Jul 2024 10:56:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgDb-0005Bu-CD; Wed, 24 Jul 2024 13:56:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCv-00019A-QX for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:55:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCr-0006Dq-21 for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:55:19 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-643-qENVtv0aOC6IrPKJalFT9Q-1; Wed, 24 Jul 2024 13:55:08 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 077D91955F2B; Wed, 24 Jul 2024 17:55:07 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3A8EE1955D42; Wed, 24 Jul 2024 17:55:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843711; 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=bK6CvPa1X+f80U/jjtLSazz/18cuyl9V9PAYQOcc5FA=; b=KAKRawptoOQ3ufpcDNZ7RhuZc7+bEwjKuuZxFtAzSmKArK3IEypD0CtxRaLeR0dRAlKnaC xuHdumPCj5V8pbB4+Kuz2JKU355XILetWUIk50P26vhQYTQNpmsiHDjKdO/fe3uL6Zl+Mv njE/RTwMd7lrw+7JH3fhs1VmBGhubC4= X-MC-Unique: qENVtv0aOC6IrPKJalFT9Q-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 23/23] gitlab-ci: Add "check-functional" to the build tests Date: Wed, 24 Jul 2024 19:52:41 +0200 Message-ID: <20240724175248.1389201-24-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721843804569116600 Now that we converted many tests from the "check-avocado" test suite to the "check-functional" test suite, we should make sure that these also get tested in the CI. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Thomas Huth --- TODO: We should also make sure of cachine the downloaded assets here... .gitlab-ci.d/buildtest-template.yml | 3 +- .gitlab-ci.d/buildtest.yml | 60 ++++++++++++++--------------- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/.gitlab-ci.d/buildtest-template.yml b/.gitlab-ci.d/buildtest-t= emplate.yml index 8f7ebfaed8..54cae74a8e 100644 --- a/.gitlab-ci.d/buildtest-template.yml +++ b/.gitlab-ci.d/buildtest-template.yml @@ -71,7 +71,7 @@ reports: junit: build/meson-logs/testlog.junit.xml =20 -.avocado_test_job_template: +.functional_test_job_template: extends: .common_test_job_template cache: key: "${CI_JOB_NAME}-cache" @@ -98,6 +98,7 @@ du -chs ${CI_PROJECT_DIR}/avocado-cache ; fi - export AVOCADO_ALLOW_UNTRUSTED_CODE=3D1 + - export QEMU_TEST_ALLOW_UNTRUSTED_CODE=3D1 after_script: - cd build - du -chs ${CI_PROJECT_DIR}/avocado-cache diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index e3a0758bd9..8b1d61911c 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -22,14 +22,14 @@ check-system-alpine: IMAGE: alpine MAKE_CHECK_ARGS: check-unit check-qtest =20 -avocado-system-alpine: - extends: .avocado_test_job_template +functional-system-alpine: + extends: .functional_test_job_template needs: - job: build-system-alpine artifacts: true variables: IMAGE: alpine - MAKE_CHECK_ARGS: check-avocado + MAKE_CHECK_ARGS: check-avocado check-functional AVOCADO_TAGS: arch:avr arch:loongarch64 arch:mips64 arch:mipsel =20 build-system-ubuntu: @@ -53,14 +53,14 @@ check-system-ubuntu: IMAGE: ubuntu2204 MAKE_CHECK_ARGS: check =20 -avocado-system-ubuntu: - extends: .avocado_test_job_template +functional-system-ubuntu: + extends: .functional_test_job_template needs: - job: build-system-ubuntu artifacts: true variables: IMAGE: ubuntu2204 - MAKE_CHECK_ARGS: check-avocado + MAKE_CHECK_ARGS: check-avocado check-functional AVOCADO_TAGS: arch:alpha arch:microblazeel arch:mips64el =20 build-system-debian: @@ -85,14 +85,14 @@ check-system-debian: IMAGE: debian MAKE_CHECK_ARGS: check =20 -avocado-system-debian: - extends: .avocado_test_job_template +functional-system-debian: + extends: .functional_test_job_template needs: - job: build-system-debian artifacts: true variables: IMAGE: debian - MAKE_CHECK_ARGS: check-avocado + MAKE_CHECK_ARGS: check-avocado check-functional AVOCADO_TAGS: arch:arm arch:i386 arch:riscv64 arch:sh4 arch:sparc arch= :xtensa =20 crash-test-debian: @@ -129,14 +129,14 @@ check-system-fedora: IMAGE: fedora MAKE_CHECK_ARGS: check =20 -avocado-system-fedora: - extends: .avocado_test_job_template +functional-system-fedora: + extends: .functional_test_job_template needs: - job: build-system-fedora artifacts: true variables: IMAGE: fedora - MAKE_CHECK_ARGS: check-avocado + MAKE_CHECK_ARGS: check-avocado check-functional AVOCADO_TAGS: arch:microblaze arch:mips arch:xtensa arch:m68k arch:riscv32 arch:ppc arch:sparc64 =20 @@ -243,14 +243,14 @@ check-system-centos: IMAGE: centos9 MAKE_CHECK_ARGS: check =20 -avocado-system-centos: - extends: .avocado_test_job_template +functional-system-centos: + extends: .functional_test_job_template needs: - job: build-system-centos artifacts: true variables: IMAGE: centos9 - MAKE_CHECK_ARGS: check-avocado + MAKE_CHECK_ARGS: check-avocado check-functional AVOCADO_TAGS: arch:ppc64 arch:or1k arch:s390x arch:x86_64 arch:rx arch:sh4 =20 @@ -274,14 +274,14 @@ check-system-opensuse: IMAGE: opensuse-leap MAKE_CHECK_ARGS: check =20 -avocado-system-opensuse: - extends: .avocado_test_job_template +functional-system-opensuse: + extends: .functional_test_job_template needs: - job: build-system-opensuse artifacts: true variables: IMAGE: opensuse-leap - MAKE_CHECK_ARGS: check-avocado + MAKE_CHECK_ARGS: check-avocado check-functional AVOCADO_TAGS: arch:s390x arch:x86_64 arch:aarch64 =20 # @@ -302,15 +302,15 @@ build-system-flaky: ppc64-softmmu rx-softmmu s390x-softmmu sh4-softmmu x86_64-softmmu MAKE_CHECK_ARGS: check-build =20 -avocado-system-flaky: - extends: .avocado_test_job_template +functional-system-flaky: + extends: .functional_test_job_template needs: - job: build-system-flaky artifacts: true allow_failure: true variables: IMAGE: debian - MAKE_CHECK_ARGS: check-avocado + MAKE_CHECK_ARGS: check-avocado check-functional QEMU_JOB_OPTIONAL: 1 QEMU_TEST_FLAKY_TESTS: 1 AVOCADO_TAGS: flaky @@ -484,14 +484,14 @@ check-cfi-aarch64: IMAGE: fedora MAKE_CHECK_ARGS: check =20 -avocado-cfi-aarch64: - extends: .avocado_test_job_template +functional-cfi-aarch64: + extends: .functional_test_job_template needs: - job: build-cfi-aarch64 artifacts: true variables: IMAGE: fedora - MAKE_CHECK_ARGS: check-avocado + MAKE_CHECK_ARGS: check-avocado check-functional =20 build-cfi-ppc64-s390x: extends: @@ -522,14 +522,14 @@ check-cfi-ppc64-s390x: IMAGE: fedora MAKE_CHECK_ARGS: check =20 -avocado-cfi-ppc64-s390x: - extends: .avocado_test_job_template +functional-cfi-ppc64-s390x: + extends: .functional_test_job_template needs: - job: build-cfi-ppc64-s390x artifacts: true variables: IMAGE: fedora - MAKE_CHECK_ARGS: check-avocado + MAKE_CHECK_ARGS: check-avocado check-functional =20 build-cfi-x86_64: extends: @@ -556,14 +556,14 @@ check-cfi-x86_64: IMAGE: fedora MAKE_CHECK_ARGS: check =20 -avocado-cfi-x86_64: - extends: .avocado_test_job_template +functional-cfi-x86_64: + extends: .functional_test_job_template needs: - job: build-cfi-x86_64 artifacts: true variables: IMAGE: fedora - MAKE_CHECK_ARGS: check-avocado + MAKE_CHECK_ARGS: check-avocado check-functional =20 tsan-build: extends: .native_build_job_template --=20 2.45.2