From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id E1C9B440F39 for ; Mon, 30 Mar 2020 21:59:26 +0300 (MSK) Date: Mon, 30 Mar 2020 21:53:07 +0300 From: Igor Munkin Message-ID: <20200330185307.GK22874@tarantool.org> References: <0f113c2f2f746a26f85575d7904235e8920dc5a3.1585312984.git.imun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <0f113c2f2f746a26f85575d7904235e8920dc5a3.1585312984.git.imun@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH 3/4] test: enable luajit-tap:gh-4427-ffi-sandwich tests List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sergey Ostanevich , Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org Fixed the issue with shared library suffix. The diff is below: ================================================================================ diff --git a/test/app-tap/gh-4427-ffi-sandwich.test.lua b/test/app-tap/gh-4427-ffi-sandwich.test.lua index 602af88d4..829c129a0 100755 --- a/test/app-tap/gh-4427-ffi-sandwich.test.lua +++ b/test/app-tap/gh-4427-ffi-sandwich.test.lua @@ -4,9 +4,13 @@ local tap = require('tap') local test = tap.test('gh-4427-ffi-sandwich') -local cmd = string.gsub( - 'LUA_CPATH=$/?.so LD_LIBRARY_PATH=$ tarantool 2>&1 $/test.lua %d %d', - '%$', os.getenv('BUILDDIR') .. '/test/luajit-tap/gh-4427-ffi-sandwich') +local vars = { + PATH = os.getenv('BUILDDIR') .. '/test/luajit-tap/gh-4427-ffi-sandwich', + SUFFIX = package.cpath:match('?.(%a+);'), +} + +local cmd = string.gsub('LUA_CPATH=/?. LD_LIBRARY_PATH= ' + .. 'tarantool 2>&1 /test.lua %d %d', '%<(%w+)>', vars) local checks = { { hotloop = 1, trigger = 1, success = true }, ================================================================================ Also added a skipcond for FreeBSD: ================================================================================ diff --git a/test/app-tap/gh-4427-ffi-sandwich.skipcond b/test/app-tap/gh-4427-ffi-sandwich.skipcond new file mode 100644 index 000000000..2a2ec4d97 --- /dev/null +++ b/test/app-tap/gh-4427-ffi-sandwich.skipcond @@ -0,0 +1,7 @@ +import platform + +# Disabled on FreeBSD due to #4819. +if platform.system() == 'FreeBSD': + self.skip = 1 + +# vim: set ft=python: ================================================================================ On 27.03.20, Igor Munkin wrote: > The test is added as a CMake subdirectory and the runner executes > tarantool test.lua command via io.popen to check whether the platform > successfully finishes the execution or platform panic occurs. > > Follow-up #4427 > > Signed-off-by: Igor Munkin > --- > test/CMakeLists.txt | 1 + > test/app-tap/gh-4427-ffi-sandwich.test.lua | 30 ++++++++++++++++++++++ > 2 files changed, 31 insertions(+) > create mode 100755 test/app-tap/gh-4427-ffi-sandwich.test.lua > > diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt > index 00fce7270..bceea4567 100644 > --- a/test/CMakeLists.txt > +++ b/test/CMakeLists.txt > @@ -59,6 +59,7 @@ add_subdirectory(app) > add_subdirectory(app-tap) > add_subdirectory(box) > add_subdirectory(unit) > +add_subdirectory(luajit-tap/gh-4427-ffi-sandwich) > > # Move tarantoolctl config > if (NOT ${PROJECT_BINARY_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) > diff --git a/test/app-tap/gh-4427-ffi-sandwich.test.lua b/test/app-tap/gh-4427-ffi-sandwich.test.lua > new file mode 100755 > index 000000000..602af88d4 > --- /dev/null > +++ b/test/app-tap/gh-4427-ffi-sandwich.test.lua > @@ -0,0 +1,30 @@ > +#!/usr/bin/env tarantool > + > +local tap = require('tap') > + > +local test = tap.test('gh-4427-ffi-sandwich') > + > +local cmd = string.gsub( > + 'LUA_CPATH=$/?.so LD_LIBRARY_PATH=$ tarantool 2>&1 $/test.lua %d %d', > + '%$', os.getenv('BUILDDIR') .. '/test/luajit-tap/gh-4427-ffi-sandwich') > + > +local checks = { > + { hotloop = 1, trigger = 1, success = true }, > + { hotloop = 1, trigger = 2, success = false }, > +} > + > +test:plan(#checks) > + > +for _, ch in pairs(checks) do > + local res > + local proc = io.popen(cmd:format(ch.hotloop, ch.trigger)) > + for s in proc:lines('*l') do res = s end > + assert(res, 'proc:lines failed') > + if ch.success then > + test:is(tonumber(res), ch.hotloop + ch.trigger + 1) > + else > + test:is(res, 'Lua VM re-entrancy is detected while executing the trace') > + end > +end > + > +os.exit(test:check() and 0 or 1) > -- > 2.25.0 > -- Best regards, IM