-
Notifications
You must be signed in to change notification settings - Fork 36
/
bond-ks-initramfs.ks.in
87 lines (68 loc) · 3.06 KB
/
bond-ks-initramfs.ks.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#test name: bond-ks-intiramfs
# Test bond configured via kickstart in initramfs
# Because kickstart is obtained (injected in initramfs) without activating
# network (which would be done from boot options network configuration),
# network in initramfs will be activated from kickstart configuration.
%ksappend common/common.ks
%ksappend repos/default.ks
%ksappend l10n/default.ks
%ksappend users/default.ks
%ksappend storage/default.ks
%ksappend payload/default_packages.ks
network --device bond0 --bootproto dhcp --bondslaves=@KSTEST_NETDEV1@,@KSTEST_NETDEV2@ --bondopts=mode=active-backup,primary=@KSTEST_NETDEV1@ --activate
%pre
# 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 [ "${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
check_config_exists bond0_slave_2 yes
# NM creates 3 connections in initramfs plus
# 3 connections after switchroot based on ifcfg files created in initramfs.
# There is a short drop in connectivity switching to the ifcfg connections
# but it does not seem to be causing any issues.
check_number_of_connections 6
else
check_config_exists bond0 no
check_config_exists @KSTEST_NETDEV1@ no
check_config_exists @KSTEST_NETDEV2@ no
# includes "lo" connection
check_number_of_connections 4
fi
check_device_connected bond0 yes
%end
%post --nochroot
@KSINCLUDE@ post-nochroot-lib-network.sh
# First copy result from %pre stage to chroot
copy_pre_stage_result
@KSINCLUDE@ post-nochroot-lib-network.sh
check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ bond0
%end
%post
@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 [ "${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 port-type bond
check_device_config_value bond0_slave_2 ONBOOT yes connection autoconnect __NONE
check_device_config_value bond0_slave_2 SLAVE yes connection port-type bond
else
# 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 port-type bond
check_device_config_value @KSTEST_NETDEV2@ ONBOOT yes connection autoconnect __NONE
check_device_config_value @KSTEST_NETDEV2@ SLAVE yes connection port-type bond
fi
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