assertSoftware.py 51.1 KB
Newer Older
Łukasz Nowak's avatar
Łukasz Nowak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
##############################################################################
#
# Copyright (c) 2008-2010 Nexedi SA and Contributors. All Rights Reserved.
#                    Lukasz Nowak <luke@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
##############################################################################
28

Łukasz Nowak's avatar
Łukasz Nowak committed
29 30
import os
import subprocess
31
import unittest
32
from distutils import util
33

34 35 36 37 38 39 40 41 42 43
try:
  any([True])
except NameError:
  # there is no any in python2.4
  def any(l):
    for q in l:
      if q:
        return True
    return False

44 45 46
# List of libraries which are acceptable to be linked in globally
ACCEPTABLE_GLOBAL_LIB_LIST = (
  # 32 bit Linux
47 48
	'/usr/lib/libstdc++.so',
 	'/lib/libgcc_s.so',
49 50 51 52 53 54 55
  '/lib/ld-linux.so',
  '/lib/libc.so',
  '/lib/libcrypt.so',
  '/lib/libdl.so',
  '/lib/libm.so',
  '/lib/libnsl.so',
  '/lib/libpthread.so',
Łukasz Nowak's avatar
Łukasz Nowak committed
56
  '/lib/libresolv.so',
57
  '/lib/librt.so',
58 59
  '/lib/libutil.so',
  # 64 bit Linux
60 61
	'/lib64/libgcc_s.so',
	'/usr/lib64/libstdc++.so',
62 63 64 65 66 67 68
  '/lib64/ld-linux-x86-64.so',
  '/lib64/libc.so',
  '/lib64/libcrypt.so',
  '/lib64/libdl.so',
  '/lib64/libm.so',
  '/lib64/libnsl.so',
  '/lib64/libpthread.so',
Łukasz Nowak's avatar
Łukasz Nowak committed
69
  '/lib64/libresolv.so',
70
  '/lib64/librt.so',
71 72 73 74 75
  '/lib64/libutil.so',
  # Arch independed Linux
  'linux-vdso.so',
)

76 77
SKIP_PART_LIST = (
  'parts/boost-lib-download',
78
  'parts/mysql-5.1__compile__',
79 80 81
  'parts/openoffice-bin',
  'parts/openoffice-bin__unpack__',
)
82

83 84
def readElfAsDict(f):
  """Reads ELF information from file"""
85 86
  popen = subprocess.Popen(['readelf', '-d', os.path.join(*f.split('/'))],
      stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
87 88
  result = popen.communicate()[0]
  if popen.returncode != 0:
Łukasz Nowak's avatar
Łukasz Nowak committed
89
    raise AssertionError(result)
90
  library_list = []
91 92
  rpath_list = []
  runpath_list = []
93 94
  for l in result.split('\n'):
    if '(NEEDED)' in l:
Łukasz Nowak's avatar
Łukasz Nowak committed
95
      library_list.append(l.split(':')[1].strip(' []').split('.so')[0])
96
    elif '(RPATH)' in l:
97
      rpath_list = [q.rstrip('/') for q in l.split(':',1)[1].strip(' []').split(':')]
98
    elif '(RUNPATH)' in l:
99
      runpath_list = [q.rstrip('/') for q in l.split(':',1)[1].strip(' []').split(':')]
100 101
  if len(runpath_list) == 0:
    runpath_list = rpath_list
102 103
  elif len(rpath_list) != 0 and runpath_list != rpath_list:
    raise ValueError('RPATH and RUNPATH are different.')
104
  return dict(
Łukasz Nowak's avatar
Łukasz Nowak committed
105 106
    library_list=sorted(library_list),
    runpath_list=sorted(runpath_list)
107 108
  )

109 110 111 112 113 114 115
def getPythonVersion():
  return '%s.%s' % util.sys.version_info[0:2]

def getDevelopEggName(name, version):
  return '%s-%s-py%s-%s.egg' % (name, version, getPythonVersion(),
                                util.get_platform())

116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
def readLddInfoList(f):
  popen = subprocess.Popen(['ldd', f], stdout=subprocess.PIPE,
      stderr=subprocess.STDOUT)
  link_list = []
  a = link_list.append
  result = popen.communicate()[0]
  if 'not a dynamic executable' in result:
    return link_list
  for line in result.split('\n'):
    line = line.strip()
    if '=>' in line:
      lib, path = line.split('=>')
      lib = lib.strip()
      path = path.strip()
      if lib in path:
        # libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f77fcebf000)
        a(path.split()[0])
      else:
        # linux-vdso.so.1 =>  (0x00007fffa7fff000)
        a(lib)
136 137
    elif 'warning: you do not have execution permission for' in line:
      pass
Łukasz Nowak's avatar
Łukasz Nowak committed
138 139 140
    elif 'No such file or directory' in line:
      # ignore broken links
      pass
141 142 143 144 145
    elif line:
      # /lib64/ld-linux-x86-64.so.2 (0x00007f77fd400000)
      a(line.split()[0])
  return link_list

146 147 148 149 150
class AssertSoftwareMixin(unittest.TestCase):
  def assertEqual(self, first, second, msg=None):
    try:
      return unittest.TestCase.assertEqual(self, first, second, msg=msg)
    except unittest.TestCase.failureException:
151
      if isinstance(first, list) and \
152
          isinstance(second, list):
153
        err = ''
154 155
        for elt in first:
          if elt not in second:
156
            err += '- %s\n' % elt
157 158
        for elt in second:
          if elt not in first:
159 160
            err += '+ %s\n' % elt
        if err == '':
161 162
          raise
        else:
163 164 165 166
          if msg:
            msg = '%s: Lists are different:\n%s' % (msg, err)
          else:
            msg = 'Lists are different:\n%s' % err
167 168 169 170
          raise unittest.TestCase.failureException, msg
      else:
        raise

171 172 173 174 175 176 177 178 179 180 181 182 183
  def assertLibraryList(self, path, library_list=None, software_list=None,
                        additional_runpath_list=None):
    elf_dict = readElfAsDict(path)
    if library_list is not None:
      self.assertEqual(sorted(library_list), elf_dict['library_list'], path)
    if software_list is not None:
      soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts')
      runpath_list = [os.path.join(soft_dir, software, 'lib') for
        software in software_list]
      if additional_runpath_list is not None:
        runpath_list.extend(additional_runpath_list)
      self.assertEqual(sorted(runpath_list), elf_dict['runpath_list'], path)

184 185 186 187 188 189 190 191 192 193 194 195 196 197
  def assertSoftwareDictEmpty(self, first, msg=None):
    try:
      return unittest.TestCase.assertEqual(self, first, {}, msg)
    except unittest.TestCase.failureException:
      if msg is None:
        msg = ''
        for path, wrong_link_list in first.iteritems():
          msg += '%s:\n' % path
          msg += '\n'.join(['\t' + q for q in sorted(wrong_link_list)]) + '\n'
        msg = 'Bad linked software:\n%s' % msg
        raise unittest.TestCase.failureException, msg
      else:
        raise

198
class AssertSoftwareRunable(AssertSoftwareMixin):
199 200 201 202 203 204 205 206 207 208 209 210
  def test_HaProxy(self):
    stdout, stderr = subprocess.Popen(["parts/haproxy/sbin/haproxy", "-v"],
        stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
    self.assertEqual(stderr, '')
    self.assertTrue(stdout.startswith('HA-Proxy'))

  def test_Apache(self):
    stdout, stderr = subprocess.Popen(["parts/apache/bin/httpd", "-v"],
        stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
    self.assertEqual(stderr, '')
    self.assertTrue(stdout.startswith('Server version: Apache'))

211 212 213 214 215 216
  def test_Varnish(self):
    stdout, stderr = subprocess.Popen(["parts/varnish/sbin/varnishd", "-V"],
        stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
    self.assertEqual(stdout, '')
    self.assertTrue(stderr.startswith('varnishd ('))

217 218 219 220 221 222 223 224 225 226 227 228 229
  def test_TokyoCabinet(self):
    stdout, stderr = subprocess.Popen(["parts/tokyocabinet/bin/tcamgr",
      "version"],
        stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
    self.assertEqual(stderr, '')
    self.assertTrue(stdout.startswith('Tokyo Cabinet'))

  def test_Flare(self):
    stdout, stderr = subprocess.Popen(["parts/flare/bin/flarei", "-v"],
        stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
    self.assertEqual(stderr, '')
    self.assertTrue(stdout.startswith('flare'))

230
  def test_rdiff_backup(self):
231 232
    stdout, stderr = subprocess.Popen(["bin/rdiff-backup", "-V"],
        stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
233 234 235
    self.assertEqual(stderr, '')
    self.assertEqual(stdout.strip(), 'rdiff-backup 1.0.5')

236 237 238 239 240 241 242 243 244 245 246 247
  def test_imagemagick(self):
    binary_list = [ 'animate', 'composite', 'convert', 'identify', 'mogrify',
        'stream', 'compare', 'conjure', 'display', 'import', 'montage']
    base = os.path.join('parts', 'imagemagick', 'bin')
    error_list = []
    for binary in binary_list:
      stdout, stderr = subprocess.Popen([os.path.join(base, binary), "-version"],
          stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
      if 'Version: ImageMagick' not in stdout:
        error_list.append(binary)
    self.assertEqual([], error_list)

248 249 250 251 252 253
  def test_w3m(self):
    stdout, stderr = subprocess.Popen(["parts/w3m/bin/w3m", "-V"],
        stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
    self.assertEqual(stderr, '')
    self.assertTrue(stdout.startswith('w3m version w3m/0.5.2'))

254
class AssertMysql50Tritonn(AssertSoftwareMixin):
255
  def test_ld_mysqld(self):
256
    self.assertLibraryList('parts/mysql-tritonn-5.0/libexec/mysqld', [
257 258 259 260 261 262 263 264 265 266 267 268 269
      'libc',
      'libcrypt',
      'libcrypto',
      'libdl',
      'libgcc_s',
      'libm',
      'libnsl',
      'libpthread',
      'librt',
      'libsenna',
      'libssl',
      'libstdc++',
      'libz',
270 271 272 273 274 275 276
      ], [
      'ncurses',
      'openssl',
      'readline',
      'senna',
      'zlib',
      ])
277 278

  def test_ld_mysqlmanager(self):
279
    self.assertLibraryList('parts/mysql-tritonn-5.0/libexec/mysqlmanager', [
280 281 282 283 284 285 286 287 288 289
      'libc',
      'libcrypt',
      'libcrypto',
      'libgcc_s',
      'libm',
      'libnsl',
      'libpthread',
      'libssl',
      'libstdc++',
      'libz',
290 291 292 293 294 295
      ], [
      'ncurses',
      'zlib',
      'readline',
      'openssl',
      ])
296

297
  def test_ld_libmysqlclient_r(self):
298
    self.assertLibraryList('parts/mysql-tritonn-5.0/lib/mysql/libmysqlclient_r.so', [
299 300 301 302 303 304 305 306
      'libc',
      'libcrypt',
      'libcrypto',
      'libm',
      'libnsl',
      'libpthread',
      'libssl',
      'libz',
307 308 309 310 311 312
      ], [
      'ncurses',
      'openssl',
      'readline',
      'zlib',
      ])
313 314

  def test_ld_libmysqlclient(self):
315
    self.assertLibraryList('parts/mysql-tritonn-5.0/lib/mysql/libmysqlclient.so', [
316 317 318 319 320 321 322
      'libc',
      'libcrypt',
      'libcrypto',
      'libm',
      'libnsl',
      'libssl',
      'libz',
323 324 325 326 327 328
      ], [
      'ncurses',
      'openssl',
      'readline',
      'zlib',
      ])
329 330

  def test_ld_sphinx(self):
331
    self.assertLibraryList('parts/mysql-tritonn-5.0/lib/mysql/sphinx.so', [
332 333 334 335 336 337 338
      'libc',
      'libcrypt',
      'libgcc_s',
      'libm',
      'libnsl',
      'libpthread',
      'libstdc++',
339 340 341 342 343 344
      ], [
      'ncurses',
      'openssl',
      'readline',
      'zlib',
      ])
345

346
  def test_ld_mysql(self):
347
    self.assertLibraryList('parts/mysql-tritonn-5.0/bin/mysql', [
348 349 350 351 352 353 354 355 356 357 358 359
      'libc',
      'libcrypt',
      'libcrypto',
      'libgcc_s',
      'libm',
      'libmysqlclient',
      'libncurses',
      'libnsl',
      'libreadline',
      'libssl',
      'libstdc++',
      'libz',
360 361 362 363 364 365 366
      ], [
      'ncurses',
      'zlib',
      'readline',
      'openssl',
      ], [os.path.join(os.path.abspath(os.curdir),
      'parts', 'mysql-tritonn-5.0', 'lib', 'mysql')])
367 368

  def test_ld_mysqladmin(self):
369
    self.assertLibraryList('parts/mysql-tritonn-5.0/bin/mysqladmin', [
370 371 372 373 374 375 376 377 378 379
      'libc',
      'libcrypt',
      'libcrypto',
      'libgcc_s',
      'libm',
      'libmysqlclient',
      'libnsl',
      'libssl',
      'libstdc++',
      'libz',
380 381 382 383 384 385 386
      ], [
      'ncurses',
      'openssl',
      'readline',
      'zlib',
      ], [os.path.join(os.path.abspath(os.curdir),
      'parts', 'mysql-tritonn-5.0', 'lib', 'mysql')])
387 388

  def test_ld_mysqldump(self):
389 390 391
    self.assertLibraryList('parts/mysql-tritonn-5.0/bin/mysqldump', ['libc', 'libcrypt', 'libcrypto', 'libm',
      'libmysqlclient', 'libnsl', 'libssl', 'libz'], ['ncurses', 'zlib', 'readline', 'openssl'], [os.path.join(os.path.abspath(os.curdir),
      'parts', 'mysql-tritonn-5.0', 'lib', 'mysql')])
392

393
class AssertMysql51(AssertSoftwareMixin):
394
  def test_ld_mysqld(self):
395 396
    self.assertLibraryList('parts/mysql-5.1/libexec/mysqld', ['libc', 'libcrypt', 'libdl', 'libgcc_s', 'libm', 'libnsl',
      'libpthread', 'libstdc++', 'libz'], ['ncurses', 'zlib', 'readline'])
397 398

  def test_ld_mysqlmanager(self):
399 400
    self.assertLibraryList('parts/mysql-5.1/libexec/mysqlmanager', ['libc', 'libcrypt', 'libgcc_s', 'libm', 'libnsl',
      'libpthread', 'libstdc++', 'libz'], ['ncurses', 'zlib', 'readline'])
401 402

  def test_ld_libmysqlclient_r(self):
403
    self.assertLibraryList('parts/mysql-5.1/lib/mysql/libmysqlclient_r.so', ['libc', 'libz', 'libcrypt', 'libm', 'libnsl', 'libpthread'], ['ncurses', 'zlib', 'readline'])
404 405

  def test_ld_libmysqlclient(self):
406
    self.assertLibraryList('parts/mysql-5.1/lib/mysql/libmysqlclient.so', ['libc', 'libz', 'libcrypt', 'libm', 'libnsl', 'libpthread'], ['ncurses', 'readline', 'zlib'])
407 408

  def test_ld_mysql(self):
409
    self.assertLibraryList('parts/mysql-5.1/bin/mysql', ['libc', 'libz', 'libcrypt', 'libgcc_s', 'libm',
410
      'libmysqlclient', 'libncurses', 'libnsl', 'libpthread', 'libreadline',
411 412 413
      'libstdc++'], ['ncurses', 'zlib', 'readline'],
                           [os.path.join(os.path.abspath(os.curdir),
      'parts', 'mysql-5.1', 'lib', 'mysql')])
414 415

  def test_ld_mysqladmin(self):
416 417 418 419
    self.assertLibraryList('parts/mysql-5.1/bin/mysqladmin', ['libc', 'libz', 'libcrypt', 'libgcc_s', 'libm',
      'libmysqlclient', 'libnsl', 'libpthread', 'libstdc++'], ['ncurses', 'zlib', 'readline'],
                           [os.path.join(os.path.abspath(os.curdir),
      'parts', 'mysql-5.1', 'lib', 'mysql')])
420 421

  def test_ld_mysqldump(self):
422 423 424 425
    self.assertLibraryList('parts/mysql-5.1/bin/mysqldump', ['libc', 'libz', 'libcrypt', 'libm', 'libmysqlclient',
      'libnsl', 'libpthread'], ['ncurses', 'zlib', 'readline'],
                           [os.path.join(os.path.abspath(os.curdir),
      'parts', 'mysql-5.1', 'lib', 'mysql')])
426

Łukasz Nowak's avatar
Łukasz Nowak committed
427 428 429 430
class AssertSqlite3(AssertSoftwareMixin):
  """Tests for built memcached"""

  def test_ld_bin_sqlite3(self):
431
    self.assertLibraryList('parts/sqlite3/bin/sqlite3', ['libpthread', 'libc', 'libdl', 'libsqlite3'], ['sqlite3'])
Łukasz Nowak's avatar
Łukasz Nowak committed
432 433

  def test_ld_libsqlite3(self):
434
    self.assertLibraryList('parts/sqlite3/lib/libsqlite3.so', ['libpthread', 'libc', 'libdl'], [])
Łukasz Nowak's avatar
Łukasz Nowak committed
435

436
class AssertMemcached(AssertSoftwareMixin):
437 438 439
  """Tests for built memcached"""

  def test_ld_memcached(self):
440
    """Checks proper linking to libevent from memcached"""
441
    self.assertLibraryList('parts/memcached/bin/memcached', ['libpthread', 'libevent-1.4', 'libc'], ['libevent'])
442

443 444 445
class AssertSubversion(AssertSoftwareMixin):
  """Tests for built subversion"""
  def test_ld_svn(self):
446
    self.assertLibraryList('parts/subversion/bin/svn', ['libsvn_client-1', 'libsvn_wc-1', 'libsvn_ra-1',
447 448
      'libsvn_diff-1', 'libsvn_ra_local-1', 'libsvn_repos-1', 'libsvn_fs-1',
      'libsvn_fs_fs-1', 'libsvn_fs_util-1', 'libsvn_ra_svn-1',
449
      'libsvn_delta-1', 'libsvn_subr-1', 'libsqlite3', 'libxml2',
450
      'libaprutil-1', 'libapr-1', 'libuuid', 'librt', 'libexpat',
451
      'libz', 'libssl', 'libcrypto', 'libsvn_ra_neon-1',
452
      'libc', 'libcrypt', 'libdl', 'libm',
453
      'libpthread', 'libneon'
454 455
      ], ['apache', 'libexpat', 'openssl', 'neon', 'libxml2',
                     'sqlite3', 'subversion', 'zlib', 'libuuid'])
456 457

  def test_ld_svnadmin(self):
458
    self.assertLibraryList('parts/subversion/bin/svnadmin', ['libsvn_repos-1', 'libsvn_fs-1',
459 460 461
      'libsvn_fs_fs-1', 'libsvn_fs_util-1', 'libsvn_delta-1', 'libsvn_subr-1',
      'libsqlite3', 'libaprutil-1', 'libapr-1', 'libuuid', 'librt',
      'libexpat', 'libz', 'libc', 'libcrypt', 'libdl', 'libpthread',
462 463
      ], ['apache', 'libexpat',
                     'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
Łukasz Nowak's avatar
Łukasz Nowak committed
464 465

  def test_ld_svndumpfilter(self):
466
    self.assertLibraryList('parts/subversion/bin/svndumpfilter', ['libsvn_repos-1', 'libsvn_fs-1',
Łukasz Nowak's avatar
Łukasz Nowak committed
467 468 469
      'libsvn_fs_fs-1', 'libsvn_fs_util-1', 'libsvn_delta-1', 'libsvn_subr-1',
      'libsqlite3', 'libaprutil-1', 'libapr-1', 'libuuid', 'librt',
      'libexpat', 'libz', 'libc', 'libcrypt', 'libdl', 'libpthread',
470 471
      ], ['apache', 'libexpat',
                     'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
Łukasz Nowak's avatar
Łukasz Nowak committed
472 473

  def test_ld_svnlook(self):
474
    self.assertLibraryList('parts/subversion/bin/svnlook', ['libsvn_repos-1', 'libsvn_fs-1', 'libsvn_diff-1',
Łukasz Nowak's avatar
Łukasz Nowak committed
475 476 477
      'libsvn_fs_fs-1', 'libsvn_fs_util-1', 'libsvn_delta-1', 'libsvn_subr-1',
      'libsqlite3', 'libaprutil-1', 'libapr-1', 'libuuid', 'librt',
      'libexpat', 'libz', 'libc', 'libcrypt', 'libdl', 'libpthread',
478 479
      ], ['apache', 'libexpat',
                     'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
Łukasz Nowak's avatar
Łukasz Nowak committed
480 481

  def test_ld_svnserve(self):
482
    self.assertLibraryList('parts/subversion/bin/svnserve', ['libsvn_repos-1', 'libsvn_fs-1', 'libsvn_ra_svn-1',
Łukasz Nowak's avatar
Łukasz Nowak committed
483 484 485
      'libsvn_fs_fs-1', 'libsvn_fs_util-1', 'libsvn_delta-1', 'libsvn_subr-1',
      'libsqlite3', 'libaprutil-1', 'libapr-1', 'libuuid', 'librt',
      'libexpat', 'libz', 'libc', 'libcrypt', 'libdl', 'libpthread',
486 487
      ], ['apache', 'libexpat',
                     'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
Łukasz Nowak's avatar
Łukasz Nowak committed
488 489

  def test_ld_svnsync(self):
490
    self.assertLibraryList('parts/subversion/bin/svnsync', [
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516
      'libapr-1',
      'libaprutil-1',
      'libc',
      'libcrypt',
      'libcrypto',
      'libdl',
      'libexpat',
      'libm',
      'libneon',
      'libpthread',
      'librt',
      'libsqlite3',
      'libssl',
      'libsvn_delta-1',
      'libsvn_fs-1',
      'libsvn_fs_fs-1',
      'libsvn_fs_util-1',
      'libsvn_ra-1',
      'libsvn_ra_local-1',
      'libsvn_ra_neon-1',
      'libsvn_ra_svn-1',
      'libsvn_repos-1',
      'libsvn_subr-1',
      'libuuid',
      'libxml2',
      'libz',
517 518 519 520 521 522 523 524 525 526 527
      ], [
      'apache',
      'libexpat',
      'libuuid',
      'libxml2',
      'neon',
      'openssl',
      'sqlite3',
      'subversion',
      'zlib',
      ])
Łukasz Nowak's avatar
Łukasz Nowak committed
528 529

  def test_ld_svnversion(self):
530
    self.assertLibraryList('parts/subversion/bin/svnversion', ['libsvn_diff-1', 'libsvn_wc-1',
Łukasz Nowak's avatar
Łukasz Nowak committed
531 532 533
      'libsvn_delta-1', 'libsvn_subr-1', 'libsqlite3',
      'libaprutil-1', 'libapr-1', 'libuuid', 'librt', 'libexpat',
      'libz', 'libc', 'libcrypt', 'libdl', 'libpthread',
534 535
      ], ['apache', 'libexpat',
                     'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
536 537

  def test_ld_libsvn_client(self):
538
    self.assertLibraryList('parts/subversion/lib/libsvn_client-1.so', ['libsvn_diff-1', 'libsvn_wc-1',
539 540 541
      'libsvn_delta-1', 'libsvn_subr-1', 'libsvn_ra-1',
      'libaprutil-1', 'libapr-1', 'libuuid', 'librt', 'libexpat',
      'libc', 'libcrypt', 'libdl', 'libpthread',
542 543
      ], ['apache', 'libexpat', 'sqlite3', 'subversion', 'zlib',
      'libuuid', 'neon'])
544 545

  def test_ld_libsvn_delta(self):
546
    self.assertLibraryList('parts/subversion/lib/libsvn_delta-1.so', [
547 548 549
      'libsvn_subr-1', 'libz',
      'libaprutil-1', 'libapr-1', 'libuuid', 'librt', 'libexpat',
      'libc', 'libcrypt', 'libdl', 'libpthread',
550 551
      ], ['apache', 'libexpat', 'sqlite3', 'subversion', 'zlib',
      'libuuid', 'neon'])
552 553

  def test_ld_libsvn_diff(self):
554
    self.assertLibraryList('parts/subversion/lib/libsvn_diff-1.so', [
555 556
      'libsvn_subr-1', 'libaprutil-1', 'libapr-1', 'libuuid', 'librt',
      'libexpat', 'libc', 'libcrypt', 'libdl', 'libpthread',
557 558
      ], ['apache', 'libexpat', 'sqlite3', 'subversion', 'zlib',
      'libuuid', 'neon'])
559 560

  def test_ld_libsvn_fs(self):
561
    self.assertLibraryList('parts/subversion/lib/libsvn_fs-1.so', [
562 563 564 565 566 567 568 569 570 571 572
      'libapr-1',
      'libc',
      'libcrypt',
      'libdl',
      'libpthread',
      'librt',
      'libsvn_delta-1',
      'libsvn_fs_fs-1',
      'libsvn_fs_util-1',
      'libsvn_subr-1',
      'libuuid',
573 574 575 576 577 578 579 580
      ], [
      'apache',
      'libuuid',
      'neon',
      'sqlite3',
      'subversion',
      'zlib',
      ])
581 582

  def test_ld_libsvn_fs_fs(self):
583
    self.assertLibraryList('parts/subversion/lib/libsvn_fs_fs-1.so', ['libsvn_delta-1', 'libaprutil-1', 'libexpat',
584 585
      'libsvn_fs_util-1', 'libsvn_subr-1', 'libapr-1', 'libuuid', 'librt',
      'libc', 'libcrypt', 'libdl', 'libpthread',
586 587
      ], ['apache', 'libexpat', 'sqlite3', 'subversion', 'zlib',
      'libuuid', 'neon'])
588 589

  def test_ld_libsvn_fs_util(self):
590
    self.assertLibraryList('parts/subversion/lib/libsvn_fs_util-1.so', ['libaprutil-1', 'libexpat',
591 592
      'libsvn_subr-1', 'libapr-1', 'libuuid', 'librt',
      'libc', 'libcrypt', 'libdl', 'libpthread',
593 594
      ], ['apache', 'libexpat', 'sqlite3', 'subversion', 'zlib',
      'libuuid', 'neon'])
595 596

  def test_ld_libsvn_ra(self):
597
    self.assertLibraryList('parts/subversion/lib/libsvn_ra-1.so', ['libaprutil-1', 'libsvn_delta-1', 'libsvn_fs-1',
598
      'libsvn_ra_local-1', 'libsvn_ra_neon-1', 'libsvn_ra_svn-1',
599 600
      'libsvn_repos-1', 'libexpat', 'libsvn_subr-1', 'libapr-1', 'libuuid',
      'librt', 'libc', 'libcrypt', 'libdl', 'libpthread',
601 602
      ], ['apache', 'libexpat',
                     'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
603 604

  def test_ld_libsvn_ra_local(self):
605
    self.assertLibraryList('parts/subversion/lib/libsvn_ra_local-1.so', ['libaprutil-1', 'libsvn_delta-1', 'libsvn_fs-1',
606 607
      'libsvn_repos-1', 'libexpat', 'libsvn_subr-1', 'libapr-1', 'libuuid',
      'librt', 'libc', 'libcrypt', 'libdl', 'libpthread',
608 609
      ], ['apache', 'libexpat',
                     'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
610

611
  def test_ld_libsvn_ra_neon(self):
612
    self.assertLibraryList('parts/subversion/lib/libsvn_ra_neon-1.so', [
613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628
      'libapr-1',
      'libaprutil-1',
      'libc',
      'libcrypt',
      'libcrypto',
      'libdl',
      'libexpat',
      'libm',
      'libneon',
      'libpthread',
      'librt',
      'libssl',
      'libsvn_delta-1',
      'libsvn_subr-1',
      'libuuid',
      'libxml2',
629
      'libz',
630 631 632 633 634 635 636 637 638 639 640
      ], [
      'apache',
      'libexpat',
      'libuuid',
      'libxml2',
      'neon',
      'openssl',
      'sqlite3',
      'subversion',
      'zlib',
      ])
641 642

  def test_ld_libsvn_ra_svn(self):
643
    self.assertLibraryList('parts/subversion/lib/libsvn_ra_svn-1.so', ['libaprutil-1', 'libsvn_delta-1',
644 645
      'libexpat', 'libsvn_subr-1', 'libapr-1', 'libuuid',
      'librt', 'libc', 'libcrypt', 'libdl', 'libpthread',
646 647
      ], ['apache', 'libexpat',
                     'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
648 649

  def test_ld_libsvn_repos(self):
650
    self.assertLibraryList('parts/subversion/lib/libsvn_repos-1.so', ['libaprutil-1', 'libsvn_delta-1',
651 652
      'libexpat', 'libsvn_subr-1', 'libapr-1', 'libuuid', 'libsvn_fs-1',
      'librt', 'libc', 'libcrypt', 'libdl', 'libpthread',
653 654
      ], ['apache', 'libexpat',
                     'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
655 656

  def test_ld_libsvn_subr(self):
657
    self.assertLibraryList('parts/subversion/lib/libsvn_subr-1.so', ['libaprutil-1', 'libexpat', 'libapr-1',
658 659
      'libuuid', 'librt', 'libc', 'libcrypt', 'libdl', 'libpthread',
      'libsqlite3', 'libz',
660 661
      ], ['apache', 'libexpat',
                     'sqlite3', 'zlib', 'libuuid', 'neon'])
662 663

  def test_ld_libsvn_wc(self):
664
    self.assertLibraryList('parts/subversion/lib/libsvn_wc-1.so', ['libaprutil-1', 'libexpat', 'libapr-1',
665 666
      'libsvn_delta-1', 'libsvn_diff-1', 'libsvn_subr-1',
      'libuuid', 'librt', 'libc', 'libcrypt', 'libdl', 'libpthread',
667 668
      ], ['apache', 'libexpat', 'subversion',
                     'sqlite3', 'zlib', 'libuuid', 'neon'])
669

670 671 672
class AssertNeon(AssertSoftwareMixin):
  """Tests for built neon"""
  def test_ld_libneon(self):
673
    self.assertLibraryList('parts/neon/lib/libneon.so', [
Łukasz Nowak's avatar
Łukasz Nowak committed
674 675 676 677 678 679 680
      'libc',
      'libcrypto',
      'libdl',
      'libm',
      'libssl',
      'libxml2',
      'libz',
681 682 683 684 685
      ], [
      'libxml2',
      'openssl',
      'zlib',
      ])
686

687 688 689 690 691 692 693 694 695 696
  def test_neonconfig(self):
    popen = subprocess.Popen([os.path.join('parts', 'neon', 'bin', 'neon-config'),
      '--libs'],
    stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
    result = popen.communicate()[0]
    self.assertEqual(0, popen.returncode, result)
    result_left = []
    for l in result.split():
      # let's remove acceptable parameters
      if l in (
697 698 699 700 701 702 703 704 705
      '-Wl,-rpath',
      '-lcrypto',
      '-ldl',
      '-lm',
      '-lneon',
      '-lpthread',
      '-lssl',
      '-lxml2',
      '-lz',
706 707 708 709 710 711 712 713 714 715 716 717 718 719
          ):
        continue
      if 'parts/neon/lib' in l:
        continue
      if 'parts/zlib/lib' in l:
        continue
      if 'parts/libxml2/lib' in l:
        continue
      if 'parts/openssl/lib' in l:
        continue
      result_left.append(l)
    # whatever left is wrong
    self.assertEqual([], result_left)

720
class AssertPythonMysql(AssertSoftwareMixin):
721 722 723 724 725 726
  def test_ld_mysqlso(self):
    for d in os.listdir('develop-eggs'):
      if d.startswith('MySQL_python'):
        path = os.path.join('develop-eggs', d, '_mysql.so')
        elf_dict = readElfAsDict(path)
        self.assertEqual(sorted(['libc', 'libcrypt', 'libcrypto', 'libm',
727
      'libmysqlclient_r', 'libnsl', 'libpthread', 'libssl', 'libz']),
728 729 730
          elf_dict['library_list'])
        soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts')
        expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for
731 732
            software in ['zlib', 'openssl']]
        expected_rpath_list.append(os.path.join(os.path.abspath(os.curdir), 'parts', 'mysql-tritonn-5.0', 'lib', 'mysql'))
733
        self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
734

735
class AssertApache(AssertSoftwareMixin):
Łukasz Nowak's avatar
Łukasz Nowak committed
736
  """Tests for built apache"""
737

738 739 740 741 742 743 744 745 746 747
  apache_rpath = [
      'gdbm',
      'libexpat',
      'libuuid',
      'openssl',
      'pcre',
      'sqlite3',
      'zlib',
  ]

748
  def test_ld_libaprutil1(self):
749
    self.assertLibraryList('parts/apache/lib/libaprutil-1.so', ['libexpat', 'libapr-1', 'librt', 'libcrypt',
750
      'libpthread', 'libdl', 'libc', 'libuuid'],
751
      self.apache_rpath + ['apache'])
752

753
  def test_ld_libapr1(self):
754
    self.assertLibraryList('parts/apache/lib/libapr-1.so', ['librt', 'libcrypt', 'libuuid',
755
      'libpthread', 'libdl', 'libc'], self.apache_rpath)
756

757
  def test_modules(self):
758
    required_module_list = sorted([q.strip() for q in """
Łukasz Nowak's avatar
Łukasz Nowak committed
759 760 761 762 763
      actions_module
      alias_module
      asis_module
      auth_basic_module
      auth_digest_module
764
      authn_alias_module
Łukasz Nowak's avatar
Łukasz Nowak committed
765
      authn_anon_module
766
      authn_dbd_module
Łukasz Nowak's avatar
Łukasz Nowak committed
767 768 769
      authn_dbm_module
      authn_default_module
      authn_file_module
770
      authz_dbm_module
Łukasz Nowak's avatar
Łukasz Nowak committed
771 772 773 774
      authz_default_module
      authz_groupfile_module
      authz_host_module
      authz_owner_module
775
      authz_svn_module
Łukasz Nowak's avatar
Łukasz Nowak committed
776 777 778 779
      authz_user_module
      autoindex_module
      bucketeer_module
      cache_module
780
      case_filter_in_module
Łukasz Nowak's avatar
Łukasz Nowak committed
781 782 783 784 785
      case_filter_module
      cern_meta_module
      cgi_module
      cgid_module
      charset_lite_module
786 787 788 789 790
      core_module
      dav_fs_module
      dav_module
      dav_svn_module
      dbd_module
Łukasz Nowak's avatar
Łukasz Nowak committed
791 792 793 794 795 796 797 798 799 800
      deflate_module
      dir_module
      disk_cache_module
      dumpio_module
      echo_module
      env_module
      expires_module
      ext_filter_module
      filter_module
      headers_module
801
      http_module
Łukasz Nowak's avatar
Łukasz Nowak committed
802
      ident_module
803 804 805
      imagemap_module
      include_module
      info_module
Łukasz Nowak's avatar
Łukasz Nowak committed
806 807 808
      log_config_module
      log_forensic_module
      logio_module
809 810
      mime_magic_module
      mime_module
811
      mpm_prefork_module
812 813 814 815
      negotiation_module
      optional_fn_export_module
      optional_fn_import_module
      optional_hook_export_module
Łukasz Nowak's avatar
Łukasz Nowak committed
816
      optional_hook_import_module
817
      proxy_ajp_module
Łukasz Nowak's avatar
Łukasz Nowak committed
818 819
      proxy_balancer_module
      proxy_connect_module
820
      proxy_ftp_module
Łukasz Nowak's avatar
Łukasz Nowak committed
821 822
      proxy_http_module
      proxy_module
823 824
      proxy_scgi_module
      reqtimeout_module
Łukasz Nowak's avatar
Łukasz Nowak committed
825 826
      rewrite_module
      setenvif_module
827
      so_module
828
      speling_module
Łukasz Nowak's avatar
Łukasz Nowak committed
829 830 831 832
      ssl_module
      status_module
      substitute_module
      unique_id_module
833
      userdir_module
Łukasz Nowak's avatar
Łukasz Nowak committed
834 835 836
      usertrack_module
      version_module
      vhost_alias_module
837 838 839 840 841 842 843
    """.split() if len(q.strip()) > 0])
    popen = subprocess.Popen(['parts/apache/bin/httpd', '-M'],
        stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    result = popen.communicate()[0]
    loaded_module_list = sorted([module_name for module_name in result.split()
                          if module_name.endswith('module')])
    self.assertEqual(loaded_module_list, required_module_list)
844

845
  def test_ld_module_mod_actions(self):
846
    self.assertLibraryList('parts/apache/modules/mod_actions.so', ['libpthread', 'libc'], self.apache_rpath)
847

Łukasz Nowak's avatar
Łukasz Nowak committed
848
  def test_ld_module_mod_alias(self):
849
    self.assertLibraryList('parts/apache/modules/mod_alias.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
850 851

  def test_ld_module_mod_asis(self):
852
    self.assertLibraryList('parts/apache/modules/mod_asis.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
853 854

  def test_ld_module_mod_auth_basic(self):
855
    self.assertLibraryList('parts/apache/modules/mod_auth_basic.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
856 857

  def test_ld_module_mod_auth_digest(self):
858
    self.assertLibraryList('parts/apache/modules/mod_auth_digest.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
859 860

  def test_ld_module_mod_authn_alias(self):
861
    self.assertLibraryList('parts/apache/modules/mod_authn_alias.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
862 863

  def test_ld_module_mod_authn_anon(self):
864
    self.assertLibraryList('parts/apache/modules/mod_authn_anon.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
865 866

  def test_ld_module_mod_authn_dbd(self):
867
    self.assertLibraryList('parts/apache/modules/mod_authn_dbd.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
868 869

  def test_ld_module_mod_authn_dbm(self):
870
    self.assertLibraryList('parts/apache/modules/mod_authn_dbm.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
871 872

  def test_ld_module_mod_authn_default(self):
873
    self.assertLibraryList('parts/apache/modules/mod_authn_default.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
874 875

  def test_ld_module_mod_authn_file(self):
876
    self.assertLibraryList('parts/apache/modules/mod_authn_file.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
877 878

  def test_ld_module_mod_authz_dbm(self):
879
    self.assertLibraryList('parts/apache/modules/mod_authz_dbm.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
880 881

  def test_ld_module_mod_authz_default(self):
882
    self.assertLibraryList('parts/apache/modules/mod_authz_default.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
883 884

  def test_ld_module_mod_authz_groupfile(self):
885
    self.assertLibraryList('parts/apache/modules/mod_authz_groupfile.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
886 887

  def test_ld_module_mod_authz_host(self):
888
    self.assertLibraryList('parts/apache/modules/mod_authz_host.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
889 890

  def test_ld_module_mod_authz_owner(self):
891
    self.assertLibraryList('parts/apache/modules/mod_authz_owner.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
892 893

  def test_ld_module_mod_authz_user(self):
894
    self.assertLibraryList('parts/apache/modules/mod_authz_user.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
895 896

  def test_ld_module_mod_autoindex(self):
897
    self.assertLibraryList('parts/apache/modules/mod_autoindex.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
898 899

  def test_ld_module_mod_bucketeer(self):
900
    self.assertLibraryList('parts/apache/modules/mod_bucketeer.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
901 902

  def test_ld_module_mod_cache(self):
903
    self.assertLibraryList('parts/apache/modules/mod_cache.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
904 905

  def test_ld_module_mod_case_filter(self):
906
    self.assertLibraryList('parts/apache/modules/mod_case_filter.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
907 908

  def test_ld_module_mod_case_filter_in(self):
909
    self.assertLibraryList('parts/apache/modules/mod_case_filter_in.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
910 911

  def test_ld_module_mod_cern_meta(self):
912
    self.assertLibraryList('parts/apache/modules/mod_cern_meta.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
913 914

  def test_ld_module_mod_cgi(self):
915
    self.assertLibraryList('parts/apache/modules/mod_cgi.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
916 917

  def test_ld_module_mod_cgid(self):
918
    self.assertLibraryList('parts/apache/modules/mod_cgid.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
919 920

  def test_ld_module_mod_charset_lite(self):
921
    self.assertLibraryList('parts/apache/modules/mod_charset_lite.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
922 923

  def test_ld_module_mod_dav(self):
924
    self.assertLibraryList('parts/apache/modules/mod_dav.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
925 926

  def test_ld_module_mod_dav_fs(self):
927
    self.assertLibraryList('parts/apache/modules/mod_dav_fs.so', ['libpthread', 'libc'], self.apache_rpath)
Łukasz Nowak's avatar
Łukasz Nowak committed
928

929
  def test_ld_module_mod_dbd(self):
930
    self.assertLibraryList('parts/apache/modules/mod_dbd.so', ['libpthread', 'libc'], self.apache_rpath)
931 932

  def test_ld_module_mod_deflate(self):
933
    self.assertLibraryList('parts/apache/modules/mod_deflate.so', ['libpthread', 'libc', 'libz'], self.apache_rpath)
934 935

  def test_ld_module_mod_dir(self):
936
    self.assertLibraryList('parts/apache/modules/mod_dir.so', ['libpthread', 'libc'], self.apache_rpath)
937 938

  def test_ld_module_mod_disk_cache(self):
939
    self.assertLibraryList('parts/apache/modules/mod_disk_cache.so', ['libpthread', 'libc'], self.apache_rpath)
940 941

  def test_ld_module_mod_dumpio(self):
942
    self.assertLibraryList('parts/apache/modules/mod_dumpio.so', ['libpthread', 'libc'], self.apache_rpath)
943 944

  def test_ld_module_mod_echo(self):
945
    self.assertLibraryList('parts/apache/modules/mod_echo.so', ['libpthread', 'libc'], self.apache_rpath)
946 947

  def test_ld_module_mod_env(self):
948
    self.assertLibraryList('parts/apache/modules/mod_env.so', ['libpthread', 'libc'], self.apache_rpath)
949 950

  def test_ld_module_mod_expires(self):
951
    self.assertLibraryList('parts/apache/modules/mod_expires.so', ['libpthread', 'libc'], self.apache_rpath)
952 953

  def test_ld_module_mod_ext_filter(self):
954
    self.assertLibraryList('parts/apache/modules/mod_ext_filter.so', ['libpthread', 'libc'], self.apache_rpath)
955 956

  def test_ld_module_mod_filter(self):
957
    self.assertLibraryList('parts/apache/modules/mod_filter.so', ['libpthread', 'libc'], self.apache_rpath)
958 959

  def test_ld_module_mod_headers(self):
960
    self.assertLibraryList('parts/apache/modules/mod_headers.so', ['libpthread', 'libc'], self.apache_rpath)
961 962

  def test_ld_module_mod_ident(self):
963
    self.assertLibraryList('parts/apache/modules/mod_ident.so', ['libpthread', 'libc'], self.apache_rpath)
964 965

  def test_ld_module_mod_imagemap(self):
966
    self.assertLibraryList('parts/apache/modules/mod_imagemap.so', ['libpthread', 'libc'], self.apache_rpath)
967 968

  def test_ld_module_mod_include(self):
969
    self.assertLibraryList('parts/apache/modules/mod_include.so', ['libpthread', 'libc'], self.apache_rpath)
970 971

  def test_ld_module_mod_info(self):
972
    self.assertLibraryList('parts/apache/modules/mod_info.so', ['libpthread', 'libc'], self.apache_rpath)
973 974

  def test_ld_module_mod_log_config(self):
975
    self.assertLibraryList('parts/apache/modules/mod_log_config.so', ['libpthread', 'libc'], self.apache_rpath)
976 977

  def test_ld_module_mod_log_forensic(self):
978
    self.assertLibraryList('parts/apache/modules/mod_log_forensic.so', ['libpthread', 'libc'], self.apache_rpath)
979 980

  def test_ld_module_mod_logio(self):
981
    self.assertLibraryList('parts/apache/modules/mod_logio.so', ['libpthread', 'libc'], self.apache_rpath)
982 983

  def test_ld_module_mod_mime(self):
984
    self.assertLibraryList('parts/apache/modules/mod_mime.so', ['libpthread', 'libc'], self.apache_rpath)
985 986

  def test_ld_module_mod_mime_magic(self):
987
    self.assertLibraryList('parts/apache/modules/mod_mime_magic.so', ['libpthread', 'libc'], self.apache_rpath)
988 989

  def test_ld_module_mod_negotiation(self):
990
    self.assertLibraryList('parts/apache/modules/mod_negotiation.so', ['libpthread', 'libc'], self.apache_rpath)
991 992

  def test_ld_module_mod_optional_fn_export(self):
993
    self.assertLibraryList('parts/apache/modules/mod_optional_fn_export.so', ['libpthread', 'libc'], self.apache_rpath)
994 995

  def test_ld_module_mod_optional_fn_import(self):
996
    self.assertLibraryList('parts/apache/modules/mod_optional_fn_import.so', ['libpthread', 'libc'], self.apache_rpath)
997 998

  def test_ld_module_mod_optional_hook_export(self):
999
    self.assertLibraryList('parts/apache/modules/mod_optional_hook_export.so', ['libpthread', 'libc'], self.apache_rpath)
1000 1001

  def test_ld_module_mod_optional_hook_import(self):
1002
    self.assertLibraryList('parts/apache/modules/mod_optional_hook_import.so', ['libpthread', 'libc'], self.apache_rpath)
1003 1004

  def test_ld_module_mod_proxy(self):
1005
    self.assertLibraryList('parts/apache/modules/mod_proxy.so', ['libpthread', 'libc'], self.apache_rpath)
1006 1007

  def test_ld_module_mod_proxy_ajp(self):
1008
    self.assertLibraryList('parts/apache/modules/mod_proxy_ajp.so', ['libpthread', 'libc'], self.apache_rpath)
1009 1010

  def test_ld_module_mod_proxy_balancer(self):
1011
    self.assertLibraryList('parts/apache/modules/mod_proxy_balancer.so', ['libpthread', 'libc'], self.apache_rpath)
1012 1013

  def test_ld_module_mod_proxy_connect(self):
1014
    self.assertLibraryList('parts/apache/modules/mod_proxy_connect.so', ['libpthread', 'libc'], self.apache_rpath)
1015 1016

  def test_ld_module_mod_proxy_ftp(self):
1017
    self.assertLibraryList('parts/apache/modules/mod_proxy_ftp.so', ['libpthread', 'libc'], self.apache_rpath)
1018 1019

  def test_ld_module_mod_proxy_http(self):
1020
    self.assertLibraryList('parts/apache/modules/mod_proxy_http.so', ['libpthread', 'libc'], self.apache_rpath)
1021 1022

  def test_ld_module_mod_proxy_scgi(self):
1023
    self.assertLibraryList('parts/apache/modules/mod_proxy_scgi.so', ['libpthread', 'libc'], self.apache_rpath)
1024 1025

  def test_ld_module_mod_reqtimeout(self):
1026
    self.assertLibraryList('parts/apache/modules/mod_reqtimeout.so', ['libpthread', 'libc'], self.apache_rpath)
1027 1028

  def test_ld_module_mod_rewrite(self):
1029
    self.assertLibraryList('parts/apache/modules/mod_rewrite.so', ['libpthread', 'libc'], self.apache_rpath)
1030 1031

  def test_ld_module_mod_setenvif(self):
1032 1033
    self.assertLibraryList('parts/apache/modules/mod_setenvif.so', ['libpthread', 'libc'],
        self.apache_rpath)
1034 1035

  def test_ld_module_mod_speling(self):
1036 1037
    self.assertLibraryList('parts/apache/modules/mod_speling.so', ['libpthread', 'libc'],
        self.apache_rpath)
1038 1039

  def test_ld_module_mod_ssl(self):
1040 1041 1042 1043 1044 1045 1046 1047
    self.assertLibraryList('parts/apache/modules/mod_ssl.so',[
      'libc',
      'libcrypto',
      'libdl',
      'libpthread',
      'libssl',
      'libz',
      ], self.apache_rpath)
1048 1049

  def test_ld_module_mod_status(self):
1050 1051
    self.assertLibraryList('parts/apache/modules/mod_status.so', ['libpthread', 'libc'],
        self.apache_rpath)
1052 1053

  def test_ld_module_mod_substitute(self):
1054 1055
    self.assertLibraryList('parts/apache/modules/mod_substitute.so', ['libpthread', 'libc'],
        self.apache_rpath)
1056 1057

  def test_ld_module_mod_unique_id(self):
1058 1059
    self.assertLibraryList('parts/apache/modules/mod_unique_id.so', ['libpthread', 'libc'],
        self.apache_rpath)
1060 1061

  def test_ld_module_mod_userdir(self):
1062 1063
    self.assertLibraryList('parts/apache/modules/mod_userdir.so', ['libpthread', 'libc'],
        self.apache_rpath)
1064 1065

  def test_ld_module_mod_usertrack(self):
1066 1067
    self.assertLibraryList('parts/apache/modules/mod_usertrack.so', ['libpthread', 'libc'],
        self.apache_rpath)
1068 1069

  def test_ld_module_mod_version(self):
1070 1071
    self.assertLibraryList('parts/apache/modules/mod_version.so', ['libpthread', 'libc'],
        self.apache_rpath)
1072 1073

  def test_ld_module_mod_vhost_alias(self):
1074
    self.assertLibraryList('parts/apache/modules/mod_vhost_alias.so', ['libpthread', 'libc'], self.apache_rpath)
1075

1076 1077 1078 1079 1080
  def test_ld_apr_dbd_sqlite3(self):
    self.assertLibraryList('parts/apache/lib/apr-util-1/apr_dbd_sqlite3.so', [
      'libc',
      'libpthread',
      'libsqlite3',
Łukasz Nowak's avatar
Łukasz Nowak committed
1081
      ], self.apache_rpath)
1082

1083
class AssertItools(AssertSoftwareMixin):
1084
  def test_ld_parserso(self):
1085
    self.assertLibraryList('parts/itools/lib/itools/xml/parser.so', ['libc', 'libglib-2.0', 'libpthread'], ['glib'])
1086

1087
class AssertOpenssl(AssertSoftwareMixin):
Łukasz Nowak's avatar
Łukasz Nowak committed
1088
  def test_ld_openssl(self):
1089
    self.assertLibraryList('parts/openssl/bin/openssl', ['libc', 'libcrypto', 'libdl', 'libssl'], ['openssl'])
1090

1091
class AssertCyrusSasl(AssertSoftwareMixin):
1092
  def test_ld_pluginviewer(self):
1093
    self.assertLibraryList('parts/cyrus-sasl/sbin/pluginviewer', [
1094 1095 1096
      'libc',
      'libdl',
      'libresolv',
1097
      'libsasl2',
1098 1099 1100 1101
      ], [
      'cyrus-sasl',
      'zlib',
      ])
1102

1103
  def test_ld_libsasl2(self):
1104
    self.assertLibraryList('parts/cyrus-sasl/lib/libsasl2.so', [
1105
      'libc',
1106
      'libdl',
1107
      'libresolv',
1108 1109
      ], [
      ])
1110

1111
  def test_ld_sasl2_libanonymous(self):
1112
    self.assertLibraryList('parts/cyrus-sasl/lib/sasl2/libanonymous.so', [
1113 1114
      'libc',
      'libresolv',
1115 1116
      ], [
      ])
1117

1118
  def test_ld_sasl2_libcrammd5(self):
1119
    self.assertLibraryList('parts/cyrus-sasl/lib/sasl2/libcrammd5.so', [
1120 1121
      'libc',
      'libresolv',
1122 1123
      ], [
      ])
1124 1125

  def test_ld_sasl2_libplain(self):
1126
    self.assertLibraryList('parts/cyrus-sasl/lib/sasl2/libplain.so', [
1127 1128 1129
      'libc',
      'libcrypt',
      'libresolv',
1130 1131
      ], [
      ])
1132

1133 1134
class AssertPython26(AssertSoftwareMixin):
  def test_ld_dyn_locale(self):
1135
    self.assertLibraryList('parts/python2.6/lib/python2.6/lib-dynload/_locale.so', [
1136 1137 1138
      'libc',
      'libintl',
      'libpthread',
1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149
      ], [
      'bzip2',
      'gdbm',
      'gettext',
      'libdb',
      'ncurses',
      'openssl',
      'readline',
      'sqlite3',
      'zlib',
      ])
1150

Łukasz Nowak's avatar
Łukasz Nowak committed
1151 1152
class AssertGettext(AssertSoftwareMixin):
  def test_ld_libintl(self):
1153
    self.assertLibraryList('parts/gettext/lib/libintl.so', [
Łukasz Nowak's avatar
Łukasz Nowak committed
1154
      'libc',
1155 1156 1157 1158 1159
      ], [
      'libxml2',
      'ncurses',
      'zlib',
      ])
Łukasz Nowak's avatar
Łukasz Nowak committed
1160 1161

  def test_ld_libasprintf(self):
1162
    self.assertLibraryList('parts/gettext/lib/libasprintf.so', [
Łukasz Nowak's avatar
Łukasz Nowak committed
1163 1164 1165 1166
      'libc',
      'libgcc_s',
      'libm',
      'libstdc++',
1167 1168 1169 1170 1171
      ], [
      'libxml2',
      'ncurses',
      'zlib',
      ])
Łukasz Nowak's avatar
Łukasz Nowak committed
1172 1173

  def test_ld_libgettextlib(self):
1174
    self.assertLibraryList('parts/gettext/lib/libgettextlib.so', [
Łukasz Nowak's avatar
Łukasz Nowak committed
1175 1176 1177 1178 1179 1180 1181
      'libc',
      'libdl',
      'libintl',
      'libm',
      'libncurses',
      'libxml2',
      'libz',
1182 1183 1184 1185 1186 1187
      ], [
      'gettext',
      'libxml2',
      'ncurses',
      'zlib',
      ])
Łukasz Nowak's avatar
Łukasz Nowak committed
1188 1189

  def test_ld_libgettextpo(self):
1190
    self.assertLibraryList('parts/gettext/lib/libgettextpo.so', [
Łukasz Nowak's avatar
Łukasz Nowak committed
1191 1192
      'libc',
      'libintl',
1193 1194 1195 1196 1197 1198
      ], [
      'gettext',
      'libxml2',
      'ncurses',
      'zlib',
      ])
Łukasz Nowak's avatar
Łukasz Nowak committed
1199 1200

  def test_ld_libgettextsrc(self):
1201
    self.assertLibraryList('parts/gettext/lib/libgettextsrc.so', [
Łukasz Nowak's avatar
Łukasz Nowak committed
1202 1203 1204 1205 1206 1207 1208 1209
      'libc',
      'libdl',
      'libgettextlib-0.18.1',
      'libintl',
      'libm',
      'libncurses',
      'libxml2',
      'libz',
1210 1211 1212 1213 1214 1215
      ], [
      'gettext',
      'libxml2',
      'ncurses',
      'zlib',
      ])
Łukasz Nowak's avatar
Łukasz Nowak committed
1216

Łukasz Nowak's avatar
Łukasz Nowak committed
1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374
  def _test_ld_gettext_bin(self, bin):
    self.assertLibraryList(bin, [
      'libc',
      'libdl',
      'libgettextlib-0.18.1',
      'libgettextsrc-0.18.1',
      'libintl',
      'libm',
      'libncurses',
      'libxml2',
      'libz',
      ], [
      'gettext',
      'libxml2',
      'ncurses',
      'zlib',
      ])

  def test_ld_envsubst(self):
    self.assertLibraryList('parts/gettext/bin/envsubst', [
      'libc',
      'libintl',
      ], [
      'gettext',
      'libxml2',
      'ncurses',
      'zlib',
      ])

  def test_ld_gettext(self):
    self.assertLibraryList('parts/gettext/bin/gettext', [
      'libc',
      'libintl',
      ], [
      'gettext',
      'libxml2',
      'ncurses',
      'zlib',
      ])

  def test_ld_msgattrib(self):
    self._test_ld_gettext_bin('parts/gettext/bin/msgattrib')

  def test_ld_msgcat(self):
    self._test_ld_gettext_bin('parts/gettext/bin/msgcat')

  def test_ld_msgcmp(self):
    self._test_ld_gettext_bin('parts/gettext/bin/msgcmp')

  def test_ld_msgcomm(self):
    self._test_ld_gettext_bin('parts/gettext/bin/msgcomm')

  def test_ld_msgconv(self):
    self._test_ld_gettext_bin('parts/gettext/bin/msgconv')

  def test_ld_msgen(self):
    self._test_ld_gettext_bin('parts/gettext/bin/msgen')

  def test_ld_msgexec(self):
    self._test_ld_gettext_bin('parts/gettext/bin/msgexec')

  def test_ld_msgfilter(self):
    self._test_ld_gettext_bin('parts/gettext/bin/msgfilter')

  def test_ld_msgfmt(self):
    self._test_ld_gettext_bin('parts/gettext/bin/msgfmt')

  def test_ld_msggrep(self):
    self.assertLibraryList('parts/gettext/bin/msggrep', [
      'libc',
      'libdl',
      'libgettextlib-0.18.1',
      'libgettextsrc-0.18.1',
      'libintl',
      'libm',
      'libncurses',
      'libxml2',
      'libz',
      ], [
      'gettext',
      'libxml2',
      'ncurses',
      'zlib',
      ])

  def test_ld_msginit(self):
    self.assertLibraryList('parts/gettext/bin/msginit', [
      'libc',
      'libdl',
      'libgettextlib-0.18.1',
      'libgettextsrc-0.18.1',
      'libintl',
      'libm',
      'libncurses',
      'libxml2',
      'libz',
      ], [
      'gettext',
      'libxml2',
      'ncurses',
      'zlib',
      ])

  def test_ld_msgmerge(self):
    self.assertLibraryList('parts/gettext/bin/msgmerge', [
      'libc',
      'libdl',
      'libgettextlib-0.18.1',
      'libgettextsrc-0.18.1',
      'libintl',
      'libm',
      'libncurses',
      'libxml2',
      'libz',
      ], [
      'gettext',
      'libxml2',
      'ncurses',
      'zlib',
      ])

  def test_ld_msgunfmt(self):
    self._test_ld_gettext_bin('parts/gettext/bin/msgunfmt')

  def test_ld_msguniq(self):
    self._test_ld_gettext_bin('parts/gettext/bin/msguniq')

  def test_ld_ngettext(self):
    self.assertLibraryList('parts/gettext/bin/ngettext', [
      'libc',
      'libintl',
      ], [
      'gettext',
      'libxml2',
      'ncurses',
      'zlib',
      ])

  def test_ld_recode_sr_latin(self):
    self.assertLibraryList('parts/gettext/bin/recode-sr-latin', [
      'libc',
      'libdl',
      'libgettextlib-0.18.1',
      'libintl',
      'libm',
      'libncurses',
      'libxml2',
      'libz',
      ], [
      'gettext',
      'libxml2',
      'ncurses',
      'zlib',
      ])

  def test_ld_xgettext(self):
    self._test_ld_gettext_bin('parts/gettext/bin/xgettext')

1375
class AssertLibxslt(AssertSoftwareMixin):
Kazuhiko Shiozaki's avatar
Kazuhiko Shiozaki committed
1376
  def test_ld_xsltproc(self):
1377
    self.assertLibraryList('parts/libxslt/bin/xsltproc', [
1378 1379 1380 1381 1382 1383 1384
      'libc',
      'libdl',
      'libexslt',
      'libm',
      'libxml2',
      'libxslt',
      'libz',
1385 1386 1387 1388 1389
      ], [
      'libxml2',
      'libxslt',
      'zlib',
      ])
1390 1391

class AssertW3m(AssertSoftwareMixin):
Kazuhiko Shiozaki's avatar
Kazuhiko Shiozaki committed
1392
  def test_ld_w3m(self):
1393
    self.assertLibraryList('parts/w3m/bin/w3m', [
1394 1395 1396 1397 1398 1399 1400 1401 1402
      'libc',
      'libdl',
      'libcrypto',
      'libgc',
      'libm',
      'libncurses',
      'libnsl',
      'libpthread',
      'libssl',
1403 1404 1405 1406 1407 1408
      ], [
      'garbage-collector',
      'ncurses',
      'openssl',
      'zlib',
      ])
1409

1410 1411
class AssertVarnish(AssertSoftwareMixin):
  def test_ld_varnishd(self):
1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424
    self.assertLibraryList('parts/varnish/sbin/varnishd', [
      'libc',
      'libdl',
      'libm',
      'libnsl',
      'libpthread',
      'libvarnish',
      'libvarnishcompat',
      'libvcl',
      ], [
      'ncurses',
      'varnish',
      ])
1425
    self.assertLibraryList('parts/varnish-2.1/sbin/varnishd', [
1426 1427 1428 1429 1430 1431 1432 1433
      'libc',
      'libdl',
      'libm',
      'libnsl',
      'libpthread',
      'libvarnish',
      'libvarnishcompat',
      'libvcl',
1434 1435 1436 1437
      ], [
      'ncurses',
      'varnish-2.1',
      ])
1438 1439

  def test_ld_varnishtop(self):
1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450
    self.assertLibraryList('parts/varnish/bin/varnishtop', [
      'libc',
      'libncurses',
      'libpthread',
      'libvarnish',
      'libvarnishapi',
      'libvarnishcompat',
      ], [
      'ncurses',
      'varnish',
      ])
1451
    self.assertLibraryList('parts/varnish-2.1/bin/varnishtop', [
1452 1453 1454 1455 1456 1457
      'libc',
      'libncurses',
      'libpthread',
      'libvarnish',
      'libvarnishapi',
      'libvarnishcompat',
1458 1459 1460 1461
      ], [
      'ncurses',
      'varnish-2.1',
      ])
1462

1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482
  def test_ld_libvarnish(self):
    self.assertLibraryList('parts/varnish/lib/libvarnish.so', [
      'libc',
      'libm',
      'libnsl',
      'librt',
      ], [
      'ncurses',
      ])
    self.assertLibraryList('parts/varnish-2.1/lib/libvarnish.so', [
      'libc',
      'libm',
      'libnsl',
      'libpcre',
      'librt',
      ], [
      'ncurses',
      'pcre',
      ])

Łukasz Nowak's avatar
Łukasz Nowak committed
1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509
class AssertLibrsync(AssertSoftwareMixin):
  def test_ld_rdiff(self):
    self.assertLibraryList('parts/librsync/bin/rdiff', [
      'libbz2',
      'libc',
      'libpopt',
      'librsync',
      'libz',
      ], [
      'bzip2',
      'librsync',
      'popt',
      'zlib',
      ])

  def test_ld_librsync(self):
    self.assertLibraryList('parts/librsync/lib/librsync.so', [
      'libbz2',
      'libc',
      'libpopt',
      'libz',
      ], [
      'bzip2',
      'popt',
      'zlib',
      ])

Łukasz Nowak's avatar
Łukasz Nowak committed
1510 1511 1512 1513 1514 1515 1516
class AssertPopt(AssertSoftwareMixin):
  def test_ld_libpopt(self):
    self.assertLibraryList('parts/popt/lib/libpopt.so', [
      'libc',
      ], [
      ])

Łukasz Nowak's avatar
Łukasz Nowak committed
1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529
class AssertBzip2(AssertSoftwareMixin):
  def test_ld_bzip2(self):
    self.assertLibraryList('parts/bzip2/bin/bzip2', [
      'libc',
      ], [
      ])

  def test_ld_libbz2(self):
    self.assertLibraryList('parts/bzip2/lib/libbz2.so', [
      'libc',
      ], [
      ])

1530 1531
class AssertPysvn(AssertSoftwareMixin):
  def test_ld_pysvn(self):
1532 1533 1534
    self.assertLibraryList('develop-eggs/%s/pysvn/_pysvn_%s.so' % (
      getDevelopEggName('pysvn', '1.7.4'),
      getPythonVersion().replace('.', '_')), [
1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546
      'libc',
      'libgcc_s',
      'libm',
      'libresolv',
      'libstdc++',
      'libsvn_client-1',
      'libsvn_diff-1',
      'libsvn_repos-1',
      ], [
      'subversion'
      ])

1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581
class AssertLxml(AssertSoftwareMixin):
  def test_ld_etree_so(self):
    egg_name = getDevelopEggName('lxml', '2.2.8')
    python_version_major, python_version_minor = util.sys.version_info[0:2]
    self.assertLibraryList('develop-eggs/%s/lxml/etree.so' % (egg_name), [
      'libc',
      'libexslt',
      'libm',
      'libpthread',
      'libxml2',
      'libxslt',
      'libz',
      ], [
      'libxml2',
      'libxslt',
      'zlib',
      ])

  def test_ld_objectify_so(self):
    egg_name = getDevelopEggName('lxml', '2.2.8')
    python_version_major, python_version_minor = util.sys.version_info[0:2]
    self.assertLibraryList('develop-eggs/%s/lxml/objectify.so' % (egg_name), [
      'libc',
      'libexslt',
      'libm',
      'libpthread',
      'libxml2',
      'libxslt',
      'libz',
      ], [
      'libxml2',
      'libxslt',
      'zlib',
      ])

Łukasz Nowak's avatar
Łukasz Nowak committed
1582 1583 1584 1585 1586 1587 1588 1589
class AssertFile(AssertSoftwareMixin):
  def test_ld_file(self):
    self.assertLibraryList('parts/file/bin/file', [
      'libc',
      'libmagic',
      'libz',
      ], [
      'file',
1590
      'zlib',
Łukasz Nowak's avatar
Łukasz Nowak committed
1591 1592 1593 1594 1595 1596 1597 1598 1599 1600
      ])

  def test_ld_libmagic(self):
    self.assertLibraryList('parts/file/lib/libmagic.so', [
      'libc',
      'libz',
      ], [
      'zlib',
      ])

1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623
class AssertImagemagick(AssertSoftwareMixin):
  lib_lib_list = [
      'libbz2',
      'libc',
      'libdl',
      'libm',
      'libpthread',
      'libz',
      ]

  lib_rpath_list = [
      'zlib',
      'bzip2',
      ]

  def test_ld_libMagickCore(self):
    self.assertLibraryList('parts/imagemagick/lib/libMagickCore.so',
      self.lib_lib_list, self.lib_rpath_list)

  def test_ld_libMagickWand(self):
    self.assertLibraryList('parts/imagemagick/lib/libMagickWand.so',
      self.lib_lib_list, self.lib_rpath_list)

1624
class AssertElfLinkedInternally(AssertSoftwareMixin):
Rafael Monnerat's avatar
Rafael Monnerat committed
1625
  def test(self):
1626
    result_dict = {}
1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640
    parts_dir = os.path.join(os.path.abspath(os.curdir), 'parts')
    develop_eggs_dir = os.path.join(os.path.abspath(os.curdir), 'develop-eggs')
    for root in (parts_dir, develop_eggs_dir):
      for dirpath, dirlist, filelist in os.walk(root):
        for filename in filelist:
          # skip some not needed places
          if any([q in dirpath for q in SKIP_PART_LIST]):
            continue
          filename = os.path.join(dirpath, filename)
          link_list = readLddInfoList(filename)
          bad_link_list = [q for q in link_list if not q.startswith(parts_dir) \
                            and not any([q.startswith(k) for k in ACCEPTABLE_GLOBAL_LIB_LIST])]
          if len(bad_link_list):
            result_dict[filename] = bad_link_list
1641 1642 1643
    self.assertSoftwareDictEmpty(result_dict)


1644 1645
if __name__ == '__main__':
  unittest.main()