-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathanaconda-modules.ks.in
79 lines (67 loc) · 2.71 KB
/
anaconda-modules.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
#version=DEVEL
# Verify that only the enabled Anaconda DBus modules are started.
# Use defaults.
%ksappend repos/default.ks
%ksappend common/common_no_payload.ks
%ksappend payload/default_packages.ks
%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.
# rhel8 and rhel9 don't have Runtime module
if [ "${platform}" == "rhel8" ] || [ "${platform}" == "rhel9" ]; then
cat > /tmp/expected.out << EOF
org.fedoraproject.Anaconda.Modules.Localization
org.fedoraproject.Anaconda.Modules.Network
org.fedoraproject.Anaconda.Modules.Payloads
org.fedoraproject.Anaconda.Modules.Security
org.fedoraproject.Anaconda.Modules.Services
org.fedoraproject.Anaconda.Modules.Storage
org.fedoraproject.Anaconda.Modules.Subscription
org.fedoraproject.Anaconda.Modules.Timezone
org.fedoraproject.Anaconda.Modules.Users
EOF
# centos has Subscription module forbidden in its conf profile
elif [ "${platform:0:4}" == "rhel" ] && [ "@KSTEST_OS_NAME@" == "centos" ]; then
cat > /tmp/expected.out << EOF
org.fedoraproject.Anaconda.Modules.Localization
org.fedoraproject.Anaconda.Modules.Network
org.fedoraproject.Anaconda.Modules.Payloads
org.fedoraproject.Anaconda.Modules.Runtime
org.fedoraproject.Anaconda.Modules.Security
org.fedoraproject.Anaconda.Modules.Services
org.fedoraproject.Anaconda.Modules.Storage
org.fedoraproject.Anaconda.Modules.Timezone
org.fedoraproject.Anaconda.Modules.Users
EOF
# fedora and rhel10 activate Subscription module
# On fedora the module is allowed to fail in conf (fails on rhsm not found).
else
cat > /tmp/expected.out << EOF
org.fedoraproject.Anaconda.Modules.Localization
org.fedoraproject.Anaconda.Modules.Network
org.fedoraproject.Anaconda.Modules.Payloads
org.fedoraproject.Anaconda.Modules.Runtime
org.fedoraproject.Anaconda.Modules.Security
org.fedoraproject.Anaconda.Modules.Services
org.fedoraproject.Anaconda.Modules.Storage
org.fedoraproject.Anaconda.Modules.Subscription
org.fedoraproject.Anaconda.Modules.Timezone
org.fedoraproject.Anaconda.Modules.Users
EOF
fi
# Check the output
diff /tmp/expected.out /tmp/generated.out
if [[ $? != 0 ]]; then
echo "*** List of activated modules differs!" >> /mnt/sysroot/root/RESULT
echo "*** The following modules were expected:" >> /mnt/sysroot/root/RESULT
cat /tmp/expected.out >> /mnt/sysroot/root/RESULT
echo "*** The following modules were generated:" >> /mnt/sysroot/root/RESULT
cat /tmp/generated.out >> /mnt/sysroot/root/RESULT
fi
%end
%ksappend validation/success_if_result_empty_standalone.ks