[Buildroot] [RFC 1/2] support/testing: test_ubi.py enable qemu's cfi flash01 old multiple chip handling

Romain Naour romain.naour at gmail.com
Sat Sep 4 10:08:36 UTC 2021


The ubi/ubifs test (test_ubi.py) rely on a Qemu bug present in 2.8.0 that was fixed in Qemu 2.9.0 [1].
The ubi/ubifs settings must be updated to run with Qemu >= 2.9.0 using the new multiple chip handling.

The issue was not detected until now since we are sill using an old qemu (2.8 from Debian stretch)
for testing in gitlab (using the Buildroot Docker image used by gitlab-ci.yml).
The test will fail with qemu >= 2.9.

In order to be able to the the test with any Qemu version >= 2.9, enable the
hw-compat property to retain the old behaviour on 2.8 and earlier versions.
(This property is not supported by qemu 2.8.0).

Tested with qemu 2.9.0.

Fixes:
https://gitlab.com/kubu93/buildroot/-/jobs/1543100932

[1] https://git.qemu.org/?p=qemu.git;a=commit;h=feb0b1aa11f14ee71660aba46b46387d1f923c9e

Signed-off-by: Romain Naour <romain.naour at gmail.com>
---
This will not work with Qemu 2.8.0 since this property doesn't exist.

I tried to update the ubi/ubifs settings without success.
---
 support/testing/tests/fs/test_ubi.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/support/testing/tests/fs/test_ubi.py b/support/testing/tests/fs/test_ubi.py
index 7321f83da9..9cacf3b4b7 100644
--- a/support/testing/tests/fs/test_ubi.py
+++ b/support/testing/tests/fs/test_ubi.py
@@ -32,7 +32,8 @@ class TestUbi(infra.basetest.BRTest):
                            kernel_cmdline=["root=ubi0:rootfs",
                                            "ubi.mtd=0",
                                            "rootfstype=ubifs"],
-                           options=["-drive", "file={},if=pflash".format(img)])
+                           options=["-global", "driver=cfi.pflash01,property=old-multiple-chip-handling,value=on",
+                                    "-drive", "file={},if=pflash".format(img)])
         self.emulator.login()
         cmd = "mount | grep 'ubi0:rootfs on / type ubifs'"
         _, exit_code = self.emulator.run(cmd)
-- 
2.31.1



More information about the buildroot mailing list