snap-telemetry 0.19.0

Closes #7198.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Nan Liu 2016-11-23 12:26:19 -08:00 committed by Mike McQuaid
parent 9e2be73514
commit 03f527b5db

View file

@ -1,8 +1,8 @@
class SnapTelemetry < Formula
desc "Snap is an opensource telemetry framework"
homepage "http://snap-telemetry.io/"
url "https://github.com/intelsdi-x/snap/archive/0.17.0.tar.gz"
sha256 "d627eff8155b346ce542fdf3251b2713a0bae887fb6a8ef3ba169b13c4f9fc60"
url "https://github.com/intelsdi-x/snap/archive/0.19.0.tar.gz"
sha256 "28c6ffa208b54251266d48236911d8c38fd27cabd79a84bf91d47376fd69dc7f"
head "https://github.com/intelsdi-x/snap.git"
@ -22,37 +22,37 @@ class SnapTelemetry < Formula
ENV["CGO_ENABLED"] = "0"
ENV["GLIDE_HOME"] = HOMEBREW_CACHE/"glide_home/#{name}"
snapd = buildpath/"src/github.com/intelsdi-x/snap"
snapd.install buildpath.children
snapteld = buildpath/"src/github.com/intelsdi-x/snap"
snapteld.install buildpath.children
cd snapd do
cd snapteld do
system "glide", "install"
system "go", "build", "-o", "snapd", "-ldflags", "-w -X main.gitversion=#{version}"
bin.install "snapd"
system "go", "build", "-o", "snapteld", "-ldflags", "-w -X main.gitversion=#{version}"
sbin.install "snapteld"
prefix.install_metafiles
end
snapctl = buildpath/"src/github.com/intelsdi-x/snap/cmd/snapctl"
cd snapctl do
system "go", "build", "-o", "snapctl", "-ldflags", "-w -X main.gitversion=#{version}"
bin.install "snapctl"
snaptel = buildpath/"src/github.com/intelsdi-x/snap/cmd/snaptel"
cd snaptel do
system "go", "build", "-o", "snaptel", "-ldflags", "-w -X main.gitversion=#{version}"
bin.install "snaptel"
end
end
test do
assert_match version.to_s, shell_output("#{bin}/snapd --version")
assert_match version.to_s, shell_output("#{bin}/snapctl --version")
assert_match version.to_s, shell_output("#{sbin}/snapteld --version")
assert_match version.to_s, shell_output("#{bin}/snaptel --version")
begin
snapd_pid = fork do
exec "#{bin}/snapd -t 0 -l 1 -o #{testpath}"
snapteld_pid = fork do
exec "#{sbin}/snapteld -t 0 -l 1 -o #{testpath}"
end
sleep 5
assert_match("No plugins", shell_output("#{bin}/snapctl plugin list"))
assert_match("No task", shell_output("#{bin}/snapctl task list"))
assert_predicate testpath/"snapd.log", :exist?
assert_match("No plugins", shell_output("#{bin}/snaptel plugin list"))
assert_match("No task", shell_output("#{bin}/snaptel task list"))
assert_predicate testpath/"snapteld.log", :exist?
ensure
Process.kill("TERM", snapd_pid)
Process.kill("TERM", snapteld_pid)
end
end
end