Skip to content
Snippets Groups Projects
Commit 98caa369 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

Merge remote-tracking branch 'origin/test-space-crash'

parents 9adbd5c9 b464d3e8
No related branches found
No related tags found
No related merge requests found
#
# A test case for: http://bugs.launchpad.net/bugs/712456
# Verify that when trying to access a non-existing or
# very large space id, no crash occurs.
#
---
- error:
errcode: (36)
errmsg: Space '1' does not exist
...
---
- error:
errcode: (36)
errmsg: Space '65537' does not exist
...
---
- error:
errcode: (36)
errmsg: Space '4294967295' does not exist
...
#
# A test case for: http://bugs.launchpad.net/bugs/716683
# Admin console should not stall on unknown command.
show status
---
- error: '[string "show status"]:1: ''='' expected near ''status'''
...
from lib.utils import check_libs
check_libs()
from tarantool.request import RequestSelect
errstr = """---
- error:
errcode: {0}
errmsg: {1}
..."""
def format_error(response):
return errstr.format(
"(%d)" % response.return_code,
response.return_message)
def format_yamllike(response):
table = ("\n"+"\n".join(["- "+str(list(k)) for k in response])) \
if len(response) else ""
return "---{0}\n...".format(table)
def select(conn, space_no, index_no, key, offset=0, limit=0, iterator=0):
data = RequestSelect(
conn, space_no, index_no,
key, offset, limit, iterator
)
response = conn._send_request(data)
if response.return_code:
return format_error(response)
return format_yamllike(response)
print """#
# A test case for: http://bugs.launchpad.net/bugs/712456
# Verify that when trying to access a non-existing or
# very large space id, no crash occurs.
#
"""
print select(iproto.py_con, 1, 0, [0])
print select(iproto.py_con, 65537, 0, [0])
print select(iproto.py_con, 4294967295, 0, [0])
print """#
# A test case for: http://bugs.launchpad.net/bugs/716683
# Admin console should not stall on unknown command.
"""
admin("show status", simple=True)
......@@ -186,29 +186,3 @@ space:delete(0)
space:delete(4294967295)
---
...
-- A test case for: http://bugs.launchpad.net/bugs/712456
-- Verify that when trying to access a non-existing or
-- very large space id, no crash occurs.
conn.space[1]:select{}
---
- error: '[string "return conn.space[1]:select{} "]:1: attempt to index a nil value'
...
conn.space[65537]:select{}
---
- error: '[string "return conn.space[65537]:select{} "]:1: attempt to index a nil
value'
...
conn.space[4294967295]:select{}
---
- error: '[string "return conn.space[4294967295]:select{} "]:1: attempt to index a
nil value'
...
box.space[0]:drop()
---
...
box.schema.user.drop('test')
---
...
-- A test case for: http://bugs.launchpad.net/bugs/716683
-- Admin console should not stall on unknown command.
--admin("show status", simple=True)
......@@ -75,17 +75,3 @@ space:select{4294967295}
-- cleanup
space:delete(0)
space:delete(4294967295)
-- A test case for: http://bugs.launchpad.net/bugs/712456
-- Verify that when trying to access a non-existing or
-- very large space id, no crash occurs.
conn.space[1]:select{}
conn.space[65537]:select{}
conn.space[4294967295]:select{}
box.space[0]:drop()
box.schema.user.drop('test')
-- A test case for: http://bugs.launchpad.net/bugs/716683
-- Admin console should not stall on unknown command.
--admin("show status", simple=True)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment