Skip to content

Commit

Permalink
Fix udp multicast test with restrictive firewall settings
Browse files Browse the repository at this point in the history
Closes luvit#539
  • Loading branch information
squeek502 committed Apr 22, 2021
1 parent 598ccf2 commit 68ba566
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test-udp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,20 @@ return require('lib/tap')(function (test)
server:recv_start(recv_cb)

assert(client:send("PING", multicast_addr, TEST_PORT, expect(function(err)
-- EPERM here likely means that a firewall has denied the send, which
-- can happen in some build/CI environments, e.g. the Fedora build system.
-- Reproducible on Linux with iptables by doing:
-- iptables --policy OUTPUT DROP
-- iptables -A OUTPUT -s 127.0.0.1 -j ACCEPT
-- and for ipv6:
-- ip6tables --policy OUTPUT DROP
-- ip6tables -A OUTPUT -s ::1 -j ACCEPT
if err == "EPERM" then
print("send to multicast ip was likely denied by firewall, skipping")
client:close()
server:close()
return
end
assert(not err, err)
end)))
end
Expand Down

0 comments on commit 68ba566

Please sign in to comment.