All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Cleber Rosa <crosa@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Caio Carrara <ccarrara@redhat.com>
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	qemu-devel@nongnu.org,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Laszlo Ersek" <lersek@redhat.com>
Subject: [Qemu-devel] [RFC PATCH v2 2/3] acceptance tests: Add EDK2 OVMF boot and debug console checking test
Date: Wed,  3 Oct 2018 20:30:35 +0200	[thread overview]
Message-ID: <20181003183036.6716-3-philmd@redhat.com> (raw)
In-Reply-To: <20181003183036.6716-1-philmd@redhat.com>

This test boots OVMF and check the debug console (I/O port on the ISA bus)
report enough information on the initialized devices.

$ avocado --show=app,debugcon run tests/acceptance/boot_firmware.py
 (1/1) tests/acceptance/boot_firmware.py:BootFirmware.test_ovmf_pc:
debugcon: SecCoreStartupWithStack(0xFFFCC000, 0x820000)
debugcon: SEC: Normal boot
...
debugcon: [Bds]Booting EFI Internal Shell
PASS (5.27 s)
JOB TIME   : 5.60 s

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/acceptance/boot_firmware.py | 49 +++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/tests/acceptance/boot_firmware.py b/tests/acceptance/boot_firmware.py
index 669e4849f6..2053b1a4b6 100644
--- a/tests/acceptance/boot_firmware.py
+++ b/tests/acceptance/boot_firmware.py
@@ -72,3 +72,52 @@ class BootFirmware(Test):
                 debugcon_logger.debug(line.strip())
             for exp in expected:
                 self.assertIn(exp + '\n', content)
+
+    def test_ovmf_pc(self):
+        """
+        Boots OVMF on the default PC machine, checks the debug console
+
+        :avocado: tags=arch:x86_64
+        :avocado: tags=maxtime:10s
+        """
+        debugcon_path = os.path.join(self.workdir, 'debugconsole.log')
+        serial_logger = logging.getLogger('serial')
+        debugcon_logger = logging.getLogger('debugcon')
+
+        self.vm.set_machine('pc')
+        self.vm.set_console()
+        self.vm.add_args('-nographic',
+                         '-net', 'none',
+                         '-global', 'isa-debugcon.iobase=0x402',
+                         '-debugcon', 'file:%s' % debugcon_path,
+                         '--bios', '/usr/share/OVMF/OVMF_CODE.fd')
+        self.vm.launch()
+        console = self.vm.console_socket.makefile()
+
+        # serial console checks
+        if not wait_for(read_console_for_string, timeout=10, step=0,
+                        args=(console, 'EDK II', serial_logger)):
+            self.fail("OVMF failed to boot")
+
+        # debug console checks
+        expected = [
+            'SEC: Normal boot',
+            'S3 support was detected on QEMU',
+            'Platform PEI Firmware Volume Initialization',
+            'DXE IPL Entry',
+            'Installing FVB for EMU Variable support',
+            'SmbiosCreateTable: Initialize 32-bit entry point structure',
+            'PlatformBootManagerBeforeConsole',
+            'OnRootBridgesConnected: root bridges have been connected, '
+                'installing ACPI tables',
+            'Found LPC Bridge device',
+            'PlatformBootManagerAfterConsole',
+            'EfiBootManagerConnectAll',
+            '[Bds]Booting EFI Internal Shell',
+        ]
+        with open(debugcon_path) as debugcon:
+            content = debugcon.readlines()
+            for line in content: # TODO use FDDrainer
+                debugcon_logger.debug(line.strip())
+            for exp in expected:
+                self.assertIn(exp + '\r\n', content)
-- 
2.17.1

  parent reply	other threads:[~2018-10-03 18:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-03 18:30 [Qemu-devel] [RFC PATCH v2 0/3] acceptance tests: Test firmware checking debug console output Philippe Mathieu-Daudé
2018-10-03 18:30 ` [Qemu-devel] [RFC PATCH v2 1/3] acceptance tests: Add SeaBIOS boot and debug console checking test Philippe Mathieu-Daudé
2018-10-03 18:30 ` Philippe Mathieu-Daudé [this message]
2018-10-03 18:30 ` [Qemu-devel] [RFC PATCH v2 3/3] acceptance tests: Add EDK2 ArmVirtQemu boot and " Philippe Mathieu-Daudé
2018-10-04 15:07   ` Laszlo Ersek
2018-10-04 15:15     ` Philippe Mathieu-Daudé
2018-10-04 16:19       ` Laszlo Ersek
2018-10-04 12:58 ` [Qemu-devel] [RFC PATCH v2 0/3] acceptance tests: Test firmware checking debug console output Alex Bennée
2018-10-04 13:04   ` Alex Bennée
2018-10-04 13:09     ` Peter Maydell
2018-10-04 14:42       ` Cleber Rosa
2018-10-04 14:44     ` Philippe Mathieu-Daudé
2018-10-04 14:40   ` Cleber Rosa
2018-10-04 15:29     ` Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181003183036.6716-3-philmd@redhat.com \
    --to=philmd@redhat.com \
    --cc=ccarrara@redhat.com \
    --cc=crosa@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=lersek@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.