mysql: replace existing test
Closes #9359. Signed-off-by: Tomasz Pajor <tomek@polishgeeks.com>
This commit is contained in:
parent
7d3211bf98
commit
ed4165cdb4
1 changed files with 18 additions and 1 deletions
|
@ -179,6 +179,23 @@ class Mysql < Formula
|
|||
end
|
||||
|
||||
test do
|
||||
system "/bin/sh", "-n", "#{bin}/mysqld_safe"
|
||||
begin
|
||||
# Expects datadir to be a completely clean dir, which testpath isn't.
|
||||
dir = Dir.mktmpdir
|
||||
system bin/"mysqld", "--initialize-insecure", "--user=#{ENV["USER"]}",
|
||||
"--basedir=#{prefix}", "--datadir=#{dir}", "--tmpdir=#{dir}"
|
||||
|
||||
pid = fork do
|
||||
exec bin/"mysqld", "--bind-address=127.0.0.1", "--datadir=#{dir}"
|
||||
end
|
||||
sleep 2
|
||||
|
||||
output = shell_output("curl 127.0.0.1:3306")
|
||||
output.force_encoding("ASCII-8BIT") if output.respond_to?(:force_encoding)
|
||||
assert_match version.to_s, output
|
||||
ensure
|
||||
Process.kill(9, pid)
|
||||
Process.wait(pid)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue