Skip to content

Commit

Permalink
snap-telemetry 0.19.0
Browse files Browse the repository at this point in the history
Closes #7198.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
  • Loading branch information
nanliu authored and MikeMcQuaid committed Nov 28, 2016
1 parent 9e2be73 commit 03f527b
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions Formula/snap-telemetry.rb
@@ -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"

Expand All @@ -22,37 +22,37 @@ def install
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

0 comments on commit 03f527b

Please sign in to comment.