assertSoftware.py 50.5 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 116 117 118 119 120 121 122 123 124 125 126 127 128
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)
129 130
    elif 'warning: you do not have execution permission for' in line:
      pass
Łukasz Nowak's avatar
Łukasz Nowak committed
131 132 133
    elif 'No such file or directory' in line:
      # ignore broken links
      pass
134 135 136 137 138
    elif line:
      # /lib64/ld-linux-x86-64.so.2 (0x00007f77fd400000)
      a(line.split()[0])
  return link_list

139 140 141 142 143
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:
144
      if isinstance(first, list) and \
145
          isinstance(second, list):
146
        err = ''
147 148
        for elt in first:
          if elt not in second:
149
            err += '- %s\n' % elt
150 151
        for elt in second:
          if elt not in first:
152 153
            err += '+ %s\n' % elt
        if err == '':
154 155
          raise
        else:
156 157 158 159
          if msg:
            msg = '%s: Lists are different:\n%s' % (msg, err)
          else:
            msg = 'Lists are different:\n%s' % err
160 161 162 163
          raise unittest.TestCase.failureException, msg
      else:
        raise

164 165 166 167 168 169 170 171 172 173 174 175 176
  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)

177 178 179 180 181 182 183 184 185 186 187 188 189 190
  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

191
class AssertSoftwareRunable(AssertSoftwareMixin):
192 193 194 195 196 197 198 199 200 201 202 203
  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'))

