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

console: remove ERRINJ_STDIN_ISATTY injection

As the underlying problem behind this injection is fixed in #7357 it can
be removed and `-i` flag could be used as initially intended.

Closes #7554
Requires #7357
NO_DOC=refactoring
NO_CHANGELOG=refactoring
parent 6947ed76
No related branches found
No related tags found
No related merge requests found
...@@ -121,7 +121,6 @@ struct errinj { ...@@ -121,7 +121,6 @@ struct errinj {
_(ERRINJ_SNAP_WRITE_DELAY, ERRINJ_BOOL, {.bparam = false}) \ _(ERRINJ_SNAP_WRITE_DELAY, ERRINJ_BOOL, {.bparam = false}) \
_(ERRINJ_SPACE_UPGRADE_DELAY, ERRINJ_BOOL, {.bparam = false}) \ _(ERRINJ_SPACE_UPGRADE_DELAY, ERRINJ_BOOL, {.bparam = false}) \
_(ERRINJ_SQL_NAME_NORMALIZATION, ERRINJ_BOOL, {.bparam = false}) \ _(ERRINJ_SQL_NAME_NORMALIZATION, ERRINJ_BOOL, {.bparam = false}) \
_(ERRINJ_STDIN_ISATTY, ERRINJ_INT, {.iparam = -1}) \
_(ERRINJ_SWIM_FD_ONLY, ERRINJ_BOOL, {.bparam = false}) \ _(ERRINJ_SWIM_FD_ONLY, ERRINJ_BOOL, {.bparam = false}) \
_(ERRINJ_TESTING, ERRINJ_BOOL, {.bparam = false}) \ _(ERRINJ_TESTING, ERRINJ_BOOL, {.bparam = false}) \
_(ERRINJ_TUPLE_ALLOC, ERRINJ_BOOL, {.bparam = false}) \ _(ERRINJ_TUPLE_ALLOC, ERRINJ_BOOL, {.bparam = false}) \
......
...@@ -919,16 +919,6 @@ run_script_f(va_list ap) ...@@ -919,16 +919,6 @@ run_script_f(va_list ap)
aux_loop_is_run = true; aux_loop_is_run = true;
int is_a_tty = isatty(STDIN_FILENO); int is_a_tty = isatty(STDIN_FILENO);
/*
* Override return value of isatty(STDIN_FILENO) if
* ERRINJ_STDIN_ISATTY enabled (iparam not set to default).
* Use iparam in such case, standard return value otherwise.
* Integer param of errinj is used in order to set different
* return values.
*/
ERROR_INJECT_INT(ERRINJ_STDIN_ISATTY, inj->iparam >= 0, {
is_a_tty = inj->iparam;
});
if (path && strcmp(path, "-") != 0 && access(path, F_OK) == 0) { if (path && strcmp(path, "-") != 0 && access(path, F_OK) == 0) {
/* Execute script. */ /* Execute script. */
......
...@@ -19,7 +19,7 @@ local TARANTOOL_PATH = arg[-1] ...@@ -19,7 +19,7 @@ local TARANTOOL_PATH = arg[-1]
local test = tap.test('gh-2717-no-quit-sigint') local test = tap.test('gh-2717-no-quit-sigint')
test:plan(8) test:plan(8)
local cmd = 'ERRINJ_STDIN_ISATTY=1 INPUTRC=Pheiphe2 ' .. TARANTOOL_PATH .. ' -i 2>&1' local cmd = 'INPUTRC=Pheiphe2 ' .. TARANTOOL_PATH .. ' -i 2>&1'
local ph = popen.new({cmd}, { local ph = popen.new({cmd}, {
shell = true, shell = true,
setsid = true, setsid = true,
...@@ -61,7 +61,7 @@ ph:close() ...@@ -61,7 +61,7 @@ ph:close()
-- --
-- gh-7109: Ctrl+C does not break multiline input. -- gh-7109: Ctrl+C does not break multiline input.
-- --
cmd = 'ERRINJ_STDIN_ISATTY=1 ' .. TARANTOOL_PATH .. ' -i 2>&1' cmd = TARANTOOL_PATH .. ' -i 2>&1'
ph = popen.new({cmd}, { ph = popen.new({cmd}, {
shell = true, shell = true,
setsid = true, setsid = true,
...@@ -150,7 +150,7 @@ local ph_server = popen.shell(TARANTOOL_PATH .. arg, 'r') ...@@ -150,7 +150,7 @@ local ph_server = popen.shell(TARANTOOL_PATH .. arg, 'r')
local f = process_timeout.open_with_timeout(log_file, file_open_timeout) local f = process_timeout.open_with_timeout(log_file, file_open_timeout)
assert(f, 'error while opening ' .. log_file) assert(f, 'error while opening ' .. log_file)
cmd = 'ERRINJ_STDIN_ISATTY=1 ' .. TARANTOOL_PATH .. ' -i 2>&1' cmd = TARANTOOL_PATH .. ' -i 2>&1'
local ph_client = popen.new({cmd}, { local ph_client = popen.new({cmd}, {
shell = true, shell = true,
setsid = true, setsid = true,
...@@ -214,7 +214,7 @@ os.remove(snap_file) ...@@ -214,7 +214,7 @@ os.remove(snap_file)
-- --
-- Testing case when the client and instance are called in the same console. -- Testing case when the client and instance are called in the same console.
-- --
cmd = 'ERRINJ_STDIN_ISATTY=1 INPUTRC=Pheiphe2 ' .. TARANTOOL_PATH .. ' -i 2>&1' cmd = 'INPUTRC=Pheiphe2 ' .. TARANTOOL_PATH .. ' -i 2>&1'
ph = popen.new({cmd}, { ph = popen.new({cmd}, {
shell = true, shell = true,
setsid = true, setsid = true,
......
...@@ -7,8 +7,7 @@ local fio = require('fio') ...@@ -7,8 +7,7 @@ local fio = require('fio')
-- --
-- Tests to check if the tarantool binary enters -- Tests to check if the tarantool binary enters
-- interactive mode or not using error injections -- interactive mode or not using `-i` flag.
-- to change return value of isatty(stdin).
-- --
local TARANTOOL_PATH = arg[-1] local TARANTOOL_PATH = arg[-1]
...@@ -28,7 +27,7 @@ local file_open_timeout = 60.0 ...@@ -28,7 +27,7 @@ local file_open_timeout = 60.0
-- * empty_output - true if command should have empty output -- * empty_output - true if command should have empty output
local testcases = { local testcases = {
{ {
cmd_args = '', cmd_args = ' -i',
stdin = 'tty', stdin = 'tty',
interactive = true interactive = true
}, },
...@@ -69,7 +68,6 @@ for _, cmd in pairs(testcases) do ...@@ -69,7 +68,6 @@ for _, cmd in pairs(testcases) do
local full_cmd = '' local full_cmd = ''
if cmd.stdin == 'tty' then if cmd.stdin == 'tty' then
cmd.stdin = '' cmd.stdin = ''
full_cmd = 'ERRINJ_STDIN_ISATTY=1 '
else else
cmd.stdin = '< ' .. cmd.stdin cmd.stdin = '< ' .. cmd.stdin
end end
......
...@@ -95,7 +95,6 @@ evals ...@@ -95,7 +95,6 @@ evals
- ERRINJ_SNAP_WRITE_DELAY: false - ERRINJ_SNAP_WRITE_DELAY: false
- ERRINJ_SPACE_UPGRADE_DELAY: false - ERRINJ_SPACE_UPGRADE_DELAY: false
- ERRINJ_SQL_NAME_NORMALIZATION: false - ERRINJ_SQL_NAME_NORMALIZATION: false
- ERRINJ_STDIN_ISATTY: -1
- ERRINJ_SWIM_FD_ONLY: false - ERRINJ_SWIM_FD_ONLY: false
- ERRINJ_TESTING: false - ERRINJ_TESTING: false
- ERRINJ_TUPLE_ALLOC: false - ERRINJ_TUPLE_ALLOC: false
......
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