[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 27/36] tests/boot_linux_console: Add a SLOW test booting Ubuntu on
From: |
Peter Maydell |
Subject: |
[PULL 27/36] tests/boot_linux_console: Add a SLOW test booting Ubuntu on OrangePi PC |
Date: |
Thu, 12 Mar 2020 16:44:50 +0000 |
From: Philippe Mathieu-Daudé <address@hidden>
This test boots Ubuntu Bionic on a OrangePi PC board.
As it requires 1GB of storage, and is slow, this test is disabled
on automatic CI testing.
It is useful for workstation testing. Currently Avocado timeouts too
quickly, so we can't run userland commands.
The kernel image and DeviceTree blob are built by the Armbian
project (based on Debian):
https://www.armbian.com/orange-pi-pc/
The Ubuntu image is downloaded from:
https://dl.armbian.com/orangepipc/Bionic_current
This test can be run using:
$ AVOCADO_ALLOW_LARGE_STORAGE=yes \
avocado --show=app,console run -t machine:orangepi-pc \
tests/acceptance/boot_linux_console.py
console: U-Boot SPL 2019.04-armbian (Nov 18 2019 - 23:08:35 +0100)
console: DRAM: 1024 MiB
console: Failed to set core voltage! Can't set CPU frequency
console: Trying to boot from MMC1
console: U-Boot 2019.04-armbian (Nov 18 2019 - 23:08:35 +0100) Allwinner
Technology
console: CPU: Allwinner H3 (SUN8I 0000)
console: Model: Xunlong Orange Pi PC
console: DRAM: 1 GiB
console: MMC: mmc@1c0f000: 0
[...]
console: Uncompressing Linux... done, booting the kernel.
console: Booting Linux on physical CPU 0x0
console: Linux version 5.3.9-sunxi (root@builder) (gcc version 8.3.0 (GNU
Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36))) #19.11.3
SMP Mon Nov 18 18:49:43 CET 2019
console: CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=50c5387d
console: CPU: div instructions available: patching division code
console: CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction
cache
console: OF: fdt: Machine model: Xunlong Orange Pi PC
[...]
console: EXT4-fs (mmcblk0p1): mounted filesystem with writeback data mode.
Opts: (null)
console: done.
console: Begin: Running /scripts/local-bottom ... done.
console: Begin: Running /scripts/init-bottom ... done.
console: systemd[1]: systemd 237 running in system mode. (...)
console: systemd[1]: Detected architecture arm.
console: Welcome to Ubuntu 18.04.3 LTS!
console: systemd[1]: Set hostname to <orangepipc>.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Niek Linnenbank <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Tested-by: Alex Bennée <address@hidden>
Message-id: address@hidden
[NL: rename in commit message Raspbian to Armbian, remove vm.set_machine()]
[NL: changed test to boot from SD card via BootROM, added check for 7z]
Signed-off-by: Peter Maydell <address@hidden>
---
tests/acceptance/boot_linux_console.py | 48 ++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/tests/acceptance/boot_linux_console.py
b/tests/acceptance/boot_linux_console.py
index 0762dbe83a5..e035c88b078 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -19,7 +19,13 @@ from avocado_qemu import exec_command_and_wait_for_pattern
from avocado_qemu import wait_for_console_pattern
from avocado.utils import process
from avocado.utils import archive
+from avocado.utils.path import find_command, CmdNotFoundError
+P7ZIP_AVAILABLE = True
+try:
+ find_command('7z')
+except CmdNotFoundError:
+ P7ZIP_AVAILABLE = False
class BootLinuxConsole(Test):
"""
@@ -619,6 +625,48 @@ class BootLinuxConsole(Test):
exec_command_and_wait_for_pattern(self, 'reboot',
'reboot: Restarting system')
+ @skipUnless(os.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage limited')
+ @skipUnless(P7ZIP_AVAILABLE, '7z not installed')
+ def test_arm_orangepi_bionic(self):
+ """
+ :avocado: tags=arch:arm
+ :avocado: tags=machine:orangepi-pc
+ """
+
+ # This test download a 196MB compressed image and expand it to 932MB...
+ image_url = ('https://dl.armbian.com/orangepipc/archive/'
+ 'Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.7z')
+ image_hash = '196a8ffb72b0123d92cea4a070894813d305c71e'
+ image_path_7z = self.fetch_asset(image_url, asset_hash=image_hash)
+ image_name = 'Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.img'
+ image_path = os.path.join(self.workdir, image_name)
+ process.run("7z e -o%s %s" % (self.workdir, image_path_7z))
+
+ self.vm.set_console()
+ self.vm.add_args('-drive', 'file=' + image_path + ',if=sd,format=raw',
+ '-nic', 'user',
+ '-no-reboot')
+ self.vm.launch()
+
+ kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
+ 'console=ttyS0,115200 '
+ 'loglevel=7 '
+ 'nosmp '
+ 'systemd.default_timeout_start_sec=9000 '
+ 'systemd.mask=armbian-zram-config.service '
+ 'systemd.mask=armbian-ramlog.service')
+
+ self.wait_for_console_pattern('U-Boot SPL')
+ self.wait_for_console_pattern('Autoboot in ')
+ exec_command_and_wait_for_pattern(self, ' ', '=>')
+ exec_command_and_wait_for_pattern(self, "setenv extraargs '" +
+ kernel_command_line + "'",
'=>')
+ exec_command_and_wait_for_pattern(self, 'boot', 'Starting kernel ...');
+
+ self.wait_for_console_pattern('systemd[1]: Set hostname ' +
+ 'to <orangepipc>')
+ self.wait_for_console_pattern('Starting Load Kernel Modules...')
+
def test_s390x_s390_ccw_virtio(self):
"""
:avocado: tags=arch:s390x
--
2.20.1
- [PULL 21/36] hw/arm/allwinner-h3: add Boot ROM support, (continued)
- [PULL 21/36] hw/arm/allwinner-h3: add Boot ROM support, Peter Maydell, 2020/03/12
- [PULL 24/36] tests/boot_linux_console: Add a quick test for the OrangePi PC board, Peter Maydell, 2020/03/12
- [PULL 25/36] tests/boot_linux_console: Add initrd test for the Orange Pi PC board, Peter Maydell, 2020/03/12
- [PULL 26/36] tests/boot_linux_console: Add a SD card test for the OrangePi PC board, Peter Maydell, 2020/03/12
- [PULL 20/36] hw/arm/allwinner-h3: add EMAC ethernet device, Peter Maydell, 2020/03/12
- [PULL 23/36] hw/arm/allwinner: add RTC device support, Peter Maydell, 2020/03/12
- [PULL 28/36] tests/boot_linux_console: Test booting NetBSD via U-Boot on OrangePi PC, Peter Maydell, 2020/03/12
- [PULL 31/36] hw/arm/virt: Introduce VirtGICType enum type, Peter Maydell, 2020/03/12
- [PULL 22/36] hw/arm/allwinner-h3: add SDRAM controller device, Peter Maydell, 2020/03/12
- [PULL 19/36] hw/arm/allwinner: add SD/MMC host controller, Peter Maydell, 2020/03/12
- [PULL 27/36] tests/boot_linux_console: Add a SLOW test booting Ubuntu on OrangePi PC,
Peter Maydell <=
- [PULL 33/36] target/arm/kvm: Let kvm_arm_vgic_probe() return a bitmap, Peter Maydell, 2020/03/12
- [PULL 30/36] hw/arm/virt: Document 'max' value in gic-version property description, Peter Maydell, 2020/03/12
- [PULL 34/36] hw/arm/virt: kvm: Restructure finalize_gic_version(), Peter Maydell, 2020/03/12
- [PULL 35/36] hw/arm/virt: kvm: allow gicv3 by default if v2 cannot work, Peter Maydell, 2020/03/12
- [PULL 29/36] docs: add Orange Pi PC document, Peter Maydell, 2020/03/12
- [PULL 32/36] hw/arm/virt: Introduce finalize_gic_version(), Peter Maydell, 2020/03/12
- [PULL 36/36] target/arm: kvm: Inject events at the last stage of sync, Peter Maydell, 2020/03/12
- Re: [PULL 00/36] target-arm queue, Peter Maydell, 2020/03/12