From 7ab9600a012d0e78c52e916f7625fbfbe4244808 Mon Sep 17 00:00:00 2001 From: "Dmitry E. Oboukhov" <unera@debian.org> Date: Fri, 26 Sep 2014 13:03:40 +0400 Subject: [PATCH] Add skipcond to check if tmpfs supports O_DIRECT. closes #209 --- test/unit/fiob.skipcond | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/unit/fiob.skipcond diff --git a/test/unit/fiob.skipcond b/test/unit/fiob.skipcond new file mode 100644 index 0000000000..d246d3b7c4 --- /dev/null +++ b/test/unit/fiob.skipcond @@ -0,0 +1,17 @@ +# vim: set ft=python : +import re +import os +import os.path +import tempfile + +dir = tempfile.mkdtemp() +file = os.path.join(dir, 'test-o-direct') + +try: + fh = os.open(file, os.O_CREAT | os.O_DIRECT | os.O_TRUNC | os.O_RDWR) + os.unlink(file) + os.rmdir(dir) +except: + self.skip = 1 + + -- GitLab