forked from rhinstaller/kickstart-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirewall.ks.in
59 lines (48 loc) · 1.23 KB
/
firewall.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
#version=DEVEL
url @KSTEST_URL@
install
network --bootproto=dhcp
bootloader --timeout=1
zerombr
clearpart --all --initlabel
autopart
keyboard en
lang en
timezone America/New_York --utc
rootpw testcase
shutdown
# TEST: firewall
firewall --enable --port=22001:tcp,6400:udp --service=tftp,smtp
%packages
%end
%post
## TEST PROCEDURE
# Test for 22001/TCP
firewall-offline-cmd --list-ports | grep 22001/tcp
if [[ $? -ne 0 ]]; then
echo "*** Firewall config for 22001/tcp" >> /root/RESULT
fi
# Test for 6400/UDP
firewall-offline-cmd --list-ports | grep 6400/udp
if [[ $? -ne 0 ]]; then
echo "*** Firewall config for 6400/udp failed" >> /root/RESULT
fi
# Test for service tftp
firewall-offline-cmd --list-services | grep tftp
if [[ $? -ne 0 ]]; then
echo "*** Firewall service tftp not assigned" >> /root/RESULT
fi
# Test for service smtp
firewall-offline-cmd --list-services | grep smtp
if [[ $? -ne 0 ]]; then
echo "*** Firewall service smtp not assigned" >> /root/RESULT
fi
# Test for service sane (disabled)
firewall-offline-cmd --list-services | grep sane
if [[ $? -ne 1 ]]; then
echo "*** Firewall service sane enabled, should be disabled" >> /root/RESULT
fi
if [[ ! -e /root/RESULT ]]; then
echo SUCCESS > /root/RESULT
fi
%end