From b344bcc056e4c0dde8385bd7b4c60e20e04d9263 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 8 Jan 2023 21:55:08 +0000 Subject: test spawning non-Ruby process with socket_dir This tests commit 649a0d3e3578 (httpd: undefine ruby_snprintf alias for non-Ruby processes, 2023-01-08) --- test/test_mwrap.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/test_mwrap.rb b/test/test_mwrap.rb index 176dca6..e04fab5 100644 --- a/test/test_mwrap.rb +++ b/test/test_mwrap.rb @@ -6,6 +6,7 @@ require 'mwrap' require 'rbconfig' require 'tempfile' require 'io/wait' +require 'tmpdir' class TestMwrap < Test::Unit::TestCase RB = "#{RbConfig::CONFIG['bindir']}/#{RbConfig::CONFIG['RUBY_INSTALL_NAME']}" @@ -79,6 +80,15 @@ class TestMwrap < Test::Unit::TestCase assert_match(/\b0x[a-f0-9]+\b/s, dump, 'dump output has addresses') end + def test_spawn_non_ruby + Dir.mktmpdir do |dir| + sockdir = "#{dir}/sockdir" + env = @@env.merge('MWRAP' => "socket_dir:#{sockdir}") + out = IO.popen(env, %w(ls -alR), { chdir: dir }, &:read) + assert_match(/\b\d+\.sock\b/, out) + end + end + def test_clear cmd = @@cmd + %w( -e ("0"*10000).clear -- cgit v1.2.3-24-ge0c7