Commit 65214e44 authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Pavel Emelyanov

zdtm: Add checkskip scripts for OFD locks

This is needed in cases when kernel doesn't support OFD locks.
(OFD locks were added in 2014).

travis-ci: success for zdtm: Add checkskip scripts for OFD locks
Signed-off-by: 's avatarPavel Begunkov <asml.silence@gmail.com>
Signed-off-by: 's avatarEugene Batalov <eabatalov89@gmail.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 3dd21b1b
#!/usr/bin/env python2
import fcntl
import tempfile
import struct
import errno
F_OFD_SETLK = 37
try:
with tempfile.TemporaryFile() as fd:
flock = struct.pack('hhllhh', fcntl.F_RDLCK, 0, 0, 0, 0, 0)
fcntl.fcntl(fd.fileno(), F_OFD_SETLK, flock)
except IOError as e:
if e.errno == errno.EINVAL:
print "I/O error({0}): {1}".format(e.errno, e.strerror)
print "OFD locks are not supported."
exit(1)
exit(0)
file_locks06.checkskip
\ No newline at end of file
file_locks06.checkskip
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment