Skip to content

Commit a3dfd7e

Browse files
committed
test: skip lj-1470 test on RED OS
RED OS for some reason sets `errno` to 2 ENOENT ("No such file or directory") after the call to `mktime()`. So just skip the test for it.
1 parent ec9d188 commit a3dfd7e

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
local tap = require('tap')
22

3+
local function detect_redos()
4+
local read_file = require('utils').tools.read_file
5+
local hasfile, data = pcall(read_file, '/etc/os-release')
6+
if not hasfile then
7+
-- Not Linux probably, so not the Red OS.
8+
return false
9+
else
10+
return data:match('RED OS')
11+
end
12+
end
13+
314
-- The test file demonstrates os.time() fail to return -1 time
415
-- value.
516
-- See also: https://github.com/LuaJIT/LuaJIT/issues/1470.
6-
local test = tap.test('lj-1470-os-time-epoch-minus-1s')
17+
local test = tap.test('lj-1470-os-time-epoch-minus-1s'):skipcond({
18+
-- XXX: RED OS for some reason sets `errno` to 2 ENOENT ("No
19+
-- such file or directory") after the call to `mktime()`. So
20+
-- just skip the test for it.
21+
['RED OS incrorrect behaviour for mktime'] = detect_redos(),
22+
})
723

824
test:plan(1)
925

0 commit comments

Comments
 (0)