From 793d5a903dfd6bc65f2ed90ff4eb70e88a600271 Mon Sep 17 00:00:00 2001 From: Radek Vykydal Date: Thu, 7 Dec 2023 12:31:05 +0100 Subject: [PATCH 1/2] Add test for bond configured by boot options with BOOTIF Related: rhbz#2175664 Rleated: RHEL-4766 --- network-bootopts-bond-bootif.ks.in | 50 ++++++++++++++++++++++++ network-bootopts-bond-bootif.sh | 62 ++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 network-bootopts-bond-bootif.ks.in create mode 100755 network-bootopts-bond-bootif.sh diff --git a/network-bootopts-bond-bootif.ks.in b/network-bootopts-bond-bootif.ks.in new file mode 100644 index 00000000..bc7983ac --- /dev/null +++ b/network-bootopts-bond-bootif.ks.in @@ -0,0 +1,50 @@ +#test name: network-bootopts-bond-bootif +# Test bond configured via boot options with BOOTIF present. +# The slave ifaces configuration files are correct slave files. +# rhbz#2175664, RHEL-4766 + +%ksappend repos/default.ks + +shutdown +# network +# no network configuration +# storage & bootloader +bootloader --timeout=1 +zerombr +clearpart --all +autopart +# l10n +keyboard us +lang en +timezone America/New_York +# user confguration +rootpw testcase + +%ksappend payload/default_packages.ks + +%post --nochroot + +@KSINCLUDE@ post-nochroot-lib-network.sh + +check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ bond0 + +%end + +%post + +@KSINCLUDE@ post-lib-network.sh + +# config files are not named bond0_slave_1 as opposed to kickstart config +check_device_config_value @KSTEST_NETDEV1@ ONBOOT yes connection autoconnect __NONE +check_device_config_value @KSTEST_NETDEV1@ SLAVE yes connection slave-type bond +check_device_config_value @KSTEST_NETDEV2@ ONBOOT yes connection autoconnect __NONE +check_device_config_value @KSTEST_NETDEV2@ SLAVE yes connection slave-type bond +check_device_connected bond0 yes +check_bond_has_slave bond0 @KSTEST_NETDEV1@ yes +check_bond_has_slave bond0 @KSTEST_NETDEV2@ yes + +# No error was written to /root/RESULT file, everything is OK +if [[ ! -e /root/RESULT ]]; then + echo SUCCESS > /root/RESULT +fi +%end diff --git a/network-bootopts-bond-bootif.sh b/network-bootopts-bond-bootif.sh new file mode 100755 index 00000000..5d9b0dd3 --- /dev/null +++ b/network-bootopts-bond-bootif.sh @@ -0,0 +1,62 @@ +# +# Copyright (C) 2023 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, +# modify, copy, or redistribute it subject to the terms and conditions of +# the GNU General Public License v.2, or (at your option) any later version. +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY expressed or implied, including the implied warranties 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, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the +# source code or documentation are not subject to the GNU General Public +# License and may only be used or replicated with the express permission of +# Red Hat, Inc. +# +# Red Hat Author(s): Radek Vykydal + +# Ignore unused variable parsed out by tooling scripts as test tags metadata +# shellcheck disable=SC2034 +TESTTYPE=${TESTTYPE:-"network skip-on-rhel-8"} + +. ${KSTESTDIR}/functions.sh + +kernel_args() { + . ${tmpdir}/ks_url + echo ${DEFAULT_BOOTOPTS} ip=bond0:dhcp bond=bond0:${KSTEST_NETDEV1},${KSTEST_NETDEV2}:mode=active-backup inst.ks=${ks_url} BOOTIF=01-52-54-00-12-34-63 +} + +# Arguments for virt-install --network options +prepare_network() { + echo "user,mac=52:54:00:12:34:63" + echo "user" +} + +prepare() { + ks=$1 + tmpdir=$2 + + # Copy the kickstart to a directory in tmpdir + mkdir ${tmpdir}/http + cp $ks ${tmpdir}/http/ks.cfg + + # Start a http server to serve the included file + start_httpd ${tmpdir}/http $tmpdir + + echo ks_url=${httpd_url}ks.cfg > ${tmpdir}/ks_url + echo "${ks}" +} + +inject_ks_to_initrd() { + echo "false" +} + +cleanup() { + tmpdir=$1 + + if [ -f ${tmpdir}/httpd-pid ]; then + kill $(cat ${tmpdir}/httpd-pid) + fi +} From 8df45873c74a91bd293b4b3c005fb4fd21cd5c9e Mon Sep 17 00:00:00 2001 From: Radek Vykydal Date: Fri, 8 Dec 2023 11:16:03 +0100 Subject: [PATCH 2/2] Disable network-bootopts-bond-bootif temporarily on rhel9 (RHEL-4766) Disable network-bootopts-bond-bootif on rhel9 until RHEL-4766 is fixed. --- containers/runner/skip-testtypes | 1 + network-bootopts-bond-bootif.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/containers/runner/skip-testtypes b/containers/runner/skip-testtypes index f23d92db..daf438c1 100644 --- a/containers/runner/skip-testtypes +++ b/containers/runner/skip-testtypes @@ -62,6 +62,7 @@ rhel9_skip_array=( gh969 # raid-ddf failing gh970 # selinux-contexts failing jiraRHEL-13150 # timezone-noncommon failing + RHEL-4766 # network-bootopts-bond-bootif should be fixed in RHEL 9.4 ) # used in workflows/daily-boot-iso-rhel8.yml diff --git a/network-bootopts-bond-bootif.sh b/network-bootopts-bond-bootif.sh index 5d9b0dd3..6663fb30 100755 --- a/network-bootopts-bond-bootif.sh +++ b/network-bootopts-bond-bootif.sh @@ -19,7 +19,7 @@ # Ignore unused variable parsed out by tooling scripts as test tags metadata # shellcheck disable=SC2034 -TESTTYPE=${TESTTYPE:-"network skip-on-rhel-8"} +TESTTYPE=${TESTTYPE:-"network skip-on-rhel-8 RHEL-4766"} . ${KSTESTDIR}/functions.sh