Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge tag 'pull-maintainer-ominbus-150923-1' of https://gitlab.com/st…
…squad/qemu into staging

testing updates:

  - update most Debian to bookworm
  - fix some typos
  - update loongarch toolchain
  - fix microbit test
  - handle GitLab/Cirrus timeout discrepancy
  - improve avocado console handling
  - disable mips avocado images pending bugfix

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCgAdFiEEZoWumedRZ7yvyN81+9DbCVqeKkQFAmUEaC4ACgkQ+9DbCVqe
# KkTF3gf/Vx2bCmVJhro1Rve49fyZJXx2udqPbPVjAeXXK/SfvZqBzodM6DS4Aw7h
# 2ZC5uP9gx7Ra+9p+87SUUEenXLUBY0GqWL4AJuYlQ3EzJsDz8A98MGA2Hzr83ngE
# I036pnkaWYD+sxu+1O40e3n2pYOYKsufzvRzOLe/+9Fzh8gcdDrMdqkjA9SXkRlY
# QVaaMMdPClsSy5hq++8smvWNarAHth6WA02SrdFsJBt5hsICDYiDA8ny0+xmN/dl
# huElcdk562dkAnpBDmOEKjIvywThBRpxVPhI7NeA78k1gkBNCg0r+en4P5OSQ6f0
# 6zqcy5q3mkUVQ7xLK656BwhFCUl/PQ==
# =4GVc
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 15 Sep 2023 10:20:30 EDT
# gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
# gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44

* tag 'pull-maintainer-ominbus-150923-1' of https://gitlab.com/stsquad/qemu:
  tests/avocado: Disable MIPS Malta tests due to GitLab issue #1884
  tests/avocado: Fix console data loss
  gitlab: make Cirrus CI jobs gating
  gitlab: make Cirrus CI timeout explicit
  qtest: kill orphaned qtest QEMU processes on FreeBSD
  microbit: add missing qtest_quit() call
  tests/docker: Update docker-loongarch-cross toolchain
  gitlab: fix typo/spelling in comments
  tests: update Debian images to Bookworm

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
Stefan Hajnoczi committed Sep 18, 2023
2 parents 4693ce2 + 5acd4bf commit b89dfa0
Show file tree
Hide file tree
Showing 23 changed files with 93 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.d/base.yml
Expand Up @@ -68,7 +68,7 @@ variables:

#############################################################
# Stage 2: fine tune execution of jobs in specific scenarios
# where the catch all logic is inapprorpaite
# where the catch all logic is inappropriate
#############################################################

# Optional jobs should not be run unless manually triggered
Expand Down
4 changes: 3 additions & 1 deletion .gitlab-ci.d/cirrus.yml
Expand Up @@ -15,8 +15,10 @@
stage: build
image: registry.gitlab.com/libvirt/libvirt-ci/cirrus-run:master
needs: []
# 20 mins larger than "timeout_in" in cirrus/build.yml
# as there's often a 5-10 minute delay before Cirrus CI
# actually starts the task
timeout: 80m
allow_failure: true
script:
- source .gitlab-ci.d/cirrus/$NAME.vars
- sed -e "s|[@]CI_REPOSITORY_URL@|$CI_REPOSITORY_URL|g"
Expand Down
2 changes: 2 additions & 0 deletions .gitlab-ci.d/cirrus/build.yml
Expand Up @@ -16,6 +16,8 @@ env:
TEST_TARGETS: "@TEST_TARGETS@"

build_task:
# A little shorter than GitLab timeout in ../cirrus.yml
timeout_in: 60m
install_script:
- @UPDATE_COMMAND@
- @INSTALL_COMMAND@ @PKGS@
Expand Down
19 changes: 19 additions & 0 deletions python/qemu/machine/machine.py
Expand Up @@ -191,6 +191,7 @@ def __init__(self,
self.sock_dir, f"{self._name}.con"
)
self._console_socket: Optional[socket.socket] = None
self._console_file: Optional[socket.SocketIO] = None
self._remove_files: List[str] = []
self._user_killed = False
self._quit_issued = False
Expand Down Expand Up @@ -509,6 +510,11 @@ def _early_cleanup(self) -> None:
# If we keep the console socket open, we may deadlock waiting
# for QEMU to exit, while QEMU is waiting for the socket to
# become writable.
if self._console_file is not None:
LOG.debug("Closing console file")
self._console_file.close()
self._console_file = None

