File: empty.test.py

package info (click to toggle)
tarantool 1.7.2.385.g952d79e-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 21,556 kB
  • ctags: 28,405
  • sloc: ansic: 180,313; cpp: 26,044; sh: 15,513; python: 4,893; makefile: 1,412
file content (30 lines) | stat: -rw-r--r-- 854 bytes parent folder | download
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
import os
import yaml
from os.path import abspath

#
# This test used to pass:
#
# Empty xlog.inprogress must be deleted during recovery
#
# it doesn't pass any more since an xlog with missing header
# can't be parsed by xdir_scan, thus we do nothing about it.
# 
server.stop()
server.deploy()
lsn = str(yaml.load(server.admin("box.info.server.lsn", silent=True))[0])
path = os.path.join(server.vardir, server.name)
filename = os.path.join(path, lsn.zfill(20) + ".xlog")
f = open(filename, "w+")
f.close()
server.start()
server.stop()
if os.access(filename, os.F_OK):
    print ".xlog exists"
# the server has started but is crippled since it
# can't override an existing file
server.start()
server.admin("_ = box.schema.space.create('test')")
os.unlink(filename)
server.admin("_ = box.schema.space.create('test')")
server.admin("box.space.test:drop()")