60 lines
2.1 KiB
Bash
Executable File
60 lines
2.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
#
|
|
# Description: Check for required kernel modules and tools in initrd
|
|
# Reference: https://issues.redhat.com/browse/RHEL-96131
|
|
# Author: Dan Horák <dhorak@redhat.com>
|
|
#
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
#
|
|
# 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-base"
|
|
INITRD=initrd.img
|
|
LISTING=$INITRD.lst
|
|
|
|
rlJournalStart
|
|
rlPhaseStartSetup
|
|
rlAssertRpm $PACKAGE
|
|
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
|
rlRun "pushd $TmpDir"
|
|
rlPhaseEnd
|
|
|
|
rlPhaseStartTest "Create initrd and check its content for required kernel modules and tools"
|
|
rlRun "dracut $INITRD"
|
|
rlRun "lsinitrd $INITRD > $LISTING"
|
|
for module in pkey pkey-pckmo pkey-ep11 pkey-cca zcrypt zcrypt_cex4; do
|
|
rlAssertGrep "kernel/drivers/s390/crypto/${module}\.ko\.xz" $LISTING
|
|
done
|
|
for module in paes_s390; do
|
|
rlAssertGrep "kernel/arch/s390/crypto/${module}\.ko\.xz" $LISTING
|
|
done
|
|
for tool in chzcrypt lszcrypt zkey zkey-cryptsetup; do
|
|
rlAssertGrep "usr/(bin|sbin)/${tool}\$" $LISTING -E
|
|
done
|
|
rlPhaseEnd
|
|
|
|
rlPhaseStartCleanup
|
|
rlRun "popd"
|
|
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
|
rlPhaseEnd
|
|
rlJournalEnd
|