From a334973de8096a08c5ee9a35ed7ef3b6402b7a78 Mon Sep 17 00:00:00 2001 From: Bulat Shakirzyanov Date: Tue, 1 Jul 2014 23:29:32 +0100 Subject: mesos: cleanup formula. Closes #30045. Signed-off-by: Mike McQuaid --- Library/Formula/mesos.rb | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'Library/Formula') diff --git a/Library/Formula/mesos.rb b/Library/Formula/mesos.rb index 97a729031..1be6169d3 100644 --- a/Library/Formula/mesos.rb +++ b/Library/Formula/mesos.rb @@ -37,6 +37,24 @@ class Mesos < Formula end test do - system "#{sbin}/mesos-master", "--version" + require "timeout" + + master = fork do + exec "#{sbin}/mesos-master", "--ip=127.0.0.1", + "--registry=in_memory" + end + slave = fork do + exec "#{sbin}/mesos-slave", "--master=127.0.0.1:5050", + "--work_dir=#{testpath}" + end + Timeout::timeout(15) do + system "#{bin}/mesos", "execute", + "--master=127.0.0.1:5050", + "--name=execute-touch", + "--command=touch\s#{testpath}/executed" + end + Process.kill("TERM", master) + Process.kill("TERM", slave) + system "[ -e #{testpath}/executed ]" end end -- cgit v1.2.3