From nobody Mon Feb 9 21:37:25 2026 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+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1667222088; cv=none; d=zohomail.com; s=zohoarc; b=JW/FVlqmLOdgPdR3f/mzsnRyIYZMbwG6K3Y57o1Js535V3wj+BoRYxbWmTjAG/W8yxYnjHaGvAij8KB0k9Bp0AR7si45E3aH6zSzZM/xS+Z2pQgB6d74PcYL4uDjD6LszN/QWIwM9yNfk34ABH6X5Ege87fBn+4Wc5qp3nPQHEg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667222088; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=m3FHixKkG/soQHBQxHKtxJZpm4FNMe+a1ZZo7qWndEQ=; b=h7ubKIGKv1jmkl6X7EDOQvtRourjlP4U2rWb40Lu0ydKqMqBA1d8phhyn8VOiaXRnPsaVCdj1jmMcbmZP51r3N8HplANFRLZGxTEzIVuPOqkYXfr3o9CXCnXWjAKD+IxK3Np9qlKfOw48iuSNlKZIYsvQucEOZyolcGK3CRofxw= 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+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 166722208821151.18212315384278; Mon, 31 Oct 2022 06:14:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opUGs-0002TJ-72; Mon, 31 Oct 2022 08:52:08 -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 1opUGY-0001i3-AW for qemu-devel@nongnu.org; Mon, 31 Oct 2022 08:51:47 -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 1opUGT-0002Lt-UF for qemu-devel@nongnu.org; Mon, 31 Oct 2022 08:51:46 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-98-ks9XDttIPeOMkLdzFeePPQ-1; Mon, 31 Oct 2022 08:51:35 -0400 Received: by mail-wm1-f71.google.com with SMTP id bg21-20020a05600c3c9500b003c2acbff422so5704495wmb.0 for ; Mon, 31 Oct 2022 05:51:35 -0700 (PDT) Received: from redhat.com ([2.52.15.189]) by smtp.gmail.com with ESMTPSA id j3-20020a05600c1c0300b003b4ff30e566sm25744163wms.3.2022.10.31.05.51.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 05:51:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667220696; 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=m3FHixKkG/soQHBQxHKtxJZpm4FNMe+a1ZZo7qWndEQ=; b=UqeB+ukCt0zexWeByeOFrnKbPsn9KlKyrFvvB+FFbJxo1YuZScHWWAE1Zliz1QBHavLvuy j9GC7SsMRq/2gTFpxQEv//wGJcwjq49icM2hBrIpaZBBKg+FzZ0JmboWAcYQcOm71Cd/36 LDmfhGae3K7XPx01ZFPI/QVCGoZyE78= X-MC-Unique: ks9XDttIPeOMkLdzFeePPQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=m3FHixKkG/soQHBQxHKtxJZpm4FNMe+a1ZZo7qWndEQ=; b=DZOQtk/1j26mKlbaPjEd3jLYFlSeuRfEtz50J7Qf2IBhV9CnOt8dw81Fiu45b8eDdp nWWYgl5abHnc08NZ7fNeQ4aQaPJrU63S4lYhqb5/M076kz8EpywtGjMt+tZsLtxkFH0z OV54WPlovmKOLxrzt5Q+FrAuuPuLWd75+8OuhsqQGqlCCWAfn+VXBXdWRYpGvdp+NiJD HV1slF4meQw7AbJrV0SAl+4o8tFfuZQhVj5eRqboDS0yGULF4mjBC2TOr/43MXluytGj CEGvAwHyHKSaNBL3ydYEU55pmMesZP4NX+BOrT1p8yJmB8lQGXK7sUDdz1CWCqF+Za3L L01w== X-Gm-Message-State: ACrzQf1nYPLkoynqGjP4gPVrs+uxxqHt+8sLEGzLbfkme0BxbLW+J9Vx B54tMO7CYdZdGGlrZN4hHGDO12PCPQi3u+txQ+JmfxgTm3Ow65DKll61V9fZ0uApHOfcpK4wd8Q Zjvs62DmWJr4kUcvE9jyX/84sdiahdQfPhjeD8PXhc72ncf865W3X5dYPVcsj X-Received: by 2002:a5d:4acc:0:b0:236:6665:b471 with SMTP id y12-20020a5d4acc000000b002366665b471mr8185220wrs.633.1667220693297; Mon, 31 Oct 2022 05:51:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM60NZ7oRk9iRuNZRtqiswdO+1lmPCQ6pjwQRwZQPp0smN5rGB9JqxBk8zUYoEqUX/CHobCusw== X-Received: by 2002:a5d:4acc:0:b0:236:6665:b471 with SMTP id y12-20020a5d4acc000000b002366665b471mr8185191wrs.633.1667220692944; Mon, 31 Oct 2022 05:51:32 -0700 (PDT) Date: Mon, 31 Oct 2022 08:51:30 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Ani Sinha , Paolo Bonzini , John Snow , Thomas Huth , Alex =?utf-8?Q?Benn=C3=A9e?= , Igor Mammedov , Michael Tsirkin Subject: [PULL 16/86] acpi/tests/avocado/bits/doc: add a doc file to describe the acpi bits test Message-ID: <20221031124928.128475-17-mst@redhat.com> References: <20221031124928.128475-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20221031124928.128475-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.048, 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_H2=-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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667222089760100001 From: Ani Sinha A doc file is added under docs/devel that describes the purpose of the vari= ous test files and gives guidance to developers on where and how to make change= s. Cc: Daniel P. Berrange" Cc: Paolo Bonzini Cc: Maydell Peter Cc: John Snow Cc: Thomas Huth Cc: Alex Benn=C3=A9e Cc: Igor Mammedov Cc: Michael Tsirkin Signed-off-by: Ani Sinha Message-Id: <20221021095108.104843-7-ani@anisinha.ca> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- docs/devel/acpi-bits.rst | 145 +++++++++++++++++++++++++++++++++++++ docs/devel/index-build.rst | 1 + 2 files changed, 146 insertions(+) create mode 100644 docs/devel/acpi-bits.rst diff --git a/docs/devel/acpi-bits.rst b/docs/devel/acpi-bits.rst new file mode 100644 index 0000000000..c9564d871a --- /dev/null +++ b/docs/devel/acpi-bits.rst @@ -0,0 +1,145 @@ +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D +ACPI/SMBIOS avocado tests using biosbits +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D + +Biosbits is a software written by Josh Triplett that can be downloaded +from https://biosbits.org/. The github codebase can be found +`here `__. It is a software = that executes +the bios components such as acpi and smbios tables directly through acpica +bios interpreter (a freely available C based library written by Intel, +downloadable from https://acpica.org/ and is included with biosbits) witho= ut an +operating system getting involved in between. +There are several advantages to directly testing the bios in a real physic= al +machine or VM as opposed to indirectly discovering bios issues through the +operating system. For one thing, the OSes tend to hide bios problems from = the +end user. The other is that we have more control of what we wanted to test +and how by directly using acpica interpreter on top of the bios on a runni= ng +system. More details on the inspiration for developing biosbits and its re= al +life uses can be found in [#a]_ and [#b]_. +This directory contains tests written in python using avocado framework th= at +exercises the QEMU bios components using biosbits and reports test failure= s. +For QEMU, we maintain a fork of bios bits in gitlab along with all the +dependent submodules: +https://gitlab.com/qemu-project/biosbits-bits +This fork contains numerous fixes, a newer acpica and changes specific to +running this avocado QEMU tests using bits. The author of this document +is the sole maintainer of the QEMU fork of bios bits repo. + +Under the directory ``tests/avocado/``, ``acpi-bits.py`` is a QEMU avocado +test that drives all this. + +A brief description of the various test files follows. + +Under ``tests/avocado/`` as the root we have: + +:: + + =E2=94=9C=E2=94=80=E2=94=80 acpi-bits + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 bits-config + =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 bits-cfg.txt + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 bits-tests + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 smbios.py2 + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 testacpi.py2 + =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 testcpuid.py2 + =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 README + =E2=94=9C=E2=94=80=E2=94=80 acpi-bits.py + +* ``tests/avocado``: + + ``acpi-bits.py``: + This is the main python avocado test script that generates a + biosbits iso. It then spawns a QEMU VM with it, collects the log and re= ports + test failures. This is the script one would be interested in if they wa= nted + to add or change some component of the log parsing, add a new command l= ine + to alter how QEMU is spawned etc. Test writers typically would not need= to + modify this script unless they wanted to enhance or change the log pars= ing + for their tests. In order to enable debugging, you can set **V=3D1** + environment variable. This enables verbose mode for the test and also d= umps + the entire log from bios bits and more information in case failure happ= ens. + + In order to run this test, please perform the following steps from the = QEMU + build directory: + :: + + $ make check-venv (needed only the first time to create the venv) + $ ./tests/venv/bin/avocado run -t acpi tests/avocado + + The above will run all acpi avocado tests including this one. + In order to run the individual tests, perform the following: + :: + + $ ./tests/venv/bin/avocado run tests/avocado/acpi-bits.py --tap - + + The above will produce output in tap format. You can omit "--tap -" in = the + end and it will produce output like the following: + :: + + $ ./tests/venv/bin/avocado run tests/avocado/acpi-bits.py + Fetching asset from tests/avocado/acpi-bits.py:AcpiBitsTest.test_acp= i_smbios_bits + JOB ID : eab225724da7b64c012c65705dc2fa14ab1defef + JOB LOG : /home/anisinha/avocado/job-results/job-2022-10-10T17.58= -eab2257/job.log + (1/1) tests/avocado/acpi-bits.py:AcpiBitsTest.test_acpi_smbios_bits:= PASS (33.09 s) + RESULTS : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT= 0 | CANCEL 0 + JOB TIME : 39.22 s + + You can inspect the log file for more information about the run or in o= rder + to diagnoze issues. If you pass V=3D1 in the environment, more diagnost= ic logs + would be found in the test log. + +* ``tests/avocado/acpi-bits/bits-config``: + + This location contains biosbits configuration files that determine how = the + software runs the tests. + + ``bits-config.txt``: + This is the biosbits config file that determines what tests + or actions are performed by bits. The description of the config options= are + provided in the file itself. + +* ``tests/avocado/acpi-bits/bits-tests``: + + This directory contains biosbits python based tests that are run from w= ithin + the biosbits environment in the spawned VM. New additions of test cases= can + be made in the appropriate test file. For example, new acpi tests can go + into testacpi.py2 and one would call testsuite.add_test() to register t= he new + test so that it gets executed as a part of the ACPI tests. + It might be occasionally necessary to disable some subtests or add a new + test that belongs to a test suite not already present in this directory= . To + do this, please clone the bits source from + https://gitlab.com/qemu-project/biosbits-bits/-/tree/qemu-bits. + Note that this is the "qemu-bits" branch and not the "bits" branch of t= he + repository. "qemu-bits" is the branch where we have made all the QEMU + specific enhancements and we must use the source from this branch only. + Copy the test suite/script that needs modification (addition of new tes= ts + or disabling them) from python directory into this directory. For + example, in order to change cpuid related tests, copy the following + file into this directory and rename it with .py2 extension: + https://gitlab.com/qemu-project/biosbits-bits/-/blob/qemu-bits/python/t= estcpuid.py + Then make your additions and changes here. Therefore, the steps are: + + (a) Copy unmodified test script to this directory from bits source. + (b) Add a SPDX license header. + (c) Perform modifications to the test. + + Commits (a), (b) and (c) should go under separate commits so that the o= riginal + test script and the changes we have made are separated and clear. + + The test framework will then use your modified test script to run the t= est. + No further changes would be needed. Please check the logs to make sure = that + appropriate changes have taken effect. + + The tests have an extension .py2 in order to indicate that: + + (a) They are python2.7 based scripts and not python 3 scripts. + (b) They are run from within the bios bits VM and is not subjected to Q= EMU + build/test python script maintainance and dependency resolutions. + (c) They need not be loaded by avocado framework when running tests. + + +Author: Ani Sinha + +References: +----------- +.. [#a] https://blog.linuxplumbersconf.org/2011/ocw/system/presentations/8= 67/original/bits.pdf +.. [#b] https://www.youtube.com/watch?v=3D36QIepyUuhg + diff --git a/docs/devel/index-build.rst b/docs/devel/index-build.rst index 1002a533a6..57e8d39d98 100644 --- a/docs/devel/index-build.rst +++ b/docs/devel/index-build.rst @@ -11,6 +11,7 @@ the basics if you are adding new files and targets to the= build. build-system kconfig testing + acpi-bits qtest ci qapi-code-gen --=20 MST