All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH 0/7] avocado: Add acceptance tests parsing the Linux boot console
@ 2018-04-19 16:46 Philippe Mathieu-Daudé
  2018-04-19 16:46 ` [Qemu-devel] [RFC PATCH 1/7] AVOCADO_QEMU: Snapshot commit Philippe Mathieu-Daudé
                   ` (9 more replies)
  0 siblings, 10 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-04-19 16:46 UTC (permalink / raw)
  To: Lukáš Doktor, Cleber Rosa, Amador Pahim,
	Stefan Hajnoczi, Zheng Xiang
  Cc: Philippe Mathieu-Daudé,
	qemu-devel, Alex Bennée, Fam Zheng, Alistair Francis

Hi,

While previously working on a Super I/O refactor, I encountered some problems
at runtime, after building the codebase successfully and running qtests.
I had to manually start to boot different guests and check the bootlog.

I wanted to give a try at Avocado which seems designed to simplify that kind
of functional tests.

I applied Amador Pahim work following Cleber Rosa documentation from
http://lists.nongnu.org/archive/html/qemu-devel/2018-01/msg03891.html,
however I had to modify few things to parse the boot console.
Since his work is not merged, I included it in this series.

The tests simply expect to find a string reported by Linux printk when a
device is detected/initialized, such "ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A"
and "i8042 KBD port at 0x60,0x64 irq 1" for the Super I/O chip, or such
"registered as PCnet/PCI II 79C970A" to confirms the PCI subsystem and network
device are correctly detected:


    self.assertIn(u'ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A', bootlog)
    self.assertIn(u'ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A', bootlog)
    self.assertIn(u'i8042 KBD port at 0x60,0x64 irq 1', bootlog)
    self.assertIn(u'i8042 AUX port at 0x60,0x64 irq 12', bootlog)

Example of the tests output:

    $ avocado run test_linux-boot-console.py -m test_linux-boot-console.py.data/parameters.yaml 
    JOB ID     : 695094c9bbe8f6011226da7c2031c2c53e949910
    JOB LOG    : /home/phil/avocado/job-results/job-2018-04-19T13.36-695094c/job.log
     (1/6) test_linux-boot-console.py:TestAlphaClipperBoot2_6.test_boot_console;alpha-2582: PASS (4.76 s)
     (2/6) test_linux-boot-console.py:TestAlphaClipperBoot2_6.test_boot_console;mips-4a72: PASS (0.00 s)
     (3/6) test_linux-boot-console.py:TestMips4kcMaltaBoot2_6.test_boot_console;alpha-2582: PASS (0.00 s)
     (4/6) test_linux-boot-console.py:TestMips4kcMaltaBoot2_6.test_boot_console;mips-4a72: PASS (3.92 s)
     (5/6) test_linux-boot-console.py:TestMips4kcMaltaBoot3_2.test_boot_console;alpha-2582: PASS (0.00 s)
     (6/6) test_linux-boot-console.py:TestMips4kcMaltaBoot3_2.test_boot_console;mips-4a72: PASS (4.08 s)
    RESULTS    : PASS 6 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
    JOB TIME   : 13.31 s

Please apologize my ugly Python, this series is just a proof-of-concept :)
I couldn't figure out how to use the @skipUnless(correct arch) decorator.

Regards,

Phil.

Amador Pahim (1):
  AVOCADO_QEMU: Snapshot commit

Philippe Mathieu-Daudé (6):
  avocado: Update python scripts to upstream codebase
  qemu.py: Check console arch is supported before calling mktemp()
  qemu.py: Avoid deprecated tempfile.mktemp()
  avocado: Add an optional flag 'login' to get_console()
  avocado: Add a test parsing Linux kernel booting console
  avocado: Add tests booting the Malta machine

 scripts/qemu.py                               |  50 ++-
 tests/avocado/README.rst                      | 132 ++++++
 tests/avocado/avocado_qemu/__init__.py        |   0
 tests/avocado/avocado_qemu/test.py            | 419 ++++++++++++++++++
 tests/avocado/parameters.yaml                 |  19 +
 tests/avocado/test_info_memdev_host_nodes.py  |  66 +++
 tests/avocado/test_linux-boot-console.py      | 180 ++++++++
 .../parameters.yaml                           |   5 +
 tests/avocado/test_nec-usb-xhci.py            |  63 +++
 .../test_nec-usb-xhci.py.data/parameters.yaml |   4 +
 tests/avocado/test_numa_hotplug.py            | 120 +++++
 tests/avocado/test_ovmf_with_240_vcpus.py     |  70 +++
 .../parameters.yaml                           |   2 +
 tests/avocado/variants.yaml                   |  62 +++
 14 files changed, 1187 insertions(+), 5 deletions(-)
 create mode 100644 tests/avocado/README.rst
 create mode 100644 tests/avocado/avocado_qemu/__init__.py
 create mode 100644 tests/avocado/avocado_qemu/test.py
 create mode 100644 tests/avocado/parameters.yaml
 create mode 100644 tests/avocado/test_info_memdev_host_nodes.py
 create mode 100644 tests/avocado/test_linux-boot-console.py
 create mode 100644 tests/avocado/test_linux-boot-console.py.data/parameters.yaml
 create mode 100644 tests/avocado/test_nec-usb-xhci.py
 create mode 100644 tests/avocado/test_nec-usb-xhci.py.data/parameters.yaml
 create mode 100644 tests/avocado/test_numa_hotplug.py
 create mode 100644 tests/avocado/test_ovmf_with_240_vcpus.py
 create mode 100644 tests/avocado/test_ovmf_with_240_vcpus.py.data/parameters.yaml
 create mode 100644 tests/avocado/variants.yaml

-- 
2.17.0

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2018-05-02 16:22 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-19 16:46 [Qemu-devel] [RFC PATCH 0/7] avocado: Add acceptance tests parsing the Linux boot console Philippe Mathieu-Daudé
2018-04-19 16:46 ` [Qemu-devel] [RFC PATCH 1/7] AVOCADO_QEMU: Snapshot commit Philippe Mathieu-Daudé
2018-04-19 16:46 ` [Qemu-devel] [RFC PATCH 2/7] avocado: Update python scripts to upstream codebase Philippe Mathieu-Daudé
2018-05-01  0:56   ` Cleber Rosa
2018-04-19 16:46 ` [Qemu-devel] [RFC PATCH 3/7] qemu.py: Check console arch is supported before calling mktemp() Philippe Mathieu-Daudé
2018-05-01 19:30   ` Cleber Rosa
2018-05-01 19:35     ` Cleber Rosa
2018-04-19 16:46 ` [Qemu-devel] [RFC PATCH 4/7] qemu.py: Avoid deprecated tempfile.mktemp() Philippe Mathieu-Daudé
2018-05-01 19:33   ` Cleber Rosa
2018-04-19 16:46 ` [Qemu-devel] [RFC PATCH 5/7] avocado: Add an optional flag 'login' to get_console() Philippe Mathieu-Daudé
2018-05-01 19:46   ` Cleber Rosa
2018-04-19 16:46 ` [Qemu-devel] [RFC PATCH 6/7] avocado: Add a test parsing Linux kernel booting console Philippe Mathieu-Daudé
2018-04-19 19:38   ` Richard Henderson
2018-05-01 21:17   ` Cleber Rosa
2018-04-19 16:46 ` [Qemu-devel] [RFC PATCH 7/7] avocado: Add tests booting the Malta machine Philippe Mathieu-Daudé
2018-05-01 21:20   ` Cleber Rosa
2018-04-19 17:14 ` [Qemu-devel] [RFC PATCH 0/7] avocado: Add acceptance tests parsing the Linux boot console no-reply
2018-04-20  4:17 ` Philippe Mathieu-Daudé
2018-04-20 12:59   ` Philippe Mathieu-Daudé
2018-05-02 16:22   ` Cleber Rosa
2018-04-30 22:49 ` Cleber Rosa

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.