This test boots a Linux kernel on a Quadra 800 board
and verify the serial is working.
Example:
$ avocado --show=app,console run -t machine:q800 tests/acceptance/boot_linux_console.py
console: ABCFGHIJK
console: Linux version 5.2.0-2-m68k (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-21)) #1 Debian 5.2.9-2 (2019-08-21)
console: Detected Macintosh model: 35
console: Apple Macintosh Quadra 800
console: Built 1 zonelists, mobility grouping on. Total pages: 32448
console: Kernel command line: printk.time=0 console=ttyS0 vga=off
[...]
console: Calibrating delay loop... 1236.99 BogoMIPS (lpj=6184960)
[...]
console: NuBus: Scanning NuBus slots.
console: Slot 9: Board resource not found!
console: SCSI subsystem initialized
console: clocksource: Switched to clocksource via1
[...]
console: macfb: framebuffer at 0xf9001000, mapped to 0x(ptrval), size 468k
console: macfb: mode is 800x600x8, linelength=800
console: Console: switching to colour frame buffer device 100x37
console: fb0: DAFB frame buffer device
console: pmac_zilog: 0.6 (Benjamin Herrenschmidt <benh@kernel.crashing.org>)
console: scc.0: ttyS0 at MMIO 0x50f0c022 (irq = 4, base_baud = 230400) is a Z85c30 ESCC - Serial port
console: scc.1: ttyS1 at MMIO 0x50f0c020 (irq = 4, base_baud = 230400) is a Z85c30 ESCC - Serial port
console: Non-volatile memory driver v1.3
console: adb: Mac II ADB Driver v1.0 for Unified ADB
console: mousedev: PS/2 mouse device common for all mice
console: random: fast init done
console: Detected ADB keyboard, type <unknown>.
console: input: ADB keyboard as /devices/virtual/input/input0
console: input: ADB mouse as /devices/virtual/input/input1
console: rtc-generic rtc-generic: registered as rtc0
console: ledtrig-cpu: registered to indicate activity on CPUs
[...]
console: rtc-generic rtc-generic: setting system clock to 2019-09-10T16:20:25 UTC (1568132425)
console: List of all partitions:
console: No filesystem could mount root, tried:
JOB TIME : 2.91 s
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
Based-on: <20190910113323.17324-1-laurent@vivier.eu>
"hw/m68k: add Apple Machintosh Quadra 800 machine"
https://lists.gnu.org/archive/html/qemu-devel/2019-09/msg01775.html
---
tests/acceptance/boot_linux_console.py | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 2504ef0150..8e346bb0f4 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -373,3 +373,27 @@ class BootLinuxConsole(Test):
self.vm.launch()
console_pattern = 'Kernel command line: %s' % kernel_command_line
self.wait_for_console_pattern(console_pattern)
+
+ def test_m68k_q800(self):
+ """
+ :avocado: tags=arch:m68k
+ :avocado: tags=machine:q800
+ """
+ deb_url = ('http://ftp.ports.debian.org/debian-ports/pool-m68k/main'
+ '/l/linux/kernel-image-5.2.0-2-m68k-di_5.2.9-2_m68k.udeb')
+ deb_hash = '0797e05129595f22f3c0142db5e199769a723bf9'
+ deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
+ kernel_path = self.extract_from_deb(deb_path,
+ '/boot/vmlinux-5.2.0-2-m68k')
+
+ self.vm.set_machine('q800')
+ self.vm.set_console()
+ kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
+ 'console=ttyS0 vga=off')
+ self.vm.add_args('-kernel', kernel_path,
+ '-append', kernel_command_line)
+ self.vm.launch()
+ console_pattern = 'Kernel command line: %s' % kernel_command_line
+ self.wait_for_console_pattern(console_pattern)
+ console_pattern = 'No filesystem could mount root'
+ self.wait_for_console_pattern(console_pattern)
--
2.20.1
Le 10/09/2019 à 18:34, Philippe Mathieu-Daudé a écrit : > This test boots a Linux kernel on a Quadra 800 board > and verify the serial is working. > > Example: > > $ avocado --show=app,console run -t machine:q800 tests/acceptance/boot_linux_console.py > console: ABCFGHIJK > console: Linux version 5.2.0-2-m68k (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-21)) #1 Debian 5.2.9-2 (2019-08-21) > console: Detected Macintosh model: 35 > console: Apple Macintosh Quadra 800 > console: Built 1 zonelists, mobility grouping on. Total pages: 32448 > console: Kernel command line: printk.time=0 console=ttyS0 vga=off > [...] > console: Calibrating delay loop... 1236.99 BogoMIPS (lpj=6184960) > [...] > console: NuBus: Scanning NuBus slots. > console: Slot 9: Board resource not found! > console: SCSI subsystem initialized > console: clocksource: Switched to clocksource via1 > [...] > console: macfb: framebuffer at 0xf9001000, mapped to 0x(ptrval), size 468k > console: macfb: mode is 800x600x8, linelength=800 > console: Console: switching to colour frame buffer device 100x37 > console: fb0: DAFB frame buffer device > console: pmac_zilog: 0.6 (Benjamin Herrenschmidt <benh@kernel.crashing.org>) > console: scc.0: ttyS0 at MMIO 0x50f0c022 (irq = 4, base_baud = 230400) is a Z85c30 ESCC - Serial port > console: scc.1: ttyS1 at MMIO 0x50f0c020 (irq = 4, base_baud = 230400) is a Z85c30 ESCC - Serial port > console: Non-volatile memory driver v1.3 > console: adb: Mac II ADB Driver v1.0 for Unified ADB > console: mousedev: PS/2 mouse device common for all mice > console: random: fast init done > console: Detected ADB keyboard, type <unknown>. > console: input: ADB keyboard as /devices/virtual/input/input0 > console: input: ADB mouse as /devices/virtual/input/input1 > console: rtc-generic rtc-generic: registered as rtc0 > console: ledtrig-cpu: registered to indicate activity on CPUs > [...] > console: rtc-generic rtc-generic: setting system clock to 2019-09-10T16:20:25 UTC (1568132425) > console: List of all partitions: > console: No filesystem could mount root, tried: > JOB TIME : 2.91 s > > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > --- > Based-on: <20190910113323.17324-1-laurent@vivier.eu> > "hw/m68k: add Apple Machintosh Quadra 800 machine" > https://lists.gnu.org/archive/html/qemu-devel/2019-09/msg01775.html > --- > tests/acceptance/boot_linux_console.py | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py > index 2504ef0150..8e346bb0f4 100644 > --- a/tests/acceptance/boot_linux_console.py > +++ b/tests/acceptance/boot_linux_console.py > @@ -373,3 +373,27 @@ class BootLinuxConsole(Test): > self.vm.launch() > console_pattern = 'Kernel command line: %s' % kernel_command_line > self.wait_for_console_pattern(console_pattern) > + > + def test_m68k_q800(self): > + """ > + :avocado: tags=arch:m68k > + :avocado: tags=machine:q800 > + """ > + deb_url = ('http://ftp.ports.debian.org/debian-ports/pool-m68k/main' > + '/l/linux/kernel-image-5.2.0-2-m68k-di_5.2.9-2_m68k.udeb') > + deb_hash = '0797e05129595f22f3c0142db5e199769a723bf9' > + deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) > + kernel_path = self.extract_from_deb(deb_path, > + '/boot/vmlinux-5.2.0-2-m68k') > + > + self.vm.set_machine('q800') > + self.vm.set_console() > + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + > + 'console=ttyS0 vga=off') > + self.vm.add_args('-kernel', kernel_path, > + '-append', kernel_command_line) > + self.vm.launch() > + console_pattern = 'Kernel command line: %s' % kernel_command_line > + self.wait_for_console_pattern(console_pattern) > + console_pattern = 'No filesystem could mount root' > + self.wait_for_console_pattern(console_pattern) > Reviewed-by: Laurent Vivier <laurent@vivier.eu>
On Tue, Sep 10, 2019 at 06:34:30PM +0200, Philippe Mathieu-Daudé wrote: > This test boots a Linux kernel on a Quadra 800 board > and verify the serial is working. > > Example: > > $ avocado --show=app,console run -t machine:q800 tests/acceptance/boot_linux_console.py > console: ABCFGHIJK > console: Linux version 5.2.0-2-m68k (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-21)) #1 Debian 5.2.9-2 (2019-08-21) > console: Detected Macintosh model: 35 > console: Apple Macintosh Quadra 800 > console: Built 1 zonelists, mobility grouping on. Total pages: 32448 > console: Kernel command line: printk.time=0 console=ttyS0 vga=off > [...] > console: Calibrating delay loop... 1236.99 BogoMIPS (lpj=6184960) > [...] > console: NuBus: Scanning NuBus slots. > console: Slot 9: Board resource not found! > console: SCSI subsystem initialized > console: clocksource: Switched to clocksource via1 > [...] > console: macfb: framebuffer at 0xf9001000, mapped to 0x(ptrval), size 468k > console: macfb: mode is 800x600x8, linelength=800 > console: Console: switching to colour frame buffer device 100x37 > console: fb0: DAFB frame buffer device > console: pmac_zilog: 0.6 (Benjamin Herrenschmidt <benh@kernel.crashing.org>) > console: scc.0: ttyS0 at MMIO 0x50f0c022 (irq = 4, base_baud = 230400) is a Z85c30 ESCC - Serial port > console: scc.1: ttyS1 at MMIO 0x50f0c020 (irq = 4, base_baud = 230400) is a Z85c30 ESCC - Serial port > console: Non-volatile memory driver v1.3 > console: adb: Mac II ADB Driver v1.0 for Unified ADB > console: mousedev: PS/2 mouse device common for all mice > console: random: fast init done > console: Detected ADB keyboard, type <unknown>. > console: input: ADB keyboard as /devices/virtual/input/input0 > console: input: ADB mouse as /devices/virtual/input/input1 > console: rtc-generic rtc-generic: registered as rtc0 > console: ledtrig-cpu: registered to indicate activity on CPUs > [...] > console: rtc-generic rtc-generic: setting system clock to 2019-09-10T16:20:25 UTC (1568132425) > console: List of all partitions: > console: No filesystem could mount root, tried: > JOB TIME : 2.91 s > > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > --- > Based-on: <20190910113323.17324-1-laurent@vivier.eu> > "hw/m68k: add Apple Machintosh Quadra 800 machine" > https://lists.gnu.org/archive/html/qemu-devel/2019-09/msg01775.html > --- > tests/acceptance/boot_linux_console.py | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py > index 2504ef0150..8e346bb0f4 100644 > --- a/tests/acceptance/boot_linux_console.py > +++ b/tests/acceptance/boot_linux_console.py > @@ -373,3 +373,27 @@ class BootLinuxConsole(Test): > self.vm.launch() > console_pattern = 'Kernel command line: %s' % kernel_command_line > self.wait_for_console_pattern(console_pattern) > + > + def test_m68k_q800(self): > + """ > + :avocado: tags=arch:m68k > + :avocado: tags=machine:q800 > + """ > + deb_url = ('http://ftp.ports.debian.org/debian-ports/pool-m68k/main' > + '/l/linux/kernel-image-5.2.0-2-m68k-di_5.2.9-2_m68k.udeb') > + deb_hash = '0797e05129595f22f3c0142db5e199769a723bf9' > + deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) > + kernel_path = self.extract_from_deb(deb_path, > + '/boot/vmlinux-5.2.0-2-m68k') > + > + self.vm.set_machine('q800') > + self.vm.set_console() > + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + > + 'console=ttyS0 vga=off') > + self.vm.add_args('-kernel', kernel_path, > + '-append', kernel_command_line) > + self.vm.launch() > + console_pattern = 'Kernel command line: %s' % kernel_command_line > + self.wait_for_console_pattern(console_pattern) > + console_pattern = 'No filesystem could mount root' > + self.wait_for_console_pattern(console_pattern) > -- > 2.20.1 > LGTM. Of course it needs to wait for the series adding the machine type. If there's a new version of the series, shouldn't this be included there? Either way: Tested-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com>
On 9/10/19 7:07 PM, Cleber Rosa wrote: > On Tue, Sep 10, 2019 at 06:34:30PM +0200, Philippe Mathieu-Daudé wrote: >> This test boots a Linux kernel on a Quadra 800 board >> and verify the serial is working. >> >> Example: >> >> $ avocado --show=app,console run -t machine:q800 tests/acceptance/boot_linux_console.py >> console: ABCFGHIJK >> console: Linux version 5.2.0-2-m68k (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-21)) #1 Debian 5.2.9-2 (2019-08-21) >> console: Detected Macintosh model: 35 >> console: Apple Macintosh Quadra 800 >> console: Built 1 zonelists, mobility grouping on. Total pages: 32448 >> console: Kernel command line: printk.time=0 console=ttyS0 vga=off >> [...] >> console: Calibrating delay loop... 1236.99 BogoMIPS (lpj=6184960) >> [...] >> console: NuBus: Scanning NuBus slots. >> console: Slot 9: Board resource not found! >> console: SCSI subsystem initialized >> console: clocksource: Switched to clocksource via1 >> [...] >> console: macfb: framebuffer at 0xf9001000, mapped to 0x(ptrval), size 468k >> console: macfb: mode is 800x600x8, linelength=800 >> console: Console: switching to colour frame buffer device 100x37 >> console: fb0: DAFB frame buffer device >> console: pmac_zilog: 0.6 (Benjamin Herrenschmidt <benh@kernel.crashing.org>) >> console: scc.0: ttyS0 at MMIO 0x50f0c022 (irq = 4, base_baud = 230400) is a Z85c30 ESCC - Serial port >> console: scc.1: ttyS1 at MMIO 0x50f0c020 (irq = 4, base_baud = 230400) is a Z85c30 ESCC - Serial port >> console: Non-volatile memory driver v1.3 >> console: adb: Mac II ADB Driver v1.0 for Unified ADB >> console: mousedev: PS/2 mouse device common for all mice >> console: random: fast init done >> console: Detected ADB keyboard, type <unknown>. >> console: input: ADB keyboard as /devices/virtual/input/input0 >> console: input: ADB mouse as /devices/virtual/input/input1 >> console: rtc-generic rtc-generic: registered as rtc0 >> console: ledtrig-cpu: registered to indicate activity on CPUs >> [...] >> console: rtc-generic rtc-generic: setting system clock to 2019-09-10T16:20:25 UTC (1568132425) >> console: List of all partitions: >> console: No filesystem could mount root, tried: >> JOB TIME : 2.91 s >> >> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> >> --- >> Based-on: <20190910113323.17324-1-laurent@vivier.eu> >> "hw/m68k: add Apple Machintosh Quadra 800 machine" >> https://lists.gnu.org/archive/html/qemu-devel/2019-09/msg01775.html >> --- >> tests/acceptance/boot_linux_console.py | 24 ++++++++++++++++++++++++ >> 1 file changed, 24 insertions(+) >> >> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py >> index 2504ef0150..8e346bb0f4 100644 >> --- a/tests/acceptance/boot_linux_console.py >> +++ b/tests/acceptance/boot_linux_console.py >> @@ -373,3 +373,27 @@ class BootLinuxConsole(Test): >> self.vm.launch() >> console_pattern = 'Kernel command line: %s' % kernel_command_line >> self.wait_for_console_pattern(console_pattern) >> + >> + def test_m68k_q800(self): >> + """ >> + :avocado: tags=arch:m68k >> + :avocado: tags=machine:q800 >> + """ >> + deb_url = ('http://ftp.ports.debian.org/debian-ports/pool-m68k/main' >> + '/l/linux/kernel-image-5.2.0-2-m68k-di_5.2.9-2_m68k.udeb') >> + deb_hash = '0797e05129595f22f3c0142db5e199769a723bf9' >> + deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) >> + kernel_path = self.extract_from_deb(deb_path, >> + '/boot/vmlinux-5.2.0-2-m68k') >> + >> + self.vm.set_machine('q800') >> + self.vm.set_console() >> + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + >> + 'console=ttyS0 vga=off') >> + self.vm.add_args('-kernel', kernel_path, >> + '-append', kernel_command_line) >> + self.vm.launch() >> + console_pattern = 'Kernel command line: %s' % kernel_command_line >> + self.wait_for_console_pattern(console_pattern) >> + console_pattern = 'No filesystem could mount root' >> + self.wait_for_console_pattern(console_pattern) >> -- >> 2.20.1 >> > > LGTM. > > Of course it needs to wait for the series adding the machine type. > If there's a new version of the series, shouldn't this be included > there? At some point I'd like we enforce the rule "each new machine is added with an integration test". So far we are still trying to figure out what is the best use of Avocado for QEMU, and what are good/cheap tests, how easy it is to add/use them, and so on. We are improving :) So, with this idea, indeed machine tests should go with the the series that introduce it. Meanwhile (there is no enforcement) I'm following new machines and trying to catch them, ask the developer how to test them if there is no guidelines, and add tests. Laurent, do you agree to queue this patch to your series? > Either way: > > Tested-by: Cleber Rosa <crosa@redhat.com> > Reviewed-by: Cleber Rosa <crosa@redhat.com> Thanks! Regards, Phil.
Le 10/09/2019 à 22:02, Philippe Mathieu-Daudé a écrit : > On 9/10/19 7:07 PM, Cleber Rosa wrote: >> On Tue, Sep 10, 2019 at 06:34:30PM +0200, Philippe Mathieu-Daudé wrote: >>> This test boots a Linux kernel on a Quadra 800 board >>> and verify the serial is working. >>> >>> Example: >>> >>> $ avocado --show=app,console run -t machine:q800 tests/acceptance/boot_linux_console.py >>> console: ABCFGHIJK >>> console: Linux version 5.2.0-2-m68k (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-21)) #1 Debian 5.2.9-2 (2019-08-21) >>> console: Detected Macintosh model: 35 >>> console: Apple Macintosh Quadra 800 >>> console: Built 1 zonelists, mobility grouping on. Total pages: 32448 >>> console: Kernel command line: printk.time=0 console=ttyS0 vga=off >>> [...] >>> console: Calibrating delay loop... 1236.99 BogoMIPS (lpj=6184960) >>> [...] >>> console: NuBus: Scanning NuBus slots. >>> console: Slot 9: Board resource not found! >>> console: SCSI subsystem initialized >>> console: clocksource: Switched to clocksource via1 >>> [...] >>> console: macfb: framebuffer at 0xf9001000, mapped to 0x(ptrval), size 468k >>> console: macfb: mode is 800x600x8, linelength=800 >>> console: Console: switching to colour frame buffer device 100x37 >>> console: fb0: DAFB frame buffer device >>> console: pmac_zilog: 0.6 (Benjamin Herrenschmidt <benh@kernel.crashing.org>) >>> console: scc.0: ttyS0 at MMIO 0x50f0c022 (irq = 4, base_baud = 230400) is a Z85c30 ESCC - Serial port >>> console: scc.1: ttyS1 at MMIO 0x50f0c020 (irq = 4, base_baud = 230400) is a Z85c30 ESCC - Serial port >>> console: Non-volatile memory driver v1.3 >>> console: adb: Mac II ADB Driver v1.0 for Unified ADB >>> console: mousedev: PS/2 mouse device common for all mice >>> console: random: fast init done >>> console: Detected ADB keyboard, type <unknown>. >>> console: input: ADB keyboard as /devices/virtual/input/input0 >>> console: input: ADB mouse as /devices/virtual/input/input1 >>> console: rtc-generic rtc-generic: registered as rtc0 >>> console: ledtrig-cpu: registered to indicate activity on CPUs >>> [...] >>> console: rtc-generic rtc-generic: setting system clock to 2019-09-10T16:20:25 UTC (1568132425) >>> console: List of all partitions: >>> console: No filesystem could mount root, tried: >>> JOB TIME : 2.91 s >>> >>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> >>> --- >>> Based-on: <20190910113323.17324-1-laurent@vivier.eu> >>> "hw/m68k: add Apple Machintosh Quadra 800 machine" >>> https://lists.gnu.org/archive/html/qemu-devel/2019-09/msg01775.html >>> --- >>> tests/acceptance/boot_linux_console.py | 24 ++++++++++++++++++++++++ >>> 1 file changed, 24 insertions(+) >>> >>> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py >>> index 2504ef0150..8e346bb0f4 100644 >>> --- a/tests/acceptance/boot_linux_console.py >>> +++ b/tests/acceptance/boot_linux_console.py >>> @@ -373,3 +373,27 @@ class BootLinuxConsole(Test): >>> self.vm.launch() >>> console_pattern = 'Kernel command line: %s' % kernel_command_line >>> self.wait_for_console_pattern(console_pattern) >>> + >>> + def test_m68k_q800(self): >>> + """ >>> + :avocado: tags=arch:m68k >>> + :avocado: tags=machine:q800 >>> + """ >>> + deb_url = ('http://ftp.ports.debian.org/debian-ports/pool-m68k/main' >>> + '/l/linux/kernel-image-5.2.0-2-m68k-di_5.2.9-2_m68k.udeb') >>> + deb_hash = '0797e05129595f22f3c0142db5e199769a723bf9' >>> + deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) >>> + kernel_path = self.extract_from_deb(deb_path, >>> + '/boot/vmlinux-5.2.0-2-m68k') >>> + >>> + self.vm.set_machine('q800') >>> + self.vm.set_console() >>> + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + >>> + 'console=ttyS0 vga=off') >>> + self.vm.add_args('-kernel', kernel_path, >>> + '-append', kernel_command_line) >>> + self.vm.launch() >>> + console_pattern = 'Kernel command line: %s' % kernel_command_line >>> + self.wait_for_console_pattern(console_pattern) >>> + console_pattern = 'No filesystem could mount root' >>> + self.wait_for_console_pattern(console_pattern) >>> -- >>> 2.20.1 >>> >> >> LGTM. >> >> Of course it needs to wait for the series adding the machine type. >> If there's a new version of the series, shouldn't this be included >> there? > > At some point I'd like we enforce the rule "each new machine is added > with an integration test". > So far we are still trying to figure out what is the best use of Avocado > for QEMU, and what are good/cheap tests, how easy it is to add/use them, > and so on. We are improving :) > So, with this idea, indeed machine tests should go with the the series > that introduce it. > Meanwhile (there is no enforcement) I'm following new machines and > trying to catch them, ask the developer how to test them if there is no > guidelines, and add tests. > > Laurent, do you agree to queue this patch to your series? > I've added it to the series. Thanks, Laurent
© 2016 - 2024 Red Hat, Inc.