From 65214e44aed88b3fbf5d4bceeddcf3abb27fd322 Mon Sep 17 00:00:00 2001 From: Pavel Begunkov Date: Tue, 24 Jan 2017 00:00:00 +0300 Subject: [PATCH] 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 Signed-off-by: Eugene Batalov Signed-off-by: Pavel Emelyanov --- test/zdtm/static/file_locks06.checkskip | 19 +++++++++++++++++++ test/zdtm/static/file_locks07.checkskip | 1 + test/zdtm/static/file_locks08.checkskip | 1 + 3 files changed, 21 insertions(+) create mode 100755 test/zdtm/static/file_locks06.checkskip create mode 120000 test/zdtm/static/file_locks07.checkskip create mode 120000 test/zdtm/static/file_locks08.checkskip diff --git a/test/zdtm/static/file_locks06.checkskip b/test/zdtm/static/file_locks06.checkskip new file mode 100755 index 000000000..e5a4775f8 --- /dev/null +++ b/test/zdtm/static/file_locks06.checkskip @@ -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) diff --git a/test/zdtm/static/file_locks07.checkskip b/test/zdtm/static/file_locks07.checkskip new file mode 120000 index 000000000..d3acb702b --- /dev/null +++ b/test/zdtm/static/file_locks07.checkskip @@ -0,0 +1 @@ +file_locks06.checkskip \ No newline at end of file diff --git a/test/zdtm/static/file_locks08.checkskip b/test/zdtm/static/file_locks08.checkskip new file mode 120000 index 000000000..d3acb702b --- /dev/null +++ b/test/zdtm/static/file_locks08.checkskip @@ -0,0 +1 @@ +file_locks06.checkskip \ No newline at end of file