Skip to content
Snippets Groups Projects
Commit ea07854e authored by Gleb Kashkin's avatar Gleb Kashkin Committed by Igor Munkin
Browse files

test: fix reading STDIN command on openSUSE

Inspired by gh-5064, that breaks the previous version of the test on
openSUSE. When using `io.popen:write()` on tarantool with `-i` flag, it
failed to run the command on openSUSE. This happened because before
gh-5064 patch it used to employ `luaL_loadfile()` that interprets EOF
as the end of the command, while when it is loaded as a string openSUSE
expects it to end with '\n'.

Needed for #5064
NO_DOC=test fix
NO_TEST=test fix
NO_CHANGELOG=test fix
parent f064175e
No related branches found
No related tags found
No related merge requests found
......@@ -20,9 +20,10 @@ test_run:cmd("setopt delimiter ';'");
| ---
| - true
| ...
-- Extra \n is required on openSUSE.
on_shutdown_cmd = "box.ctl.on_shutdown(function() local fio = require('fio') "..
"fio.open('"..file_name.."', "..
"{'O_CREAT', 'O_TRUNC', 'O_WRONLY'}, 777):close() end)";
"{'O_CREAT', 'O_TRUNC', 'O_WRONLY'}, 777):close() end)\n";
| ---
| ...
test_run:cmd("setopt delimiter ''");
......
......@@ -8,9 +8,10 @@ test_run = env.new()
--
file_name = "on_shutdown_triggered.txt"
test_run:cmd("setopt delimiter ';'");
-- Extra \n is required on openSUSE.
on_shutdown_cmd = "box.ctl.on_shutdown(function() local fio = require('fio') "..
"fio.open('"..file_name.."', "..
"{'O_CREAT', 'O_TRUNC', 'O_WRONLY'}, 777):close() end)";
"{'O_CREAT', 'O_TRUNC', 'O_WRONLY'}, 777):close() end)\n";
test_run:cmd("setopt delimiter ''");
server = io.popen('tarantool -i', 'w')
server:write(on_shutdown_cmd)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment