Skip to content

Commit

Permalink
Merge pull request #1174 from rvykydal/consider-centos-rhel-platform
Browse files Browse the repository at this point in the history
Consider centos os-variant as rhel platform
  • Loading branch information
rvykydal authored May 23, 2024
2 parents 040b02b + d5b2933 commit 4748c66
Show file tree
Hide file tree
Showing 21 changed files with 73 additions and 48 deletions.
4 changes: 2 additions & 2 deletions anaconda-conf.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ fi
%post --nochroot

@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"

if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ || \
is_rhel9 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ] || [ "${platform}" == "rhel9" ]; then
LOG_MSG="Writing a temporary configuration loaded from"
else
LOG_MSG="Configuration loaded from:"
Expand Down
4 changes: 2 additions & 2 deletions anaconda-modules.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
%post --nochroot

@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"

# Get the activated Anaconda DBus modules.
cat /tmp/syslog | grep "Activating service name" | \
grep "org.fedoraproject.Anaconda.Modules" | cut -d"'" -f2 \
| sort > /tmp/generated.out

# Generate the expected output.
if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ || \
is_rhel9 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ] || [ "${platform}" == "rhel9" ]; then
cat > /tmp/expected.out << EOF
org.fedoraproject.Anaconda.Modules.Localization
org.fedoraproject.Anaconda.Modules.Network
Expand Down
4 changes: 3 additions & 1 deletion autopart-nohome.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ shutdown
# Generate the autopart command.
autopart="autopart --type=plain --nohome"

if [ "@KSTEST_OS_NAME@" == "fedora" ]; then
@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"
if [ "${platform:0:6}" == "fedora" ]; then
autopart="$autopart --noboot --noswap"
fi

Expand Down
3 changes: 2 additions & 1 deletion bindtomac-bridge-2devs-httpks.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ bridge0 bridge1

@KSINCLUDE@ post-lib-network.sh
@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"

# bridge0

Expand Down Expand Up @@ -76,7 +77,7 @@ check_device_config_value bridge1 ONBOOT yes connection autoconnect __NONE

check_device_config_value bridge1_slave_1 ONBOOT yes connection autoconnect __NONE

if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ]; then
# RHEL-8-FAILURE: anaconda does not create default config file for enslaved device in RHEL8
check_config_exists @KSTEST_NETDEV2@ no
else
Expand Down
3 changes: 2 additions & 1 deletion bindtomac-bridge-2devs-pre.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ bridge0 bridge1

@KSINCLUDE@ post-lib-network.sh
@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"

# bridge0

Expand Down Expand Up @@ -76,7 +77,7 @@ check_device_config_value bridge1 ONBOOT yes connection autoconnect __NONE

check_device_config_value bridge1_slave_1 ONBOOT yes connection autoconnect __NONE

if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ]; then
# RHEL-8-FAILURE: anaconda does not create default config file for enslaved device in RHEL8
check_config_exists @KSTEST_NETDEV2@ no
else
Expand Down
3 changes: 2 additions & 1 deletion bindtomac-bridge-httpks.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ shutdown
%post --nochroot

@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"
@KSINCLUDE@ post-nochroot-lib-network.sh

check_bridge_has_slave_nochroot bridge0 @KSTEST_NETDEV1@ yes
if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ]; then
# RHEL-8-FAILURE: generic "Wired Connection" created in initramfs (ip=dhcp)
# would be edited for @KSTEST_NETDEV1@ in GUI which is not ideal
check_gui_configurations bridge0
Expand Down
6 changes: 4 additions & 2 deletions bond-ks-initramfs.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ network --device bond0 --bootproto dhcp --bondslaves=@KSTEST_NETDEV1@,@KSTEST_NE
# We will copy /root/RESULT to /mnt/sysimage/root/RESULT at the beginning of the %post (--nochroot) checks
@KSINCLUDE@ post-lib-network.sh
@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"

if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ]; then
# Ifcfg files for the kickstart configuration are created in initramfs
check_config_exists bond0 yes
check_config_exists bond0_slave_1 yes
Expand Down Expand Up @@ -59,9 +60,10 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ bond0

@KSINCLUDE@ post-lib-network.sh
@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"

check_device_config_value bond0 ONBOOT yes connection autoconnect __NONE
if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ]; then
check_device_config_value bond0_slave_1 ONBOOT yes connection autoconnect __NONE
check_device_config_value bond0_slave_1 SLAVE yes connection slave-type bond
check_device_config_value bond0_slave_2 ONBOOT yes connection autoconnect __NONE
Expand Down
3 changes: 2 additions & 1 deletion bridge-2devs-httpks.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ bridge0 bridge1

@KSINCLUDE@ post-lib-network.sh
@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"

# bridge0

Expand Down Expand Up @@ -77,7 +78,7 @@ check_device_config_value bridge1 ONBOOT yes connection autoconnect __NONE

check_device_config_value bridge1_slave_1 ONBOOT yes connection autoconnect __NONE

if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ]; then
# RHEL-8-FAILURE: anaconda does not create default config file for enslaved device in RHEL8
check_config_exists @KSTEST_NETDEV2@ no
else
Expand Down
3 changes: 2 additions & 1 deletion bridge-2devs-pre.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ bridge0 bridge1

