Commit e0bae66f authored by Thomas Gambier's avatar Thomas Gambier Committed by Thomas Gambier

slapos/testing: allow permission execution warnings in ldd

Without this, we can have such errors:
RuntimeError: Unknown ldd line ldd: warning: you do not have execution permission for `/opt/slapgrid/shared/bzip2/449734bcc91bae01810a28d0af447a66/lib/libbz2.so' for /opt/slapgrid/shared/bzip2/449734bcc91bae01810a28d0af447a66/lib/libbz2.so.

Indeed, the permission for the lib itself is:
[root@fedora-riscv slapos]# ls -l /opt/slapgrid/shared/bzip2/449734bcc91bae01810a28d0af447a66/lib/libbz2.so.1.0.8
-r--r----- 1 slapsoft slapsoft 260080 May 10 10:32 /opt/slapgrid/shared/bzip2/449734bcc91bae01810a28d0af447a66/lib/libbz2.so.1.0.8

See merge request !632
parent ed8d611d
...@@ -128,6 +128,7 @@ def checkSoftware(slap, software_url): ...@@ -128,6 +128,7 @@ def checkSoftware(slap, software_url):
ldd_so_resolved_re = re.compile( ldd_so_resolved_re = re.compile(
r'\t(?P<library_name>.*) => (?P<library_path>.*) \(0x') r'\t(?P<library_name>.*) => (?P<library_path>.*) \(0x')
ldd_already_loaded_re = re.compile(r'\t(?P<library_name>.*) \(0x') ldd_already_loaded_re = re.compile(r'\t(?P<library_name>.*) \(0x')
warning_execution_permission_re = re.compile(r'ldd: warning: you do not have execution permission for (?P<library_path>.*)')
ldd_not_found_re = re.compile(r'\t(?P<library_name>.*) => not found.*') ldd_not_found_re = re.compile(r'\t(?P<library_name>.*) => not found.*')
class DynamicLibraryNotFound(Exception): class DynamicLibraryNotFound(Exception):
...@@ -161,6 +162,7 @@ def checkSoftware(slap, software_url): ...@@ -161,6 +162,7 @@ def checkSoftware(slap, software_url):
for line in ldd_output.splitlines(): for line in ldd_output.splitlines():
resolved_so_match = ldd_so_resolved_re.match(line) resolved_so_match = ldd_so_resolved_re.match(line)
ldd_already_loaded_match = ldd_already_loaded_re.match(line) ldd_already_loaded_match = ldd_already_loaded_re.match(line)
warning_execution_permission_match = warning_execution_permission_re.match(line)
not_found_match = ldd_not_found_re.match(line) not_found_match = ldd_not_found_re.match(line)
if resolved_so_match: if resolved_so_match:
libraries[resolved_so_match.group( libraries[resolved_so_match.group(
...@@ -168,6 +170,9 @@ def checkSoftware(slap, software_url): ...@@ -168,6 +170,9 @@ def checkSoftware(slap, software_url):
elif ldd_already_loaded_match: elif ldd_already_loaded_match:
# VDSO or ELF, ignore . See https://stackoverflow.com/a/35805410/7294664 for more about this # VDSO or ELF, ignore . See https://stackoverflow.com/a/35805410/7294664 for more about this
pass pass
elif warning_execution_permission_match:
# for now, ignore permission warnings
pass
elif not_found_match: elif not_found_match:
library_name = not_found_match.group('library_name') library_name = not_found_match.group('library_name')
if library_name.split('.')[0] not in missing_lib_allowed_list: if library_name.split('.')[0] not in missing_lib_allowed_list:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment