tests: check if zipl is using the safer syncfs() method

Related: RHEL-157238
This commit is contained in:
Dan Horák 2026-04-20 17:12:47 +02:00
parent b90f9758fe
commit fae38e5679
2 changed files with 67 additions and 0 deletions

18
tests/zipl-sync/main.fmf Normal file
View File

@ -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 <dhorak@redhat.com>
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.

49
tests/zipl-sync/runtest.sh Executable file
View File

@ -0,0 +1,49 @@
#!/bin/bash
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Description: Check if zipl is using syncfs() instead of potentially
# blocking sync()
# Author: Dan Horák <dhorak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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