diff mbox series

[RFC,4/4] tests/acceptance: Test U-Boot/Linux from Armbian 20.08 on Orange Pi PC

Message ID 20201023131808.3198005-5-f4bug@amsat.org
State Accepted
Commit 093aac4ab2059d02bc137476198cdd5791ab0b08
Headers show
Series tests/acceptance: Test U-Boot/Linux from Armbian 20.08 on Orange Pi PC | expand

Commit Message

Philippe Mathieu-Daudé Oct. 23, 2020, 1:18 p.m. UTC
Test U-Boot and Linux on the recent Armbian release 20.08.

Suggested-by: Cleber Rosa <crosa@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 tests/acceptance/boot_linux_console.py | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

Comments

Niek Linnenbank Oct. 24, 2020, 9 p.m. UTC | #1
Hi Philippe,

I have ran this series with the new Armbian 20.08 test and noticed this
failure:

-console: /dev/mmcblk0p1: The filesystem size (according to the
superrandom: fast init done
console: block) is 264192 blocks
console: The physical size of the device is 261120 blocks
console: Either the superblock or the partition table is likely to be
corrupt!
console: /dev/mmcblk0p1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
console: (i.e., without -a or -p options)
console: fsck exited with status code 4
console: done.
console: Failure: File system check of the root filesystem failed
console: The root filesystem on /dev/mmcblk0p1 requires a manual fsck
|console: BusyBox v1.27.2 (Ubuntu 1:1.27.2-2ubuntu3.2) built-in shell (ash)
console: Enter 'help' for a list of built-in commands.
INTERRUPTED: Test interrupted by SIGTERM\nRunner error occurred: Timeout
reached\nOriginal status: ERROR\n{'name':
'5-tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_bionic_20_08',
'logdir': '/home/fox/avocado/job-results/job-2020-10-24T22.25-39... (90.47
s)

When I run the image manually I get the same error, but only if I resize
the 20.08 image to 2G. If resized to 4G, the
20.08 image boots fine.

Additionally, I noticed that the NetBSD 9.0 test has the same problem, even
in current master (4c5b97bfd0dd54dc27717ae8d1cd10e14eef1430):

   (5/5)
tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9:
|console: U-Boot SPL 2020.01+dfsg-1 (Jan 08 2020 - 08:19:44 +0000)
console: DRAM: 1024 MiB
console: Failed to set core voltage! Can't set CPU frequency
/console: Trying to boot from MMC1
console: U-Boot 2020.01+dfsg-1 (Jan 08 2020 - 08:19:44 +0000) Allwinner
Technology
...
console: Starting kernel ...
console: [   1.0000000] NetBSD/evbarm (fdt) booting ...
...
console: [   1.3300167] sdmmc0: SD card status: 4-bit, C0
console: [   1.3300167] ld0 at sdmmc0:
<0xaa:0x5859:QEMU!:0x01:0xdeadbeef:0x062>
console: [   1.3430678] ld0: 1024 MB, 1040 cyl, 32 head, 63 sec, 512
bytes/sect x 2097152 sectors
console: [   1.4102580] ld0: 4-bit width, High-Speed/SDR25, 50.000 MHz
console: [   2.0674392] WARNING: 4 errors while detecting hardware; check
system log.
console: [   2.0674392] boot device: ld0
console: [   2.0775401] root on ld0a dumps on ld0b
console: [   2.0977679] vfs_mountroot: can't open root device
console: [   2.0977679] cannot mount root, error = 6
INTERRUPTED: Test interrupted by SIGTERM\nRunner error occurred: Timeout
reached\nOriginal status: ERROR\n{'name':
'5-tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9',
'l>

To resolve this error, I made a small patch that expands the SD image in
both tests to the next power-of-two multiplied by 2:

diff --git a/tests/acceptance/boot_linux_console.py
b/tests/acceptance/boot_linux_console.py
index b604cfe7da..40835904bb 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -35,11 +35,11 @@ def pow2ceil(x):
     return 1 if x == 0 else 2**(x - 1).bit_length()

 """
-Expand file size to next power of 2
+Expand file size to next power of 2 or higher
 """
-def image_pow2ceil_expand(path):
+def image_pow2ceil_expand(path, multiply_factor = 1):
         size = os.path.getsize(path)
-        size_aligned = pow2ceil(size)
+        size_aligned = pow2ceil(size) * multiply_factor
         if size != size_aligned:
             with open(path, 'ab+') as fd:
                 fd.truncate(size_aligned)
@@ -850,7 +850,7 @@ class BootLinuxConsole(LinuxKernelTest):
         image_path_xz = self.fetch_asset(image_url, asset_hash=image_hash,
                                          algorithm='sha256')
         image_path = archive.extract(image_path_xz, self.workdir)
-        image_pow2ceil_expand(image_path)
+        image_pow2ceil_expand(image_path, 2)

         self.do_test_arm_orangepi_uboot_armbian(image_path)

@@ -879,7 +879,7 @@ class BootLinuxConsole(LinuxKernelTest):
         image_path_gz = self.fetch_asset(image_url, asset_hash=image_hash)
         image_path = os.path.join(self.workdir, 'armv7.img')
         archive.gzip_uncompress(image_path_gz, image_path)
-        image_pow2ceil_expand(image_path)
+        image_pow2ceil_expand(image_path, 2)
         image_drive_args = 'if=sd,format=raw,snapshot=on,file=' +
image_path

         # dd if=u-boot-sunxi-with-spl.bin of=armv7.img bs=1K seek=8
conv=notrunc

After applying that change, all Orange Pi tests run successfully:

$ AVOCADO_ALLOW_LARGE_STORAGE=yes ARMBIAN_ARTIFACTS_CACHED=yes avocado
--show=app,console run -t machine:orangepi-pc
tests/acceptance/boot_linux_console.py
...
RESULTS    : PASS 6 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 |
CANCEL 0
JOB TIME   : 161.69 s

I will send this as a separate patch to the list shortly, so you can
consider adding it to the series (feel free to modify it where needed).

Regards,
Niek


On Fri, Oct 23, 2020 at 3:18 PM Philippe Mathieu-Daudé <f4bug@amsat.org>
wrote:

> Test U-Boot and Linux on the recent Armbian release 20.08.

>

> Suggested-by: Cleber Rosa <crosa@redhat.com>

> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---

>  tests/acceptance/boot_linux_console.py | 25 +++++++++++++++++++++++++

>  1 file changed, 25 insertions(+)

>

> diff --git a/tests/acceptance/boot_linux_console.py

> b/tests/acceptance/boot_linux_console.py

> index 803b4512a26..b604cfe7dab 100644

> --- a/tests/acceptance/boot_linux_console.py

> +++ b/tests/acceptance/boot_linux_console.py

> @@ -829,6 +829,31 @@ def test_arm_orangepi_bionic_19_11(self):

>

>          self.do_test_arm_orangepi_uboot_armbian(image_path)

>

> +    @skipUnless(os.getenv('ARMBIAN_ARTIFACTS_CACHED'),

> +                'Test artifacts fetched from unreliable apt.armbian.com')

> +    @skipUnless(os.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage

> limited')

> +    def test_arm_orangepi_bionic_20_08(self):

> +        """

> +        :avocado: tags=arch:arm

> +        :avocado: tags=machine:orangepi-pc

> +        :avocado: tags=device:sd

> +        """

> +

> +        # This test download a 275 MiB compressed image and expand it

> +        # to 1036 MiB, but the underlying filesystem is 1552 MiB...

> +        # As we expand it to 2 GiB we are safe.

> +

> +        image_url = ('https://dl.armbian.com/orangepipc/archive/'

> +

>  'Armbian_20.08.1_Orangepipc_bionic_current_5.8.5.img.xz')

> +        image_hash = ('b4d6775f5673486329e45a0586bf06b6'

> +                      'dbe792199fd182ac6b9c7bb6c7d3e6dd')

> +        image_path_xz = self.fetch_asset(image_url, asset_hash=image_hash,

> +                                         algorithm='sha256')

> +        image_path = archive.extract(image_path_xz, self.workdir)

> +        image_pow2ceil_expand(image_path)

> +

> +        self.do_test_arm_orangepi_uboot_armbian(image_path)

> +

>      @skipUnless(os.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage

> limited')

>      def test_arm_orangepi_uboot_netbsd9(self):

>          """

> --

> 2.26.2

>

>


-- 
Niek Linnenbank
<div dir="ltr"><div>Hi Philippe,</div><div><br></div><div>I have ran this series with the new Armbian 20.08 test and noticed this failure:</div><div><br></div><div>-console: /dev/mmcblk0p1: The filesystem size (according to the superrandom: fast init done<br>console: block) is 264192 blocks<br>console: The physical size of the device is 261120 blocks<br>console: Either the superblock or the partition table is likely to be corrupt!<br>console: /dev/mmcblk0p1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.<br>console: (i.e., without -a or -p options)<br>console: fsck exited with status code 4<br>console: done.<br>console: Failure: File system check of the root filesystem failed<br>console: The root filesystem on /dev/mmcblk0p1 requires a manual fsck<br>|console: BusyBox v1.27.2 (Ubuntu 1:1.27.2-2ubuntu3.2) built-in shell (ash)<br>console: Enter &#39;help&#39; for a list of built-in commands.<br>INTERRUPTED: Test interrupted by SIGTERM\nRunner error occurred: Timeout reached\nOriginal status: ERROR\n{&#39;name&#39;: &#39;5-tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_bionic_20_08&#39;, &#39;logdir&#39;: &#39;/home/fox/avocado/job-results/job-2020-10-24T22.25-39... (90.47 s)</div><div><br></div><div>When I run the image manually I get the same error, but only if I resize the 20.08 image to 2G. If resized to 4G, the</div><div>20.08 image boots fine.<br></div><div><br></div><div>Additionally, I noticed that the NetBSD 9.0 test has the same problem, even in current master (4c5b97bfd0dd54dc27717ae8d1cd10e14eef1430):</div><div><br></div><div>   (5/5) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9: |console: U-Boot SPL 2020.01+dfsg-1 (Jan 08 2020 - 08:19:44 +0000)<br>console: DRAM: 1024 MiB<br>console: Failed to set core voltage! Can&#39;t set CPU frequency<br>/console: Trying to boot from MMC1<br>console: U-Boot 2020.01+dfsg-1 (Jan 08 2020 - 08:19:44 +0000) Allwinner Technology<br>...<br>console: Starting kernel ...<br>console: [   1.0000000] NetBSD/evbarm (fdt) booting ...<br>...<br>console: [   1.3300167] sdmmc0: SD card status: 4-bit, C0<br>console: [   1.3300167] ld0 at sdmmc0: &lt;0xaa:0x5859:QEMU!:0x01:0xdeadbeef:0x062&gt;<br>console: [   1.3430678] ld0: 1024 MB, 1040 cyl, 32 head, 63 sec, 512 bytes/sect x 2097152 sectors<br>console: [   1.4102580] ld0: 4-bit width, High-Speed/SDR25, 50.000 MHz<br>console: [   2.0674392] WARNING: 4 errors while detecting hardware; check system log.<br>console: [   2.0674392] boot device: ld0<br>console: [   2.0775401] root on ld0a dumps on ld0b<br>console: [   2.0977679] vfs_mountroot: can&#39;t open root device<br>console: [   2.0977679] cannot mount root, error = 6<br>INTERRUPTED: Test interrupted by SIGTERM\nRunner error occurred: Timeout reached\nOriginal status: ERROR\n{&#39;name&#39;: &#39;5-tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9&#39;, &#39;l&gt;<br><br></div><div>To resolve this error, I made a small patch that expands the SD image in both tests to the next power-of-two multiplied by 2:</div><div><br></div><div>diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py<br>index b604cfe7da..40835904bb 100644<br>--- a/tests/acceptance/boot_linux_console.py<br>+++ b/tests/acceptance/boot_linux_console.py<br>@@ -35,11 +35,11 @@ def pow2ceil(x):<br>     return 1 if x == 0 else 2**(x - 1).bit_length()<br> <br> &quot;&quot;&quot;<br>-Expand file size to next power of 2<br>+Expand file size to next power of 2 or higher<br> &quot;&quot;&quot;<br>-def image_pow2ceil_expand(path):<br>+def image_pow2ceil_expand(path, multiply_factor = 1):<br>         size = os.path.getsize(path)<br>-        size_aligned = pow2ceil(size)<br>+        size_aligned = pow2ceil(size) * multiply_factor<br>         if size != size_aligned:<br>             with open(path, &#39;ab+&#39;) as fd:<br>                 fd.truncate(size_aligned)<br>@@ -850,7 +850,7 @@ class BootLinuxConsole(LinuxKernelTest):<br>         image_path_xz = self.fetch_asset(image_url, asset_hash=image_hash,<br>                                          algorithm=&#39;sha256&#39;)<br>         image_path = archive.extract(image_path_xz, self.workdir)<br>-        image_pow2ceil_expand(image_path)<br>+        image_pow2ceil_expand(image_path, 2)<br> <br>         self.do_test_arm_orangepi_uboot_armbian(image_path)<br> <br>@@ -879,7 +879,7 @@ class BootLinuxConsole(LinuxKernelTest):<br>         image_path_gz = self.fetch_asset(image_url, asset_hash=image_hash)<br>         image_path = os.path.join(self.workdir, &#39;armv7.img&#39;)<br>         archive.gzip_uncompress(image_path_gz, image_path)<br>-        image_pow2ceil_expand(image_path)<br>+        image_pow2ceil_expand(image_path, 2)<br>         image_drive_args = &#39;if=sd,format=raw,snapshot=on,file=&#39; + image_path<br> <br>         # dd if=u-boot-sunxi-with-spl.bin of=armv7.img bs=1K seek=8 conv=notrunc<br></div><div><br></div><div>After applying that change, all Orange Pi tests run successfully:</div><div><br></div><div>$ AVOCADO_ALLOW_LARGE_STORAGE=yes ARMBIAN_ARTIFACTS_CACHED=yes avocado --show=app,console run -t machine:orangepi-pc tests/acceptance/boot_linux_console.py<br>...<br>RESULTS    : PASS 6 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0<br>JOB TIME   : 161.69 s</div><div><br></div><div>I will send this as a separate patch to the list shortly, so you can consider adding it to the series (feel free to modify it where needed).<br></div><div><br></div><div>Regards,</div><div>Niek<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 23, 2020 at 3:18 PM Philippe Mathieu-Daudé &lt;<a href="mailto:f4bug@amsat.org">f4bug@amsat.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Test U-Boot and Linux on the recent Armbian release 20.08.<br>
<br>
Suggested-by: Cleber Rosa &lt;<a href="mailto:crosa@redhat.com" target="_blank">crosa@redhat.com</a>&gt;<br>
Signed-off-by: Philippe Mathieu-Daudé &lt;<a href="mailto:f4bug@amsat.org" target="_blank">f4bug@amsat.org</a>&gt;<br>

---<br>
 tests/acceptance/boot_linux_console.py | 25 +++++++++++++++++++++++++<br>
 1 file changed, 25 insertions(+)<br>
<br>
diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py<br>
index 803b4512a26..b604cfe7dab 100644<br>
--- a/tests/acceptance/boot_linux_console.py<br>
+++ b/tests/acceptance/boot_linux_console.py<br>
@@ -829,6 +829,31 @@ def test_arm_orangepi_bionic_19_11(self):<br>
<br>
         self.do_test_arm_orangepi_uboot_armbian(image_path)<br>
<br>
+    @skipUnless(os.getenv(&#39;ARMBIAN_ARTIFACTS_CACHED&#39;),<br>
+                &#39;Test artifacts fetched from unreliable <a href="http://apt.armbian.com" rel="noreferrer" target="_blank">apt.armbian.com</a>&#39;)<br>
+    @skipUnless(os.getenv(&#39;AVOCADO_ALLOW_LARGE_STORAGE&#39;), &#39;storage limited&#39;)<br>
+    def test_arm_orangepi_bionic_20_08(self):<br>
+        &quot;&quot;&quot;<br>
+        :avocado: tags=arch:arm<br>
+        :avocado: tags=machine:orangepi-pc<br>
+        :avocado: tags=device:sd<br>
+        &quot;&quot;&quot;<br>
+<br>
+        # This test download a 275 MiB compressed image and expand it<br>
+        # to 1036 MiB, but the underlying filesystem is 1552 MiB...<br>
+        # As we expand it to 2 GiB we are safe.<br>
+<br>
+        image_url = (&#39;<a href="https://dl.armbian.com/orangepipc/archive/" rel="noreferrer" target="_blank">https://dl.armbian.com/orangepipc/archive/</a>&#39;<br>
+                     &#39;Armbian_20.08.1_Orangepipc_bionic_current_5.8.5.img.xz&#39;)<br>
+        image_hash = (&#39;b4d6775f5673486329e45a0586bf06b6&#39;<br>
+                      &#39;dbe792199fd182ac6b9c7bb6c7d3e6dd&#39;)<br>
+        image_path_xz = self.fetch_asset(image_url, asset_hash=image_hash,<br>
+                                         algorithm=&#39;sha256&#39;)<br>
+        image_path = archive.extract(image_path_xz, self.workdir)<br>
+        image_pow2ceil_expand(image_path)<br>
+<br>
+        self.do_test_arm_orangepi_uboot_armbian(image_path)<br>
+<br>
     @skipUnless(os.getenv(&#39;AVOCADO_ALLOW_LARGE_STORAGE&#39;), &#39;storage limited&#39;)<br>
     def test_arm_orangepi_uboot_netbsd9(self):<br>
         &quot;&quot;&quot;<br>
-- <br>
2.26.2<br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Niek Linnenbank<br><br></div></div></div>
Bin Meng Oct. 25, 2020, 2:17 a.m. UTC | #2
Hi Niek,

On Sun, Oct 25, 2020 at 5:01 AM Niek Linnenbank
<nieklinnenbank@gmail.com> wrote:
>

> Hi Philippe,

>

> I have ran this series with the new Armbian 20.08 test and noticed this failure:

>

> -console: /dev/mmcblk0p1: The filesystem size (according to the superrandom: fast init done

> console: block) is 264192 blocks

> console: The physical size of the device is 261120 blocks

> console: Either the superblock or the partition table is likely to be corrupt!

> console: /dev/mmcblk0p1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.

> console: (i.e., without -a or -p options)

> console: fsck exited with status code 4

> console: done.

> console: Failure: File system check of the root filesystem failed

> console: The root filesystem on /dev/mmcblk0p1 requires a manual fsck

> |console: BusyBox v1.27.2 (Ubuntu 1:1.27.2-2ubuntu3.2) built-in shell (ash)

> console: Enter 'help' for a list of built-in commands.

> INTERRUPTED: Test interrupted by SIGTERM\nRunner error occurred: Timeout reached\nOriginal status: ERROR\n{'name': '5-tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_bionic_20_08', 'logdir': '/home/fox/avocado/job-results/job-2020-10-24T22.25-39... (90.47 s)

>

> When I run the image manually I get the same error, but only if I resize the 20.08 image to 2G. If resized to 4G, the

> 20.08 image boots fine.

>

> Additionally, I noticed that the NetBSD 9.0 test has the same problem, even in current master (4c5b97bfd0dd54dc27717ae8d1cd10e14eef1430):

>

>    (5/5) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9: |console: U-Boot SPL 2020.01+dfsg-1 (Jan 08 2020 - 08:19:44 +0000)

> console: DRAM: 1024 MiB

> console: Failed to set core voltage! Can't set CPU frequency

> /console: Trying to boot from MMC1

> console: U-Boot 2020.01+dfsg-1 (Jan 08 2020 - 08:19:44 +0000) Allwinner Technology

> ...

> console: Starting kernel ...

> console: [   1.0000000] NetBSD/evbarm (fdt) booting ...

> ...

> console: [   1.3300167] sdmmc0: SD card status: 4-bit, C0

> console: [   1.3300167] ld0 at sdmmc0: <0xaa:0x5859:QEMU!:0x01:0xdeadbeef:0x062>

> console: [   1.3430678] ld0: 1024 MB, 1040 cyl, 32 head, 63 sec, 512 bytes/sect x 2097152 sectors

> console: [   1.4102580] ld0: 4-bit width, High-Speed/SDR25, 50.000 MHz

> console: [   2.0674392] WARNING: 4 errors while detecting hardware; check system log.

> console: [   2.0674392] boot device: ld0

> console: [   2.0775401] root on ld0a dumps on ld0b

> console: [   2.0977679] vfs_mountroot: can't open root device

> console: [   2.0977679] cannot mount root, error = 6

> INTERRUPTED: Test interrupted by SIGTERM\nRunner error occurred: Timeout reached\nOriginal status: ERROR\n{'name': '5-tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9', 'l>

>

> To resolve this error, I made a small patch that expands the SD image in both tests to the next power-of-two multiplied by 2:

>

> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py

> index b604cfe7da..40835904bb 100644

> --- a/tests/acceptance/boot_linux_console.py

> +++ b/tests/acceptance/boot_linux_console.py

> @@ -35,11 +35,11 @@ def pow2ceil(x):

>      return 1 if x == 0 else 2**(x - 1).bit_length()

>

>  """

> -Expand file size to next power of 2

> +Expand file size to next power of 2 or higher

>  """

> -def image_pow2ceil_expand(path):

> +def image_pow2ceil_expand(path, multiply_factor = 1):

>          size = os.path.getsize(path)

> -        size_aligned = pow2ceil(size)

> +        size_aligned = pow2ceil(size) * multiply_factor

>          if size != size_aligned:

>              with open(path, 'ab+') as fd:

>                  fd.truncate(size_aligned)

> @@ -850,7 +850,7 @@ class BootLinuxConsole(LinuxKernelTest):

>          image_path_xz = self.fetch_asset(image_url, asset_hash=image_hash,

>                                           algorithm='sha256')

>          image_path = archive.extract(image_path_xz, self.workdir)

> -        image_pow2ceil_expand(image_path)

> +        image_pow2ceil_expand(image_path, 2)

>

>          self.do_test_arm_orangepi_uboot_armbian(image_path)

>

> @@ -879,7 +879,7 @@ class BootLinuxConsole(LinuxKernelTest):

>          image_path_gz = self.fetch_asset(image_url, asset_hash=image_hash)

>          image_path = os.path.join(self.workdir, 'armv7.img')

>          archive.gzip_uncompress(image_path_gz, image_path)

> -        image_pow2ceil_expand(image_path)

> +        image_pow2ceil_expand(image_path, 2)

>          image_drive_args = 'if=sd,format=raw,snapshot=on,file=' + image_path

>

>          # dd if=u-boot-sunxi-with-spl.bin of=armv7.img bs=1K seek=8 conv=notrunc

>

> After applying that change, all Orange Pi tests run successfully:

>

> $ AVOCADO_ALLOW_LARGE_STORAGE=yes ARMBIAN_ARTIFACTS_CACHED=yes avocado --show=app,console run -t machine:orangepi-pc tests/acceptance/boot_linux_console.py


This command does not work for me.

Traceback (most recent call last):
  File "/usr/local/bin/avocado", line 5, in <module>
    from avocado.core.main import main
  File "/usr/local/lib/python3.8/dist-packages/avocado/core/main.py",
line 22, in <module>
    from avocado.core import data_dir
  File "/usr/local/lib/python3.8/dist-packages/avocado/core/data_dir.py",
line 39, in <module>
    from .output import LOG_JOB, LOG_UI
  File "/usr/local/lib/python3.8/dist-packages/avocado/core/output.py",
line 27, in <module>
    from .settings import settings
  File "/usr/local/lib/python3.8/dist-packages/avocado/core/settings.py",
line 625, in <module>
    settings = Settings()  # pylint: disable-msg=invalid-name
  File "/usr/local/lib/python3.8/dist-packages/avocado/core/settings.py",
line 274, in __init__
    self._prepare_base_dirs()
  File "/usr/local/lib/python3.8/dist-packages/avocado/core/settings.py",
line 315, in _prepare_base_dirs
    self._config_path_pkg = resource_filename('avocado', config_pkg_base)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",
line 1145, in resource_filename
    return get_provider(package_or_requirement).get_resource_filename(
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",
line 365, in get_provider
    return _find_adapter(_provider_factories, loader)(module)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",
line 1393, in __init__
    self.module_path = os.path.dirname(getattr(module, '__file__', ''))
  File "/usr/lib/python3.8/posixpath.py", line 152, in dirname
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType

I haven't got a command to work on testing only a single target. Any
hint? Thanks!

> ...

> RESULTS    : PASS 6 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0

> JOB TIME   : 161.69 s

>

> I will send this as a separate patch to the list shortly, so you can consider adding it to the series (feel free to modify it where needed).

>


Regards,
Bin
Philippe Mathieu-Daudé Oct. 25, 2020, 8:17 p.m. UTC | #3
Cc'ing avocado-devel@

On 10/26/20 12:35 AM, Niek Linnenbank wrote:
> On Sun, Oct 25, 2020 at 3:17 AM Bin Meng <bmeng.cn@gmail.com 
> <mailto:bmeng.cn@gmail.com>> wrote:
>     On Sun, Oct 25, 2020 at 5:01 AM Niek Linnenbank
>     <nieklinnenbank@gmail.com <mailto:nieklinnenbank@gmail.com>> wrote:
...
>      > After applying that change, all Orange Pi tests run successfully:
>      >
>      > $ AVOCADO_ALLOW_LARGE_STORAGE=yes ARMBIAN_ARTIFACTS_CACHED=yes
>     avocado --show=app,console run -t machine:orangepi-pc
>     tests/acceptance/boot_linux_console.py
> 
>     This command does not work for me.
> 
>     Traceback (most recent call last):
>        File "/usr/local/bin/avocado", line 5, in <module>
>          from avocado.core.main import main
>        File "/usr/local/lib/python3.8/dist-packages/avocado/core/main.py",
>     line 22, in <module>
>          from avocado.core import data_dir
>        File
>     "/usr/local/lib/python3.8/dist-packages/avocado/core/data_dir.py",
>     line 39, in <module>
>          from .output import LOG_JOB, LOG_UI
>        File "/usr/local/lib/python3.8/dist-packages/avocado/core/output.py",
>     line 27, in <module>
>          from .settings import settings
>        File
>     "/usr/local/lib/python3.8/dist-packages/avocado/core/settings.py",
>     line 625, in <module>
>          settings = Settings()  # pylint: disable-msg=invalid-name
>        File
>     "/usr/local/lib/python3.8/dist-packages/avocado/core/settings.py",
>     line 274, in __init__
>          self._prepare_base_dirs()
>        File
>     "/usr/local/lib/python3.8/dist-packages/avocado/core/settings.py",
>     line 315, in _prepare_base_dirs
>          self._config_path_pkg = resource_filename('avocado',
>     config_pkg_base)
>        File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",
>     line 1145, in resource_filename
>          return get_provider(package_or_requirement).get_resource_filename(
>        File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",
>     line 365, in get_provider
>          return _find_adapter(_provider_factories, loader)(module)
>        File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",
>     line 1393, in __init__
>          self.module_path = os.path.dirname(getattr(module, '__file__', ''))
>        File "/usr/lib/python3.8/posixpath.py", line 152, in dirname
>          p = os.fspath(p)
>     TypeError: expected str, bytes or os.PathLike object, not NoneType
> 
>     I haven't got a command to work on testing only a single target. Any
>     hint? Thanks!
> 
> 
> That error is new to me, I have not seen it before. From the stacktrace, 
> it looks like that avocado is trying to read its own configuration / 
> settings file (from settings.py).
> Later on there is a type conversion error for NoneType. Perhaps the 
> avocado files for your user have somehow got corrupted?
> You could try to remove them from your home directory and/or re-install 
> avocado as well and start out fresh.
> I assume that at least 'avocado --help'  should work without generating 
> this error.
> 
> Also it may be useful to know that it looks like you need to run avocado 
> from within the new 'build' directory that the new meson build system 
> now creates.
> If not running from the 'build' directory, I'm getting this printed on 
> my machine:
>    CANCEL: No QEMU binary defined or found in the build tree
> 
> So once your avocado is working without the type error you could try this:
> 
> 1) cd build
> 2) AVOCADO_ALLOW_LARGE_STORAGE=yes ARMBIAN_ARTIFACTS_CACHED=yes avocado 
> --show=app,console run -t machine:orangepi-pc 
> tests/acceptance/boot_linux_console.py
> 
> Alternatively, if you can't get avocado to run anything, you could also 
> just run the Armbian image (or any other image) directly via 
> qemu-system-arm:
> 
>    $ build/arm-softmmu/qemu-system-arm -M orangepi-pc -nographic -nic 
> user -sd Armbian_20.08.1_Orangepipc_bionic_current_5.8.5.img
>    U-Boot SPL 2020.04-armbian (Sep 02 2020 - 10:16:13 +0200)
>    DRAM: 1024 MiB
>    ...
>    Autoboot in 1 seconds, press <Space> to stop
>    => setenv extraargs 'console=ttyS0,115200'
>    => boot
>    ...
>    Uncompressing Linux... done, booting the kernel.
>    Loading, please wait...
>    starting version 237
> 
> Also see the file docs/system/arm/orangepi.rst with some additional 
> information and documentation.
> 
> Hope this helps & regards,
> 
> Niek
Niek Linnenbank Oct. 25, 2020, 11:35 p.m. UTC | #4
Hi Bin,

On Sun, Oct 25, 2020 at 3:17 AM Bin Meng <bmeng.cn@gmail.com> wrote:

> Hi Niek,

>

> On Sun, Oct 25, 2020 at 5:01 AM Niek Linnenbank

> <nieklinnenbank@gmail.com> wrote:

> >

> > Hi Philippe,

> >

> > I have ran this series with the new Armbian 20.08 test and noticed this

> failure:

> >

> > -console: /dev/mmcblk0p1: The filesystem size (according to the

> superrandom: fast init done

> > console: block) is 264192 blocks

> > console: The physical size of the device is 261120 blocks

> > console: Either the superblock or the partition table is likely to be

> corrupt!

> > console: /dev/mmcblk0p1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.

> > console: (i.e., without -a or -p options)

> > console: fsck exited with status code 4

> > console: done.

> > console: Failure: File system check of the root filesystem failed

> > console: The root filesystem on /dev/mmcblk0p1 requires a manual fsck

> > |console: BusyBox v1.27.2 (Ubuntu 1:1.27.2-2ubuntu3.2) built-in shell

> (ash)

> > console: Enter 'help' for a list of built-in commands.

> > INTERRUPTED: Test interrupted by SIGTERM\nRunner error occurred: Timeout

> reached\nOriginal status: ERROR\n{'name':

> '5-tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_bionic_20_08',

> 'logdir': '/home/fox/avocado/job-results/job-2020-10-24T22.25-39... (90.47

> s)

> >

> > When I run the image manually I get the same error, but only if I resize

> the 20.08 image to 2G. If resized to 4G, the

> > 20.08 image boots fine.

> >

> > Additionally, I noticed that the NetBSD 9.0 test has the same problem,

> even in current master (4c5b97bfd0dd54dc27717ae8d1cd10e14eef1430):

> >

> >    (5/5)

> tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9:

> |console: U-Boot SPL 2020.01+dfsg-1 (Jan 08 2020 - 08:19:44 +0000)

> > console: DRAM: 1024 MiB

> > console: Failed to set core voltage! Can't set CPU frequency

> > /console: Trying to boot from MMC1

> > console: U-Boot 2020.01+dfsg-1 (Jan 08 2020 - 08:19:44 +0000) Allwinner

> Technology

> > ...

> > console: Starting kernel ...

> > console: [   1.0000000] NetBSD/evbarm (fdt) booting ...

> > ...

> > console: [   1.3300167] sdmmc0: SD card status: 4-bit, C0

> > console: [   1.3300167] ld0 at sdmmc0:

> <0xaa:0x5859:QEMU!:0x01:0xdeadbeef:0x062>

> > console: [   1.3430678] ld0: 1024 MB, 1040 cyl, 32 head, 63 sec, 512

> bytes/sect x 2097152 sectors

> > console: [   1.4102580] ld0: 4-bit width, High-Speed/SDR25, 50.000 MHz

> > console: [   2.0674392] WARNING: 4 errors while detecting hardware;

> check system log.

> > console: [   2.0674392] boot device: ld0

> > console: [   2.0775401] root on ld0a dumps on ld0b

> > console: [   2.0977679] vfs_mountroot: can't open root device

> > console: [   2.0977679] cannot mount root, error = 6

> > INTERRUPTED: Test interrupted by SIGTERM\nRunner error occurred: Timeout

> reached\nOriginal status: ERROR\n{'name':

> '5-tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9',

> 'l>

> >

> > To resolve this error, I made a small patch that expands the SD image in

> both tests to the next power-of-two multiplied by 2:

> >

> > diff --git a/tests/acceptance/boot_linux_console.py

> b/tests/acceptance/boot_linux_console.py

> > index b604cfe7da..40835904bb 100644

> > --- a/tests/acceptance/boot_linux_console.py

> > +++ b/tests/acceptance/boot_linux_console.py

> > @@ -35,11 +35,11 @@ def pow2ceil(x):

> >      return 1 if x == 0 else 2**(x - 1).bit_length()

> >

> >  """

> > -Expand file size to next power of 2

> > +Expand file size to next power of 2 or higher

> >  """

> > -def image_pow2ceil_expand(path):

> > +def image_pow2ceil_expand(path, multiply_factor = 1):

> >          size = os.path.getsize(path)

> > -        size_aligned = pow2ceil(size)

> > +        size_aligned = pow2ceil(size) * multiply_factor

> >          if size != size_aligned:

> >              with open(path, 'ab+') as fd:

> >                  fd.truncate(size_aligned)

> > @@ -850,7 +850,7 @@ class BootLinuxConsole(LinuxKernelTest):

> >          image_path_xz = self.fetch_asset(image_url,

> asset_hash=image_hash,

> >                                           algorithm='sha256')

> >          image_path = archive.extract(image_path_xz, self.workdir)

> > -        image_pow2ceil_expand(image_path)

> > +        image_pow2ceil_expand(image_path, 2)

> >

> >          self.do_test_arm_orangepi_uboot_armbian(image_path)

> >

> > @@ -879,7 +879,7 @@ class BootLinuxConsole(LinuxKernelTest):

> >          image_path_gz = self.fetch_asset(image_url,

> asset_hash=image_hash)

> >          image_path = os.path.join(self.workdir, 'armv7.img')

> >          archive.gzip_uncompress(image_path_gz, image_path)

> > -        image_pow2ceil_expand(image_path)

> > +        image_pow2ceil_expand(image_path, 2)

> >          image_drive_args = 'if=sd,format=raw,snapshot=on,file=' +

> image_path

> >

> >          # dd if=u-boot-sunxi-with-spl.bin of=armv7.img bs=1K seek=8

> conv=notrunc

> >

> > After applying that change, all Orange Pi tests run successfully:

> >

> > $ AVOCADO_ALLOW_LARGE_STORAGE=yes ARMBIAN_ARTIFACTS_CACHED=yes avocado

> --show=app,console run -t machine:orangepi-pc

> tests/acceptance/boot_linux_console.py

>

> This command does not work for me.

>

> Traceback (most recent call last):

>   File "/usr/local/bin/avocado", line 5, in <module>

>     from avocado.core.main import main

>   File "/usr/local/lib/python3.8/dist-packages/avocado/core/main.py",

> line 22, in <module>

>     from avocado.core import data_dir

>   File "/usr/local/lib/python3.8/dist-packages/avocado/core/data_dir.py",

> line 39, in <module>

>     from .output import LOG_JOB, LOG_UI

>   File "/usr/local/lib/python3.8/dist-packages/avocado/core/output.py",

> line 27, in <module>

>     from .settings import settings

>   File "/usr/local/lib/python3.8/dist-packages/avocado/core/settings.py",

> line 625, in <module>

>     settings = Settings()  # pylint: disable-msg=invalid-name

>   File "/usr/local/lib/python3.8/dist-packages/avocado/core/settings.py",

> line 274, in __init__

>     self._prepare_base_dirs()

>   File "/usr/local/lib/python3.8/dist-packages/avocado/core/settings.py",

> line 315, in _prepare_base_dirs

>     self._config_path_pkg = resource_filename('avocado', config_pkg_base)

>   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",

> line 1145, in resource_filename

>     return get_provider(package_or_requirement).get_resource_filename(

>   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",

> line 365, in get_provider

>     return _find_adapter(_provider_factories, loader)(module)

>   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",

> line 1393, in __init__

>     self.module_path = os.path.dirname(getattr(module, '__file__', ''))

>   File "/usr/lib/python3.8/posixpath.py", line 152, in dirname

>     p = os.fspath(p)

> TypeError: expected str, bytes or os.PathLike object, not NoneType

>

> I haven't got a command to work on testing only a single target. Any

> hint? Thanks!

>


That error is new to me, I have not seen it before. From the stacktrace, it
looks like that avocado is trying to read its own configuration / settings
file (from settings.py).
Later on there is a type conversion error for NoneType. Perhaps the avocado
files for your user have somehow got corrupted?
You could try to remove them from your home directory and/or re-install
avocado as well and start out fresh.
I assume that at least 'avocado --help'  should work without generating
this error.

Also it may be useful to know that it looks like you need to run avocado
from within the new 'build' directory that the new meson build system now
creates.
If not running from the 'build' directory, I'm getting this printed on my
machine:
  CANCEL: No QEMU binary defined or found in the build tree

So once your avocado is working without the type error you could try this:

1) cd build
2) AVOCADO_ALLOW_LARGE_STORAGE=yes ARMBIAN_ARTIFACTS_CACHED=yes avocado
--show=app,console run -t machine:orangepi-pc
tests/acceptance/boot_linux_console.py

Alternatively, if you can't get avocado to run anything, you could also
just run the Armbian image (or any other image) directly via
qemu-system-arm:

  $ build/arm-softmmu/qemu-system-arm -M orangepi-pc -nographic -nic user
-sd Armbian_20.08.1_Orangepipc_bionic_current_5.8.5.img
  U-Boot SPL 2020.04-armbian (Sep 02 2020 - 10:16:13 +0200)
  DRAM: 1024 MiB
  ...
  Autoboot in 1 seconds, press <Space> to stop
  => setenv extraargs 'console=ttyS0,115200'
  => boot
  ...
  Uncompressing Linux... done, booting the kernel.
  Loading, please wait...
  starting version 237

Also see the file docs/system/arm/orangepi.rst with some additional
information and documentation.

Hope this helps & regards,

Niek


>

> > ...

> > RESULTS    : PASS 6 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 |

> CANCEL 0

> > JOB TIME   : 161.69 s

> >

> > I will send this as a separate patch to the list shortly, so you can

> consider adding it to the series (feel free to modify it where needed).

> >

>

> Regards,

> Bin

>



-- 
Niek Linnenbank
<div dir="ltr"><div>Hi Bin,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Oct 25, 2020 at 3:17 AM Bin Meng &lt;<a href="mailto:bmeng.cn@gmail.com">bmeng.cn@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Niek,<br>
<br>
On Sun, Oct 25, 2020 at 5:01 AM Niek Linnenbank<br>
&lt;<a href="mailto:nieklinnenbank@gmail.com" target="_blank">nieklinnenbank@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi Philippe,<br>
&gt;<br>
&gt; I have ran this series with the new Armbian 20.08 test and noticed this failure:<br>
&gt;<br>
&gt; -console: /dev/mmcblk0p1: The filesystem size (according to the superrandom: fast init done<br>
&gt; console: block) is 264192 blocks<br>
&gt; console: The physical size of the device is 261120 blocks<br>
&gt; console: Either the superblock or the partition table is likely to be corrupt!<br>
&gt; console: /dev/mmcblk0p1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.<br>
&gt; console: (i.e., without -a or -p options)<br>
&gt; console: fsck exited with status code 4<br>
&gt; console: done.<br>
&gt; console: Failure: File system check of the root filesystem failed<br>
&gt; console: The root filesystem on /dev/mmcblk0p1 requires a manual fsck<br>
&gt; |console: BusyBox v1.27.2 (Ubuntu 1:1.27.2-2ubuntu3.2) built-in shell (ash)<br>
&gt; console: Enter &#39;help&#39; for a list of built-in commands.<br>
&gt; INTERRUPTED: Test interrupted by SIGTERM\nRunner error occurred: Timeout reached\nOriginal status: ERROR\n{&#39;name&#39;: &#39;5-tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_bionic_20_08&#39;, &#39;logdir&#39;: &#39;/home/fox/avocado/job-results/job-2020-10-24T22.25-39... (90.47 s)<br>
&gt;<br>
&gt; When I run the image manually I get the same error, but only if I resize the 20.08 image to 2G. If resized to 4G, the<br>
&gt; 20.08 image boots fine.<br>
&gt;<br>
&gt; Additionally, I noticed that the NetBSD 9.0 test has the same problem, even in current master (4c5b97bfd0dd54dc27717ae8d1cd10e14eef1430):<br>
&gt;<br>
&gt;    (5/5) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9: |console: U-Boot SPL 2020.01+dfsg-1 (Jan 08 2020 - 08:19:44 +0000)<br>
&gt; console: DRAM: 1024 MiB<br>
&gt; console: Failed to set core voltage! Can&#39;t set CPU frequency<br>
&gt; /console: Trying to boot from MMC1<br>
&gt; console: U-Boot 2020.01+dfsg-1 (Jan 08 2020 - 08:19:44 +0000) Allwinner Technology<br>
&gt; ...<br>
&gt; console: Starting kernel ...<br>
&gt; console: [   1.0000000] NetBSD/evbarm (fdt) booting ...<br>
&gt; ...<br>
&gt; console: [   1.3300167] sdmmc0: SD card status: 4-bit, C0<br>
&gt; console: [   1.3300167] ld0 at sdmmc0: &lt;0xaa:0x5859:QEMU!:0x01:0xdeadbeef:0x062&gt;<br>
&gt; console: [   1.3430678] ld0: 1024 MB, 1040 cyl, 32 head, 63 sec, 512 bytes/sect x 2097152 sectors<br>
&gt; console: [   1.4102580] ld0: 4-bit width, High-Speed/SDR25, 50.000 MHz<br>
&gt; console: [   2.0674392] WARNING: 4 errors while detecting hardware; check system log.<br>
&gt; console: [   2.0674392] boot device: ld0<br>
&gt; console: [   2.0775401] root on ld0a dumps on ld0b<br>
&gt; console: [   2.0977679] vfs_mountroot: can&#39;t open root device<br>
&gt; console: [   2.0977679] cannot mount root, error = 6<br>
&gt; INTERRUPTED: Test interrupted by SIGTERM\nRunner error occurred: Timeout reached\nOriginal status: ERROR\n{&#39;name&#39;: &#39;5-tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9&#39;, &#39;l&gt;<br>
&gt;<br>
&gt; To resolve this error, I made a small patch that expands the SD image in both tests to the next power-of-two multiplied by 2:<br>
&gt;<br>
&gt; diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py<br>
&gt; index b604cfe7da..40835904bb 100644<br>
&gt; --- a/tests/acceptance/boot_linux_console.py<br>
&gt; +++ b/tests/acceptance/boot_linux_console.py<br>
&gt; @@ -35,11 +35,11 @@ def pow2ceil(x):<br>
&gt;      return 1 if x == 0 else 2**(x - 1).bit_length()<br>
&gt;<br>
&gt;  &quot;&quot;&quot;<br>
&gt; -Expand file size to next power of 2<br>
&gt; +Expand file size to next power of 2 or higher<br>
&gt;  &quot;&quot;&quot;<br>
&gt; -def image_pow2ceil_expand(path):<br>
&gt; +def image_pow2ceil_expand(path, multiply_factor = 1):<br>
&gt;          size = os.path.getsize(path)<br>
&gt; -        size_aligned = pow2ceil(size)<br>
&gt; +        size_aligned = pow2ceil(size) * multiply_factor<br>
&gt;          if size != size_aligned:<br>
&gt;              with open(path, &#39;ab+&#39;) as fd:<br>
&gt;                  fd.truncate(size_aligned)<br>
&gt; @@ -850,7 +850,7 @@ class BootLinuxConsole(LinuxKernelTest):<br>
&gt;          image_path_xz = self.fetch_asset(image_url, asset_hash=image_hash,<br>
&gt;                                           algorithm=&#39;sha256&#39;)<br>
&gt;          image_path = archive.extract(image_path_xz, self.workdir)<br>
&gt; -        image_pow2ceil_expand(image_path)<br>
&gt; +        image_pow2ceil_expand(image_path, 2)<br>
&gt;<br>
&gt;          self.do_test_arm_orangepi_uboot_armbian(image_path)<br>
&gt;<br>
&gt; @@ -879,7 +879,7 @@ class BootLinuxConsole(LinuxKernelTest):<br>
&gt;          image_path_gz = self.fetch_asset(image_url, asset_hash=image_hash)<br>
&gt;          image_path = os.path.join(self.workdir, &#39;armv7.img&#39;)<br>
&gt;          archive.gzip_uncompress(image_path_gz, image_path)<br>
&gt; -        image_pow2ceil_expand(image_path)<br>
&gt; +        image_pow2ceil_expand(image_path, 2)<br>
&gt;          image_drive_args = &#39;if=sd,format=raw,snapshot=on,file=&#39; + image_path<br>
&gt;<br>
&gt;          # dd if=u-boot-sunxi-with-spl.bin of=armv7.img bs=1K seek=8 conv=notrunc<br>
&gt;<br>
&gt; After applying that change, all Orange Pi tests run successfully:<br>
&gt;<br>
&gt; $ AVOCADO_ALLOW_LARGE_STORAGE=yes ARMBIAN_ARTIFACTS_CACHED=yes avocado --show=app,console run -t machine:orangepi-pc tests/acceptance/boot_linux_console.py<br>
<br>
This command does not work for me.<br>
<br>
Traceback (most recent call last):<br>
  File &quot;/usr/local/bin/avocado&quot;, line 5, in &lt;module&gt;<br>
    from avocado.core.main import main<br>
  File &quot;/usr/local/lib/python3.8/dist-packages/avocado/core/main.py&quot;,<br>
line 22, in &lt;module&gt;<br>
    from avocado.core import data_dir<br>
  File &quot;/usr/local/lib/python3.8/dist-packages/avocado/core/data_dir.py&quot;,<br>
line 39, in &lt;module&gt;<br>
    from .output import LOG_JOB, LOG_UI<br>
  File &quot;/usr/local/lib/python3.8/dist-packages/avocado/core/output.py&quot;,<br>
line 27, in &lt;module&gt;<br>
    from .settings import settings<br>
  File &quot;/usr/local/lib/python3.8/dist-packages/avocado/core/settings.py&quot;,<br>
line 625, in &lt;module&gt;<br>
    settings = Settings()  # pylint: disable-msg=invalid-name<br>
  File &quot;/usr/local/lib/python3.8/dist-packages/avocado/core/settings.py&quot;,<br>
line 274, in __init__<br>
    self._prepare_base_dirs()<br>
  File &quot;/usr/local/lib/python3.8/dist-packages/avocado/core/settings.py&quot;,<br>
line 315, in _prepare_base_dirs<br>
    self._config_path_pkg = resource_filename(&#39;avocado&#39;, config_pkg_base)<br>
  File &quot;/usr/lib/python3/dist-packages/pkg_resources/__init__.py&quot;,<br>
line 1145, in resource_filename<br>
    return get_provider(package_or_requirement).get_resource_filename(<br>
  File &quot;/usr/lib/python3/dist-packages/pkg_resources/__init__.py&quot;,<br>
line 365, in get_provider<br>
    return _find_adapter(_provider_factories, loader)(module)<br>
  File &quot;/usr/lib/python3/dist-packages/pkg_resources/__init__.py&quot;,<br>
line 1393, in __init__<br>
    self.module_path = os.path.dirname(getattr(module, &#39;__file__&#39;, &#39;&#39;))<br>
  File &quot;/usr/lib/python3.8/posixpath.py&quot;, line 152, in dirname<br>
    p = os.fspath(p)<br>
TypeError: expected str, bytes or os.PathLike object, not NoneType<br>
<br>
I haven&#39;t got a command to work on testing only a single target. Any<br>
hint? Thanks!<br></blockquote><div><br></div><div>That error is new to me, I have not seen it before. From the stacktrace, it looks like that avocado is trying to read its own configuration / settings file (from settings.py).</div><div>Later on there is a type conversion error for NoneType. Perhaps the avocado files for your user have somehow got corrupted?</div><div>You could try to remove them from your home directory and/or re-install avocado as well and start out fresh.</div><div>I assume that at least &#39;avocado --help&#39;  should work without generating this error.<br></div><div><br></div><div>Also it may be useful to know that it looks like you need to run avocado from within the new &#39;build&#39; directory that the new meson build system now creates.</div><div>If not running from the &#39;build&#39; directory, I&#39;m getting this printed on my machine:</div><div>  CANCEL: No QEMU binary defined or found in the build tree</div><div><br></div><div>So once your avocado is working without the type error you could try this:<br></div><div><br></div><div>1) cd build</div><div>2) AVOCADO_ALLOW_LARGE_STORAGE=yes ARMBIAN_ARTIFACTS_CACHED=yes avocado --show=app,console run -t machine:orangepi-pc tests/acceptance/boot_linux_console.py</div><div><br></div><div>Alternatively, if you can&#39;t get avocado to run anything, you could also just run the Armbian image (or any other image) directly via qemu-system-arm:</div><div><br></div><div>  $ build/arm-softmmu/qemu-system-arm -M orangepi-pc -nographic -nic user -sd Armbian_20.08.1_Orangepipc_bionic_current_5.8.5.img</div><div>  U-Boot SPL 2020.04-armbian (Sep 02 2020 - 10:16:13 +0200)<br>  DRAM: 1024 MiB<br></div><div>  ...</div><div>  Autoboot in 1 seconds, press &lt;Space&gt; to stop<br>  =&gt; setenv extraargs &#39;console=ttyS0,115200&#39;<br>  =&gt; boot</div><div>  ...</div><div>  Uncompressing Linux... done, booting the kernel.<br>  Loading, please wait...<br>  starting version 237</div><div><br></div><div>Also see the file docs/system/arm/orangepi.rst with some additional information and documentation.</div><div><br></div><div>Hope this helps &amp; regards,<br></div><div><br></div><div>Niek<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
&gt; ...<br>
&gt; RESULTS    : PASS 6 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0<br>
&gt; JOB TIME   : 161.69 s<br>
&gt;<br>
&gt; I will send this as a separate patch to the list shortly, so you can consider adding it to the series (feel free to modify it where needed).<br>
&gt;<br>
<br>
Regards,<br>
Bin<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Niek Linnenbank<br><br></div></div></div></div>
diff mbox series

Patch

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 803b4512a26..b604cfe7dab 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -829,6 +829,31 @@  def test_arm_orangepi_bionic_19_11(self):
 
         self.do_test_arm_orangepi_uboot_armbian(image_path)
 
+    @skipUnless(os.getenv('ARMBIAN_ARTIFACTS_CACHED'),
+                'Test artifacts fetched from unreliable apt.armbian.com')
+    @skipUnless(os.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage limited')
+    def test_arm_orangepi_bionic_20_08(self):
+        """
+        :avocado: tags=arch:arm
+        :avocado: tags=machine:orangepi-pc
+        :avocado: tags=device:sd
+        """
+
+        # This test download a 275 MiB compressed image and expand it
+        # to 1036 MiB, but the underlying filesystem is 1552 MiB...
+        # As we expand it to 2 GiB we are safe.
+
+        image_url = ('https://dl.armbian.com/orangepipc/archive/'
+                     'Armbian_20.08.1_Orangepipc_bionic_current_5.8.5.img.xz')
+        image_hash = ('b4d6775f5673486329e45a0586bf06b6'
+                      'dbe792199fd182ac6b9c7bb6c7d3e6dd')
+        image_path_xz = self.fetch_asset(image_url, asset_hash=image_hash,
+                                         algorithm='sha256')
+        image_path = archive.extract(image_path_xz, self.workdir)
+        image_pow2ceil_expand(image_path)
+
+        self.do_test_arm_orangepi_uboot_armbian(image_path)
+
     @skipUnless(os.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage limited')
     def test_arm_orangepi_uboot_netbsd9(self):
         """