From 444850708fe6c2138780d4c5bd3a473f6346bbe3 Mon Sep 17 00:00:00 2001
From: Dmitry Simonenko <pmwkaa@gmail.com>
Date: Fri, 30 Aug 2013 13:50:20 +0400
Subject: [PATCH] lua-plus-dict: Convert connector_c/ to the new data
 dictionary and new lua console.

---
 test/connector_c/cfg/master.cfg    |  7 -------
 test/connector_c/cfg/tarantool.cfg |  6 ------
 test/connector_c/connector.result  | 11 +++++++++++
 test/connector_c/connector.test.py |  4 ++++
 test/connector_c/tp.result         | 11 +++++++++++
 test/connector_c/tp.test.py        |  5 +++++
 test/connector_c/update.result     | 12 +++++++++++-
 test/connector_c/update.test.py    | 12 +++++++++---
 8 files changed, 51 insertions(+), 17 deletions(-)

diff --git a/test/connector_c/cfg/master.cfg b/test/connector_c/cfg/master.cfg
index a04a7d43f8..37a64dde1b 100644
--- a/test/connector_c/cfg/master.cfg
+++ b/test/connector_c/cfg/master.cfg
@@ -9,10 +9,3 @@ admin_port = 33015
 replication_port = 33016
 
 rows_per_wal = 50
-
-space[0].enabled = 1
-space[0].index[0].type = "HASH"
-space[0].index[0].unique = 1
-space[0].index[0].key_field[0].fieldno = 0
-space[0].index[0].key_field[0].type = "STR"
-
diff --git a/test/connector_c/cfg/tarantool.cfg b/test/connector_c/cfg/tarantool.cfg
index 3a8088fff9..2d60071c50 100644
--- a/test/connector_c/cfg/tarantool.cfg
+++ b/test/connector_c/cfg/tarantool.cfg
@@ -8,9 +8,3 @@ secondary_port = 33014
 admin_port = 33015
 
 rows_per_wal = 50
-
-space[0].enabled = 1
-space[0].index[0].type = "HASH"
-space[0].index[0].unique = 1
-space[0].index[0].key_field[0].fieldno = 0
-space[0].index[0].key_field[0].type = "NUM"
diff --git a/test/connector_c/connector.result b/test/connector_c/connector.result
index 4af85f976f..193491abfe 100644
--- a/test/connector_c/connector.result
+++ b/test/connector_c/connector.result
@@ -1,3 +1,11 @@
+box.insert(box.schema.SPACE_ID, 0, 0, 'tweedledum')
+---
+- [0, 0, 'tweedledum']
+...
+box.insert(box.schema.INDEX_ID, 0, 0, 'primary', 'hash', 1, 1, 0, 'str')
+---
+- [0, 0, 'primary', 1752392040, 1, 1, 0, 'str']
+...
 > tuple1                        [OK]
 > tuple2                        [OK]
 > list                          [OK]
@@ -40,3 +48,6 @@
 > sql select limit              [OK]
 > sql delete                    [OK]
 > sql call                      [OK]
+box.space[0]:drop()
+---
+...
diff --git a/test/connector_c/connector.test.py b/test/connector_c/connector.test.py
index 7f829b1d93..000b486a9e 100644
--- a/test/connector_c/connector.test.py
+++ b/test/connector_c/connector.test.py
@@ -2,6 +2,8 @@ import subprocess
 import sys
 import os
 
+admin("box.insert(box.schema.SPACE_ID, 0, 0, 'tweedledum')")
+admin("box.insert(box.schema.INDEX_ID, 0, 0, 'primary', 'hash', 1, 1, 0, 'str')")
 
 p = subprocess.Popen([os.path.join(builddir, "test/connector_c/tt")],
                      stdout=subprocess.PIPE)
@@ -9,4 +11,6 @@ p.wait()
 for line in p.stdout.readlines():
       sys.stdout.write(line)
 
+admin("box.space[0]:drop()")
+
 # vim: syntax=python
diff --git a/test/connector_c/tp.result b/test/connector_c/tp.result
index 53248fa913..a5d915b32a 100644
--- a/test/connector_c/tp.result
+++ b/test/connector_c/tp.result
@@ -1,3 +1,14 @@
+box.insert(box.schema.SPACE_ID, 0, 0, 'tweedledum')
+---
+- [0, 0, 'tweedledum']
+...
+box.insert(box.schema.INDEX_ID, 0, 0, 'primary', 'hash', 1, 1, 0, 'str')
+---
+- [0, 0, 'primary', 1752392040, 1, 1, 0, 'str']
+...
 tuple fields: 2
 tuple size: 42
 [_i32, 0e72ae1a-d0be-4e49-aeb9-aebea074363c]
+box.space[0]:drop()
+---
+...
diff --git a/test/connector_c/tp.test.py b/test/connector_c/tp.test.py
index 41944c25e0..a3161c5f34 100644
--- a/test/connector_c/tp.test.py
+++ b/test/connector_c/tp.test.py
@@ -2,7 +2,12 @@ import subprocess
 import sys
 import os
 
+admin("box.insert(box.schema.SPACE_ID, 0, 0, 'tweedledum')")
+admin("box.insert(box.schema.INDEX_ID, 0, 0, 'primary', 'hash', 1, 1, 0, 'str')")
+
 p = subprocess.Popen([os.path.join(builddir, "test/connector_c/tp")],
                      stdout=subprocess.PIPE)
 o,e = p.communicate()
 sys.stdout.write(o)
+
+admin("box.space[0]:drop()")
diff --git a/test/connector_c/update.result b/test/connector_c/update.result
index 4305af1260..e1d2b52a79 100644
--- a/test/connector_c/update.result
+++ b/test/connector_c/update.result
@@ -1,3 +1,11 @@
+box.insert(box.schema.SPACE_ID, 0, 0, 'tweedledum')
+---
+- [0, 0, 'tweedledum']
+...
+box.insert(box.schema.INDEX_ID, 0, 0, 'primary', 'hash', 1, 1, 0, 'str')
+---
+- [0, 0, 'primary', 1752392040, 1, 1, 0, 'str']
+...
 	*** test_simple_set ***
 # insert tuple
 insert: respond ok (op: 13, reqid: 0, code: 0, count: 1)
@@ -278,4 +286,6 @@ update fields: respond ok (op: 19, reqid: 0, code: 0, count: 1)
 # test: update w/ grater than maximal allowed opearions count
 update fields: respond ok (op: 19, reqid: 0, code: 514, count: 0)
 	*** test_boundary_args: done ***
- 
\ No newline at end of file
+ box.space[0]:drop()
+---
+...
diff --git a/test/connector_c/update.test.py b/test/connector_c/update.test.py
index a516b6575b..991105195d 100644
--- a/test/connector_c/update.test.py
+++ b/test/connector_c/update.test.py
@@ -2,13 +2,19 @@ import subprocess
 import sys
 import os
 
+admin("box.insert(box.schema.SPACE_ID, 0, 0, 'tweedledum')")
+admin("box.insert(box.schema.INDEX_ID, 0, 0, 'primary', 'hash', 1, 1, 0, 'str')")
+
 p = subprocess.Popen([ os.path.join(builddir, "test/connector_c/update") ], stdout=subprocess.PIPE)
 p.wait()
 for line in p.stdout.readlines():
       sys.stdout.write(line)
 
 # resore default suite
-server.stop()
-server.deploy(self.suite_ini["config"])
-server.start()
+#server.stop()
+#server.deploy(self.suite_ini["config"])
+#server.start()
+
+admin("box.space[0]:drop()")
+
 # vim: syntax=python
-- 
GitLab