| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 
 | test_run = require('test_run').new()
---
...
socket = require('socket');
---
...
LISTEN = require('uri').parse(box.cfg.listen)
---
...
test_run:cmd('create server connecter with script = "box/proxy.lua"')
---
- true
...
--
-- related to gh-4040: log corrupted rows
--
log_level = box.cfg.log_level
---
...
box.cfg{log_level=6}
---
...
sock = socket.tcp_connect(LISTEN.host, LISTEN.service)
---
...
sock:read(9)
---
- Tarantool
...
-- we need to have a packet with correctly encoded length,
-- so that it bypasses iproto length check, but cannot be
-- decoded in xrow_header_decode
-- 0x3C = 60, sha1 digest is 20 bytes long
data = string.fromhex('3C'..string.rep(require('digest').sha1_hex('bcde'), 3))
---
...
sock:write(data)
---
- 61
...
sock:close()
---
- true
...
test_run:wait_log('default', 'Got a corrupted row.*', nil, 10)
---
- 'Got a corrupted row:'
...
test_run:wait_log('default', '00000000:.*', nil, 10)
---
- '00000000: A3 02 D6 5A E4 D9 E7 68 A1 53 8D 53 60 5F 20 3F '
...
test_run:wait_log('default', '00000010:.*', nil, 10)
---
- '00000010: D8 E2 D6 E2 A3 02 D6 5A E4 D9 E7 68 A1 53 8D 53 '
...
test_run:wait_log('default', '00000020:.*', nil, 10)
---
- '00000020: 60 5F 20 3F D8 E2 D6 E2 A3 02 D6 5A E4 D9 E7 68 '
...
test_run:wait_log('default', '00000030:.*', nil, 10)
---
- '00000030: A1 53 8D 53 60 5F 20 3F D8 E2 D6 E2 '
...
-- we expect nothing below, so don't wait
test_run:grep_log('default', '00000040:.*')
---
- null
...
box.cfg{log_level=log_level}
---
...
 |