From 35052b972b6b047ec5757eb1d3bfa64e02394f60 Mon Sep 17 00:00:00 2001
From: Kirill Yukhin <kirill.yukhin@gmail.com>
Date: Thu, 6 Jul 2017 11:26:47 +0300
Subject: [PATCH] sql: Fix test

Use `net.box` instead of `console`.
---
 test/sql/gh2483-remote-persistency-check.result   | 11 +++++++----
 test/sql/gh2483-remote-persistency-check.test.lua |  7 +++++--
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/test/sql/gh2483-remote-persistency-check.result b/test/sql/gh2483-remote-persistency-check.result
index 7e8dd79317..185f84c917 100644
--- a/test/sql/gh2483-remote-persistency-check.result
+++ b/test/sql/gh2483-remote-persistency-check.result
@@ -22,14 +22,17 @@ box.sql.execute([[SELECT * FROM t]])
 ...
 test_run:cmd('restart server default');
 -- Connect to ourself
-require('console').connect(os.getenv("LISTEN"))
+c = require('net.box').connect(os.getenv("LISTEN"))
 ---
-- true
 ...
 -- This segfaults due to gh-2483 since
 -- before the patch sql schema was read on-demand.
 -- Which could obviously lead to access denied error.
-box.sql.execute([[SELECT * FROM t]])
+c:eval([[ return box.sql.execute('SELECT * FROM t') ]])
+---
+- [[1]]
+...
+-- sql.execute([[SELECT * FROM t]])
+box.sql.execute([[DROP TABLE t]])
 ---
-- - [1]
 ...
diff --git a/test/sql/gh2483-remote-persistency-check.test.lua b/test/sql/gh2483-remote-persistency-check.test.lua
index 2b4293f442..a02c11ab2c 100644
--- a/test/sql/gh2483-remote-persistency-check.test.lua
+++ b/test/sql/gh2483-remote-persistency-check.test.lua
@@ -14,9 +14,12 @@ box.sql.execute([[SELECT * FROM t]])
 test_run:cmd('restart server default');
 
 -- Connect to ourself
-require('console').connect(os.getenv("LISTEN"))
+c = require('net.box').connect(os.getenv("LISTEN"))
 
 -- This segfaults due to gh-2483 since
 -- before the patch sql schema was read on-demand.
 -- Which could obviously lead to access denied error.
-box.sql.execute([[SELECT * FROM t]])
+c:eval([[ return box.sql.execute('SELECT * FROM t') ]])
+-- sql.execute([[SELECT * FROM t]])
+
+box.sql.execute([[DROP TABLE t]])
-- 
GitLab