support/scripts/boot-qemu-image.py: wait before using expect
PATCH 1/1 support/scripts/boot-qemu-image.py: wait before using expect
As reported by a gitlab runtime test [1] and on the mailing list [2], some runtime tests are failing on slow host machines when the qemu-system-<arch> is missing on the host.
The boot-qemu-image.py script need to wait some time after calling pexpect.spawn() in order to make sure that the qemu process has been executed in start-qemu.sh.
If start-qemu.sh failed due to missing qemu-system binary an exception will be thrown by child.expect() and catched by the error handling (pexpect.EOF).
Thanks to Yann for the help while investigating the issue.
Tested:
https://gitlab.com/kubu93/buildroot/pipelines/136431059
[1] https://gitlab.com/kubu93/buildroot/pipelines/135487475
[2] http://lists.busybox.net/pipermail/buildroot/2020-April/280037.html
Fixes:
https://gitlab.com/kubu93/buildroot/-/jobs/509053135
--- support/scripts/boot-qemu-image.py | 5 +++++ 1 file changed, 5 insertions(+)
support/scripts/boot-qemu-image.py +5 -0
@@ -5,6 +5,7 @@ import pexpect import sys import os +import time def main():
@@ -26,6 +27,10 @@ def main(): # We want only stdout into the log to avoid double echo child.logfile = sys.stdout + # Let the spawn actually try to fork+exec to the wrapper, and then + # let the wrapper exec the qemu process. + time.sleep(5) + try: child.expect(["buildroot login:", pexpect.TIMEOUT], timeout=60) except pexpect.EOF as e:
Signature · 1 line
2.25.2
PATCH 1/1 support/testing: import rootfs-overlay for systemd testsuite
comment PS1 customization: the testsuite require a non customized PS1
# /usr/lib/systemd/tests/run-unit-tests.py PASS: test-acl-util PASS: test-af-list
La testsuite Buildroot se lance de cette mani?re et seul le test systemd est test?:
./support/testing/run-tests -o testsuite/ -k -d dl/ tests.package.test_systemd.TestSystemd
16:12:42 TestSystemd Starting
16:13:04 TestSystemd Cleaning up
.
----------------------------------------------------------------------
Ran 1 test in 22.384s
OK
Pour l'instant la testsuite de systemd n'est pas lanc?e automatiquement. Il faut lancer le script:
/lib/systemd/tests/run-unit-tests.py
On a besoin d'un niveau d'entropie suffisant pour certain tests. On test avec cgroupv2
On test avec un kernel 5.4 LTS.
SKIP: test-barrier
SKIP: test-bus-chat
FAIL: test-execute
OK: 197 SKIP: 2 FAIL: 1
--- .../package/br2-external/systemd/Config.in | 0 .../br2-external/systemd/external.desc | 2 + .../package/br2-external/systemd/external.mk | 5 + support/testing/tests/package/test_systemd.py | 92 +++++++++++++++ .../rootfs-overlay/etc/locale.conf | 1 + .../rootfs-overlay/etc/nsswitch.conf | 13 ++ .../test_systemd/rootfs-overlay/etc/profile | 20 ++++ .../test_systemd/rootfs-overlay/etc/shells | 1 + .../rootfs-overlay/etc/vconsole.conf | 1 + .../test_systemd/rootfs-overlay/myinit.sh | 3 + .../test_systemd/rootfs-overlay/root/.profile | 36 ++++++ .../test_systemd/systemd-kernel.config | 111 ++++++++++++++++++ 12 files changed, 285 insertions(+) create mode 100644 support/testing/tests/package/br2-external/systemd/Config.in create mode 100644 support/testing/tests/package/br2-external/systemd/external.desc create mode 100644 support/testing/tests/package/br2-external/systemd/external.mk create mode 100644 support/testing/tests/package/test_systemd.py create mode 100644 support/testing/tests/package/test_systemd/rootfs-overlay/etc/locale.conf create mode 100644 support/testing/tests/package/test_systemd/rootfs-overlay/etc/nsswitch.conf create mode 100644 support/testing/tests/package/test_systemd/rootfs-overlay/etc/profile create mode 100644 support/testing/tests/package/test_systemd/rootfs-overlay/etc/shells create mode 100644 support/testing/tests/package/test_systemd/rootfs-overlay/etc/vconsole.conf create mode 100755 support/testing/tests/package/test_systemd/rootfs-overlay/myinit.sh create mode 100644 support/testing/tests/package/test_systemd/rootfs-overlay/root/.profile create mode 100644 support/testing/tests/package/test_systemd/systemd-kernel.config
support/testing/tests/package/br2-external/systemd/Config.in new file +0 -0
support/testing/tests/package/br2-external/systemd/external.desc new file +2 -0
@@ -0,0 +1,2 @@ +name: BUILDROOT_SYSTEMD_TESTSUITE +desc: Buildroot to easily test systemd changes or changes to the systemd recipe in buildroot
support/testing/tests/package/br2-external/systemd/external.mk new file +5 -0
@@ -0,0 +1,5 @@ +# Append SYSTEMD_CONF_OPTS from this BR2_EXTERNAL due to include order in the Buildroot main Makefile: +# -include $(PACKAGE_OVERRIDE_FILE) +# -include $(sort $(wildcard package/*/*.mk)) +# include $(BR2_EXTERNAL_FILE) +SYSTEMD_CONF_OPTS += -Dslow-tests=true -Dinstall-tests=true -Dtests=true
support/testing/tests/package/test_systemd.py new file +92 -0
92 lines not on this page · raw message
support/testing/tests/package/test_systemd/rootfs-overlay/etc/locale.conf new file +1 -0
@@ -0,0 +1 @@ +LANG=fr_FR.utf8
support/testing/tests/package/test_systemd/rootfs-overlay/etc/nsswitch.conf new file +13 -0
@@ -0,0 +1,13 @@ +# /etc/nsswitch.conf + +passwd: files mymachines systemd +group: files mymachines systemd +shadow: files + +hosts: files mymachines resolve [!UNAVAIL=return] dns myhostname +networks: files dns + +protocols: files +services: files +ethers: files +rpc: files
support/testing/tests/package/test_systemd/rootfs-overlay/etc/profile new file +20 -0
@@ -0,0 +1,20 @@ +export PATH=/bin:/sbin:/usr/bin:/usr/sbin + +if [ "$PS1" ]; then + if [ "`id -u`" -eq 0 ]; then + export PS1='# ' + else + export PS1='$ ' + fi +fi + +#export PAGER='/bin/more ' +export EDITOR='/bin/vi' + +# Source configuration files from /etc/profile.d +for i in /etc/profile.d/*.sh ; do + if [ -r "$i" ]; then + . $i + fi + unset i +done
support/testing/tests/package/test_systemd/rootfs-overlay/etc/shells new file +1 -0
@@ -0,0 +1 @@ +/bin/bash
support/testing/tests/package/test_systemd/rootfs-overlay/etc/vconsole.conf new file +1 -0
@@ -0,0 +1 @@ +KEYMAP=fr
support/testing/tests/package/test_systemd/rootfs-overlay/myinit.sh new file +3 -0
@@ -0,0 +1,3 @@ +#!/bin/sh +mount -o rw /dev/vdb /var +exec /usr/lib/systemd/systemd
support/testing/tests/package/test_systemd/rootfs-overlay/root/.profile new file +36 -0
@@ -0,0 +1,36 @@ +# /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) +# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). + +if [ "`id -u`" -eq 0 ]; then + PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" +else + PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" +fi +export PATH + +if [ "${PS1-}" ]; then + if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then + # The file bash.bashrc already sets the default PS1. + # PS1='\h:\w\$ ' + if [ -f /etc/bash.bashrc ]; then + . /etc/bash.bashrc + fi + else + if [ "`id -u`" -eq 0 ]; then + PS1='# ' + else + PS1='$ ' + fi + fi +fi + +#PS1="\[\033[35m\]\t\[\033[m\]-\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ " +if [ -d /etc/profile.d ]; then + for i in /etc/profile.d/*.sh; do + if [ -r $i ]; then + . $i + fi + done + unset i +fi +. /usr/share/bash-completion/bash_completion
support/testing/tests/package/test_systemd/systemd-kernel.config new file +111 -0
111 lines not on this page · raw message
Signature · 1 line
2.25.2
PATCH 1/1 support/testing: import rootfs-overlay for systemd testsuite
Hello,
Oops, there is some spoil about my current work on the qemu runtime testing with Buildroot :)
This patch is a WIP and not intended to be published yet on the mailing list, please ignore.
Best regards,
Romain
PATCH 1/1 package/qemu: enable or1k support in host-qemu
In reply to Romain NaourThis change enables host qemu support for or1k which among other things allows to test this architecture in gitlab.
The or1k support was nammed or32 in qemu < 2.9.0 and renamed or1k by [1]. But only the qemu 4.2.0 has been tested with qemu_or1k_defconfig.
So we may consider the or1k support was added by [1].
Tested using qemu_or1k_defconfig.
[1] https://git.qemu.org/?p=qemu.git;a=commit;h=4a09d0bb34ab030e09e87173b2e3ec0fd7616cff
--- package/qemu/Config.in.host | 1 + package/qemu/qemu.mk | 1 + 2 files changed, 2 insertions(+)
package/qemu/Config.in.host +1 -0
@@ -11,6 +11,7 @@ config BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS default y if BR2_mips default y if BR2_mipsel default y if BR2_nios2 + default y if BR2_or1k default y if BR2_powerpc default y if BR2_powerpc64 default y if BR2_powerpc64le
package/qemu/qemu.mk +1 -0
@@ -199,6 +199,7 @@ HOST_QEMU_DEPENDENCIES = host-pkgconf host-zlib host-libglib2 host-pixman host-p # mips64 mips64 # mips64el mips64el # nios2 nios2 +# or1k or1k # powerpc ppc # powerpc64 ppc64 # powerpc64le ppc64 (system) / ppc64le (usermode)
Signature · 1 line
2.25.2
PATCH 1/1 package/qemu: enable or1k support in host-qemu
Quoted 7 lines · On Fri, 17 Apr 2020 22:16:26 +0200 Romain Naour <[email protected]> wrote:
This change enables host qemu support for or1k which among other things allows to test this architecture in gitlab.
The or1k support was nammed or32 in qemu < 2.9.0 and renamed or1k by [1]. But only the qemu 4.2.0 has been tested with
qemu_or1k_defconfig.
So we may consider the or1k support was added by [1].
I was a bit confused by these last two sentences, and was not sure how relevant this was. I reworded this paragraph slightly and applied. Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com