Skip to content

Commit

Permalink
minidlna: use free_port helper (Homebrew#57982)
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrodrigues committed Jul 15, 2020
1 parent 6376d45 commit 24b1162
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Formula/minidlna.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,12 @@ def plist
log_dir=#{testpath}/.config/minidlna
EOS

system sbin/"minidlnad", "-f", "minidlna.conf", "-p", "8081", "-P",
port = free_port

system sbin/"minidlnad", "-f", "minidlna.conf", "-p", port.to_s, "-P",
testpath/"minidlna.pid"
sleep 2

begin
assert_match /MiniDLNA #{version}/, shell_output("curl localhost:8081")
ensure
Process.kill("SIGINT", File.read("minidlna.pid").to_i)
end
assert_match /MiniDLNA #{version}/, shell_output("curl localhost:#{port}")
end
end

0 comments on commit 24b1162

Please sign in to comment.