This ensures we detect the runtime system and release, not the ones
when Samba was build. It's necessary to detect the correct kernel
version we're running on because for kernels before 5.3.1 O_PATH opens
unnecessarily broke kernel oplocks, which breaks our tests. And in
gitlab it can happen that we build on kernels after 5.3.1 and later
run on older kernels. In this situation we can't run kernel oplock
tests.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
import os
import sys
import re
+import platform
sys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), "../../selftest")))
import selftesthelpers
from selftesthelpers import bindir, srcdir, scriptdir, binpath
finally:
f.close()
-if config_hash["SYSTEM_UNAME_SYSNAME"] == '"Linux"':
- m = re.search(r'(\d+).(\d+).(\d+)', config_hash["SYSTEM_UNAME_RELEASE"])
+linux_kernel_version = None
+if platform.system() == 'Linux':
+ m = re.search(r'(\d+).(\d+).(\d+)', platform.release())
if m:
linux_kernel_version = [int(m.group(1)), int(m.group(2)), int(m.group(3))]