Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: allow dhcp service if firewall is active #724

Merged
merged 1 commit into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading