diff --git a/test/interactive_tarantool.lua b/test/interactive_tarantool.lua index 91cd9ec2b6b18bbea491d3bfb4cb711af13bfd52..bf67654e0f23c97dbd6091c54878c85e24e864b2 100644 --- a/test/interactive_tarantool.lua +++ b/test/interactive_tarantool.lua @@ -7,6 +7,7 @@ local log = require('log') local yaml = require('yaml') local popen = require('popen') local tnt = require('tarantool') +local t = require('luatest') -- Default timeout for expecting an input on child's stdout. -- @@ -269,6 +270,15 @@ function mt.close(self) self.ph:close() end +-- Run a command and assert response. +function mt.roundtrip(self, command, expected) + self:execute_command(command) + local response = self:read_response() + if expected ~= nil then + t.assert_equals(response, expected) + end +end + -- }}} Instance methods -- {{{ Module functions