From fae38e5679b1526830359fa53d59bd56be296be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Mon, 20 Apr 2026 17:12:47 +0200 Subject: [PATCH] tests: check if zipl is using the safer syncfs() method Related: RHEL-157238 --- tests/zipl-sync/main.fmf | 18 ++++++++++++++ tests/zipl-sync/runtest.sh | 49 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 tests/zipl-sync/main.fmf create mode 100755 tests/zipl-sync/runtest.sh diff --git a/tests/zipl-sync/main.fmf b/tests/zipl-sync/main.fmf new file mode 100644 index 0000000..2ad64df --- /dev/null +++ b/tests/zipl-sync/main.fmf @@ -0,0 +1,18 @@ +summary: zipl-sync +description: | + Check if zipl is using syncfs() instead of potentially blocking sync() +link: https://redhat.atlassian.net/browse/RHEL-157238 +contact: Daniel Horák +component: + - s390utils +test: ./runtest.sh +framework: beakerlib +require: + - s390utils-core + - strace +duration: 5m +enabled: true +adjust: + - when: arch != s390x + enabled: false + because: This test applies only to s390x systems. diff --git a/tests/zipl-sync/runtest.sh b/tests/zipl-sync/runtest.sh new file mode 100755 index 0000000..42bac90 --- /dev/null +++ b/tests/zipl-sync/runtest.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Description: Check if zipl is using syncfs() instead of potentially +# blocking sync() +# Author: Dan Horák +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2026 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="s390utils-core strace" + +log=/tmp/zipl.log + +rlJournalStart +rlPhaseStartSetup + rlAssertRpm $PACKAGE +rlPhaseEnd + +rlPhaseStartTest "Check if zipl is using syncfs() instead of potentially blocking sync()" + rlRun "strace -o $log zipl -V" + rlAssertGrep syncfs $log -w + rlAssertNotGrep sync $log -w +rlPhaseEnd + +rlPhaseStartCleanup +rlPhaseEnd + +rlJournalPrintText +rlJournalEnd