From ca1767f09d5c4d1b594c9540a8faf8503f811944 Mon Sep 17 00:00:00 2001
From: Roman Tsisyk <roman@tsisyk.com>
Date: Fri, 5 Feb 2016 17:13:19 +0300
Subject: [PATCH] Extract tests for application server from box/ to app/

---
 test/app-tap/suite.ini             |  4 ++--
 test/app/app.lua                   | 10 ++++++++++
 test/{box => app}/cmdline.result   |  2 +-
 test/{box => app}/cmdline.test.lua |  2 +-
 test/{box => app}/digest.result    |  0
 test/{box => app}/digest.test.lua  |  0
 test/{box => app}/fiber.result     |  0
 test/{box => app}/fiber.test.lua   |  0
 test/{box => app}/fio.result       |  0
 test/{box => app}/fio.test.lua     |  0
 test/{box => app}/ipc.result       |  0
 test/{box => app}/ipc.test.lua     |  0
 test/{box => app}/lua/fiber.lua    |  0
 test/{box => app}/luafun.result    |  0
 test/{box => app}/luafun.test.lua  |  0
 test/{box => app}/pack.result      |  0
 test/{box => app}/pack.test.lua    |  0
 test/{box => app}/socket.result    |  5 ++---
 test/{box => app}/socket.skipcond  |  0
 test/{box => app}/socket.test.lua  |  5 ++---
 test/{box => app}/strict.result    |  0
 test/{box => app}/strict.test.lua  |  0
 test/app/suite.ini                 |  6 ++++++
 test/{box => app}/uuid.result      |  0
 test/{box => app}/uuid.skipcond    |  0
 test/{box => app}/uuid.test.lua    |  0
 test/box/suite.ini                 |  4 ++--
 27 files changed, 26 insertions(+), 12 deletions(-)
 create mode 100644 test/app/app.lua
 rename test/{box => app}/cmdline.result (88%)
 rename test/{box => app}/cmdline.test.lua (82%)
 rename test/{box => app}/digest.result (100%)
 rename test/{box => app}/digest.test.lua (100%)
 rename test/{box => app}/fiber.result (100%)
 rename test/{box => app}/fiber.test.lua (100%)
 rename test/{box => app}/fio.result (100%)
 rename test/{box => app}/fio.test.lua (100%)
 rename test/{box => app}/ipc.result (100%)
 rename test/{box => app}/ipc.test.lua (100%)
 rename test/{box => app}/lua/fiber.lua (100%)
 rename test/{box => app}/luafun.result (100%)
 rename test/{box => app}/luafun.test.lua (100%)
 rename test/{box => app}/pack.result (100%)
 rename test/{box => app}/pack.test.lua (100%)
 rename test/{box => app}/socket.result (99%)
 rename test/{box => app}/socket.skipcond (100%)
 rename test/{box => app}/socket.test.lua (99%)
 rename test/{box => app}/strict.result (100%)
 rename test/{box => app}/strict.test.lua (100%)
 create mode 100644 test/app/suite.ini
 rename test/{box => app}/uuid.result (100%)
 rename test/{box => app}/uuid.skipcond (100%)
 rename test/{box => app}/uuid.test.lua (100%)

diff --git a/test/app-tap/suite.ini b/test/app-tap/suite.ini
index 611771f1a9..f44df4a93b 100644
--- a/test/app-tap/suite.ini
+++ b/test/app-tap/suite.ini
@@ -1,4 +1,4 @@
 [default]
-core = app 
-description = application server tests
+core = app
+description = application server tests (TAP)
 lua_libs = lua/require_mod.lua lua/serializer_test.lua
diff --git a/test/app/app.lua b/test/app/app.lua
new file mode 100644
index 0000000000..c17a780008
--- /dev/null
+++ b/test/app/app.lua
@@ -0,0 +1,10 @@
+#!/usr/bin/env tarantool
+
+box.cfg{
+    listen              = os.getenv("LISTEN"),
+    slab_alloc_arena    = 0.1,
+    pid_file            = "tarantool.pid",
+    rows_per_wal        = 50
+}
+
+require('console').listen(os.getenv('ADMIN'))
diff --git a/test/box/cmdline.result b/test/app/cmdline.result
similarity index 88%
rename from test/box/cmdline.result
rename to test/app/cmdline.result
index daa5633003..facb915e2e 100644
--- a/test/box/cmdline.result
+++ b/test/app/cmdline.result
@@ -18,7 +18,7 @@ string.match(arg[-1], '/tarantool$') ~= nil
 ---
 - true
 ...
-string.match(arg[2], 'box%.lua$') ~= nil
+string.match(arg[2], 'app%.lua$') ~= nil
 ---
 - true
 ...
diff --git a/test/box/cmdline.test.lua b/test/app/cmdline.test.lua
similarity index 82%
rename from test/box/cmdline.test.lua
rename to test/app/cmdline.test.lua
index 32a0d73744..316f761fc4 100644
--- a/test/box/cmdline.test.lua
+++ b/test/app/cmdline.test.lua
@@ -4,7 +4,7 @@ string.match(arg[-1], '^/') ~= nil
 string.match(arg[0], '^/') == nil
 
 string.match(arg[-1], '/tarantool$') ~= nil
-string.match(arg[2], 'box%.lua$') ~= nil
+string.match(arg[2], 'app%.lua$') ~= nil
 
 io.type( io.open(arg[-1]) )
 io.type( io.open(arg[0]) )
