Skip to content

Commit

Permalink
test: allow dhcp service if firewall is active
Browse files Browse the repository at this point in the history
If firewall is active, the dhcp services do not work.  Change the test
to add and remove the dhcp services if firewall is active.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
  • Loading branch information
richm committed Aug 17, 2024
1 parent 757081e commit e55e2a7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/tasks/create_test_interfaces_with_dhcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@
ip link set {{ dhcp_interface1 }}p master testbr
ip link set {{ dhcp_interface2 }}p master testbr
# Run joint DHCP4/DHCP6 server with RA enabled in veth namespace
if systemctl is-enabled firewalld; then
for service in dhcp dhcpv6 dhcpv6-client; do
if ! firewall-cmd --query-service="$service"; then
firewall-cmd --add-service "$service"
fi
done
fi
dnsmasq \
--pid-file=/run/dhcp_testbr.pid \
--dhcp-leasefile=/run/dhcp_testbr.lease \
Expand Down
7 changes: 7 additions & 0 deletions tests/tasks/remove_test_interfaces_with_dhcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,11 @@
service radvd stop
iptables -D INPUT -i testbr -p udp --dport 67:68 --sport 67:68 -j ACCEPT
fi
if systemctl is-enabled firewalld; then
for service in dhcp dhcpv6 dhcpv6-client; do
if firewall-cmd --query-service="$service"; then
firewall-cmd --remove-service "$service"
fi
done
fi
changed_when: false

0 comments on commit e55e2a7

Please sign in to comment.