mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-18 00:58:31 +00:00
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: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Eugene Batalov <eabatalov89@gmail.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
3dd21b1bdd
commit
65214e44ae
3 changed files with 21 additions and 0 deletions
19
test/zdtm/static/file_locks06.checkskip
Executable file
19
test/zdtm/static/file_locks06.checkskip
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/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)
|
||||
1
test/zdtm/static/file_locks07.checkskip
Symbolic link
1
test/zdtm/static/file_locks07.checkskip
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
file_locks06.checkskip
|
||||
1
test/zdtm/static/file_locks08.checkskip
Symbolic link
1
test/zdtm/static/file_locks08.checkskip
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
file_locks06.checkskip
|
||||
Loading…
Add table
Add a link
Reference in a new issue