From e18b9ab604cdd280995d5ade772448808b747066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Thu, 31 Jul 2025 17:55:16 +0200 Subject: [PATCH] tests: add check for long kernel parameters support in zipl --- tests/zipl-long-params/main.fmf | 18 ++++++++++ tests/zipl-long-params/runtest.sh | 56 +++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 tests/zipl-long-params/main.fmf create mode 100755 tests/zipl-long-params/runtest.sh diff --git a/tests/zipl-long-params/main.fmf b/tests/zipl-long-params/main.fmf new file mode 100644 index 0000000..65b6255 --- /dev/null +++ b/tests/zipl-long-params/main.fmf @@ -0,0 +1,18 @@ +summary: zipl-long-params +description: | + Check for long parameter line support in zipl +link: https://issues.redhat.com/browse/RHEL-105492 +contact: Daniel Horák +component: + - s390utils +test: ./runtest.sh +framework: beakerlib +require: + - s390utils-core + - grubby +duration: 5m +enabled: true +adjust: + - when: arch != s390x + enabled: false + because: This test applies only to s390x systems. diff --git a/tests/zipl-long-params/runtest.sh b/tests/zipl-long-params/runtest.sh new file mode 100755 index 0000000..ba56623 --- /dev/null +++ b/tests/zipl-long-params/runtest.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Description: Check for long parameter line support in zipl +# Author: Dan Horák +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2025 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" +PARAMS=params.txt + +rlJournalStart +if [ "$TMT_REBOOT_COUNT" -eq 0 ]; then + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlPhaseEnd + + rlPhaseStartTest "Check if long kernel parameter line is supported" + # add additional parameters for the default kernel, 24x 46B = 1104B, over the original 896B limit + ( for i in `seq -w 0 23`; do echo -n " param$i=`uuidgen`"; done ) > $PARAMS + rlRun 'grubby --args="$(cat $PARAMS)" --update-kernel=DEFAULT' + rlRun "zipl -V" + rlPhaseEnd + + rlRun "tmt-reboot" 0 "Reboot the machine" + +elif [ "$TMT_REBOOT_COUNT" -eq 1 ]; then + rlPhaseStartTest "Check if all parameters are present after reboot" + rlRun "grep -f $PARAMS /proc/cmdline" + rlPhaseEnd + + rlPhaseStartCleanup + rlPhaseEnd +fi +rlJournalPrintText +rlJournalEnd