stubby: update plist to use new YAML config file

and update the test block to use a YAML config file.

Closes #19507.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
Sara Dickinson 2017-10-16 15:26:18 +01:00 committed by ilovezfs
parent 9e48fb6621
commit 3cbb4566d1

View file

@ -3,6 +3,7 @@ class Stubby < Formula
homepage "https://getdnsapi.net/blog/dns-privacy-daemon-stubby/" homepage "https://getdnsapi.net/blog/dns-privacy-daemon-stubby/"
url "https://github.com/getdnsapi/stubby/archive/v0.1.3.tar.gz" url "https://github.com/getdnsapi/stubby/archive/v0.1.3.tar.gz"
sha256 "5f20659945696647f7c3f4a090ffc8bf1d96e69a751bbf36e3cddb584846602e" sha256 "5f20659945696647f7c3f4a090ffc8bf1d96e69a751bbf36e3cddb584846602e"
revision 1
head "https://github.com/getdnsapi/stubby.git", :branch => "develop" head "https://github.com/getdnsapi/stubby.git", :branch => "develop"
bottle do bottle do
@ -26,7 +27,7 @@ class Stubby < Formula
system "make", "install" system "make", "install"
end end
plist_options :startup => true, :manual => "sudo stubby -C #{HOMEBREW_PREFIX}/etc/stubby/stubby.conf" plist_options :startup => true, :manual => "sudo stubby -C #{HOMEBREW_PREFIX}/etc/stubby/stubby.yml"
def plist; <<-EOS.undent def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
@ -43,7 +44,7 @@ class Stubby < Formula
<array> <array>
<string>#{opt_bin}/stubby</string> <string>#{opt_bin}/stubby</string>
<string>-C</string> <string>-C</string>
<string>#{etc}/stubby/stubby.conf</string> <string>#{etc}/stubby/stubby.yml</string>
<string>-l</string> <string>-l</string>
</array> </array>
<key>StandardErrorPath</key> <key>StandardErrorPath</key>
@ -56,22 +57,25 @@ class Stubby < Formula
end end
test do test do
(testpath/"stubby_test.conf").write <<-EOS.undent assert_predicate etc/"stubby/stubby.yml", :exist?
{ resolution_type: GETDNS_RESOLUTION_STUB (testpath/"stubby_test.yml").write <<-EOS.undent
, dns_transport_list: [ GETDNS_TRANSPORT_TLS, GETDNS_TRANSPORT_UDP, GETDNS_TRANSPORT_TCP ] resolution_type: GETDNS_RESOLUTION_STUB
, listen_addresses: [ 127.0.0.1@5553] dns_transport_list:
, idle_timeout: 0 - GETDNS_TRANSPORT_TLS
, upstream_recursive_servers: - GETDNS_TRANSPORT_UDP
[ { address_data: 145.100.185.15}, - GETDNS_TRANSPORT_TCP
{ address_data: 145.100.185.16}, listen_addresses:
{ address_data: 185.49.141.37} - 127.0.0.1@5553
] idle_timeout: 0
} upstream_recursive_servers:
- address_data: 145.100.185.15
- address_data: 145.100.185.16
- address_data: 185.49.141.37
EOS EOS
output = shell_output("#{bin}/stubby -i -C stubby_test.conf") output = shell_output("#{bin}/stubby -i -C stubby_test.yml")
assert_match "bindata for 145.100.185.15", output assert_match "bindata for 145.100.185.15", output
pid = fork do pid = fork do
exec "#{bin}/stubby", "-C", testpath/"stubby_test.conf" exec "#{bin}/stubby", "-C", testpath/"stubby_test.yml"
end end
begin begin
sleep 2 sleep 2