Commit b4e8c9d4 authored by Łukasz Nowak's avatar Łukasz Nowak

- simplify assertions


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40100 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2ad3f5c1
...@@ -43,15 +43,15 @@ def readElfAsDict(f): ...@@ -43,15 +43,15 @@ def readElfAsDict(f):
library_list = [] library_list = []
for l in result.split('\n'): for l in result.split('\n'):
if '(NEEDED)' in l: if '(NEEDED)' in l:
library_list.append(l.split(':')[1].strip(' []')) library_list.append(l.split(':')[1].strip(' []').split('.so')[0])
elif '(RPATH)' in l: elif '(RPATH)' in l:
rpath_list = l.split(':',1)[1].strip(' []').split(':') rpath_list = l.split(':',1)[1].strip(' []').split(':')
elif '(RUNPATH)' in l: elif '(RUNPATH)' in l:
runpath_list = l.split(':',1)[1].strip(' []').split(':') runpath_list = l.split(':',1)[1].strip(' []').split(':')
return dict( return dict(
library_list=library_list, library_list=sorted(library_list),
rpath_list=rpath_list, rpath_list=sorted(rpath_list),
runpath_list=runpath_list runpath_list=sorted(runpath_list)
) )
class AssertPythonSoftware(unittest.TestCase): class AssertPythonSoftware(unittest.TestCase):
...@@ -231,10 +231,13 @@ class AssertApache(unittest.TestCase): ...@@ -231,10 +231,13 @@ class AssertApache(unittest.TestCase):
def test_ld_libaprutil1(self): def test_ld_libaprutil1(self):
"""Checks proper linking""" """Checks proper linking"""
elf_dict = readElfAsDict('parts/apache/lib/libaprutil-1.so') elf_dict = readElfAsDict('parts/apache/lib/libaprutil-1.so')
for lib in ['libexpat', 'libapr-1', 'librt', self.assertEqual(sorted(['libexpat', 'libapr-1', 'librt', 'libcrypt',
'libcrypt', 'libpthread', 'libdl', 'libc']: 'libpthread', 'libdl', 'libc']), elf_dict['library_list'])
self.assertEqual(1, len([q for q in elf_dict['library_list'] if soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts')
q.startswith(lib+'.')]), 'No %r found' % lib) expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for
software in ['apache', 'zlib', 'openssl']]
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
def test_modules(self): def test_modules(self):
"""Checks for availability of apache modules""" """Checks for availability of apache modules"""
......
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