From nobody Thu May  8 01:53:13 2025
Delivered-To: importer@patchew.org
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@nongnu.org;
 helo=lists.gnu.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@nongnu.org;
	dmarc=pass(p=none dis=none)  header.from=linaro.org
ARC-Seal: i=1; a=rsa-sha256; t=1584032271; cv=none;
	d=zohomail.com; s=zohoarc;
	b=dYEl/lF8G15P8fSl6vpCNhhlQ6FlwcT5oLqyN9xffogcT+0CfHYUTyu9vlBqekWwAgCbAXhzht+VSQx6KKgn8XFRtZAsiiWbEP5ADl2agxKWEJxg2b6XxkU7GABtTUrvrPRct/qBgvTOO3zaPpv4tG2RBlHffhs8S0PyVH8bo5w=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc;
	t=1584032271;
 h=Content-Type:Content-Transfer-Encoding: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=mha8ggtLl3GSDXDN2JnZIRZCgok7p39icY2aw8kNGWU=;
	b=A86AIt2YIokaM8krSWb9czoQ8zuDSOaRtD8agMQLg5hODAJm7spB52Kwwktd8u0lStm0Q8o7CGR3zAOZudZ00omxhQpLuCA0yh25UcUCVTg7kApkkaSQejRYNS3wJ+l2Nu0va3H1cTwRqlqf4ZNo6kWWxUdhYlWQJhQgKWhLMhM=
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@nongnu.org;
	dmarc=pass header.from=<peter.maydell@linaro.org> (p=none dis=none)
 header.from=<peter.maydell@linaro.org>
Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org>
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by
 mx.zohomail.com
	with SMTPS id 1584032271034297.43960397349963;
 Thu, 12 Mar 2020 09:57:51 -0700 (PDT)
Received: from localhost ([::1]:45816 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>)
	id 1jCR9Z-0006R6-VD
	for importer@patchew.org; Thu, 12 Mar 2020 12:57:49 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:35835)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <peter.maydell@linaro.org>) id 1jCQxl-0000at-7u
 for qemu-devel@nongnu.org; Thu, 12 Mar 2020 12:45:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <peter.maydell@linaro.org>) id 1jCQxj-0005G1-Dm
 for qemu-devel@nongnu.org; Thu, 12 Mar 2020 12:45:37 -0400
Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:36725)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <peter.maydell@linaro.org>)
 id 1jCQxj-0005Et-48
 for qemu-devel@nongnu.org; Thu, 12 Mar 2020 12:45:35 -0400
Received: by mail-wm1-x32e.google.com with SMTP id g62so7133087wme.1
 for <qemu-devel@nongnu.org>; Thu, 12 Mar 2020 09:45:35 -0700 (PDT)
Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148])
 by smtp.gmail.com with ESMTPSA id j15sm36838640wrp.85.2020.03.12.09.45.32
 for <qemu-devel@nongnu.org>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 12 Mar 2020 09:45:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;
 h=from:to:subject:date:message-id:in-reply-to:references:mime-version
 :content-transfer-encoding;
 bh=mha8ggtLl3GSDXDN2JnZIRZCgok7p39icY2aw8kNGWU=;
 b=AJtyy89NqQKoZ/ZvlPfdn17n5QoWB15TADNm/1gdRVDamPtH0gZ9tCRyWn5tZV1Zqh
 7fQznhleIh6rXwHi4Jblr6yPjDDQ5vclKY9ETd1HUiaFBpfk0SGV1xomjOHLjlQCu1R5
 H1eWgpq7l3ggR6IZ+xs7BQCFJDV4V3cN9XxIIFAy6QFGLJWQqGjlplRAIGHImjJ7KB+z
 qcMO+kBCLvxROweSv0g46rnCsbqWUg5pWtK7oHpohnpn10CzLOqkHyzvzm4o4s5ax3DV
 cFp7BiolKLV/FvsZWqgNajzifa8Bc9usz+CQhugHhp/qDCys8UhMAbzvroo4zKzWLa57
 eVYw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=mha8ggtLl3GSDXDN2JnZIRZCgok7p39icY2aw8kNGWU=;
 b=rrZNDjyTgyQu0tvMThLfjpQI3zrxueQTazW4l0pp1WVRf4xLp2gsW+l0mCIgvhbsTN
 A+CoxpdN6Sq3E5My6jrQgV+VSj81yN7OLAm2sVE6hovFDX2W3HDK7lIztI3XZwQOeX96
 3HxYJolfw9EGZQyA2As0cS99XuDcPTaAfj8HmC0T4hO8XclYnbNc5FWHUhyY9iJvHvfX
 al3sTNzQn8AnnVEXIGrGwlt6a0rNLA4XD8wtDLOevc0xb5mOHhoODh7hTcbNwv3bNMCS
 +ZnIhS8eGVK96CEQUZlo4Ei6fXaVn9bAz9z8/RnjYU1iUN1mXn6g1Y8l/KLXKf78FPbt
 Wx3w==