if self._console_socket is not None:
LOG.debug("Closing console socket")
self._console_socket.close()
Expand Down Expand Up @@ -874,12 +880,25 @@ def console_socket(self) -> socket.socket:
Returns a socket connected to the console
"""
if self._console_socket is None:
LOG.debug("Opening console socket")
self._console_socket = console_socket.ConsoleSocket(
self._console_address,
file=self._console_log_path,
drain=self._drain_console)
return self._console_socket

@property
def console_file(self) -> socket.SocketIO:
"""
Returns a file associated with the console socket
"""
if self._console_file is None:
LOG.debug("Opening console file")
self._console_file = self.console_socket.makefile(mode='rb',
buffering=0,
encoding='utf-8')
return self._console_file

@property
def temp_dir(self) -> str:
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/avocado/avocado_qemu/__init__.py
Expand Up @@ -137,7 +137,7 @@ def _console_interaction(test, success_message, failure_message,
assert not keep_sending or send_string
if vm is None:
vm = test.vm
console = vm.console_socket.makefile(mode='rb', encoding='utf-8')
console = vm.console_file
console_logger = logging.getLogger('console')
while True:
if send_string:
Expand Down
7 changes: 7 additions & 0 deletions tests/avocado/boot_linux_console.py
Expand Up @@ -116,6 +116,7 @@ def test_x86_64_pc(self):
console_pattern = 'Kernel command line: %s' % kernel_command_line
self.wait_for_console_pattern(console_pattern)

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
def test_mips_malta(self):
"""
:avocado: tags=arch:mips
Expand All @@ -138,6 +139,7 @@ def test_mips_malta(self):
console_pattern = 'Kernel command line: %s' % kernel_command_line
self.wait_for_console_pattern(console_pattern)

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
def test_mips64el_malta(self):
"""
This test requires the ar tool to extract "data.tar.gz" from
Expand Down Expand Up @@ -191,6 +193,7 @@ def test_mips64el_fuloong2e(self):
console_pattern = 'Kernel command line: %s' % kernel_command_line
self.wait_for_console_pattern(console_pattern)

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
def test_mips_malta_cpio(self):
"""
:avocado: tags=arch:mips
Expand Down Expand Up @@ -232,6 +235,7 @@ def test_mips_malta_cpio(self):
# Wait for VM to shut down gracefully
self.vm.wait()

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
@skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
def test_mips64el_malta_5KEc_cpio(self):
"""
Expand Down Expand Up @@ -292,6 +296,7 @@ def do_test_mips_malta32el_nanomips(self, kernel_url, kernel_hash):
console_pattern = 'Kernel command line: %s' % kernel_command_line
self.wait_for_console_pattern(console_pattern)

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
def test_mips_malta32el_nanomips_4k(self):
"""
:avocado: tags=arch:mipsel
Expand All @@ -305,6 +310,7 @@ def test_mips_malta32el_nanomips_4k(self):
kernel_hash = '477456aafd2a0f1ddc9482727f20fe9575565dd6'
self.do_test_mips_malta32el_nanomips(kernel_url, kernel_hash)

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
def test_mips_malta32el_nanomips_16k_up(self):
"""
:avocado: tags=arch:mipsel
Expand All @@ -318,6 +324,7 @@ def test_mips_malta32el_nanomips_16k_up(self):
kernel_hash = 'e882868f944c71c816e832e2303b7874d044a7bc'
self.do_test_mips_malta32el_nanomips(kernel_url, kernel_hash)

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
def test_mips_malta32el_nanomips_64k_dbg(self):
"""
:avocado: tags=arch:mipsel
Expand Down
6 changes: 6 additions & 0 deletions tests/avocado/machine_mips_malta.py
Expand Up @@ -11,6 +11,7 @@
import gzip
import logging

from avocado import skip
from avocado import skipIf
from avocado import skipUnless
from avocado.utils import archive
Expand Down Expand Up @@ -93,6 +94,7 @@ def do_test_i6400_framebuffer_logo(self, cpu_cores_count):
cv2.imwrite(debug_png, screendump_bgr)
self.assertGreaterEqual(tuxlogo_count, cpu_cores_count)

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
def test_mips_malta_i6400_framebuffer_logo_1core(self):
"""
:avocado: tags=arch:mips64el
Expand All @@ -101,6 +103,7 @@ def test_mips_malta_i6400_framebuffer_logo_1core(self):
"""
self.do_test_i6400_framebuffer_logo(1)

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
@skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
def test_mips_malta_i6400_framebuffer_logo_7cores(self):
"""
Expand All @@ -111,6 +114,7 @@ def test_mips_malta_i6400_framebuffer_logo_7cores(self):
"""
self.do_test_i6400_framebuffer_logo(7)

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
@skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
def test_mips_malta_i6400_framebuffer_logo_8cores(self):
"""
Expand Down Expand Up @@ -142,6 +146,7 @@ def do_test_yamon(self):
wait_for_console_pattern(self, prompt)
self.vm.shutdown()

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
def test_mipsel_malta_yamon(self):
"""
:avocado: tags=arch:mipsel
Expand All @@ -150,6 +155,7 @@ def test_mipsel_malta_yamon(self):
"""
self.do_test_yamon()

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
def test_mips64el_malta_yamon(self):
"""
:avocado: tags=arch:mips64el
Expand Down
7 changes: 7 additions & 0 deletions tests/avocado/replay_kernel.py
Expand Up @@ -98,6 +98,7 @@ def test_x86_64_pc(self):

self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5)

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
def test_mips_malta(self):
"""
:avocado: tags=arch:mips
Expand All @@ -116,6 +117,7 @@ def test_mips_malta(self):

self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5)

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
def test_mips64el_malta(self):
"""
This test requires the ar tool to extract "data.tar.gz" from
Expand Down Expand Up @@ -431,6 +433,7 @@ class ReplayKernelSlow(ReplayKernelBase):
# making it very slow.
timeout = 180

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
def test_mips_malta_cpio(self):
"""
:avocado: tags=arch:mips
Expand Down Expand Up @@ -460,6 +463,7 @@ def test_mips_malta_cpio(self):
self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5,
args=('-initrd', initrd_path))

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
@skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
def test_mips64el_malta_5KEc_cpio(self):
"""
Expand Down Expand Up @@ -502,6 +506,7 @@ def do_test_mips_malta32el_nanomips(self, kernel_path_xz):
console_pattern = 'Kernel command line: %s' % kernel_command_line
self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5)

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
def test_mips_malta32el_nanomips_4k(self):
"""
:avocado: tags=arch:mipsel
Expand All @@ -516,6 +521,7 @@ def test_mips_malta32el_nanomips_4k(self):
kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
self.do_test_mips_malta32el_nanomips(kernel_path_xz)

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
def test_mips_malta32el_nanomips_16k_up(self):
"""
:avocado: tags=arch:mipsel
Expand All @@ -530,6 +536,7 @@ def test_mips_malta32el_nanomips_16k_up(self):
kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
self.do_test_mips_malta32el_nanomips(kernel_path_xz)

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
def test_mips_malta32el_nanomips_64k_dbg(self):
"""
:avocado: tags=arch:mipsel
Expand Down
4 changes: 4 additions & 0 deletions tests/avocado/tuxrun_baselines.py
Expand Up @@ -352,6 +352,7 @@ def test_i386(self):

self.common_tuxrun(csums=sums, drive="virtio-blk-pci")

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
def test_mips32(self):
"""
:avocado: tags=arch:mips
Expand All @@ -370,6 +371,7 @@ def test_mips32(self):

self.common_tuxrun(csums=sums, drive="driver=ide-hd,bus=ide.0,unit=0")

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
def test_mips32el(self):
"""
:avocado: tags=arch:mipsel
Expand All @@ -387,6 +389,7 @@ def test_mips32el(self):

self.common_tuxrun(csums=sums, drive="driver=ide-hd,bus=ide.0,unit=0")

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
def test_mips64(self):
"""
:avocado: tags=arch:mips64
Expand All @@ -404,6 +407,7 @@ def test_mips64(self):

self.common_tuxrun(csums=sums, drive="driver=ide-hd,bus=ide.0,unit=0")

@skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
def test_mips64el(self):
"""
:avocado: tags=arch:mips64el
Expand Down
10 changes: 3 additions & 7 deletions tests/docker/dockerfiles/debian-amd64-cross.docker
@@ -1,10 +1,10 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool dockerfile --layers all --cross-arch x86_64 debian-11 qemu
# $ lcitool dockerfile --layers all --cross-arch x86_64 debian-12 qemu
#
# https://gitlab.com/libvirt/libvirt-ci

FROM docker.io/library/debian:11-slim
FROM docker.io/library/debian:12-slim

RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
Expand Down Expand Up @@ -47,11 +47,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
python3-opencv \
python3-pillow \
python3-pip \
python3-setuptools \
python3-sphinx \
python3-sphinx-rtd-theme \
python3-venv \
python3-wheel \
python3-yaml \
rpm2cpio \
sed \
Expand All @@ -67,8 +65,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
dpkg-reconfigure locales

RUN /usr/bin/pip3 install tomli

ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
Expand All @@ -84,7 +80,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
g++-x86-64-linux-gnu \
gcc-x86-64-linux-gnu \
libaio-dev:amd64 \
libasan5:amd64 \
libasan6:amd64 \
libasound2-dev:amd64 \
libattr1-dev:amd64 \
libbpf-dev:amd64 \
Expand Down
10 changes: 3 additions & 7 deletions tests/docker/dockerfiles/debian-amd64.docker
@@ -1,10 +1,10 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool dockerfile --layers all debian-11 qemu
# $ lcitool dockerfile --layers all debian-12 qemu
#
# https://gitlab.com/libvirt/libvirt-ci

FROM docker.io/library/debian:11-slim
FROM docker.io/library/debian:12-slim

RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
Expand Down Expand Up @@ -32,7 +32,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
git \
hostname \
libaio-dev \
libasan5 \
libasan6 \
libasound2-dev \
libattr1-dev \
libbpf-dev \
Expand Down Expand Up @@ -115,11 +115,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
python3-opencv \
python3-pillow \
python3-pip \
python3-setuptools \
python3-sphinx \
python3-sphinx-rtd-theme \
python3-venv \
python3-wheel \
python3-yaml \
rpm2cpio \
sed \
Expand All @@ -145,8 +143,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/g++ && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc

RUN /usr/bin/pip3 install tomli

ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
Expand Down

0 comments on commit b89dfa0

Please sign in to comment.