Fix glibc version check
@@ -9,6 +9,7 @@ import logging
import tempfile
import subprocess
import errno
+import distutils.version
import six
@@ -26,6 +27,7 @@ from . import environment
MAX_OUT_LEN = 1000 * 1000 # 1 mb
MAX_MESSAGE_LEN = 1500
SANITIZER_ERROR_PATTERN = r": ([A-Z][\w]+Sanitizer)"
+GLIBC_PATTERN = re.compile(r"GLIBC_([0-9.]+)")
yatest_logger = logging.getLogger("ya.test")
@@ -595,20 +597,13 @@ def _run_readelf(binary_path):
def check_glibc_version(binary_path):
+ lucid_glibc_version = distutils.version.LooseVersion("2.11")
+
for l in _run_readelf(binary_path).split('\n'):
- if 'GLIBC_' in l:
- if '_2.2.5' in l:
- pass
- elif '_2.3' in l:
- pass
- elif '_2.4' in l:
- pass
- elif '_2.7' in l:
- pass
- elif '_2.9' in l:
- pass
- else:
- assert not l
+ match = GLIBC_PATTERN.search(l)
+ if not match:
+ continue
+ assert distutils.version.LooseVersion(match.group(1)) <= lucid_glibc_version
def backtrace_to_html(bt_filename, output):
