Skip to content

Commit

Permalink
tests/acceptance: Fix race conditions in s390x tests & skip fedora on…
Browse files Browse the repository at this point in the history
… gitlab-CI

There was a race condition in the first test where there was already the
"crw" output in the dmesg, but the "0.0.4711" entry has not been created
in the /sys fs yet. Fix it by waiting until it is there.

The second test has even more problems on gitlab-CI. Even after adding some
more synchronization points (that wait for some messages in the "dmesg"
output to make sure that the modules got loaded correctly), there are still
occasionally some hangs in this test when it is running in the gitlab-CI.
So far I was unable to reproduce these hangs locally on my computer, so
this issue might take a while to debug. Thus disable the 2nd test in the
gitlab-CI until the problems are better understood and fixed.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Tested-by: Willian Rampazzo <willianr@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Message-Id: <20210108185645.86351-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
  • Loading branch information
huth committed Jan 11, 2021
1 parent f6eb4a0 commit 333168e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/acceptance/machine_s390_ccw_virtio.py
Expand Up @@ -12,6 +12,7 @@
import os
import tempfile

from avocado import skipIf
from avocado_qemu import Test
from avocado_qemu import exec_command_and_wait_for_pattern
from avocado_qemu import wait_for_console_pattern
Expand Down Expand Up @@ -133,8 +134,10 @@ def test_s390x_devices(self):
self.vm.command('device_add', driver='virtio-net-ccw',
devno='fe.0.4711', id='net_4711')
self.wait_for_crw_reports()
exec_command_and_wait_for_pattern(self, 'ls /sys/bus/ccw/devices/',
'0.0.4711')
exec_command_and_wait_for_pattern(self, 'for i in 1 2 3 4 5 6 7 ; do '
'if [ -e /sys/bus/ccw/devices/*4711 ]; then break; fi ;'
'sleep 1 ; done ; ls /sys/bus/ccw/devices/',
'0.0.4711')
# and detach it again
self.clear_guest_dmesg()
self.vm.command('device_del', id='net_4711')
Expand All @@ -155,6 +158,7 @@ def test_s390x_devices(self):
'MemTotal: 115640 kB')


@skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
def test_s390x_fedora(self):

"""
Expand Down Expand Up @@ -199,6 +203,9 @@ def test_s390x_fedora(self):

# Some tests to see whether the CLI options have been considered:
self.log.info("Test whether QEMU CLI options have been considered")
exec_command_and_wait_for_pattern(self,
'while ! (dmesg | grep enP7p0s0) ; do sleep 1 ; done',
'virtio_net virtio0 enP7p0s0: renamed')
exec_command_and_wait_for_pattern(self, 'lspci',
'0007:00:00.0 Class 0200: Device 1af4:1000')
exec_command_and_wait_for_pattern(self,
Expand All @@ -222,6 +229,9 @@ def test_s390x_fedora(self):
# can simply read the written "magic bytes" back from the PPM file to
# check whether the framebuffer is working as expected.
self.log.info("Test screendump of virtio-gpu device")
exec_command_and_wait_for_pattern(self,
'while ! (dmesg | grep gpudrmfb) ; do sleep 1 ; done',
'virtio_gpudrmfb frame buffer device')
exec_command_and_wait_for_pattern(self,
'echo -e "\e[?25l" > /dev/tty0', ':/#')
exec_command_and_wait_for_pattern(self, 'for ((i=0;i<250;i++)); do '
Expand Down

0 comments on commit 333168e

Please sign in to comment.