X-Gm-Message-State: ANhLgQ2Y/dQjHDQZPcubb0M0hh9HEAWwcaezHVozCuyODNtXKuMLK2qs
 55mo8x9jB4cm6d81QyMu3kFGcq+YJjHnwA==
X-Google-Smtp-Source: 
 ADFU+vuFSSAzbrZ0vtDAj1XF5qwbCGG5vdIeubkckGRSNzrT5svsp+xOjNjI83Gbjv6kokKUnp3jLA==
X-Received: by 2002:a05:600c:2056:: with SMTP id
 p22mr5397723wmg.136.1584031533711;
 Thu, 12 Mar 2020 09:45:33 -0700 (PDT)
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 26/36] tests/boot_linux_console: Add a SD card test for the
 OrangePi PC board
Date: Thu, 12 Mar 2020 16:44:49 +0000
Message-Id: <20200312164459.25924-27-peter.maydell@linaro.org>
X-Mailer: git-send-email 2.20.1
In-Reply-To: <20200312164459.25924-1-peter.maydell@linaro.org>
References: <20200312164459.25924-1-peter.maydell@linaro.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2a00:1450:4864:20::32e
X-BeenThere: qemu-devel@nongnu.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: <qemu-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel>
List-Post: <mailto:qemu-devel@nongnu.org>
List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org
Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org>
X-ZohoMail-DKIM: pass (identity @linaro.org)

From: Philippe Mathieu-Daud=C3=A9 <f4bug@amsat.org>

The kernel image and DeviceTree blob are built by the Armbian
project (based on Debian):
https://www.armbian.com/orange-pi-pc/

The SD image is from the kernelci.org project:
https://kernelci.org/faq/#the-code

If ARM is a target being built, "make check-acceptance" will
automatically include this test by the use of the "arch:arm" tags.

Alternatively, this test can be run using:

  $ avocado --show=3Dconsole run -t machine:orangepi-pc tests/acceptance/bo=
ot_linux_console.py
  console: Uncompressing Linux... done, booting the kernel.
  console: Booting Linux on physical CPU 0x0
  console: Linux version 4.20.7-sunxi (root@armbian.com) (gcc version 7.2.1=
 20171011 (Linaro GCC 7.2-2017.11)) #5.75 SMP Fri Feb 8 09:02:10 CET 2019
  console: CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=3D50c5387d
  [...]
  console: sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=3D16 sec, =
nowayout=3D0)
  console: sunxi-mmc 1c0f000.mmc: Linked as a consumer to regulator.2
  console: sunxi-mmc 1c0f000.mmc: Got CD GPIO
  console: ledtrig-cpu: registered to indicate activity on CPUs
  console: hidraw: raw HID events driver (C) Jiri Kosina
  console: usbcore: registered new interface driver usbhid
  console: usbhid: USB HID core driver
  console: Initializing XFRM netlink socket
  console: sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
  console: NET: Registered protocol family 10
  console: mmc0: host does not support reading read-only switch, assuming w=
rite-enable
  console: mmc0: Problem switching card into high-speed mode!
  console: mmc0: new SD card at address 4567
  console: mmcblk0: mmc0:4567 QEMU! 60.0 MiB
  [...]
  console: EXT4-fs (mmcblk0): mounting ext2 file system using the ext4 subs=
ystem
  console: EXT4-fs (mmcblk0): mounted filesystem without journal. Opts: (nu=
ll)
  console: VFS: Mounted root (ext2 filesystem) on device 179:0.
  console: Run /sbin/init as init process
  console: EXT4-fs (mmcblk0): re-mounted. Opts: block_validity,barrier,user=
