From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 2C9EF1F47C for ; Sun, 8 Jan 2023 21:55:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1673214908; bh=u5lm1MdKXGc73pWJUbEQa+/MbROppPCdEG9tHGhNg3E=; h=From:To:Subject:Date:From; b=vqQRn3a8nHhsleVMM7jTcHwtDpJ1CR0p4R/I7977NE5lt17eNUWKifKsD9tSDpx98 Sk03njeAoOs7oFjloWKSrOtCnefVGdVT7HjSsAOGASqFODnAA+ANozVb8Qi0+VGiHE rXsP27BEcoM9wIYrxScFS/NlMuMyBqBL5W7Df/tM= From: Eric Wong To: mwrap-public@80x24.org Subject: [PATCH] test spawning non-Ruby process with socket_dir Date: Sun, 8 Jan 2023 21:55:08 +0000 Message-Id: <20230108215508.413137-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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