From 0fae1a21bf02711c3214b63465e21ffb0efb4261 Mon Sep 17 00:00:00 2001 From: ilovezfs Date: Sun, 3 Jul 2016 00:23:59 -0700 Subject: [PATCH] etcd 3.0.1 use full path in the test Closes #2537. Signed-off-by: ilovezfs --- Formula/etcd.rb | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Formula/etcd.rb b/Formula/etcd.rb index 238b6a1de2..4f49124302 100644 --- a/Formula/etcd.rb +++ b/Formula/etcd.rb @@ -1,8 +1,8 @@ class Etcd < Formula desc "Key value store for shared configuration and service discovery" homepage "https://github.com/coreos/etcd" - url "https://github.com/coreos/etcd/archive/v2.2.5.tar.gz" - sha256 "a7fb7998ada620fda74e517c100891d25a15a6fa20b627df52da7cd29328e6d5" + url "https://github.com/coreos/etcd/archive/v3.0.1.tar.gz" + sha256 "29ccdf960a3bdb72bff3f9082c2ce14a909fe9156e3309afd7288cb3e050dd2d" head "https://github.com/coreos/etcd.git" bottle do @@ -12,21 +12,19 @@ class Etcd < Formula sha256 "77e16e9d78546f5dd81d452afeae71828f7a239d47993cc5edaf457315f616b8" => :mavericks end - devel do - url "https://github.com/coreos/etcd/archive/v2.3.0-alpha.0.tar.gz" - version "2.3.0-alpha.0" - sha256 "6603684824a650c472c791fc7c4cdf6811920f473e01bcfe8b1d95b0fd1f25c6" - end - depends_on "go" => :build def install ENV["GOPATH"] = buildpath + mkdir_p "src/github.com/coreos" + ln_s buildpath, "src/github.com/coreos/etcd" system "./build" bin.install "bin/etcd" bin.install "bin/etcdctl" end + plist_options :manual => "etcd" + def plist; <<-EOS.undent @@ -57,13 +55,13 @@ class Etcd < Formula require "utils/json" test_string = "Hello from brew test!" etcd_pid = fork do - exec "etcd", "--force-new-cluster", "--data-dir=#{testpath}" + exec bin/"etcd", "--force-new-cluster", "--data-dir=#{testpath}" end # sleep to let etcd get its wits about it sleep 10 - etcd_uri = "http://127.0.0.1:4001/v2/keys/brew_test" + etcd_uri = "http://127.0.0.1:2379/v2/keys/brew_test" system "curl", "--silent", "-L", etcd_uri, "-XPUT", "-d", "value=#{test_string}" - curl_output = shell_output "curl --silent -L #{etcd_uri}" + curl_output = shell_output("curl --silent -L #{etcd_uri}") response_hash = Utils::JSON.load(curl_output) assert_match(test_string, response_hash.fetch("node").fetch("value")) ensure