204 205 206 207 208 209
  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 ('))

210 211 212 213 214 215 216 217 218 219 220 221 222
  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'))

223
  def test_rdiff_backup(self):
224 225
    stdout, stderr = subprocess.Popen(["bin/rdiff-backup", "-V"],
        stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
226 227 228
    self.assertEqual(stderr, '')
    self.assertEqual(stdout.strip(), 'rdiff-backup 1.0.5')

229 230 231 232 233 234 235 236 237 238 239 240
  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)

241 242 243 244 245 246
  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'))

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

  def test_ld_mysqlmanager(self):
272
    self.assertLibraryList('parts/mysql-tritonn-5.0/libexec/mysqlmanager', [
273 274 275 276 277 278 279 280 281 282
      'libc',
      'libcrypt',
      'libcrypto',
      'libgcc_s',
      'libm',
      'libnsl',
      'libpthread',
      'libssl',
      'libstdc++',
      'libz',
283 284 285 286 287 288
      ], [
      'ncurses',
      'zlib',
      'readline',
      'openssl',
      ])
289

290
  def test_ld_libmysqlclient_r(self):
291
    self.assertLibraryList('parts/mysql-tritonn-5.0/lib/mysql/libmysqlclient_r.so', [
292 293 294 295 296 297 298 299
      'libc',
      'libcrypt',
      'libcrypto',
      'libm',
      'libnsl',
      'libpthread',
      'libssl',
      'libz',
300 301 302 303 304 305
      ], [
      'ncurses',
      'openssl',
      'readline',
      'zlib',
      ])
306 307

  def test_ld_libmysqlclient(self):
308
    self.assertLibraryList('parts/mysql-tritonn-5.0/lib/mysql/libmysqlclient.so', [
309 310 311 312 313 314 315
      'libc',
      'libcrypt',
      'libcrypto',
      'libm',
      'libnsl',
      'libssl',
      'libz',
316 317 318 319 320 321
      ], [
      'ncurses',
      'openssl',
      'readline',
      'zlib',
      ])
322 323

  def test_ld_sphinx(self):
324
    self.assertLibraryList('parts/mysql-tritonn-5.0/lib/mysql/sphinx.so', [
325 326 327 328 329 330 331
      'libc',
      'libcrypt',
      'libgcc_s',
      'libm',
      'libnsl',
      'libpthread',
      'libstdc++',
332 333 334 335 336 337
      ], [
      'ncurses',
      'openssl',
      'readline',
      'zlib',
      ])
338

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

  def test_ld_mysqladmin(self):
362
    self.assertLibraryList('parts/mysql-tritonn-5.0/bin/mysqladmin', [
363 364 365 366 367 368 369 370 371 372
      'libc',
      'libcrypt',
      'libcrypto',
      'libgcc_s',
      'libm',
      'libmysqlclient',
      'libnsl',
      'libssl',
      'libstdc++',
      'libz',
373 374 375 376 377 378 379
      ], [
      'ncurses',
      'openssl',
      'readline',
      'zlib',
      ], [os.path.join(os.path.abspath(os.curdir),
      'parts', 'mysql-tritonn-5.0', 'lib', 'mysql')])
380 381

  def test_ld_mysqldump(self):
382 383 384
    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')])
385

386
class AssertMysql51(AssertSoftwareMixin):
387
  def test_ld_mysqld(self):
388 389
    self.assertLibraryList('parts/mysql-5.1/libexec/mysqld', ['libc', 'libcrypt', 'libdl', 'libgcc_s', 'libm', 'libnsl',
      'libpthread', 'libstdc++', 'libz'], ['ncurses', 'zlib', 'readline'])
390 391

  def test_ld_mysqlmanager(self):
392 393
    self.assertLibraryList('parts/mysql-5.1/libexec/mysqlmanager', ['libc', 'libcrypt', 'libgcc_s', 'libm', 'libnsl',
      'libpthread', 'libstdc++', 'libz'], ['ncurses', 'zlib', 'readline'])
394 395

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

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

  def test_ld_mysql(self):
402
    self.assertLibraryList('parts/mysql-5.1/bin/mysql', ['libc', 'libz', 'libcrypt', 'libgcc_s', 'libm',
403
      'libmysqlclient', 'libncurses', 'libnsl', 'libpthread', 'libreadline',
404 405 406
      'libstdc++'], ['ncurses', 'zlib', 'readline'],
                           [os.path.join(os.path.abspath(os.curdir),
      'parts', 'mysql-5.1', 'lib', 'mysql')])
407 408

  def test_ld_mysqladmin(self):
409 410 411 412
    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')])
413 414

  def test_ld_mysqldump(self):
415 416 417 418
    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')])
419

Łukasz Nowak's avatar
Łukasz Nowak committed
420 421 422 423
class AssertSqlite3(AssertSoftwareMixin):
  """Tests for built memcached"""

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

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

429
class AssertMemcached(AssertSoftwareMixin):
430 431 432
  """Tests for built memcached"""

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

436 437 438
class AssertSubversion(AssertSoftwareMixin):
  """Tests for built subversion"""
  def test_ld_svn(self):
439
    self.assertLibraryList('parts/subversion/bin/svn', ['libsvn_client-1', 'libsvn_wc-1', 'libsvn_ra-1',
440 441
      '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',
442
      'libsvn_delta-1', 'libsvn_subr-1', 'libsqlite3', 'libxml2',
443
      'libaprutil-1', 'libapr-1', 'libuuid', 'librt', 'libexpat',
444
      'libz', 'libssl', 'libcrypto', 'libsvn_ra_neon-1',
445
      'libc', 'libcrypt', 'libdl', 'libm',
446
      'libpthread', 'libneon'
447 448
      ], ['apache', 'libexpat', 'openssl', 'neon', 'libxml2',
                     'sqlite3', 'subversion', 'zlib', 'libuuid'])
449 450

  def test_ld_svnadmin(self):
451
    self.assertLibraryList('parts/subversion/bin/svnadmin', ['libsvn_repos-1', 'libsvn_fs-1',
452 453 454
      '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',
455 456
      ], ['apache', 'libexpat',
                     'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
Łukasz Nowak's avatar
Łukasz Nowak committed
457 458

  def test_ld_svndumpfilter(self):
459
    self.assertLibraryList('parts/subversion/bin/svndumpfilter', ['libsvn_repos-1', 'libsvn_fs-1',
Łukasz Nowak's avatar
Łukasz Nowak committed
460 461 462
      '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',
463 464
      ], ['apache', 'libexpat',
                     'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
Łukasz Nowak's avatar
Łukasz Nowak committed
465 466

  def test_ld_svnlook(self):
467
    self.assertLibraryList('parts/subversion/bin/svnlook', ['libsvn_repos-1', 'libsvn_fs-1', 'libsvn_diff-1',
Łukasz Nowak's avatar
Łukasz Nowak committed
468 469 470
      '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',
471 472
      ], ['apache', 'libexpat',
                     'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
Łukasz Nowak's avatar
Łukasz Nowak committed
473 474

  def test_ld_svnserve(self):
475
    self.assertLibraryList('parts/subversion/bin/svnserve', ['libsvn_repos-1', 'libsvn_fs-1', 'libsvn_ra_svn-1',
Łukasz Nowak's avatar
Łukasz Nowak committed
476 477 478
      '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',
479 480
      ], ['apache', 'libexpat',
                     'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
Łukasz Nowak's avatar
Łukasz Nowak committed
481 482

  def test_ld_svnsync(self):
483
    self.assertLibraryList('parts/subversion/bin/svnsync', [
484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509
      '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',
510 511 512 513 514 515 516 517 518 519 520
      ], [
      'apache',
      'libexpat',
      'libuuid',
      'libxml2',
      'neon',
      'openssl',
      'sqlite3',
      'subversion',
      'zlib',
      ])
Łukasz Nowak's avatar
Łukasz Nowak committed
521 522

  def test_ld_svnversion(self):
523
    self.assertLibraryList('parts/subversion/bin/svnversion', ['libsvn_diff-1', 'libsvn_wc-1',
Łukasz Nowak's avatar
Łukasz Nowak committed
524 525 526
      'libsvn_delta-1', 'libsvn_subr-1', 'libsqlite3',
      'libaprutil-1', 'libapr-1', 'libuuid', 'librt', 'libexpat',
      'libz', 'libc', 'libcrypt', 'libdl', 'libpthread',
527 528
      ], ['apache', 'libexpat',
                     'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
529 530

  def test_ld_libsvn_client(self):
531
    self.assertLibraryList('parts/subversion/lib/libsvn_client-1.so', ['libsvn_diff-1', 'libsvn_wc-1',
532 533 534
      'libsvn_delta-1', 'libsvn_subr-1', 'libsvn_ra-1',
      'libaprutil-1', 'libapr-1', 'libuuid', 'librt', 'libexpat',
      'libc', 'libcrypt', 'libdl', 'libpthread',
535 536
      ], ['apache', 'libexpat', 'sqlite3', 'subversion', 'zlib',
      'libuuid', 'neon'])
537 538

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

  def test_ld_libsvn_diff(self):
547
    self.assertLibraryList('parts/subversion/lib/libsvn_diff-1.so', [
548 549
      'libsvn_subr-1', '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_fs(self):
554
    self.assertLibraryList('parts/subversion/lib/libsvn_fs-1.so', [
555 556 557 558 559 560 561 562 563 564 565
      'libapr-1',
      'libc',
      'libcrypt',
      'libdl',
      'libpthread',
      'librt',
      'libsvn_delta-1',
      'libsvn_fs_fs-1',
      'libsvn_fs_util-1',
      'libsvn_subr-1',
      'libuuid',
566 567 568 569 570 571 572 573
      ], [
      'apache',
      'libuuid',
      'neon',
      'sqlite3',
      'subversion',
      'zlib',
      ])
574 575

  def test_ld_libsvn_fs_fs(self):
576
    self.assertLibraryList('parts/subversion/lib/libsvn_fs_fs-1.so', ['libsvn_delta-1', 'libaprutil-1', 'libexpat',
577 578
      'libsvn_fs_util-1', 'libsvn_subr-1', 'libapr-1', 'libuuid', 'librt',
      'libc', 'libcrypt', 'libdl', 'libpthread',
579 580
      ], ['apache', 'libexpat', 'sqlite3', 'subversion', 'zlib',
      'libuuid', 'neon'])
581 582

  def test_ld_libsvn_fs_util(self):
583
    self.assertLibraryList('parts/subversion/lib/libsvn_fs_util-1.so', ['libaprutil-1', 'libexpat',
584 585
      '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_ra(self):
590
    self.assertLibraryList('parts/subversion/lib/libsvn_ra-1.so', ['libaprutil-1', 'libsvn_delta-1', 'libsvn_fs-1',
591
      'libsvn_ra_local-1', 'libsvn_ra_neon-1', 'libsvn_ra_svn-1',
592 593
      'libsvn_repos-1', 'libexpat', 'libsvn_subr-1', 'libapr-1', 'libuuid',
      'librt', 'libc', 'libcrypt', 'libdl', 'libpthread',
594 595
      ], ['apache', 'libexpat',
                     'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
596 597

  def test_ld_libsvn_ra_local(self):
598
    self.assertLibraryList('parts/subversion/lib/libsvn_ra_local-1.so', ['libaprutil-1', 'libsvn_delta-1', 'libsvn_fs-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_neon(self):
605
    self.assertLibraryList('parts/subversion/lib/libsvn_ra_neon-1.so', [
606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621
      'libapr-1',
      'libaprutil-1',
      'libc',
      'libcrypt',
      'libcrypto',
      'libdl',
      'libexpat',
      'libm',
      'libneon',
      'libpthread',
      'librt',
      'libssl',
      'libsvn_delta-1',
      'libsvn_subr-1',
      'libuuid',
      'libxml2',
622
      'libz',
623 624 625 626 627 628 629 630 631 632 633
      ], [
      'apache',
      'libexpat',
      'libuuid',
      'libxml2',
      'neon',
      'openssl',
      'sqlite3',
      'subversion',
      'zlib',
      ])
634 635

  def test_ld_libsvn_ra_svn(self):
636
    self.assertLibraryList('parts/subversion/lib/libsvn_ra_svn-1.so', ['libaprutil-1', 'libsvn_delta-1',
637 638
      'libexpat', 'libsvn_subr-1', 'libapr-1', 'libuuid',
      'librt', 'libc', 'libcrypt', 'libdl', 'libpthread',
639 640
      ], ['apache', 'libexpat',
                     'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
641 642

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

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

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

663 664 665
class AssertNeon(AssertSoftwareMixin):
  """Tests for built neon"""
  def test_ld_libneon(self):
666
    self.assertLibraryList('parts/neon/lib/libneon.so', [
Łukasz Nowak's avatar
Łukasz Nowak committed
667 668 669 670 671 672 673
      'libc',
      'libcrypto',
      'libdl',
      'libm',
      'libssl',
      'libxml2',
      'libz',
674 675 676 677 678
      ], [
      'libxml2',
      'openssl',
      'zlib',
      ])
679

680 681 682 683 684 685 686 687 688 689
  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 (
690 691 692 693 694 695 696 697 698
      '-Wl,-rpath',
      '-lcrypto',
      '-ldl',
      '-lm',
      '-lneon',
      '-lpthread',
      '-lssl',
      '-lxml2',
      '-lz',
699 700 701 702 703 704 705 706 707 708 709 710 711 712
          ):
        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)

713
class AssertPythonMysql(AssertSoftwareMixin):
714 715 716 717 718 719
  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',
720
      'libmysqlclient_r', 'libnsl', 'libpthread', 'libssl', 'libz']),
721 722 723
          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
724 725
            software in ['zlib', 'openssl']]
        expected_rpath_list.append(os.path.join(os.path.abspath(os.curdir), 'parts', 'mysql-tritonn-5.0', 'lib', 'mysql'))
726
        self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
727

728
class AssertApache(AssertSoftwareMixin):
Łukasz Nowak's avatar
Łukasz Nowak committed
729
  """Tests for built apache"""
730

731
  def test_ld_libaprutil1(self):
732
    """Checks proper linking of libaprutil-1.so"""
733 734
    self.assertLibraryList('parts/apache/lib/libaprutil-1.so', ['libexpat', 'libapr-1', 'librt', 'libcrypt',
      'libpthread', 'libdl', 'libc', 'libuuid'], ['apache', 'zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
735

736 737
  def test_ld_libapr1(self):
    """Checks proper linking of libapr-1.so"""
738 739
    self.assertLibraryList('parts/apache/lib/libapr-1.so', ['librt', 'libcrypt', 'libuuid',
      'libpthread', 'libdl', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
740

741
  def test_modules(self):
742
    required_module_list = sorted([q.strip() for q in """
Łukasz Nowak's avatar
Łukasz Nowak committed
743 744 745 746 747
      actions_module
      alias_module
      asis_module
      auth_basic_module
      auth_digest_module
748
      authn_alias_module
Łukasz Nowak's avatar
Łukasz Nowak committed
749
      authn_anon_module
750
      authn_dbd_module
Łukasz Nowak's avatar
Łukasz Nowak committed
751 752 753
      authn_dbm_module
      authn_default_module
      authn_file_module
754
      authz_dbm_module
Łukasz Nowak's avatar
Łukasz Nowak committed
755 756 757 758
      authz_default_module
      authz_groupfile_module
      authz_host_module
      authz_owner_module
759
      authz_svn_module
Łukasz Nowak's avatar
Łukasz Nowak committed
760 761 762 763
      authz_user_module
      autoindex_module
      bucketeer_module
      cache_module
764
      case_filter_in_module
Łukasz Nowak's avatar
Łukasz Nowak committed
765 766 767 768 769
      case_filter_module
      cern_meta_module
      cgi_module
      cgid_module
      charset_lite_module
770 771 772 773 774
      core_module
      dav_fs_module
      dav_module
      dav_svn_module
      dbd_module
Łukasz Nowak's avatar
Łukasz Nowak committed
775 776 777 778 779 780 781 782 783 784
      deflate_module
      dir_module
      disk_cache_module
      dumpio_module
      echo_module
      env_module
      expires_module
      ext_filter_module
      filter_module
      headers_module
785
      http_module
Łukasz Nowak's avatar
Łukasz Nowak committed
786
      ident_module
787 788 789
      imagemap_module
      include_module
      info_module
Łukasz Nowak's avatar
Łukasz Nowak committed
790 791 792
      log_config_module
      log_forensic_module
      logio_module
793 794
      mime_magic_module
      mime_module
795
      mpm_prefork_module
796 797 798 799
      negotiation_module
      optional_fn_export_module
      optional_fn_import_module
      optional_hook_export_module
Łukasz Nowak's avatar
Łukasz Nowak committed
800
      optional_hook_import_module
801
      proxy_ajp_module
Łukasz Nowak's avatar
Łukasz Nowak committed
802 803
      proxy_balancer_module
      proxy_connect_module
804
      proxy_ftp_module
Łukasz Nowak's avatar
Łukasz Nowak committed
805 806
      proxy_http_module
      proxy_module
807 808
      proxy_scgi_module
      reqtimeout_module
Łukasz Nowak's avatar
Łukasz Nowak committed
809 810
      rewrite_module
      setenvif_module
811
      so_module
812
      speling_module
Łukasz Nowak's avatar
Łukasz Nowak committed
813 814 815 816
      ssl_module
      status_module
      substitute_module
      unique_id_module
817
      userdir_module
Łukasz Nowak's avatar
Łukasz Nowak committed
818 819 820
      usertrack_module
      version_module
      vhost_alias_module
821 822 823 824 825 826 827
    """.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)
828

829
  def test_ld_module_mod_actions(self):
830
    self.assertLibraryList('parts/apache/modules/mod_actions.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
831

Łukasz Nowak's avatar
Łukasz Nowak committed
832
  def test_ld_module_mod_alias(self):
833
    self.assertLibraryList('parts/apache/modules/mod_alias.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
834 835

  def test_ld_module_mod_asis(self):
836
    self.assertLibraryList('parts/apache/modules/mod_asis.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
837 838

  def test_ld_module_mod_auth_basic(self):
839
    self.assertLibraryList('parts/apache/modules/mod_auth_basic.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
840 841

  def test_ld_module_mod_auth_digest(self):
842
    self.assertLibraryList('parts/apache/modules/mod_auth_digest.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
843 844

  def test_ld_module_mod_authn_alias(self):
845
    self.assertLibraryList('parts/apache/modules/mod_authn_alias.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
846 847

  def test_ld_module_mod_authn_anon(self):
848
    self.assertLibraryList('parts/apache/modules/mod_authn_anon.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
849 850

  def test_ld_module_mod_authn_dbd(self):
851
    self.assertLibraryList('parts/apache/modules/mod_authn_dbd.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
852 853

  def test_ld_module_mod_authn_dbm(self):
854
    self.assertLibraryList('parts/apache/modules/mod_authn_dbm.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
855 856

  def test_ld_module_mod_authn_default(self):
857
    self.assertLibraryList('parts/apache/modules/mod_authn_default.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
858 859

  def test_ld_module_mod_authn_file(self):
860
    self.assertLibraryList('parts/apache/modules/mod_authn_file.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
861 862

  def test_ld_module_mod_authz_dbm(self):
863
    self.assertLibraryList('parts/apache/modules/mod_authz_dbm.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
864 865

  def test_ld_module_mod_authz_default(self):
866
    self.assertLibraryList('parts/apache/modules/mod_authz_default.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
867 868

  def test_ld_module_mod_authz_groupfile(self):
869
    self.assertLibraryList('parts/apache/modules/mod_authz_groupfile.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
870 871

  def test_ld_module_mod_authz_host(self):
872
    self.assertLibraryList('parts/apache/modules/mod_authz_host.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
873 874

  def test_ld_module_mod_authz_owner(self):
875
    self.assertLibraryList('parts/apache/modules/mod_authz_owner.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
876 877

  def test_ld_module_mod_authz_user(self):
878
    self.assertLibraryList('parts/apache/modules/mod_authz_user.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
879 880

  def test_ld_module_mod_autoindex(self):
881
    self.assertLibraryList('parts/apache/modules/mod_autoindex.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
882 883

  def test_ld_module_mod_bucketeer(self):
884
    self.assertLibraryList('parts/apache/modules/mod_bucketeer.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
885 886

  def test_ld_module_mod_cache(self):
887
    self.assertLibraryList('parts/apache/modules/mod_cache.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
888 889

  def test_ld_module_mod_case_filter(self):
890
    self.assertLibraryList('parts/apache/modules/mod_case_filter.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
891 892

  def test_ld_module_mod_case_filter_in(self):
893
    self.assertLibraryList('parts/apache/modules/mod_case_filter_in.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
894 895

  def test_ld_module_mod_cern_meta(self):
896
    self.assertLibraryList('parts/apache/modules/mod_cern_meta.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
897 898

  def test_ld_module_mod_cgi(self):
899
    self.assertLibraryList('parts/apache/modules/mod_cgi.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
900 901

  def test_ld_module_mod_cgid(self):
902
    self.assertLibraryList('parts/apache/modules/mod_cgid.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
903 904

  def test_ld_module_mod_charset_lite(self):
905
    self.assertLibraryList('parts/apache/modules/mod_charset_lite.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
906 907

  def test_ld_module_mod_dav(self):
908
    self.assertLibraryList('parts/apache/modules/mod_dav.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
909 910

  def test_ld_module_mod_dav_fs(self):
911
    self.assertLibraryList('parts/apache/modules/mod_dav_fs.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
Łukasz Nowak's avatar
Łukasz Nowak committed
912

913
  def test_ld_module_mod_dbd(self):
914
    self.assertLibraryList('parts/apache/modules/mod_dbd.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
915 916

  def test_ld_module_mod_deflate(self):
917
    self.assertLibraryList('parts/apache/modules/mod_deflate.so', ['libpthread', 'libc', 'libz'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
918 919

  def test_ld_module_mod_dir(self):
920
    self.assertLibraryList('parts/apache/modules/mod_dir.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
921 922

  def test_ld_module_mod_disk_cache(self):
923
    self.assertLibraryList('parts/apache/modules/mod_disk_cache.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
924 925

  def test_ld_module_mod_dumpio(self):
926
    self.assertLibraryList('parts/apache/modules/mod_dumpio.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
927 928

  def test_ld_module_mod_echo(self):
929
    self.assertLibraryList('parts/apache/modules/mod_echo.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
930 931

  def test_ld_module_mod_env(self):
932
    self.assertLibraryList('parts/apache/modules/mod_env.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
933 934

  def test_ld_module_mod_expires(self):
935
    self.assertLibraryList('parts/apache/modules/mod_expires.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
936 937

  def test_ld_module_mod_ext_filter(self):
938
    self.assertLibraryList('parts/apache/modules/mod_ext_filter.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
939 940

  def test_ld_module_mod_filter(self):
941
    self.assertLibraryList('parts/apache/modules/mod_filter.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
942 943

  def test_ld_module_mod_headers(self):
944
    self.assertLibraryList('parts/apache/modules/mod_headers.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
945 946

  def test_ld_module_mod_ident(self):
947
    self.assertLibraryList('parts/apache/modules/mod_ident.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
948 949

  def test_ld_module_mod_imagemap(self):
950
    self.assertLibraryList('parts/apache/modules/mod_imagemap.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
951 952

  def test_ld_module_mod_include(self):
953
    self.assertLibraryList('parts/apache/modules/mod_include.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
954 955

  def test_ld_module_mod_info(self):
956
    self.assertLibraryList('parts/apache/modules/mod_info.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
957 958

  def test_ld_module_mod_log_config(self):
959
    self.assertLibraryList('parts/apache/modules/mod_log_config.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
960 961

  def test_ld_module_mod_log_forensic(self):
962
    self.assertLibraryList('parts/apache/modules/mod_log_forensic.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
963 964

  def test_ld_module_mod_logio(self):
965
    self.assertLibraryList('parts/apache/modules/mod_logio.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
966 967

  def test_ld_module_mod_mime(self):
968
    self.assertLibraryList('parts/apache/modules/mod_mime.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
969 970

  def test_ld_module_mod_mime_magic(self):
971
    self.assertLibraryList('parts/apache/modules/mod_mime_magic.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
972 973

  def test_ld_module_mod_negotiation(self):
974
    self.assertLibraryList('parts/apache/modules/mod_negotiation.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
975 976

  def test_ld_module_mod_optional_fn_export(self):
977
    self.assertLibraryList('parts/apache/modules/mod_optional_fn_export.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
978 979

  def test_ld_module_mod_optional_fn_import(self):
980
    self.assertLibraryList('parts/apache/modules/mod_optional_fn_import.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
981 982

  def test_ld_module_mod_optional_hook_export(self):
983
    self.assertLibraryList('parts/apache/modules/mod_optional_hook_export.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
984 985

  def test_ld_module_mod_optional_hook_import(self):
986
    self.assertLibraryList('parts/apache/modules/mod_optional_hook_import.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
987 988

  def test_ld_module_mod_proxy(self):
989
    self.assertLibraryList('parts/apache/modules/mod_proxy.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
990 991

  def test_ld_module_mod_proxy_ajp(self):
992
    self.assertLibraryList('parts/apache/modules/mod_proxy_ajp.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
993 994

  def test_ld_module_mod_proxy_balancer(self):
995
    self.assertLibraryList('parts/apache/modules/mod_proxy_balancer.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
996 997

  def test_ld_module_mod_proxy_connect(self):
998
    self.assertLibraryList('parts/apache/modules/mod_proxy_connect.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
999 1000

  def test_ld_module_mod_proxy_ftp(self):
1001
    self.assertLibraryList('parts/apache/modules/mod_proxy_ftp.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
1002 1003

  def test_ld_module_mod_proxy_http(self):
1004
    self.assertLibraryList('parts/apache/modules/mod_proxy_http.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
1005 1006

  def test_ld_module_mod_proxy_scgi(self):
1007
    self.assertLibraryList('parts/apache/modules/mod_proxy_scgi.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
1008 1009

  def test_ld_module_mod_reqtimeout(self):
1010
    self.assertLibraryList('parts/apache/modules/mod_reqtimeout.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
1011 1012

  def test_ld_module_mod_rewrite(self):
1013
    self.assertLibraryList('parts/apache/modules/mod_rewrite.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
1014 1015

  def test_ld_module_mod_setenvif(self):
1016
    self.assertLibraryList('parts/apache/modules/mod_setenvif.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
1017 1018

  def test_ld_module_mod_speling(self):
1019
    self.assertLibraryList('parts/apache/modules/mod_speling.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
1020 1021

  def test_ld_module_mod_ssl(self):
1022 1023
    self.assertLibraryList('parts/apache/modules/mod_ssl.so', ['libpthread', 'libc', 'libcrypto', 'libdl',
      'libssl', 'libz'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
1024 1025

  def test_ld_module_mod_status(self):
1026
    self.assertLibraryList('parts/apache/modules/mod_status.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
1027 1028

  def test_ld_module_mod_substitute(self):
1029
    self.assertLibraryList('parts/apache/modules/mod_substitute.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
1030 1031

  def test_ld_module_mod_unique_id(self):
1032
    self.assertLibraryList('parts/apache/modules/mod_unique_id.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
1033 1034

  def test_ld_module_mod_userdir(self):
1035
    self.assertLibraryList('parts/apache/modules/mod_userdir.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
1036 1037

  def test_ld_module_mod_usertrack(self):
1038
    self.assertLibraryList('parts/apache/modules/mod_usertrack.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
1039 1040

  def test_ld_module_mod_version(self):
1041
    self.assertLibraryList('parts/apache/modules/mod_version.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
1042 1043

  def test_ld_module_mod_vhost_alias(self):
1044
    self.assertLibraryList('parts/apache/modules/mod_vhost_alias.so', ['libpthread', 'libc'], ['zlib', 'openssl', 'libuuid', 'libexpat', 'pcre'])
1045

1046
class AssertItools(AssertSoftwareMixin):
1047
  def test_ld_parserso(self):
1048
    self.assertLibraryList('parts/itools/lib/itools/xml/parser.so', ['libc', 'libglib-2.0', 'libpthread'], ['glib'])
1049

1050
class AssertOpenssl(AssertSoftwareMixin):
Łukasz Nowak's avatar
Łukasz Nowak committed
1051
  def test_ld_openssl(self):
1052
    self.assertLibraryList('parts/openssl/bin/openssl', ['libc', 'libcrypto', 'libdl', 'libssl'], ['openssl'])
1053

1054
class AssertCyrusSasl(AssertSoftwareMixin):
1055
  def test_ld_pluginviewer(self):
1056
    self.assertLibraryList('parts/cyrus-sasl/sbin/pluginviewer', [
1057 1058 1059
      'libc',
      'libdl',
      'libresolv',
1060
      'libsasl2',
1061 1062 1063 1064
      ], [
      'cyrus-sasl',
      'zlib',
      ])
1065

1066
  def test_ld_libsasl2(self):
1067
    self.assertLibraryList('parts/cyrus-sasl/lib/libsasl2.so', [
1068
      'libc',
1069
      'libdl',
1070
      'libresolv',
1071 1072
      ], [
      ])
1073

1074
  def test_ld_sasl2_libanonymous(self):
1075
    self.assertLibraryList('parts/cyrus-sasl/lib/sasl2/libanonymous.so', [
1076 1077
      'libc',
      'libresolv',
1078 1079
      ], [
      ])
1080

1081
  def test_ld_sasl2_libcrammd5(self):
1082
    self.assertLibraryList('parts/cyrus-sasl/lib/sasl2/libcrammd5.so', [
1083 1084
      'libc',
      'libresolv',
1085 1086
      ], [
      ])
1087 1088

  def test_ld_sasl2_libplain(self):
1089
    self.assertLibraryList('parts/cyrus-sasl/lib/sasl2/libplain.so', [
1090 1091 1092
      'libc',
      'libcrypt',
      'libresolv',
1093 1094
      ], [
      ])
1095

1096 1097
class AssertPython26(AssertSoftwareMixin):
  def test_ld_dyn_locale(self):
1098
    self.assertLibraryList('parts/python2.6/lib/python2.6/lib-dynload/_locale.so', [
1099 1100 1101
      'libc',
      'libintl',
      'libpthread',
1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112
      ], [
      'bzip2',
      'gdbm',
      'gettext',
      'libdb',
      'ncurses',
      'openssl',
      'readline',
      'sqlite3',
      'zlib',
      ])
1113

Łukasz Nowak's avatar
Łukasz Nowak committed
1114 1115
class AssertGettext(AssertSoftwareMixin):
  def test_ld_libintl(self):
1116
    self.assertLibraryList('parts/gettext/lib/libintl.so', [
Łukasz Nowak's avatar
Łukasz Nowak committed
1117
      'libc',
1118 1119 1120 1121 1122
      ], [
      'libxml2',
      'ncurses',
      'zlib',
      ])
Łukasz Nowak's avatar
Łukasz Nowak committed
1123 1124

  def test_ld_libasprintf(self):
1125
    self.assertLibraryList('parts/gettext/lib/libasprintf.so', [
Łukasz Nowak's avatar
Łukasz Nowak committed
1126 1127 1128 1129
      'libc',
      'libgcc_s',
      'libm',
      'libstdc++',
1130 1131 1132 1133 1134
      ], [
      'libxml2',
      'ncurses',
      'zlib',
      ])
Łukasz Nowak's avatar
Łukasz Nowak committed
1135 1136

  def test_ld_libgettextlib(self):
1137
    self.assertLibraryList('parts/gettext/lib/libgettextlib.so', [
Łukasz Nowak's avatar
Łukasz Nowak committed
1138 1139 1140 1141 1142 1143 1144
      'libc',
      'libdl',
      'libintl',
      'libm',
      'libncurses',
      'libxml2',
      'libz',
1145 1146 1147 1148 1149 1150
      ], [
      'gettext',
      'libxml2',
      'ncurses',
      'zlib',
      ])
Łukasz Nowak's avatar
Łukasz Nowak committed
1151 1152

  def test_ld_libgettextpo(self):
1153
    self.assertLibraryList('parts/gettext/lib/libgettextpo.so', [
Łukasz Nowak's avatar
Łukasz Nowak committed
1154 1155
      'libc',
      'libintl',
1156 1157 1158 1159 1160 1161
      ], [
      'gettext',
      'libxml2',
      'ncurses',
      'zlib',
      ])
Łukasz Nowak's avatar
Łukasz Nowak committed
1162 1163

  def test_ld_libgettextsrc(self):
1164
    self.assertLibraryList('parts/gettext/lib/libgettextsrc.so', [
Łukasz Nowak's avatar
Łukasz Nowak committed
1165 1166 1167 1168 1169 1170 1171 1172
      'libc',
      'libdl',
      'libgettextlib-0.18.1',
      'libintl',
      'libm',
      'libncurses',
      'libxml2',
      'libz',
1173 1174 1175 1176 1177 1178
      ], [
      'gettext',
      'libxml2',
      'ncurses',
      'zlib',
      ])
Łukasz Nowak's avatar
Łukasz Nowak committed
1179

Łukasz Nowak's avatar
Łukasz Nowak committed
1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 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
  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')

1338
class AssertLibxslt(AssertSoftwareMixin):
Kazuhiko Shiozaki's avatar
Kazuhiko Shiozaki committed
1339
  def test_ld_xsltproc(self):
1340
    self.assertLibraryList('parts/libxslt/bin/xsltproc', [
1341 1342 1343 1344 1345 1346 1347
      'libc',
      'libdl',
      'libexslt',
      'libm',
      'libxml2',
      'libxslt',
      'libz',
1348 1349 1350 1351 1352
      ], [
      'libxml2',
      'libxslt',
      'zlib',
      ])
1353 1354

class AssertW3m(AssertSoftwareMixin):
Kazuhiko Shiozaki's avatar
Kazuhiko Shiozaki committed
1355
  def test_ld_w3m(self):
1356
    self.assertLibraryList('parts/w3m/bin/w3m', [
1357 1358 1359 1360 1361 1362 1363 1364 1365
      'libc',
      'libdl',
      'libcrypto',
      'libgc',
      'libm',
      'libncurses',
      'libnsl',
      'libpthread',
      'libssl',
1366 1367 1368 1369 1370 1371
      ], [
      'garbage-collector',
      'ncurses',
      'openssl',
      'zlib',
      ])
1372

1373 1374
class AssertVarnish(AssertSoftwareMixin):
  def test_ld_varnishd(self):
1375
    self.assertLibraryList('parts/varnish-2.1/sbin/varnishd', [
1376 1377 1378 1379 1380 1381 1382 1383
      'libc',
      'libdl',
      'libm',
      'libnsl',
      'libpthread',
      'libvarnish',
      'libvarnishcompat',
      'libvcl',
1384 1385 1386 1387
      ], [
      'ncurses',
      'varnish-2.1',
      ])
1388 1389

  def test_ld_varnishtop(self):
1390
    self.assertLibraryList('parts/varnish-2.1/bin/varnishtop', [
1391 1392 1393 1394 1395 1396
      'libc',
      'libncurses',
      'libpthread',
      'libvarnish',
      'libvarnishapi',
      'libvarnishcompat',
1397 1398 1399 1400
      ], [
      'ncurses',
      'varnish-2.1',
      ])
1401

Łukasz Nowak's avatar
Łukasz Nowak committed
1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428
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
1429 1430 1431 1432 1433 1434 1435
class AssertPopt(AssertSoftwareMixin):
  def test_ld_libpopt(self):
    self.assertLibraryList('parts/popt/lib/libpopt.so', [
      'libc',
      ], [
      ])

Łukasz Nowak's avatar
Łukasz Nowak committed
1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448
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',
      ], [
      ])

1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473
class AssertPysvn(AssertSoftwareMixin):
  def test_ld_pysvn(self):
    python_version_major, python_version_minor = util.sys.version_info[0:2]
    self.assertLibraryList('develop-eggs/pysvn-1.7.4-py%s.%s-%s.egg/pysvn/_pysvn_%s_%s.so' % (
      python_version_major, python_version_minor, util.get_platform(),
      python_version_major, python_version_minor), [
      'libc',
      'libcom_err',
      'libexpat',
      'libgcc_s',
      'libm',
      'libneon',
      'libresolv',
      'libssl',
      'libstdc++',
      'libsvn_client-1',
      'libsvn_diff-1',
      'libsvn_repos-1',
      ], [
      'libexpat',
      'neon',
      'openssl',
      'subversion'
      ])

1474
class AssertElfLinkedInternally(AssertSoftwareMixin):
Rafael Monnerat's avatar
Rafael Monnerat committed
1475
  def test(self):
1476 1477 1478 1479
    result_dict = {}
    root = os.path.join(os.path.abspath(os.curdir), 'parts')
    for dirpath, dirlist, filelist in os.walk(root):
      for filename in filelist:
1480 1481 1482
        # skip some not needed places
        if any([q in dirpath for q in SKIP_PART_LIST]):
          continue
1483 1484 1485 1486 1487 1488 1489 1490 1491
        filename = os.path.join(dirpath, filename)
        link_list = readLddInfoList(filename)
        bad_link_list = [q for q in link_list if not q.startswith(root) \
                          and not any([q.startswith(k) for k in ACCEPTABLE_GLOBAL_LIB_LIST])]
        if len(bad_link_list):
          result_dict[filename] = bad_link_list
    self.assertSoftwareDictEmpty(result_dict)


1492 1493
if __name__ == '__main__':
  unittest.main()