-
Notifications
You must be signed in to change notification settings - Fork 36
/
bindtomac-bridge-2devs-pre.ks.in
100 lines (72 loc) · 2.95 KB
/
bindtomac-bridge-2devs-pre.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
88
89
90
91
92
93
94
95
96
97
98
99
100
#test name bindtomac-bridge-2devs-pre
# One bridge with slave activated in dracut,
# the other one with slave activated only with the bridge
%ksappend repos/default.ks
%include /tmp/ksinclude
%pre
echo "network --device=bridge0 --bridgeslaves=@KSTEST_NETDEV1@ --bootproto=dhcp --onboot=no --bindto=mac" >> /tmp/ksinclude
echo "network --device=bridge1 --bridgeslaves=@KSTEST_NETDEV2@ --bootproto=dhcp --bindto=mac" >> /tmp/ksinclude
%end
bootloader --timeout=1
zerombr
clearpart --all
autopart
keyboard us
lang en
timezone America/New_York
rootpw qweqwe
shutdown
%packages
%end
%post --nochroot
@KSINCLUDE@ post-nochroot-lib-network.sh
pass_autoconnections_info_to_chroot
check_bridge_has_slave_nochroot bridge0 @KSTEST_NETDEV1@ yes
check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ bridge0 bridge1
%end
%post
@KSINCLUDE@ post-lib-network.sh
@KSINCLUDE@ scripts-lib.sh
platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)"
# bridge0
check_device_connected bridge0 yes
check_device_connected @KSTEST_NETDEV1@ yes
check_device_config_value bridge0_slave_1 BRIDGE bridge0 connection controller bridge0
check_device_config_value bridge0_slave_1 BRIDGE bridge0 connection port-type bridge
check_device_has_ipv4_address bridge0 yes
check_device_has_ipv4_address @KSTEST_NETDEV1@ no
# This check is removed because since NM in initramfs the slave's (non-bridge)
# configuration from initramfs does not produce corresponding config file
# check_device_config_value @KSTEST_NETDEV1@ ONBOOT yes connection autoconnect __NONE
check_device_config_value bridge0 ONBOOT no connection autoconnect false
check_device_config_value bridge0_slave_1 ONBOOT no connection autoconnect false
# bridge1
check_device_connected bridge1 no
detect_nm_has_autoconnections_off
nm_has_autoconnections_off=$?
if [[ $nm_has_autoconnections_off -eq 0 ]]; then
check_device_connected @KSTEST_NETDEV2@ no
check_device_has_ipv4_address @KSTEST_NETDEV2@ no
else
check_device_connected @KSTEST_NETDEV2@ yes
fi
check_device_config_value bridge1_slave_1 BRIDGE bridge1 connection controller bridge1
check_device_config_value bridge1_slave_1 BRIDGE bridge1 connection port-type bridge
check_device_config_value bridge1 ONBOOT yes connection autoconnect __NONE
check_device_config_value bridge1_slave_1 ONBOOT yes connection autoconnect __NONE
# Configuration from boot options
if [ "${platform}" != "rhel8" ]; then
check_config_exists @KSTEST_NETDEV1@ yes
fi
# RHEL-8-FAILURE: anaconda does not create default config file for enslaved device in RHEL8
# Since RHEL-38451 don't create default persistent connection for ports/slaves
check_config_exists @KSTEST_NETDEV2@ no
check_device_config_bound_to_mac bridge0_slave_1
check_device_config_bound_to_mac bridge1_slave_1
# WARNING: this depends on assumption of running %post scripts in order they
# are defined here
# No error was written to /root/RESULT file, everything is OK
if [[ ! -e /root/RESULT ]]; then
echo SUCCESS > /root/RESULT
fi
%end