diff --git a/src/lib/core/errinj.h b/src/lib/core/errinj.h index 1c177a42f76989f012a4c20bfb371f6a2c7ce1a3..6857d97bf80e6839cefebdcec627a57412bfd431 100644 --- a/src/lib/core/errinj.h +++ b/src/lib/core/errinj.h @@ -132,7 +132,6 @@ struct errinj { _(ERRINJ_SNAP_WRITE_UNKNOWN_ROW_TYPE, ERRINJ_BOOL, {.bparam = false}) \ _(ERRINJ_SPACE_UPGRADE_DELAY, 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_TESTING, ERRINJ_BOOL, {.bparam = false}) \ _(ERRINJ_TUPLE_ALLOC, ERRINJ_BOOL, {.bparam = false}) \ diff --git a/src/lua/init.c b/src/lua/init.c index d33accc0a5eeeef020478d0f9b924bcb003eb494..c47a7f1a5558b20b0247e249aded6abd75873d23 100644 --- a/src/lua/init.c +++ b/src/lua/init.c @@ -921,16 +921,6 @@ run_script_f(va_list ap) aux_loop_is_run = true; 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) { /* Execute script. */ diff --git a/test/app-tap/gh-2717-no-quit-sigint.test.lua b/test/app-tap/gh-2717-no-quit-sigint.test.lua index c2729656b0e7709992fafc6a15ba6d84f036755d..13c9a5890a9ecc49ba9044cd3ec88f80a2df5b5a 100755 --- a/test/app-tap/gh-2717-no-quit-sigint.test.lua +++ b/test/app-tap/gh-2717-no-quit-sigint.test.lua @@ -19,7 +19,7 @@ local TARANTOOL_PATH = arg[-1] local test = tap.test('gh-2717-no-quit-sigint') 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}, { shell = true, setsid = true, @@ -61,7 +61,7 @@ ph:close() -- -- 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}, { shell = true, setsid = true, @@ -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) 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}, { shell = true, setsid = true, @@ -214,7 +214,7 @@ os.remove(snap_file) -- -- 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}, { shell = true, setsid = true, diff --git a/test/app-tap/gh-5040-inter-mode-isatty-via-errinj.test.lua b/test/app-tap/gh-5040-inter-mode-isatty.test.lua similarity index 95% rename from test/app-tap/gh-5040-inter-mode-isatty-via-errinj.test.lua rename to test/app-tap/gh-5040-inter-mode-isatty.test.lua index 159f30e5709902f98be45b68cce883be4c7a3242..9ed5254adf3851f08a4a054df4d594f094907d80 100755 --- a/test/app-tap/gh-5040-inter-mode-isatty-via-errinj.test.lua +++ b/test/app-tap/gh-5040-inter-mode-isatty.test.lua @@ -7,8 +7,7 @@ local fio = require('fio') -- -- Tests to check if the tarantool binary enters --- interactive mode or not using error injections --- to change return value of isatty(stdin). +-- interactive mode or not using `-i` flag. -- local TARANTOOL_PATH = arg[-1] @@ -28,7 +27,7 @@ local file_open_timeout = 60.0 -- * empty_output - true if command should have empty output local testcases = { { - cmd_args = '', + cmd_args = ' -i', stdin = 'tty', interactive = true }, @@ -69,7 +68,6 @@ for _, cmd in pairs(testcases) do local full_cmd = '' if cmd.stdin == 'tty' then cmd.stdin = '' - full_cmd = 'ERRINJ_STDIN_ISATTY=1 ' else cmd.stdin = '< ' .. cmd.stdin end diff --git a/test/box/errinj.result b/test/box/errinj.result index bdb99a438f1a0ef0b802cfc4781617674b896d02..6871bfb7822c908b8e79b61c19e47588e1738be8 100644 --- a/test/box/errinj.result +++ b/test/box/errinj.result @@ -106,7 +106,6 @@ evals - ERRINJ_SNAP_WRITE_UNKNOWN_ROW_TYPE: false - ERRINJ_SPACE_UPGRADE_DELAY: false - ERRINJ_SQL_NAME_NORMALIZATION: false - - ERRINJ_STDIN_ISATTY: -1 - ERRINJ_SWIM_FD_ONLY: false - ERRINJ_TESTING: false - ERRINJ_TUPLE_ALLOC: false