_xattr,acl
  console: Starting syslogd: OK
  console: Starting klogd: OK
  console: Populating /dev using udev: udevd[203]: starting version 3.2.7
  console: /bin/sh: can't access tty; job control turned off
  console: cat /proc/partitions
  console: / # cat /proc/partitions
  console: major minor  #blocks  name
  console: 1        0       4096 ram0
  console: 1        1       4096 ram1
  console: 1        2       4096 ram2
  console: 1        3       4096 ram3
  console: 179        0      61440 mmcblk0
  console: reboot
  console: / # reboot
  console: umount: devtmpfs busy - remounted read-only
  console: EXT4-fs (mmcblk0): re-mounted. Opts: (null)
  console: The system is going down NOW!
  console: Sent SIGTERM to all processes
  console: Sent SIGKILL to all processes
  console: Requesting system reboot
  console: reboot: Restarting system
  JOB TIME   : 68.64 s

Signed-off-by: Philippe Mathieu-Daud=C3=A9 <f4bug@amsat.org>
Signed-off-by: Niek Linnenbank <nieklinnenbank@gmail.com>
Reviewed-by: Alex Benn=C3=A9e <alex.bennee@linaro.org>
Tested-by: Alex Benn=C3=A9e <alex.bennee@linaro.org>
Message-id: 20200311221854.30370-16-nieklinnenbank@gmail.com
[NL: rename in commit message Raspbian to Armbian, remove vm.set_machine()]
[NL: extend test with ethernet device checks]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 tests/acceptance/boot_linux_console.py | 47 ++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot=
_linux_console.py
index dabc8ef2afb..0762dbe83a5 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -572,6 +572,53 @@ class BootLinuxConsole(Test):
         exec_command_and_wait_for_pattern(self, 'reboot',
                                                 'reboot: Restarting system=
')
=20
+    def test_arm_orangepi_sd(self):
+        """
+        :avocado: tags=3Darch:arm
+        :avocado: tags=3Dmachine:orangepi-pc
+        """
+        deb_url =3D ('https://apt.armbian.com/pool/main/l/'
+                   'linux-4.20.7-sunxi/linux-image-dev-sunxi_5.75_armhf.de=
b')
+        deb_hash =3D '1334c29c44d984ffa05ed10de8c3361f33d78315'
+        deb_path =3D self.fetch_asset(deb_url, asset_hash=3Ddeb_hash)
+        kernel_path =3D self.extract_from_deb(deb_path,
+                                            '/boot/vmlinuz-4.20.7-sunxi')
+        dtb_path =3D '/usr/lib/linux-image-dev-sunxi/sun8i-h3-orangepi-pc.=
dtb'
+        dtb_path =3D self.extract_from_deb(deb_path, dtb_path)
+        rootfs_url =3D ('http://storage.kernelci.org/images/rootfs/buildro=
ot/'
+                      'kci-2019.02/armel/base/rootfs.ext2.xz')
+        rootfs_hash =3D '692510cb625efda31640d1de0a8d60e26040f061'
+        rootfs_path_xz =3D self.fetch_asset(rootfs_url, asset_hash=3Drootf=
s_hash)
+        rootfs_path =3D os.path.join(self.workdir, 'rootfs.cpio')
+        archive.lzma_uncompress(rootfs_path_xz, rootfs_path)
+
+        self.vm.set_console()
+        kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE +
+                               'console=3DttyS0,115200 '
+                               'root=3D/dev/mmcblk0 rootwait rw '
+                               'panic=3D-1 noreboot')
+        self.vm.add_args('-kernel', kernel_path,
+                         '-dtb', dtb_path,
+                         '-drive', 'file=3D' + rootfs_path + ',if=3Dsd,for=
mat=3Draw',
+                         '-append', kernel_command_line,
+                         '-no-reboot')
+        self.vm.launch()
+        shell_ready =3D "/bin/sh: can't access tty; job control turned off"
+        self.wait_for_console_pattern(shell_ready)
+
+        exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo',
+                                                'Allwinner sun8i Family')
+        exec_command_and_wait_for_pattern(self, 'cat /proc/partitions',
+                                                'mmcblk0')
+        exec_command_and_wait_for_pattern(self, 'ifconfig eth0 up',
+                                                 'eth0: Link is Up')
+        exec_command_and_wait_for_pattern(self, 'udhcpc eth0',
+            'udhcpc: lease of 10.0.2.15 obtained')
+        exec_command_and_wait_for_pattern(self, 'ping -c 3 10.0.2.2',
+            '3 packets transmitted, 3 packets received, 0% packet loss')
+        exec_command_and_wait_for_pattern(self, 'reboot',
+                                                'reboot: Restarting system=
')
+
     def test_s390x_s390_ccw_virtio(self):
         """
         :avocado: tags=3Darch:s390x
--=20
2.20.1