@KSINCLUDE@ post-lib-network.sh
@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"

# bridge0

Expand Down Expand Up @@ -76,7 +77,7 @@ check_device_config_value bridge1 ONBOOT yes connection autoconnect __NONE

check_device_config_value bridge1_slave_1 ONBOOT yes connection autoconnect __NONE

if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ]; then
# RHEL-8-FAILURE: anaconda does not create default config file for enslaved device in RHEL8
check_config_exists @KSTEST_NETDEV2@ no
else
Expand Down
3 changes: 2 additions & 1 deletion bridge-2devs.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ bridge0 bridge1

@KSINCLUDE@ post-lib-network.sh
@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"

# bridge0

Expand Down Expand Up @@ -75,7 +76,7 @@ check_device_config_value bridge1 ONBOOT yes connection autoconnect __NONE

check_device_config_value bridge1_slave_1 ONBOOT yes connection autoconnect __NONE

if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ]; then
# RHEL-8-FAILURE: anaconda does not create default config file for enslaved device in RHEL8
check_config_exists @KSTEST_NETDEV2@ no
else
Expand Down
3 changes: 2 additions & 1 deletion bridge-httpks.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ shutdown
%post --nochroot

@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"
@KSINCLUDE@ post-nochroot-lib-network.sh

check_bridge_has_slave_nochroot bridge0 @KSTEST_NETDEV1@ yes
if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ]; then
# RHEL-8-FAILURE: generic "Wired Connection" created in initramfs (ip=dhcp)
# would be edited for @KSTEST_NETDEV1@ in GUI which is not ideal
check_gui_configurations bridge0
Expand Down
3 changes: 2 additions & 1 deletion bridge-no-bootopts-net.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ check_gui_configurations @KSTEST_NETDEV1@ bridge0

@KSINCLUDE@ post-lib-network.sh
@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"

check_device_connected bridge0 yes
check_device_connected @KSTEST_NETDEV1@ yes

if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ]; then
# RHEL-8-FAILURE: in rhel 8 the ifcfg is generated in initramfs by Anaconda
check_device_config_value bridge0_slave_1 BRIDGE bridge0 connection master bridge0
check_device_config_value bridge0_slave_1 BRIDGE bridge0 connection slave-type bridge
Expand Down
5 changes: 4 additions & 1 deletion default-fstype.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ cp /.buildstamp /mnt/sysroot

%post

@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"

expected_fstype="ext4"
if [ "@KSTEST_OS_NAME@" == "rhel" ] || grep -qi '^variant=server' /.buildstamp; then
if [ "${platform:0:4}" == "rhel" ] || grep -qi '^variant=server' /.buildstamp; then
expected_fstype="xfs"
fi

Expand Down
4 changes: 3 additions & 1 deletion dns.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
%post

@KSINCLUDE@ post-lib-network.sh
@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"

if [ "@KSTEST_OS_NAME@" == "rhel" ]; then
if [ "${platform:0:4}" == "rhel" ]; then
# rhbz#1989472
check_resolv_conf_is_by_nm
else
Expand Down
3 changes: 2 additions & 1 deletion network-addr-gen-mode.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ @KSTEST_NETDEV3@ @KST

@KSINCLUDE@ post-lib-network.sh
@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"

check_device_config_value @KSTEST_NETDEV1@ IPV6_ADDR_GEN_MODE eui64 ipv6 addr-gen-mode eui64
check_connection_setting "@KSTEST_NETDEV1@" ipv6.addr-gen-mode eui64
check_device_config_value @KSTEST_NETDEV2@ IPV6_ADDR_GEN_MODE __NONE ipv6 addr-gen-mode eui64
if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ]; then
# In rhel8 ifcfg from kickstart is generated in initramfs
check_connection_setting "System @KSTEST_NETDEV2@" ipv6.addr-gen-mode default-or-eui64
else
Expand Down
10 changes: 6 additions & 4 deletions network-autoconnections-dhcpall-httpks.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ shutdown
# We will copy /root/RESULT to /mnt/sysimage/root/RESULT at the beginning of the %post (--nochroot) checks
@KSINCLUDE@ post-lib-network.sh
@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"

check_config_exists @KSTEST_NETDEV1@ no
if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ]; then
check_config_exists @KSTEST_NETDEV2@ yes
else
check_config_exists @KSTEST_NETDEV2@ no
Expand All @@ -38,7 +39,7 @@ check_device_connected @KSTEST_NETDEV1@ yes
check_device_connected @KSTEST_NETDEV2@ yes
check_device_connected @KSTEST_NETDEV3@ yes

if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ]; then
check_number_of_connections 2
else
# includes "lo" connection
Expand All @@ -47,7 +48,7 @@ fi

check_connection_device "Wired Connection" @KSTEST_NETDEV1@
check_connection_device "Wired Connection" @KSTEST_NETDEV2@
if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ]; then
check_connection_device "System @KSTEST_NETDEV2@"
fi
check_connection_device "Wired Connection" @KSTEST_NETDEV3@
Expand Down Expand Up @@ -76,6 +77,7 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ @KSTEST_NETDEV3@