diff --git a/test/box/digest.result b/test/app/digest.result
similarity index 100%
rename from test/box/digest.result
rename to test/app/digest.result
diff --git a/test/box/digest.test.lua b/test/app/digest.test.lua
similarity index 100%
rename from test/box/digest.test.lua
rename to test/app/digest.test.lua
diff --git a/test/box/fiber.result b/test/app/fiber.result
similarity index 100%
rename from test/box/fiber.result
rename to test/app/fiber.result
diff --git a/test/box/fiber.test.lua b/test/app/fiber.test.lua
similarity index 100%
rename from test/box/fiber.test.lua
rename to test/app/fiber.test.lua
diff --git a/test/box/fio.result b/test/app/fio.result
similarity index 100%
rename from test/box/fio.result
rename to test/app/fio.result
diff --git a/test/box/fio.test.lua b/test/app/fio.test.lua
similarity index 100%
rename from test/box/fio.test.lua
rename to test/app/fio.test.lua
diff --git a/test/box/ipc.result b/test/app/ipc.result
similarity index 100%
rename from test/box/ipc.result
rename to test/app/ipc.result
diff --git a/test/box/ipc.test.lua b/test/app/ipc.test.lua
similarity index 100%
rename from test/box/ipc.test.lua
rename to test/app/ipc.test.lua
diff --git a/test/box/lua/fiber.lua b/test/app/lua/fiber.lua
similarity index 100%
rename from test/box/lua/fiber.lua
rename to test/app/lua/fiber.lua
diff --git a/test/box/luafun.result b/test/app/luafun.result
similarity index 100%
rename from test/box/luafun.result
rename to test/app/luafun.result
diff --git a/test/box/luafun.test.lua b/test/app/luafun.test.lua
similarity index 100%
rename from test/box/luafun.test.lua
rename to test/app/luafun.test.lua
diff --git a/test/box/pack.result b/test/app/pack.result
similarity index 100%
rename from test/box/pack.result
rename to test/app/pack.result
diff --git a/test/box/pack.test.lua b/test/app/pack.test.lua
similarity index 100%
rename from test/box/pack.test.lua
rename to test/app/pack.test.lua
diff --git a/test/box/socket.result b/test/app/socket.result
similarity index 99%
rename from test/box/socket.result
rename to test/app/socket.result
index f12cf1c26e..f5501b1ede 100644
--- a/test/box/socket.result
+++ b/test/app/socket.result
@@ -1404,9 +1404,8 @@ test_run:cmd("setopt delimiter ';'")
 ---
 - true
 ...
-for i=100,900 do
-    local f = fiber.find(i)
-    if f and f:name():match('^testserv/') then
+for _, f in pairs(fiber.info()) do
+    if f.name:match('^testserv/') then
         cnt = cnt + 1
     end
 end;
diff --git a/test/box/socket.skipcond b/test/app/socket.skipcond
similarity index 100%
rename from test/box/socket.skipcond
rename to test/app/socket.skipcond
diff --git a/test/box/socket.test.lua b/test/app/socket.test.lua
similarity index 99%
rename from test/box/socket.test.lua
rename to test/app/socket.test.lua
index 2cc6629612..d20d99b1f3 100644
--- a/test/box/socket.test.lua
+++ b/test/app/socket.test.lua
@@ -461,9 +461,8 @@ client ~= nil
 -- Check that listen and client fibers have appropriate names
 cnt = 0
 test_run:cmd("setopt delimiter ';'")
-for i=100,900 do
-    local f = fiber.find(i)
-    if f and f:name():match('^testserv/') then
+for _, f in pairs(fiber.info()) do
+    if f.name:match('^testserv/') then
         cnt = cnt + 1
     end
 end;
diff --git a/test/box/strict.result b/test/app/strict.result
similarity index 100%
rename from test/box/strict.result
rename to test/app/strict.result
diff --git a/test/box/strict.test.lua b/test/app/strict.test.lua
similarity index 100%
rename from test/box/strict.test.lua
rename to test/app/strict.test.lua
diff --git a/test/app/suite.ini b/test/app/suite.ini
new file mode 100644
index 0000000000..702f4d72db
--- /dev/null
+++ b/test/app/suite.ini
@@ -0,0 +1,6 @@
+[default]
+core = tarantool
+description = application server tests
+script = app.lua
+lua_libs = lua/fiber.lua
+use_unix_sockets = True
diff --git a/test/box/uuid.result b/test/app/uuid.result
similarity index 100%
rename from test/box/uuid.result
rename to test/app/uuid.result
diff --git a/test/box/uuid.skipcond b/test/app/uuid.skipcond
similarity index 100%
rename from test/box/uuid.skipcond
rename to test/app/uuid.skipcond
diff --git a/test/box/uuid.test.lua b/test/app/uuid.test.lua
similarity index 100%
rename from test/box/uuid.test.lua
rename to test/app/uuid.test.lua
diff --git a/test/box/suite.ini b/test/box/suite.ini
index 86e6dc66eb..a8220611d6 100644
--- a/test/box/suite.ini
+++ b/test/box/suite.ini
@@ -1,9 +1,9 @@
 [default]
 core = tarantool
-description = tarantool/box, minimal configuration
+description = Database tests
 script = box.lua
 disabled = rtree_errinj.test.lua tuple_bench.test.lua
 valgrind_disabled = admin_coredump.test.lua
 release_disabled = errinj.test.lua errinj_index.test.lua rtree_errinj.test.lua upsert_errinj.test.lua
-lua_libs = lua/fiber.lua lua/fifo.lua
+lua_libs = lua/fifo.lua
 use_unix_sockets = True
-- 
GitLab