File: net.box_log_corrupted_rows_gh-4040.result

package info (click to toggle)
tarantool 2.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 85,364 kB
  • sloc: ansic: 513,760; cpp: 69,489; sh: 25,650; python: 19,190; perl: 14,973; makefile: 4,173; yacc: 1,329; sql: 1,074; pascal: 620; ruby: 190; awk: 18; lisp: 7
file content (72 lines) | stat: -rw-r--r-- 1,487 bytes parent folder | download | duplicates (3)
1
2
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}
---
...