@KSINCLUDE@ post-lib-network.sh
@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"

check_device_config_value @KSTEST_NETDEV1@ ONBOOT yes connection autoconnect __NONE
check_device_config_value @KSTEST_NETDEV2@ ONBOOT yes connection autoconnect __NONE
Expand All @@ -89,7 +91,7 @@ check_device_connected @KSTEST_NETDEV3@ yes
check_connection_device "Wired Connection" @KSTEST_NETDEV2@
check_connection_device @KSTEST_NETDEV2@

if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ]; then
check_number_of_connections 4
else
# includes "lo" connection
Expand Down
10 changes: 6 additions & 4 deletions network-autoconnections-httpks.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ shutdown
# We will copy /root/RESULT to /mnt/sysimage/root/RESULT at the beginning of the %post (--nochroot) checks
@KSINCLUDE@ post-lib-network.sh
@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"
# Note: up to RHEL8.2 the file was created by dracut network module
# check_config_exists @KSTEST_NETDEV1@ yes
check_config_exists @KSTEST_NETDEV1@ no
# In RHEL8 ifcfg files are created from kickstart already in initramfs
if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ]; then
check_config_exists @KSTEST_NETDEV2@ yes
else
check_config_exists @KSTEST_NETDEV2@ no
Expand All @@ -40,7 +41,7 @@ check_config_exists @KSTEST_NETDEV3@ no

check_device_connected @KSTEST_NETDEV1@ yes
check_connection_device @KSTEST_NETDEV1@ @KSTEST_NETDEV1@
if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ]; then
check_connection_device "System @KSTEST_NETDEV2@"
fi

Expand All @@ -53,7 +54,7 @@ check_connection_setting "@KSTEST_NETDEV1@" 802-3-ethernet.mac-address --
detect_nm_has_autoconnections_off
nm_has_autoconnections_off=$?
if [[ $nm_has_autoconnections_off -eq 0 ]]; then
if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ]; then
check_number_of_connections 2
else
# includes "lo" connection
Expand Down Expand Up @@ -94,6 +95,7 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ @KSTEST_NETDEV3@

@KSINCLUDE@ post-lib-network.sh
@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"

check_device_config_value @KSTEST_NETDEV1@ ONBOOT yes connection autoconnect __NONE
check_device_config_value @KSTEST_NETDEV2@ ONBOOT yes connection autoconnect __NONE
Expand All @@ -103,7 +105,7 @@ detect_nm_has_autoconnections_off
nm_has_autoconnections_off=$?
if [[ $nm_has_autoconnections_off -eq 0 ]]; then
check_device_config_value @KSTEST_NETDEV3@ ONBOOT no connection autoconnect false
if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ]; then
check_number_of_connections 3
else
# includes "lo" connection
Expand Down
4 changes: 3 additions & 1 deletion network-options-pre.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ @KSTEST_NETDEV3@ @KST
%post

@KSINCLUDE@ post-lib-network.sh
@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"

check_device_config_value @KSTEST_NETDEV1@ DEFROUTE yes ipv4 never-default __NONE
check_device_config_value @KSTEST_NETDEV2@ DEFROUTE no ipv4 never-default true
Expand All @@ -47,7 +49,7 @@ check_device_connected @KSTEST_NETDEV4@ yes
check_device_config_value @KSTEST_NETDEV3@ MTU 9000 ethernet mtu 9000

# It is not working on rhel yet (RHEL-30406)
if [ "@KSTEST_OS_NAME@" == "rhel" ]; then
if [ "${platform:0:4}" == "rhel" ]; then
check_device_config_value @KSTEST_NETDEV4@ DHCP_VENDOR_CLASS_IDENTIFIER __NONE ipv4 dhcp-vendor-class-identifier __NONE
else
check_device_config_value @KSTEST_NETDEV4@ DHCP_VENDOR_CLASS_IDENTIFIER RHEL ipv4 dhcp-vendor-class-identifier RHEL
Expand Down
4 changes: 2 additions & 2 deletions repo-install.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ repo --name=test05 --baseurl=EMPTY_REPO_URL --includepkgs=p1,p2 --excludepkgs=p3
%post

@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"

# Define patterns for repo options.
if is_rhel8 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ || \
is_rhel9 @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@ ; then
if [ "${platform}" == "rhel8" ] || [ "${platform}" == "rhel9" ]; then
cost='^cost=25$'
sslverify='^sslverify=0$'
includepkgs='^includepkgs=p1,p2$'
Expand Down
5 changes: 4 additions & 1 deletion reqpart.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ cp /.buildstamp /mnt/sysroot

%post

@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"

expected_fstype="ext4"
if [ "@KSTEST_OS_NAME@" == "rhel" ] || grep -qi '^variant=server' /.buildstamp; then
if [ "${platform:0:4}" == "rhel" ] || grep -qi '^variant=server' /.buildstamp; then
expected_fstype="xfs"
fi

Expand Down
Loading

0 comments on commit 4748c66

Please sign in to comment.