Commit 65a2ce4d authored by Julien Muchembled's avatar Julien Muchembled

Migrate repository from Subversion to Git

parent d150abb8
*.pyc
*.pyo
Where to report issues about ERP5 Appliance Buildout?
=====================================================
Please use erp5-users and erp5-dev mailing lists, you can find more
information here: http://www.erp5.com/support/ml
Patches are welcomed too!
Why do you compile your own python and so much other software?
==============================================================
Because of extreme portability. There is no other way to achieve it, LSB is
ignored by distributions, there is no other standard then source standard.
Sometimes some remote resources are not available, what to do?
==============================================================
We are aware of it and we are working hard to provide good solution for
everyone.
How to develop this buildout?
=============================
Please read README.Development.txt
# svn propset svn:ignore -F ./IGNORE.TXT .
.installed.cfg
bin
develop-eggs
downloads
eggs
parts
reboostrap.*
.reboostrap.*
Please see http://www.erp5.com/Howto-Install.erp5.From.Buildout
How to develop ERP5 Appliance Buildout
======================================
Normal buildout run assumes that all resources are available over the network.
And this is correct way to use buildout, but...how to develop it locally and
still be sure that it run over the network.
Lets assume that software is available in ~/erp5.buildout.
Create your working directory ~/buildout.devel:
$ mkdir ~/buildout.devel
Now checkout the buildout:
~/erp5.buildout/parts/subversion/bin/svn https://svn.erp5.org/repos/public/erp5/trunk/buildout/ ~/buildout.devel/checkout
Start simple http server there:
$ cd ~/buildout.devel/checkout
$ ~/erp5.buildout/bin/python2.6 -m SimpleHTTPServer 9000 # or any other free port
Now create directory to simulate extending over the network:
$ mkdir ~/buildout.devel/work
And create profile there:
$ cat > ~/buildout.devel/work/buildout.cfg
[buildout]
extends = http://localhost:9000/buildout-2.12.cfg
extends-cache = extends-cache
^D
Now it is time to play. Observe what and how is downloaded from your simulated
server.
Happy hacking!
Simple server idea contributed by Lucas Carvalho Teixeira
Please see http://www.erp5.com/Howto-Install.erp5.From.Buildout
bootstrap.py file is updated from time to time from:
http://svn.zope.org/*checkout*/zc.buildout/trunk/bootstrap/bootstrap.py
or:
http://svn.zope.org/*checkout*/zc.buildout/tags/RELEASE/bootstrap/bootstrap.py
There is no need to fix it locally, all changes shall go upstream.
Moreover buildout has ability to autoupdate itself, so local manipulations on
that file might have side effects.
##############################################################################
#
# Copyright (c) 2006 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Bootstrap a buildout-based project
Simply run this script in a directory containing a buildout.cfg.
The script accepts buildout command-line options, so you can
use the -c option to specify an alternate configuration file.
$Id$
"""
import os, shutil, sys, tempfile, urllib2
from optparse import OptionParser
tmpeggs = tempfile.mkdtemp()
is_jython = sys.platform.startswith('java')
# parsing arguments
parser = OptionParser(
'This is a custom version of the zc.buildout %prog script. It is '
'intended to meet a temporary need if you encounter problems with '
'the zc.buildout 1.5 release.')
parser.add_option("-v", "--version", dest="version", default='1.4.4',
help='Use a specific zc.buildout version. *This '
'bootstrap script defaults to '
'1.4.4, unlike usual buildpout bootstrap scripts.*')
parser.add_option("-d", "--distribute",
action="store_true", dest="distribute", default=False,
help="Use Disribute rather than Setuptools.")
parser.add_option("-c", None, action="store", dest="config_file",
help=("Specify the path to the buildout configuration "
"file to be used."))
options, args = parser.parse_args()
# if -c was provided, we push it back into args for buildout' main function
if options.config_file is not None:
args += ['-c', options.config_file]
if options.version is not None:
VERSION = '==%s' % options.version
else:
VERSION = ''
USE_DISTRIBUTE = options.distribute
args = args + ['bootstrap']
to_reload = False
try:
import pkg_resources
if not hasattr(pkg_resources, '_distribute'):
to_reload = True
raise ImportError
except ImportError:
ez = {}
if USE_DISTRIBUTE:
exec urllib2.urlopen('http://python-distribute.org/distribute_setup.py'
).read() in ez
ez['use_setuptools'](to_dir=tmpeggs, download_delay=0, no_fake=True)
else:
exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
).read() in ez
ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
if to_reload:
reload(pkg_resources)
else:
import pkg_resources
if sys.platform == 'win32':
def quote(c):
if ' ' in c:
return '"%s"' % c # work around spawn lamosity on windows
else:
return c
else:
def quote (c):
return c
ws = pkg_resources.working_set
if USE_DISTRIBUTE:
requirement = 'distribute'
else:
requirement = 'setuptools'
env = dict(os.environ,
PYTHONPATH=
ws.find(pkg_resources.Requirement.parse(requirement)).location
)
cmd = [quote(sys.executable),
'-c',
quote('from setuptools.command.easy_install import main; main()'),
'-mqNxd',
quote(tmpeggs)]
if 'bootstrap-testing-find-links' in os.environ:
cmd.extend(['-f', os.environ['bootstrap-testing-find-links']])
cmd.append('zc.buildout' + VERSION)
if is_jython:
import subprocess
exitcode = subprocess.Popen(cmd, env=env).wait()
else: # Windows prefers this, apparently; otherwise we would prefer subprocess
exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env]))
assert exitcode == 0
ws.add_entry(tmpeggs)
ws.require('zc.buildout' + VERSION)
import zc.buildout.buildout
zc.buildout.buildout.main(args)
shutil.rmtree(tmpeggs)
[buildout]
# Note: profiles/development-2.12.cfg is added only to fill extends cache
# for instances
extends =
profiles/development-2.12.cfg
profiles/official-2.12.cfg
unzip = true
[buildout]
# Note: profiles/development.cfg is added only to fill extends cache
# for instances
extends =
profiles/development.cfg
profiles/official.cfg
unzip = true
\ No newline at end of file
[buildout]
parts = zope-frontend
[zope-frontend]
recipe = erp5.recipe.apache
httpd_binary = ${software_definition:software_home}/parts/apache/bin/httpd
openssl_binary = ${software_definition:software_home}/parts/openssl/bin/openssl
ip = 127.0.0.1
port = 42080
server_name = localhost
backend_mapping =
127.0.0.1:18080/ /
[buildout]
extends =
../profiles/software-definition.cfg
../profiles/common.cfg
../profiles/links.cfg
supervisor.cfg
parts =
cloudooo-instance
paster
create-log-directory
supervisor-instance
[configuration]
oood_port = 8011
[paster]
recipe = zc.recipe.egg
eggs =
PasteScript
cloudooo.handler.ooo
cloudooo.handler.pdf
cloudooo.handler.ffmpeg
cloudooo.handler.imagemagick
cloudooo
[create-log-directory]
recipe = z3c.recipe.mkdir
paths =
${buildout:log-directory}
${buildout:run-directory}
[cloudooo-instance]
recipe = erp5.recipe.cloudoooinstance
depends =
${paster:eggs}
${create-log-directory:paths}
daemon = true # only true or false
conf-output = ${buildout:etc-directory}/cloudooo.conf
ctl-output = ${buildout:data-bin-directory}/cloudoooctl
log-directory = ${buildout:log-directory}
run-directory = ${buildout:run-directory}
bin-directory = ${buildout:bin-directory}
start-timeout = 20
hostname = localhost
debug-mode = True
working_path = ${buildout:run-directory}
#
## Monitor Settings
#
request-limit = 100
monitor-interval = 10
timeout-response = 40
enable-memory-monitor = True
memory-limit = 1000
#
## OpenOffice Settings
#
uno-path = ${software_definition:openoffice_software}/basis-link/program/
office-binary-path = ${software_definition:openoffice_software}/program/
openoffice-port = 4062
env-PATH = ${software_definition:software_home}/parts/xpdf/bin:${software_definition:software_home}/parts/imagemagick/bin:${software_definition:software_home}/parts/ffmpeg/bin:${software_definition:software_home}/parts/pdftk/bin
env-LD_LIBRARY_PATH = ${software_definition:software_home}/parts/file/lib:${software_definition:software_home}/parts/zlib/lib:${software_definition:software_home}/parts/freetype/lib:${software_definition:software_home}/parts/libXext/lib:${software_definition:software_home}/parts/libXau/lib:${software_definition:software_home}/parts/libX11/lib:${software_definition:software_home}/parts/libXdmcp/lib:${software_definition:software_home}/parts/libxcb/lib
server-hostname = 0.0.0.0
protocol-version = HTTP/1.1
server-library-name = http
server-egg-name = egg:Paste
server-port = ${configuration:oood_port}
supervisor-priority = 30
supervisor-program =
${:supervisor-priority} ${:_buildout_section_name_} (stopsignal=HUP stopwaitsecs=20) ${buildout:bin-directory}/paster [serve ${cloudooo-instance:conf-output}]
handler-mapping =
ooo OOHandler
pdf PDFHandler
imagemagick ImageMagickHandler
ffmpeg FFMPEGHandler
mimetype-registry =
application/pdf * ooo
video/* * ffmpeg
audio/* * ffmpeg
application/x-shockwave-flash * ffmpeg
application/ogg * ffmpeg
application/ogv * ffmpeg
image/* * ooo
text/* * ooo
application/zip * ooo
application/msword * ooo
application/vnd* * ooo
application/vnd* * ooo
application/x-vnd* * ooo
application/postscript * ooo
application/wmf * ooo
application/csv * ooo
application/x-openoffice-gdimetafile * ooo
application/x-emf * ooo
application/emf * ooo
application/octet* * ooo
# this name is only for backward compatibility
[cloudooo-instance-template]
<= cloudooo-instance
[buildout]
parts =
kumo-server-instance
kumo-manager-instance
kumo-gateway-instance
kumo-volatile-server-instance
kumo-volatile-manager-instance
kumo-volatile-gateway-instance
# persistent storage configuration that works same as flare
[kumo-server-instance]
recipe =
server-address = 127.0.0.1
server-port = 19800
server-listen-port = 19900
manager-address = ${kumo-manager-instance:manager-address}
manager-port = ${kumo-manager-instance:manager-port}
# you can customise the storage (eg. bucket size etc.) by creating the
# storage file manually beforehand.
# read http://fallabs.com/tokyocabinet/spex-en.html#tcadbapi for the detail.
storage = ${buildout:var-directory}/${:_buildout_section_name_}.tch
supervisor-priority = 30
supervisor-program =
${:supervisor-priority} ${:_buildout_section_name_} ${software_definition:software_home}/parts/kumo/bin/kumo-server [-l ${:server-address}:${:server-port} -L ${:server-listen-port} -m ${:manager-address}:${:manager-port} -s ${:storage}]
[kumo-manager-instance]
recipe =
manager-address = 127.0.0.1
manager-port = 19700
supervisor-priority = 31
supervisor-program =
${:supervisor-priority} ${:_buildout_section_name_} ${software_definition:software_home}/parts/kumo/bin/kumo-manager [-a -l ${:manager-address}:${:manager-port}]
[kumo-gateway-instance]
recipe =
manager-address = ${kumo-manager-instance:manager-address}
manager-port = ${kumo-manager-instance:manager-port}
gateway-address = 127.0.0.1
# this gateway port is same as flare's default port
gateway-port = 12121
supervisor-priority = 32
supervisor-program =
${:supervisor-priority} ${:_buildout_section_name_} ${software_definition:software_home}/parts/kumo/bin/kumo-gateway [-F -E -m ${:manager-address}:${:manager-port} -t ${:gateway-address}:${:gateway-port}]
# volatile storage configuration that works same as memcached but
# accepts longer keys and bigger data.
[kumo-volatile-server-instance]
<= kumo-server-instance
server-address = 127.0.0.1
server-port = 29800
server-listen-port = 29900
manager-address = ${kumo-volatile-manager-instance:manager-address}
manager-port = ${kumo-volatile-manager-instance:manager-port}
# this configuration means a RAM storage whose maximum usage is 64MB.
# read http://fallabs.com/tokyocabinet/spex-en.html#tcadbapi for the detail.
storage = *#capsiz=64m
[kumo-volatile-manager-instance]
<= kumo-manager-instance
manager-address = 127.0.0.1
manager-port = 29700
[kumo-volatile-gateway-instance]
<= kumo-gateway-instance
manager-address = ${kumo-volatile-manager-instance:manager-address}
manager-port = ${kumo-volatile-manager-instance:manager-port}
gateway-address = 127.0.0.1
# this gateway port is same as memcached's default port
gateway-port = 11211
# Experimental Recipe for setup a KVM instance.
[kvm-instance-template]
recipe = erp5.recipe.kvm
# Define the image.
image =
gzip = true
kvm_snapshot = true
# ssh Information
ssh_key_file = <DEFINE YOUR IMAGE HERE>
ssh_port = 13456
[buildout]
parts = memcached-instance
[memcached-instance]
depends =
#XXX-JPS : NO PLURALS
${create-directories:command}
recipe = erp5.recipe.memcachedserver
memcached_software_bin = ${software_definition:software_home}/parts/memcached/bin
memcached_bin_folder = ${buildout:data-bin-directory}
memcached_conf_file = ${buildout:etc-directory}/memcached.conf
instancehome = ${buildout:var-directory}/memcached
supervisor-priority = 20
supervisor-program =
${:supervisor-priority} ${:_buildout_section_name_} (autorestart=true) ${:memcached_bin_folder}/memcached
### JPS : Problem : promise-based config : We don't know if goal is reached
### + don't crush everything each time if nothing changed
### + specify the goal
# Configuration goes here
# -p
memcached_tcp_port = 11211
# -U
memcached_udp_port = 11211
# -l
memcached_host = 127.0.0.1
# -m
memcached_memory_size = 64
# -c
memcached_simultaneous_connections = 1024
# -u
memcached_user =
# -d
memcached_run_as_daemon = false
# -P
memcached_pid_file = ${:instancehome}/memcached.pid
# -f
memcached_factor = 1.25
# -n
memcached_key_size = 48
# -t
memcached_threads = 4
[buildout]
parts =
mysql-database-template
[mysql-database-template]
recipe = erp5.recipe.mysqldatabase
# MySQL
mysql_database_name = appliance_database
mysql_user = root
mysql_password =
mysql_host = ${configuration:mysql_host}
mysql_port = ${configuration:mysql_port}
mysql_superuser = root
mysql_superpassword =
# This is data only part of buildout for mysql with senna
# made by Leonardo Rochael Almeida <leorochael@gmail.com> (thanks!)
# Original place: https://svn.erp5.org/repos/public/experimental/mysqlsenna.buildout/
[buildout]
parts =
mysql-instance
[configuration]
mysql_port = 10002
mysql_host = 0.0.0.0
# below are candidates to be removed from global configuration
mysql_datadir = ${buildout:var-directory}/mysql
mysql_pid = ${:mysql_datadir}/mysql.pid
mysql_sock = ${:mysql_datadir}/mysql.sock
[mysql-instance]
depends =
${create-directories:command}
recipe = erp5.recipe.mysqlserver
mysql_software_bin = ${software_definition:mysql_software}/bin
mysql_bin_folder = ${buildout:data-bin-directory}
mysql_software_libexec = ${software_definition:mysql_software}/libexec
mysql_datadir = ${configuration:mysql_datadir}
mysql_auto_start = false
mysql_cnf_file = ${buildout:etc-directory}/my.cnf
# template related
mysql_port = ${configuration:mysql_port}
mysql_host = ${configuration:mysql_host}
mysql_datadir = ${configuration:mysql_datadir}
mysql_pid = ${configuration:mysql_pid}
mysql_sock = ${configuration:mysql_sock}
mysql_error_log = ${buildout:log-directory}/mysql.err.log
mysql_slow_query_log = ${buildout:log-directory}/mysql.slow.log
mysql_slow_query_time = 5
# Add some extra configuration to mysqld part in my.cnf
mysqld-extra-configuration =
supervisor-priority = 10
supervisor-program =
${:supervisor-priority} ${:_buildout_section_name_} (autorestart=true) ${:mysql_software_libexec}/mysqld [--defaults-file=${:mysql_cnf_file} --pid-file=${configuration:mysql_pid}]
[mysql-server-template]
<= mysql-instance
[buildout]
parts = oood-instance
[oood-instance]
depends =
${oood-directories:command}
recipe = erp5.recipe.ooodinstance
wrapper_path = ${buildout:data-bin-directory}/oood-runserw
oood_conf_file = ${buildout:etc-directory}/oood.conf
wrapper_part = oood-wrapper
configuration_part = oood-configuration
supervisor-priority = 20
supervisor-program =
${:supervisor-priority} ${:_buildout_section_name_} (autorestart=true stopsignal=TERM stopwaitsecs=30) ${buildout:data-bin-directory}/oood-runserw ${buildout:etc-directory}
[oood-wrapper]
openoffice_python = ${software_definition:openoffice_software}/program/python
oood_pid = ${oood-configuration:oood_run}/server_pid.lock
openoffice_uno = ${oood-configuration:openoffice_uno}
oood_software = ${oood-configuration:oood_software}
[oood-configuration]
oood_software = ${software_definition:oood_software}
oood_run = ${buildout:var-directory}/oood
oood_tmp = ${:oood_run}
oood_host = 127.0.0.1
oood_port = ${configuration:oood_port}
oood_pool_host = localhost
oood_pool_range_start = ${configuration:oood_pool_range_start}
oood_instance_load_time = 20
oood_instance_timeout = 360
oood_virtual_display_id = 99
openoffice_uno = ${software_definition:openoffice_software}/basis-link/program/
openoffice_program = ${software_definition:openoffice_software}/program
oood_log_file = ${buildout:log-directory}/oood.log
[configuration]
oood_port = 8008
oood_pool_range_start = 4060
[oood-directories]
recipe = plone.recipe.command
depends = ${create-directories:command}
command = mkdir -p ${oood-configuration:oood_run}
update-command = ${:command}
[conversion-server-template]
<= oood-instance
[buildout]
parts =
sphinx-instance
[configuration]
sphinx_address = 127.0.0.1
sphinx_port = 9312
sphinx_sql_port = 9306
# below are candidates to be removed from global configuration
sphinx_data_directory = ${buildout:var-directory}/sphinx
sphinx_log_directory = ${buildout:log-directory}
[sphinx-instance]
depends =
${create-directories:command}
recipe = erp5.recipe.sphinxserver
sphinx_software_bin = ${software_definition:sphinx_software}/bin
sphinx_bin_directory = ${buildout:data-bin-directory}
sphinx_data_directory = ${configuration:sphinx_data_directory}
sphinx_log_directory = ${configuration:sphinx_log_directory}
sphinx_conf_file = ${buildout:etc-directory}/sphinx.conf
# template related
sphinx_address = ${configuration:sphinx_address}
sphinx_port = ${configuration:sphinx_port}
sphinx_sql_port = ${configuration:sphinx_sql_port}
supervisor-priority = 30
supervisor-program =
${:supervisor-priority} ${:_buildout_section_name_} (autorestart=true stopsignal=TERM) ${buildout:data-bin-directory}/searchd [ --nodetach ]
[buildout]
parts =
supervisor-instance
extensions += erp5.extension.sectionextender
section-extender =
supervisor:programs supervisor-program
[configuration]
supervisor_port = 9001
supervisor_host = 127.0.0.1
[supervisor-instance]
depends =
${supervisor:recipe}
${create-directories:command}
recipe = plone.recipe.command
command =
ln -sf ${buildout:bin-directory}/supervisorctl ${buildout:data-bin-directory}/supervisorctl
ln -sf ${buildout:bin-directory}/supervisord ${buildout:data-bin-directory}/supervisord
ln -sf ${buildout:bin-directory}/pidproxy ${buildout:data-bin-directory}/pidproxy
[pidproxy]
# this should've been provided by collective.recipe.supervisor itself
recipe = zc.recipe.egg
eggs = supervisor
scripts = pidproxy
[supervisor]
supervisord-conf = ${buildout:etc-directory}/supervisord.conf
depends = ${pidproxy:recipe}
recipe = collective.recipe.supervisor
serverurl = http://${configuration:supervisor_host}:${configuration:supervisor_port}
pp = ${buildout:directory}/eggs/supervisor-3.0a7-py2.5.egg/supervisor/pidproxy.py
port = ${configuration:supervisor_host}:${configuration:supervisor_port}
# This configuration only contains a template part which should
# be instaciated by another recipe.
[test-instance-template]
recipe = erp5.recipe.testing
url = <Define it>
# This configuration only contains a template part which should
# be instaciated by another recipe.
[create-test-runner-place]
recipe = plone.recipe.command
command =
mkdir -p ${:test_runner_location}
mkdir -p ${:test_runner_location}/bt5
mkdir -p ${:test_runner_location}/import
update-command = ${:command}
test_runner_location = ${buildout:parts-directory}/test-runner
[test-runner-template]
recipe = erp5.recipe.testrunner
# For now it is required define location like this.
location = ${create-test-runner-place:test_runner_location}
# Extend products, bt5_path should be always defined
# when this template be used.
products =
${software_definition:products-zope}
bt5_path =
instance-home =
# MySQL
# below could be set in configuration
mysql_superuser = root
mysql_superpassword =
mysql_database_name = test
mysql_user = root
mysql_password =
mysql_host = 127.0.0.1
mysql_port = ${configuration:mysql_port}
erp5_sql_connection_string = ${:mysql_database_name}@${:mysql_host}:${:mysql_port} ${:mysql_user}
initialization =
import os
os.environ['PATH'] = ':'.join(['${buildout:data-bin-directory}','${buildout:bin-directory}'] + os.environ.get('PATH','').split(':'))
sys.argv.insert(1, '--conversion_server_port=${configuration:oood_port}')
# This file is an example that shows how to setup a ZEO server and
# several ZEO clients.
[buildout]
parts =
zeo-server
zeo-client-1
zeo-client-2
[zeo-server]
recipe = plone.recipe.zeoserver
zeo-address = 8100
eggs =
${eggs:eggs}
supervisor-priority = 20
supervisor-program =
${:supervisor-priority} ${:_buildout_section_name_} (stdout_logfile=NONE) ${buildout:parts-directory}/${:_buildout_section_name_}/bin/runzeo true
[zeo-client-template]
recipe = erp5.recipe.zope2instance
eggs = ${eggs:eggs}
extra-paths = ${eggs:extra-paths}
user = zope:zope
environment-vars =
PATH ${software_definition:software_home}/parts/imagemagick/bin:${software_definition:software_home}/parts/w3m/bin:${software_definition:software_home}/parts/xpdf/bin:${software_definition:software_home}/parts/ghostscript/bin:${software_definition:software_home}/parts/pdftk/bin:${software_definition:software_home}/parts/file/bin:${software_definition:software_home}/parts/graphviz/bin
LD_LIBRARY_PATH ${software_definition:software_home}/parts/file/lib
zope-conf-additional =
# Timerserver to have ticks in zope
%import timerserver
<timer-server>
interval 5
</timer-server>
zeo-client = on
zeo-address = ${zeo-server:zeo-address}
supervisor-priority = 30
supervisor-program =
${:supervisor-priority} ${:_buildout_section_name_} (stdout_logfile=NONE environment=LD_LIBRARY_PATH=${software_definition:software_home}/parts/file/lib) ${buildout:bin-directory}/runzope [-C ${buildout:parts-directory}/${:_buildout_section_name_}/etc/zope.conf] true
[zeo-client-1]
<= zeo-client-template
http-address = 9800
[zeo-client-2]
<= zeo-client-template
http-address = 9801
[buildout]
parts = zope-instance
[zope-instance]
recipe = erp5.recipe.zope2instance
eggs = ${eggs:eggs}
extra-paths = ${eggs:extra-paths}
user = zope:zope
environment-vars =
PATH ${software_definition:software_home}/parts/imagemagick/bin:${software_definition:software_home}/parts/w3m/bin:${software_definition:software_home}/parts/xpdf/bin:${software_definition:software_home}/parts/ghostscript/bin:${software_definition:software_home}/parts/pdftk/bin:${software_definition:software_home}/parts/file/bin:${software_definition:software_home}/parts/graphviz/bin
LD_LIBRARY_PATH ${software_definition:software_home}/parts/file/lib
zope-conf-additional =
# Timerserver to have ticks in zope
%import timerserver
<timer-server>
interval 5
</timer-server>
supervisor-priority = 30
supervisor-program =
${:supervisor-priority} ${:_buildout_section_name_} (stdout_logfile=NONE environment=LD_LIBRARY_PATH=${software_definition:software_home}/parts/file/lib) ${buildout:bin-directory}/runzope [-C ${buildout:parts-directory}/${:_buildout_section_name_}/etc/zope.conf] true
# this name is only for backward compatibility
[zope-instance-template]
<= zope-instance
[buildout]
parts = zope-instance
[zope-instance]
recipe = erp5.recipe.zope2instance
eggs = ${eggs:eggs}
extra-paths = ${eggs:extra-paths}
zope2-location = ${software_definition:zope_software}
user = zope:zope
environment-vars =
PATH ${software_definition:software_home}/parts/imagemagick/bin:${software_definition:software_home}/parts/w3m/bin:${software_definition:software_home}/parts/xpdf/bin:${software_definition:software_home}/parts/ghostscript/bin:${software_definition:software_home}/parts/pdftk/bin:${software_definition:software_home}/parts/file/bin:${software_definition:software_home}/parts/graphviz/bin
LD_LIBRARY_PATH ${software_definition:software_home}/parts/file/lib
zope-conf-additional =
# Timerserver to have ticks in zope
%import timerserver
<timer-server>
interval 5
</timer-server>
supervisor-priority = 30
supervisor-program =
${:supervisor-priority} ${:_buildout_section_name_} (stdout_logfile=NONE environment=LD_LIBRARY_PATH=${software_definition:software_home}/parts/file/lib) ${buildout:parts-directory}/${:_buildout_section_name_}/bin/runzope true
# this name is only for backward compatibility
[zope-instance-template]
<= zope-instance
# Independent profile (disconnect from others) which can be used to
# create private business template repositories. This profile is
# experimental and we highly recommend use default repositories.
[buildout]
extends =
versions-common.cfg
software-definition.cfg
common.cfg
parts = bt5
[bt5]
recipe = erp5.recipe.btrepository
preserve-download = 0
url =
https://svn.erp5.org/repos/public/erp5/trunk/products/ERP5/bootstrap/
https://svn.erp5.org/repos/public/erp5/trunk/bt5
download-command-extra = -r ${versions:erp5_bt5_revision}
# Use svn compiled from software.
svn-params = --trust-server-cert --non-interactive --quiet
download-command = ${software_definition:software_home}/parts/subversion/bin/svn co ${:svn-params}
# Common configuration for public erp5 code (business templates and products).
# it also defines standard repository sources (find-link) and default structure
# parts (create-directories).
[buildout]
extends = links.cfg
[itools]
# This part should not contain contain dependencies to other parts and should
# contain only paths relative to software_home as it will be used directly by
# instances. It should probably be moved to a .cfg file inside
# "instance-profiles"
pkgname = itools-0.50.8
location = ${software_definition:software_home}/parts/itools
lib = ${:location}/lib
source = ${:location}/src
[create-directories]
recipe = plone.recipe.command
command =
mkdir -p ${buildout:etc-directory}
mkdir -p ${buildout:var-directory}
mkdir -p ${buildout:log-directory}
mkdir -p ${buildout:data-bin-directory}
update-command = ${:command}
[instance_template]
recipe = collective.recipe.template
input = inline:
[buildout]
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
[software_definition]
software_home = ${software_definition:software_home}
mysql_software = ${software_definition:mysql_software}
output = ${buildout:directory}/instance.inc
# This Configuration file is used to to define a standard deployment, without
# any create instances. This should create the basic services required for run
# one ERP5 instance, like MySQL server, CloudOoo and so on. For use this
# configuration # it is required build a software home previously.
[buildout]
extends =
../instance-profiles/apache.cfg
../instance-profiles/cloudooo.cfg
../instance-profiles/kumo.cfg
../instance-profiles/kvm.cfg
../instance-profiles/memcached.cfg
../instance-profiles/mysql-database.cfg
../instance-profiles/mysql.cfg
../instance-profiles/sphinx.cfg
../instance-profiles/supervisor.cfg
../instance-profiles/testing.cfg
../instance-profiles/testrunner.cfg
../instance-profiles/zeo.cfg
../instance-profiles/zope-2.12.cfg
common.cfg
software-definition.cfg
versions-2.12.cfg
parts =
eggs
mysql-instance
cloudooo-instance
supervisor-instance
memcached-instance
versions = versions
[eggs]
recipe = zc.recipe.egg
scripts =
mkzopeinstance
runzope
runzeo
eggs =
Products.ExternalEditor
lxml
MySQL_python
python_ldap
PyXML
SOAPpy
cElementTree
chardet
elementtree
erp5diff
ipdb
mechanize
numpy
ordereddict
pycrypto
paramiko
ply
pysvn
python-magic
python-memcached
pytz
threadframe
timerserver
urlnorm
uuid
xml_marshaller
xupdate_processor
feedparser
# Zope 2.12 with patched acquisition
Zope2
Acquisition
# Other Zope 2 packages
Products.PluggableAuthService
Products.PluginRegistry
# CMF 2.2
Products.CMFActionIcons
Products.CMFCalendar
Products.CMFCore
Products.CMFDefault
Products.CMFTopic
Products.CMFUid
Products.DCWorkflow
Products.GenericSetup
five.localsitemanager
# Other products
Products.DCWorkflowGraph
Products.MimetypesRegistry
Products.ExternalEditor
Products.Zelenium
# Currently forked in our repository
# Products.PortalTransforms
# Dependency for our fork of PortalTransforms
StructuredText
extra-paths =
${itools:lib}
#[software-links]
#recipe = plone.recipe.command
#command =
# ln -sf ${software_definition:software_home}/bin/python2.4 ${buildout:bin-directory}/python2.4
# ln -sf ${software_definition:software_home}/bin/ipython2.4 ${buildout:bin-directory}/ipython2.4
#update-command = ${:command}
[buildout]
extends = minimal.cfg
parts +=
# zope-instance
# This Configuration file is used to to define a standard deployment, without
# any create instances. This should create the basic services required for run
# one ERP5 instance, like MySQL server, Oood and so on. For use this configuration
# it is required build a software home previously.
[buildout]
extends =
../instance-profiles/apache.cfg
../instance-profiles/kumo.cfg
../instance-profiles/memcached.cfg
../instance-profiles/mysql-database.cfg
../instance-profiles/mysql.cfg
../instance-profiles/sphinx.cfg
../instance-profiles/cloudooo.cfg
../instance-profiles/supervisor.cfg
../instance-profiles/zope.cfg
../instance-profiles/kvm.cfg
../instance-profiles/testrunner.cfg
../instance-profiles/testing.cfg
software-definition.cfg
versions.cfg
common.cfg
parts =
eggs
software-links
mysql-instance
cloudooo-instance
supervisor-instance
memcached-instance
versions = versions
[eggs]
recipe = zc.recipe.egg
eggs =
itools
MySQL_python
python_ldap
pysvn
ClientForm
PyXML
SOAPpy
cElementTree
chardet
ctypes
elementtree
erp5.recipe.mysqldatabase
erp5diff
ipdb
lxml
mechanize
numpy
ordereddict
pycrypto
paramiko
ply
python-ldap
python-magic
python-memcached
pytz
simplejson
threadframe
timerserver
urlnorm
uuid
xml_marshaller
xupdate_processor
feedparser
extra-paths =
${software_definition:zope_software}/lib/python
[software-links]
recipe = plone.recipe.command
command =
ln -sf ${software_definition:software_home}/bin/python2.4 ${buildout:bin-directory}/python2.4
update-command = ${:command}
[software_definition]
software_home = /opt/erp5/trunk
executable = ${:software_home}/bin/python2.4
zope_software = ${:software_home}/parts/zope-2.8
products-zope = ${:zope_software}/lib/python/Products
# This Configuration file is used to create a standard instance for developers.
# You should build a software home before use this recipe.
[buildout]
extends =
bt5.cfg
deployment-2.12.cfg
parts +=
development-site
runUnitTest
[configuration]
development_site_products =
${software_definition:products-erp5}
${software_definition:products-erp5-development}
${software_definition:products-deps}
development_site_instancehome = ${buildout:parts-directory}/development-site
[software_definition]
software_home = ${buildout:directory}
[runUnitTest]
<= test-runner-template
eggs = ${development-site:eggs}
extra-paths = ${development-site:extra-paths}
products = ${configuration:development_site_products}
instance-home = ${configuration:development_site_instancehome}
mysql_create_database = false
mysql_database_name = test212
mysql_user = test
[development-site]
<= zope-instance-template
instancehome = ${configuration:development_site_instancehome}
http-address = 18080
debug-mode = on
verbose-security = on
# until we will have more control over products we need to redefine to insert
# local products to be able to override
products =
${:instancehome}/Products/
${configuration:development_site_products}
# This Configuration file is used to create a standard instance for developers.
# You should build a software home before use this recipe.
[buildout]
extends =
bt5.cfg
deployment.cfg
parts +=
development-site
runUnitTest
[configuration]
development_site_products =
${software_definition:products-zope}
${software_definition:products-erp5}
${software_definition:products-erp5-development}
${software_definition:products-deps}
${software_definition:products-other}
${software_definition:products-cmf15}
development_site_instancehome = ${buildout:parts-directory}/development-site
[runUnitTest]
<= test-runner-template
eggs = ${development-site:eggs}
extra-paths = ${development-site:extra-paths}
products = ${configuration:development_site_products}
instance-home = ${configuration:development_site_instancehome}
[development-site]
<= zope-instance-template
instancehome = ${configuration:development_site_instancehome}
http-address = 18080
debug-mode = on
verbose-security = on
# until we will have more control over products we need to redefine to insert
# local products to be able to override
products =
${:instancehome}/Products/
${configuration:development_site_products}
[buildout]
find-links =
http://download.zope.org/distribution/
http://download.hforge.org/itools/0.20/
http://download.hforge.org/itools/
http://dist.repoze.org
http://www.nexedi.org/static/packages/source/
# Minimial configuration
# Generates minimal ERP5 software without any dependencies, only products used
# in Zope
[buildout]
extends =
versions.cfg
../software-profiles/erp5.cfg
../instance-profiles/zope.cfg
parts =
cmf15
itools
products-other
products-deps
products-erp5
[buildout]
extends =
versions-2.12.cfg
software-definition.cfg
../software-profiles/apache.cfg
common.cfg
software-common.cfg
../software-profiles/products-erp5.cfg
../software-profiles/erp5-2.12.cfg
../software-profiles/file.cfg
../software-profiles/fonts.cfg
../software-profiles/garbage-collector.cfg
../software-profiles/graphviz.cfg
../software-profiles/tokyocabinet.cfg
../software-profiles/haproxy.cfg
../software-profiles/hookbox.cfg
../software-profiles/imagemagick.cfg
../software-profiles/kumo.cfg
../software-profiles/ghostscript.cfg
../software-profiles/libevent.cfg
../software-profiles/libpng.cfg
../software-profiles/libtool.cfg
../software-profiles/m2crypto.cfg
../software-profiles/mariadb.cfg
../software-profiles/memcached.cfg
../software-profiles/messagepack.cfg
../software-profiles/mysql-tritonn-5.0.cfg
../software-profiles/sphinx.cfg
../software-profiles/stunnel.cfg
../software-profiles/w3-validator.cfg
../software-profiles/libreoffice-bin.cfg
../software-profiles/python-2.6.cfg
../software-profiles/python-2.7.cfg
../software-profiles/rdiff-backup.cfg
../software-profiles/w3m.cfg
../software-profiles/varnish.cfg
../software-profiles/xorg.cfg
../software-profiles/xpdf.cfg
../software-profiles/tesseract.cfg
versions = versions
parts =
itools-build
rdiff-backup
apache
file
graphviz
memcached
haproxy
varnish
varnish-2.1
stunnel
w3m
xpdf
libpng12
ghostscript
mysql-tritonn-5.0
mariadb
sphinx
imagemagick
kumo
messagepack
w3-validator
libreoffice-bin
eggs
tesseract-eng-traineddata-unzip
tesseract
hookbox
# omelette
bootstrap2.6
precache-eggs
instance_template
# basic Xorg
libXdmcp
libXext
libXau
libX11
# fonts
liberation-fonts
ipaex-fonts
# Zope products
products-deps
products-erp5
products-erp5-development
[bootstrap2.6]
python = python2.6
[rebootstrap]
# This is first version of python
version = 2
section = python2.7
[software_definition]
software_home = ${buildout:directory}
[buildout]
extends =
versions.cfg
software-definition.cfg
../software-profiles/apache.cfg
common.cfg
software-common.cfg
../software-profiles/products-erp5.cfg
../software-profiles/erp5.cfg
../software-profiles/file.cfg
../software-profiles/fonts.cfg
../software-profiles/garbage-collector.cfg
../software-profiles/graphviz.cfg
../software-profiles/tokyocabinet.cfg
../software-profiles/haproxy.cfg
../software-profiles/imagemagick.cfg
../software-profiles/kumo.cfg
../software-profiles/ghostscript.cfg
../software-profiles/libevent.cfg
../software-profiles/libpng.cfg
../software-profiles/libtool.cfg
../software-profiles/m2crypto.cfg
../software-profiles/mariadb.cfg
../software-profiles/memcached.cfg
../software-profiles/messagepack.cfg
../software-profiles/mysql-tritonn-5.0.cfg
../software-profiles/sphinx.cfg
../software-profiles/stunnel.cfg
../software-profiles/w3-validator.cfg
../software-profiles/libreoffice-bin.cfg
../software-profiles/python-2.4.cfg
../software-profiles/python-2.7.cfg
../software-profiles/rdiff-backup.cfg
../software-profiles/w3m.cfg
../software-profiles/varnish.cfg
../software-profiles/xorg.cfg
../software-profiles/xpdf.cfg
../software-profiles/tesseract.cfg
../software-profiles/zope-2.8.cfg
versions = versions
parts =
eggs
rdiff-backup
apache
file
graphviz
memcached
haproxy
varnish
varnish-2.1
stunnel
w3m
xpdf
libpng12
ghostscript
mysql-tritonn-5.0
mariadb
sphinx
imagemagick
kumo
messagepack
zope-2.8
cmf15
itools
bootstrap2.4
mysql-python
w3-validator
tesseract-eng-traineddata-unzip
tesseract
libreoffice-bin
precache-eggs
pythonbin2.4
bootstrap2.4
instance_template
# basic Xorg
libXdmcp
libXext
libXau
libX11
# fonts
liberation-fonts
ipaex-fonts
# Zope products
products-deps
products-erp5
products-erp5-development
products-other
[bootstrap2.4]
python = python2.4
[rebootstrap]
# This is first version of python
version = 2
section = python2.7
[software_definition]
software_home = ${buildout:directory}
# as mysql-python part, which uses mysql-python-env is not depending directly
# on mysql-tritonn-5.0 part, but official buildout shall provide whole software
# set dependency here
# Thanks to this it is possible to build mysql-python part in own environment
# with local mysql, but by default buildout mysql will be used.
mysql_software = ${mysql-tritonn-5.0:location}
#executable = ${python2.4:executable}
# Define executable to script generated by buildout. This variable is used by
# instance setups as standard executable because all eggs are available only
# by this script and not into the binary.
executable = ${:software_home}/bin/python2.4
[buildout]
extensions =
slapos.rebootstrap
slapos.tool.networkcache
slapos.zcbworkarounds
mr.developer
buildout.dumppickedversions
dump-picked-versions-file = dumped-versions.cfg
overwrite-picked-versions-file = true
[precache-eggs]
# Part to populate the egg cache during software-home build, so instances can
# run in offline mode. Hence, no scripts
recipe = zc.recipe.egg
scripts =
eggs =
cloudooo
cloudooo.handler.ffmpeg
cloudooo.handler.imagemagick
cloudooo.handler.ooo
cloudooo.handler.pdf
collective.recipe.supervisor
collective.recipe.template
erp5.conflictresolver
erp5.recipe.apache
erp5.recipe.cloudoooinstance
erp5.recipe.genbt5list
erp5.recipe.btrepository
erp5.recipe.memcachedserver
erp5.recipe.mysqldatabase
erp5.recipe.mysqlserver
erp5.recipe.ooodinstance
erp5.recipe.sphinxserver
erp5.recipe.testrunner
erp5.recipe.zope2instance
erp5.extension.sectionextender
plone.recipe.command
supervisor
z3c.recipe.mkdir
# Standard definition of where the softwares are located, this information
# is used when build appliacations instances.
[buildout]
var-directory = ${:directory}/var
etc-directory = ${:var-directory}/etc
log-directory = ${:var-directory}/log
run-directory = ${:var-directory}/run
data-bin-directory = ${:var-directory}/bin
[software_definition]
mysql_software = ${:software_home}/parts/mysql-tritonn-5.0
sphinx_software = ${:software_home}/parts/sphinx
openoffice_software = ${:software_home}/parts/libreoffice-bin
products-erp5 = ${:software_home}/parts/products-erp5
products-erp5-development = ${:software_home}/parts/products-erp5-development
products-deps = ${:software_home}/parts/products-deps
products-other = ${:software_home}/parts/products-other/Products
products-cmf15 = ${:software_home}/parts/cmf15
[buildout]
extends = ../instance-profiles/cloudooo.cfg
[buildout]
extends = minimal.cfg
parts +=
# zope-instance
# Configuration file for create a test envionment, this should
# contains everything required (including dependencies) to run
# all unit tests. For use this build software in advance.
[buildout]
extends = development.cfg
parts =
products-erp5
products-erp5-development
mysql-instance
oood-instance
supervisor-instance
runUnitTest
[mysql-instance]
mysql_auto_start = true
[software_definition]
products-erp5 = ${buildout:directory}/parts/products-erp5
products-erp5-development = ${buildout:directory}/parts/products-erp5-development
[configuration]
mysql_port = 43306
oood_port = 48011
oood_pool_range_start = 44063
oood_virtual_display_id = 91
supervisor_port = 49004
# Packages versions specific for Zope 2.12 flavour
[buildout]
extends =
http://svn.zope.org/repos/main/Zope/tags/2.12.17/versions.cfg
versions-common.cfg
[versions]
# pin Acquisition and Products.DCWorkflow to Nexedi flavour of eggs
Acquisition = 2.13.7nxd001
Products.DCWorkflow = 2.2.1nxd001
# Common packages versions for all flavours
[versions]
# XXX refactor parts shared with versions.cfg into a common file
erp5_bt5_revision = ${:erp5_products_revision}
erp5_products_revision = HEAD
numpy = 1.3.0
# Patched version which support python 2.6
PyXML = 0.8.4nxd001
# modified version that works fine for buildout installation
SOAPpy = 0.12.0nxd001
# we are still using this old stable version.
rdiff-backup = 1.0.5
# special version of z3c.recipe.openoffice with architecture autodetection
z3c.recipe.openoffice = 0.3.1dev4
# Zope Known Good Set is incompatible with buildout 1.5.0 in case of
# distribute and zc.buildout, and as ERP5 Appliance trunk wants to use
# the newest versions of buildout infrastructure clear the pin
distribute =
zc.buildout =
setuptools =
# official pysvn egg does not supports --include-dirs and
# --library-dirs, so we use our modified version
pysvn = 1.7.4nxd006
# - several bug fixes
# - support ipv6
# - normalization improvements
urlnorm >= 1.1.2
# Packages versions specific for Zope 2.8 flavour
[buildout]
extends = versions-common.cfg
[versions]
# 0.20.8 is the latest version of itools that works with python-2.4.
itools = 0.20.8
# we sometimes have troubles with downloading alpha/beta version of
# lxml, and this is the lates stable version.
lxml = 2.2.8
# official pysvn egg does not work with zc.recipe.egg, so we use our
# modified version
#pysvn = 1.7.2
# zc.recipe.egg is pinned as this is known compatible versions with
zc.recipe.egg = 1.2.2
# erp5.recipe.zope2instance 2.x is for Zope-2.12 or later
erp5.recipe.zope2instance = 1.3.1
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved.
# Lukasz Nowak <luke@nexedi.com>
# Romain Courteaud <romain@nexedi.com>
# Rafael Monnerat <rafael@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.
#
##############################################################################
""" Run this test at software built folder.
cd software
python path/to/assertInstance.py
"""
import signal
import pexpect, time
import os
import unittest
import subprocess
import shutil
class TimeoutException(Exception):
pass
class SubFailed(Exception):
pass
def callWithTimeout(command_list, timeout=60, cwd=None,
input_list=None):
output = []
def timeout_handler(signum, frame):
raise TimeoutException()
old_handler = signal.signal(signal.SIGALRM, timeout_handler)
signal.signal(signal.SIGALRM, timeout_handler)
signal.alarm(timeout)
command = None
try:
try:
returncode = None
command = pexpect.spawn(" ".join(command_list), timeout=timeout, cwd=cwd)
isalive = True
while isalive:
if input_list is not None:
for input in input_list:
command.expect(input[0])
command.sendline(input[1])
time.sleep(1)
line = command.readline()
if line:
line = line[:-1]
l = line.rstrip('\n').rstrip('\r')
print l
output.append(l)
isalive = command.isalive()
for line in command.readlines():
print line
output.append(l)
command.close()
returncode = command.exitstatus
except TimeoutException:
returncode = 1
command.close()
finally:
if command is not None:
command.kill(signal.SIGKILL)
signal.signal(signal.SIGALRM, old_handler)
signal.alarm(0)
if returncode != 0:
raise SubFailed, "%s %s" % (returncode, command_list)
return returncode, "\n".join(output)
class AssertDefaultERP5Instance26(unittest.TestCase):
instance_path = os.path.join(os.getcwd(),".instance_test")
software_path = os.getcwd()
extends_cache = os.path.join(os.getcwd(),"extends-cache")
instance_buildout = """[buildout]
extends-cache = %(extends_cache)s
offline = true
extends =
%(instance_profile_url)s
%(instance_template_file)s
parts =
mysql-instance
cloudooo-instance
supervisor-instance
runUnitTest
development-site
[configuration]
supervisor_port = 19999
mysql_port = 19998
oood_port = 19997
[development-site]
http-address = 19996
"""
instance_profile_url = 'https://svn.erp5.org/repos/public/erp5/trunk/buildout/profiles/development-2.12.cfg'
binary_bootstrap_file_name = 'bootstrap2.6'
def assertRelativePathExists(self,relative_list):
path_list = [self.instance_path]
path_list.extend(relative_list)
self.assertTrue(os.path.exists(os.path.join(*path_list)))
def test(self):
if not os.path.exists(self.instance_path):
mkdir = ['mkdir', self.instance_path]
callWithTimeout(mkdir)
self.assertTrue(os.path.exists(self.instance_path))
# Create buildout profile
instance_kw = dict(
instance_profile_url = self.instance_profile_url,
extends_cache = self.extends_cache,
instance_template_file = os.path.join(self.software_path, 'instance.inc')
)
file(os.path.join(self.instance_path, 'buildout.cfg'), 'w').write(
self.instance_buildout % instance_kw)
# Bootstrap instance
instance_bootstrap = [os.path.join(self.software_path, 'bin' , self.binary_bootstrap_file_name)]
callWithTimeout(instance_bootstrap, cwd=self.instance_path)
self.assertRelativePathExists(['bin', 'buildout'])
# Run instance buildout
callWithTimeout([os.path.join(self.instance_path, 'bin', 'buildout')], cwd=self.instance_path)
self.assertRelativePathExists(['var'])
self.assertRelativePathExists(['var', 'development-site'])
self.assertRelativePathExists(['var', 'bin', 'supervisord'])
self.assertRelativePathExists(['var', 'bin', 'mysql'])
self.assertRelativePathExists(['var', 'bin', 'cloudoooctl'])
# Start supervisor in foreground mode and have control over its process
# as in the end it have to be cleanly shutdown
supervisord_command = [os.path.join(self.instance_path, 'bin', 'supervisord'),
'-n']
supervisord_popen = subprocess.Popen(supervisord_command, cwd=self.instance_path)
supervisord_popen.poll()
# Wait 10 seconds, to give supervisord chance to start required services
time.sleep(10)
try:
mysql_command = [os.path.join(self.instance_path, 'var', 'bin', 'mysql'),
'-h', '127.0.0.1', '-u', 'root']
callWithTimeout(mysql_command,
cwd=self.instance_path, input_list=[
("mysql> ", "create database development_site;"),
("mysql> ", "grant all privileges on development_site.* to "
"'development_user'@'localhost' identified by "
"'development_password';"),
("mysql> ", "grant all privileges on development_site.* to "
"'development_user'@'127.0.0.1' identified by "
"'development_password';"),
("mysql> ", "create database test212;"),
("mysql> ", "grant all privileges on test212.* to "
"'test'@'localhost';"),
("mysql> ", "grant all privileges on test212.* to "
"'test'@'127.0.0.1';"),
("mysql> ", "exit")])
# Run a test from readme
test_run_command = [os.path.join(self.instance_path, 'bin', 'runUnitTest'),
'testClassTool']
returncode, output = callWithTimeout(test_run_command,
timeout=1200,
cwd=self.instance_path)
self.assertEquals(output.split("\n")[-1], 'OK')
bt5_directory = os.path.join(self.instance_path, 'bt5')
try:
svn = os.path.join(self.software_path, 'parts', 'subversion', 'bin', 'svn')
if not os.path.exists(bt5_directory):
os.mkdir(bt5_directory)
# Get needed business template
for bt5 in ['erp5_base', 'erp5_ingestion', 'erp5_ingestion_mysql_'
'innodb_catalog', 'erp5_web', 'erp5_dms', 'erp5_full_text_myisam_catalog']:
callWithTimeout([svn, 'export', '--non-interactive',
'--trust-server-cert',
'https://svn.erp5.org/repos/public/erp5/trunk/bt5/' + bt5,
os.path.join(bt5_directory, bt5)], timeout=600)
# Check that catalog is working
for test in ['testERP5Catalog.TestERP5Catalog.'
'test_04_SearchFolderWithDeletedObjects',
'testDms.TestDocument.'
'testOOoDocument_get_size']:
test_run_command = [os.path.join(self.instance_path, 'bin', 'runUnitTest'),
'--bt5_path=%s/bt5' % self.instance_path, test]
returncode, output = \
callWithTimeout(test_run_command, timeout=1200,cwd=self.instance_path)
self.assertEquals(output.split("\n")[-1], 'OK')
finally:
if os.path.exists(bt5_directory):
shutil.rmtree(bt5_directory)
finally:
# Stop supervisor
while supervisord_popen.poll() is None:
# send SIGKILL
supervisord_popen.terminate()
# give some time to terminate services
time.sleep(5)
callWithTimeout(["rm -rf", self.instance_path])
if __name__ == '__main__':
unittest.main()
import unittest
import uno
class AssertOpenOfficeSoftware(unittest.TestCase):
""" tests try some connection and call some methods from uno"""
def test_simple_connection(self):
localContext = uno.getComponentContext()
resolver = localContext.ServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", localContext )
self.assertNotEquals(None, resolver)
remoteContext = resolver.resolve("uno:socket,host=localhost,port=8100;urp;StarOffice.ComponentContext")
self.assertNotEquals(None, remoteContext)
self.assertNotEquals(None, remoteContext.ServiceManager)
some_filter = remoteContext.ServiceManager.createInstance("com.sun.star.document.FilterFactory")
self.assertNotEquals(None, some_filter)
type_service = remoteContext.ServiceManager.createInstance("com.sun.star.document.TypeDetection")
self.assertNotEquals(None, type_service)
if __name__ == '__main__':
unittest.main()
##############################################################################
#
# 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.
#
##############################################################################
import os
import subprocess
from glob import glob
import unittest
from distutils import util
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
# checking if Zope-2.8 flavour or Zope-2.12 flavour
# BBB it is adhoc, but all tests in this file will be soon merged into
# each buildout configuration.
parts_dir = os.path.join(os.path.abspath(os.curdir), 'parts')
if os.path.exists('%s/zope-2.8' % parts_dir):
python_version = '2.4'
else:
python_version = '2.6'
# List of libraries which are acceptable to be linked in globally
ACCEPTABLE_GLOBAL_LIB_LIST = (
# 32 bit Linux
'/usr/lib/libstdc++.so',
'/lib/libgcc_s.so',
'/lib/ld-linux.so',
'/lib/libc.so',
'/lib/libcrypt.so',
'/lib/libdl.so',
'/lib/libm.so',
'/lib/libnsl.so',
'/lib/libpthread.so',
'/lib/libresolv.so',
'/lib/librt.so',
'/lib/libutil.so',
# i686 Mandriva
'/lib/i686/libgcc_s.so',
'/lib/i686/ld-linux.so',
'/lib/i686/libc.so',
'/lib/i686/libcrypt.so',
'/lib/i686/libdl.so',
'/lib/i686/libm.so',
'/lib/i686/libnsl.so',
'/lib/i686/libpthread.so',
'/lib/i686/libresolv.so',
'/lib/i686/librt.so',
# i686 debian
'/lib/tls/i686/cmov/libc.so',
'/lib/tls/i686/cmov/libcrypt.so',
'/lib/tls/i686/cmov/libdl.so',
'/lib/tls/i686/cmov/libm.so',
'/lib/tls/i686/cmov/libnsl.so',
'/lib/tls/i686/cmov/libpthread.so',
'/lib/tls/i686/cmov/libresolv.so',
'/lib/tls/i686/cmov/librt.so',
'/lib/tls/i686/cmov/libutil.so',
# 64 bit Linux
'/lib64/libgcc_s.so',
'/usr/lib64/libstdc++.so',
'/lib64/ld-linux-x86-64.so',
'/lib64/libc.so',
'/lib64/libcrypt.so',
'/lib64/libdl.so',
'/lib64/libm.so',
'/lib64/libnsl.so',
'/lib64/libpthread.so',
'/lib64/libresolv.so',
'/lib64/librt.so',
'/lib64/libutil.so',
# Arch independed Linux
'linux-gate.so',
'linux-vdso.so',
)
IGNORABLE_LINKED_LIB_LIST = (
'libdl',
)
SKIP_PART_LIST = (
'parts/boost-lib-download',
'parts/mariadb__compile__',
'parts/libreoffice-bin',
'parts/libreoffice-bin__unpack__',
'parts/products-erp5',
)
def readElfAsDict(f):
"""Reads ELF information from file"""
popen = subprocess.Popen(['readelf', '-d', os.path.join(*f.split('/'))],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
result = popen.communicate()[0]
if popen.returncode != 0:
raise AssertionError(result)
library_list = []
rpath_list = []
runpath_list = []
for l in result.split('\n'):
if '(NEEDED)' in l:
library_list.append(l.split(':')[1].strip(' []').split('.so')[0])
elif '(RPATH)' in l:
rpath_list = [q.rstrip('/') for q in l.split(':',1)[1].strip(' []').split(':')]
elif '(RUNPATH)' in l:
runpath_list = [q.rstrip('/') for q in l.split(':',1)[1].strip(' []').split(':')]
if len(runpath_list) == 0:
runpath_list = rpath_list
elif len(rpath_list) != 0 and runpath_list != rpath_list:
raise ValueError('RPATH and RUNPATH are different.')
return dict(
library_list=sorted(library_list),
runpath_list=sorted(runpath_list)
)
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 or 'cannot read header' 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)
elif 'warning: you do not have execution permission for' in line:
pass
elif 'No such file or directory' in line:
# ignore broken links
pass
elif line:
# /lib64/ld-linux-x86-64.so.2 (0x00007f77fd400000)
a(line.split()[0])
return link_list
class AssertSoftwareMixin(unittest.TestCase):
def getDevelopEggName(self, name, version):
return '%s-%s-py%s-%s.egg' % (name, version, python_version,
util.get_platform())
def assertEqual(self, first, second, msg=None):
try:
return unittest.TestCase.assertEqual(self, first, second, msg=msg)
except unittest.TestCase.failureException:
if isinstance(first, list) and \
isinstance(second, list):
err = ''
for elt in first:
if elt not in second:
err += '- %s\n' % elt
for elt in second:
if elt not in first:
err += '+ %s\n' % elt
if err == '':
raise
else:
if msg:
msg = '%s: Lists are different:\n%s' % (msg, err)
else:
msg = 'Lists are different:\n%s' % err
raise unittest.TestCase.failureException, msg
else:
raise
def assertLibraryList(self, path, library_list=None, software_list=None,
additional_runpath_list=None):
parts_name = getattr(self, 'parts_name', 'parts')
elf_dict = readElfAsDict(path)
if library_list is not None:
expected_library_list = elf_dict['library_list']
for lib in IGNORABLE_LINKED_LIB_LIST:
if lib in library_list:
library_list.remove(lib)
if lib in expected_library_list:
expected_library_list.remove(lib)
self.assertEqual(sorted(library_list), expected_library_list, path)
if software_list is not None:
soft_dir = os.path.join(os.path.abspath(os.curdir), parts_name)
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)
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
class AssertSoftwareRunable(AssertSoftwareMixin):
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'))
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 ('))
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_rdiff_backup(self):
stdout, stderr = subprocess.Popen(["bin/rdiff-backup", "-V"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
self.assertEqual(stderr, '')
self.assertEqual(stdout.strip(), 'rdiff-backup 1.0.5')
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)
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.3'))
class AssertMysql50Tritonn(AssertSoftwareMixin):
def test_ld_mysqld(self):
self.assertLibraryList('parts/mysql-tritonn-5.0/libexec/mysqld', [
'libc',
'libcrypt',
'libcrypto',
'libdl',
'libgcc_s',
'libm',
'libnsl',
'libpthread',
'librt',
'libsenna',
'libssl',
'libstdc++',
'libz',
], [
'ncurses',
'openssl',
'readline',
'senna',
'zlib',
])
def test_ld_mysqlmanager(self):
self.assertLibraryList('parts/mysql-tritonn-5.0/libexec/mysqlmanager', [
'libc',
'libcrypt',
'libcrypto',
'libgcc_s',
'libm',
'libnsl',
'libpthread',
'libssl',
'libstdc++',
'libz',
], [
'ncurses',
'zlib',
'readline',
'openssl',
])
def test_ld_libmysqlclient_r(self):
self.assertLibraryList('parts/mysql-tritonn-5.0/lib/mysql/libmysqlclient_r.so', [
'libc',
'libcrypt',
'libcrypto',
'libm',
'libnsl',
'libpthread',
'libssl',
'libz',
], [
'ncurses',
'openssl',
'readline',
'zlib',
])
def test_ld_libmysqlclient(self):
self.assertLibraryList('parts/mysql-tritonn-5.0/lib/mysql/libmysqlclient.so', [
'libc',
'libcrypt',
'libcrypto',
'libm',
'libnsl',
'libssl',
'libz',
], [
'ncurses',
'openssl',
'readline',
'zlib',
])
def test_ld_sphinx(self):
self.assertLibraryList('parts/mysql-tritonn-5.0/lib/mysql/sphinx.so', [
'libc',
'libcrypt',
'libgcc_s',
'libm',
'libnsl',
'libpthread',
'libstdc++',
], [
'ncurses',
'openssl',
'readline',
'zlib',
])
def test_ld_mysql(self):
self.assertLibraryList('parts/mysql-tritonn-5.0/bin/mysql', [
'libc',
'libcrypt',
'libcrypto',
'libgcc_s',
'libm',
'libmysqlclient',
'libncurses',
'libnsl',
'libreadline',
'libssl',
'libstdc++',
'libz',
], [
'ncurses',
'zlib',
'readline',
'openssl',
], [os.path.join(os.path.abspath(os.curdir),
'parts', 'mysql-tritonn-5.0', 'lib', 'mysql')])
def test_ld_mysqladmin(self):
self.assertLibraryList('parts/mysql-tritonn-5.0/bin/mysqladmin', [
'libc',
'libcrypt',
'libcrypto',
'libgcc_s',
'libm',
'libmysqlclient',
'libnsl',
'libssl',
'libstdc++',
'libz',
], [
'ncurses',
'openssl',
'readline',
'zlib',
], [os.path.join(os.path.abspath(os.curdir),
'parts', 'mysql-tritonn-5.0', 'lib', 'mysql')])
def test_ld_mysqldump(self):
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')])
class AssertMariadb(AssertSoftwareMixin):
def test_ld_mysqld(self):
self.assertLibraryList('parts/mariadb/libexec/mysqld', ['libc', 'libcrypt', 'libdl', 'libgcc_s', 'libm', 'libnsl',
'libpthread', 'librt', 'libstdc++', 'libz'], ['ncurses', 'zlib', 'readline'])
def test_ld_mysqlmanager(self):
self.assertLibraryList('parts/mariadb/libexec/mysqlmanager', ['libc', 'libcrypt', 'libdl', 'libgcc_s', 'libm', 'libnsl',
'libpthread', 'librt', 'libstdc++', 'libz'], ['ncurses', 'zlib', 'readline'])
def test_ld_libmysqlclient_r(self):
self.assertLibraryList('parts/mariadb/lib/mysql/libmysqlclient_r.so', ['libc', 'libdl', 'librt', 'libz', 'libcrypt', 'libm', 'libnsl', 'libpthread'], ['ncurses', 'zlib', 'readline'])
def test_ld_libmysqlclient(self):
self.assertLibraryList('parts/mariadb/lib/mysql/libmysqlclient.so', ['libc', 'libdl', 'librt', 'libz', 'libcrypt', 'libm', 'libnsl', 'libpthread'], ['ncurses', 'readline', 'zlib'])
def test_ld_mysql(self):
self.assertLibraryList('parts/mariadb/bin/mysql', ['libc', 'libdl', 'librt', 'libz', 'libcrypt', 'libgcc_s', 'libm',
'libmysqlclient', 'libncursesw', 'libnsl', 'libpthread', 'libreadline',
'libstdc++'], ['ncurses', 'zlib', 'readline'],
[os.path.join(os.path.abspath(os.curdir),
'parts', 'mariadb', 'lib', 'mysql')])
def test_ld_mysqladmin(self):
self.assertLibraryList('parts/mariadb/bin/mysqladmin', ['libc', 'libdl', 'librt', 'libz', 'libcrypt', 'libgcc_s', 'libm',
'libmysqlclient', 'libnsl', 'libpthread', 'libstdc++'], ['ncurses', 'zlib', 'readline'],
[os.path.join(os.path.abspath(os.curdir),
'parts', 'mariadb', 'lib', 'mysql')])
def test_ld_mysqldump(self):
self.assertLibraryList('parts/mariadb/bin/mysqldump', ['libc', 'libdl', 'librt', 'libz', 'libcrypt', 'libm', 'libmysqlclient',
'libnsl', 'libpthread'], ['ncurses', 'zlib', 'readline'],
[os.path.join(os.path.abspath(os.curdir),
'parts', 'mariadb', 'lib', 'mysql')])
class AssertSqlite3(AssertSoftwareMixin):
"""Tests for built memcached"""
def test_ld_bin_sqlite3(self):
self.assertLibraryList('parts/sqlite3/bin/sqlite3', ['libpthread', 'libc', 'libdl', 'libsqlite3', 'libreadline', 'libncurses'],
['sqlite3'],
[ os.path.join(os.path.abspath(os.curdir), 'parts', 'readline', 'lib'),
os.path.join(os.path.abspath(os.curdir), 'parts', 'ncurses', 'lib')])
def test_ld_libsqlite3(self):
self.assertLibraryList('parts/sqlite3/lib/libsqlite3.so', ['libpthread', 'libc', 'libdl'], [],
[ os.path.join(os.path.abspath(os.curdir), 'parts', 'readline', 'lib'),
os.path.join(os.path.abspath(os.curdir), 'parts', 'ncurses', 'lib')])
class AssertMemcached(AssertSoftwareMixin):
"""Tests for built memcached"""
def test_ld_memcached(self):
"""Checks proper linking to libevent from memcached"""
self.assertLibraryList('parts/memcached/bin/memcached', ['libpthread', 'libevent-1.4', 'libc'], ['libevent'])
class AssertSubversion(AssertSoftwareMixin):
"""Tests for built subversion"""
def test_ld_svn(self):
self.assertLibraryList('parts/subversion/bin/svn', ['libsvn_client-1', 'libsvn_wc-1', 'libsvn_ra-1',
'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',
'libsvn_delta-1', 'libsvn_subr-1', 'libsqlite3', 'libxml2',
'libaprutil-1', 'libapr-1', 'libuuid', 'librt', 'libexpat',
'libz', 'libssl', 'libcrypto', 'libsvn_ra_neon-1',
'libc', 'libcrypt', 'libdl', 'libm',
'libpthread', 'libneon'
], ['apache', 'libexpat', 'openssl', 'neon', 'libxml2',
'sqlite3', 'subversion', 'zlib', 'libuuid'])
def test_ld_svnadmin(self):
self.assertLibraryList('parts/subversion/bin/svnadmin', ['libsvn_repos-1', 'libsvn_fs-1',
'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',
], ['apache', 'libexpat',
'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
def test_ld_svndumpfilter(self):
self.assertLibraryList('parts/subversion/bin/svndumpfilter', ['libsvn_repos-1', 'libsvn_fs-1',
'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',
], ['apache', 'libexpat',
'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
def test_ld_svnlook(self):
self.assertLibraryList('parts/subversion/bin/svnlook', ['libsvn_repos-1', 'libsvn_fs-1', 'libsvn_diff-1',
'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',
], ['apache', 'libexpat',
'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
def test_ld_svnserve(self):
self.assertLibraryList('parts/subversion/bin/svnserve', ['libsvn_repos-1', 'libsvn_fs-1', 'libsvn_ra_svn-1',
'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',
], ['apache', 'libexpat',
'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
def test_ld_svnsync(self):
self.assertLibraryList('parts/subversion/bin/svnsync', [
'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',
], [
'apache',
'libexpat',
'libuuid',
'libxml2',
'neon',
'openssl',
'sqlite3',
'subversion',
'zlib',
])
def test_ld_svnversion(self):
self.assertLibraryList('parts/subversion/bin/svnversion', ['libsvn_diff-1', 'libsvn_wc-1',
'libsvn_delta-1', 'libsvn_subr-1', 'libsqlite3',
'libaprutil-1', 'libapr-1', 'libuuid', 'librt', 'libexpat',
'libz', 'libc', 'libcrypt', 'libdl', 'libpthread',
], ['apache', 'libexpat',
'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
def test_ld_libsvn_client(self):
self.assertLibraryList('parts/subversion/lib/libsvn_client-1.so', ['libsvn_diff-1', 'libsvn_wc-1',
'libsvn_delta-1', 'libsvn_subr-1', 'libsvn_ra-1',
'libaprutil-1', 'libapr-1', 'libuuid', 'librt', 'libexpat',
'libc', 'libcrypt', 'libdl', 'libpthread',
], ['apache', 'libexpat', 'sqlite3', 'subversion', 'zlib',
'libuuid', 'neon'])
def test_ld_libsvn_delta(self):
self.assertLibraryList('parts/subversion/lib/libsvn_delta-1.so', [
'libsvn_subr-1', 'libz',
'libaprutil-1', 'libapr-1', 'libuuid', 'librt', 'libexpat',
'libc', 'libcrypt', 'libdl', 'libpthread',
], ['apache', 'libexpat', 'sqlite3', 'subversion', 'zlib',
'libuuid', 'neon'])
def test_ld_libsvn_diff(self):
self.assertLibraryList('parts/subversion/lib/libsvn_diff-1.so', [
'libsvn_subr-1', 'libaprutil-1', 'libapr-1', 'libuuid', 'librt',
'libexpat', 'libc', 'libcrypt', 'libdl', 'libpthread',
], ['apache', 'libexpat', 'sqlite3', 'subversion', 'zlib',
'libuuid', 'neon'])
def test_ld_libsvn_fs(self):
self.assertLibraryList('parts/subversion/lib/libsvn_fs-1.so', [
'libapr-1',
'libc',
'libcrypt',
'libdl',
'libpthread',
'librt',
'libsvn_delta-1',
'libsvn_fs_fs-1',
'libsvn_fs_util-1',
'libsvn_subr-1',
'libuuid',
], [
'apache',
'libuuid',
'neon',
'sqlite3',
'subversion',
'zlib',
])
def test_ld_libsvn_fs_fs(self):
self.assertLibraryList('parts/subversion/lib/libsvn_fs_fs-1.so', ['libsvn_delta-1', 'libaprutil-1', 'libexpat',
'libsvn_fs_util-1', 'libsvn_subr-1', 'libapr-1', 'libuuid', 'librt',
'libc', 'libcrypt', 'libdl', 'libpthread',
], ['apache', 'libexpat', 'sqlite3', 'subversion', 'zlib',
'libuuid', 'neon'])
def test_ld_libsvn_fs_util(self):
self.assertLibraryList('parts/subversion/lib/libsvn_fs_util-1.so', ['libaprutil-1', 'libexpat',
'libsvn_subr-1', 'libapr-1', 'libuuid', 'librt',
'libc', 'libcrypt', 'libdl', 'libpthread',
], ['apache', 'libexpat', 'sqlite3', 'subversion', 'zlib',
'libuuid', 'neon'])
def test_ld_libsvn_ra(self):
self.assertLibraryList('parts/subversion/lib/libsvn_ra-1.so', ['libaprutil-1', 'libsvn_delta-1', 'libsvn_fs-1',
'libsvn_ra_local-1', 'libsvn_ra_neon-1', 'libsvn_ra_svn-1',
'libsvn_repos-1', 'libexpat', 'libsvn_subr-1', 'libapr-1', 'libuuid',
'librt', 'libc', 'libcrypt', 'libdl', 'libpthread',
], ['apache', 'libexpat',
'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
def test_ld_libsvn_ra_local(self):
self.assertLibraryList('parts/subversion/lib/libsvn_ra_local-1.so', ['libaprutil-1', 'libsvn_delta-1', 'libsvn_fs-1',
'libsvn_repos-1', 'libexpat', 'libsvn_subr-1', 'libapr-1', 'libuuid',
'librt', 'libc', 'libcrypt', 'libdl', 'libpthread',
], ['apache', 'libexpat',
'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
def test_ld_libsvn_ra_neon(self):
self.assertLibraryList('parts/subversion/lib/libsvn_ra_neon-1.so', [
'libapr-1',
'libaprutil-1',
'libc',
'libcrypt',
'libcrypto',
'libdl',
'libexpat',
'libm',
'libneon',
'libpthread',
'librt',
'libssl',
'libsvn_delta-1',
'libsvn_subr-1',
'libuuid',
'libxml2',
'libz',
], [
'apache',
'libexpat',
'libuuid',
'libxml2',
'neon',
'openssl',
'sqlite3',
'subversion',
'zlib',
])
def test_ld_libsvn_ra_svn(self):
self.assertLibraryList('parts/subversion/lib/libsvn_ra_svn-1.so', ['libaprutil-1', 'libsvn_delta-1',
'libexpat', 'libsvn_subr-1', 'libapr-1', 'libuuid',
'librt', 'libc', 'libcrypt', 'libdl', 'libpthread',
], ['apache', 'libexpat',
'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
def test_ld_libsvn_repos(self):
self.assertLibraryList('parts/subversion/lib/libsvn_repos-1.so', ['libaprutil-1', 'libsvn_delta-1',
'libexpat', 'libsvn_subr-1', 'libapr-1', 'libuuid', 'libsvn_fs-1',
'librt', 'libc', 'libcrypt', 'libdl', 'libpthread',
], ['apache', 'libexpat',
'sqlite3', 'subversion', 'zlib', 'libuuid', 'neon'])
def test_ld_libsvn_subr(self):
self.assertLibraryList('parts/subversion/lib/libsvn_subr-1.so', ['libaprutil-1', 'libexpat', 'libapr-1',
'libuuid', 'librt', 'libc', 'libcrypt', 'libdl', 'libpthread',
'libsqlite3', 'libz',
], ['apache', 'libexpat',
'sqlite3', 'zlib', 'libuuid', 'neon'])
def test_ld_libsvn_wc(self):
self.assertLibraryList('parts/subversion/lib/libsvn_wc-1.so', ['libaprutil-1', 'libexpat', 'libapr-1',
'libsvn_delta-1', 'libsvn_diff-1', 'libsvn_subr-1',
'libuuid', 'librt', 'libc', 'libcrypt', 'libdl', 'libpthread',
], ['apache', 'libexpat', 'subversion',
'sqlite3', 'zlib', 'libuuid', 'neon'])
class AssertNeon(AssertSoftwareMixin):
"""Tests for built neon"""
def test_ld_libneon(self):
self.assertLibraryList('parts/neon/lib/libneon.so', [
'libc',
'libcrypto',
'libdl',
'libm',
'libssl',
'libxml2',
'libz',
], [
'libxml2',
'openssl',
'zlib',
])
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 (
'-Wl,-rpath',
'-lcrypto',
'-ldl',
'-lm',
'-lneon',
'-lpthread',
'-lssl',
'-lxml2',
'-lz',
):
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)
class AssertPythonMysql(AssertSoftwareMixin):
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', 'libm',
'libmysqlclient_r', 'libnsl', 'libpthread', 'librt', 'libz']),
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
software in ['zlib', 'openssl']]
expected_rpath_list.append(os.path.join(os.path.abspath(os.curdir), 'parts', 'mariadb', 'lib', 'mysql'))
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
class AssertApache(AssertSoftwareMixin):
"""Tests for built apache"""
apache_rpath = [
'gdbm',
'libexpat',
'libuuid',
'openssl',
'pcre',
'sqlite3',
'zlib',
]
def test_ld_libaprutil1(self):
self.assertLibraryList('parts/apache/lib/libaprutil-1.so', ['libexpat', 'libapr-1', 'librt', 'libcrypt',
'libpthread', 'libdl', 'libc', 'libuuid'],
self.apache_rpath + ['apache'])
def test_ld_libapr1(self):
self.assertLibraryList('parts/apache/lib/libapr-1.so', ['librt', 'libcrypt', 'libuuid',
'libpthread', 'libdl', 'libc'], self.apache_rpath)
def test_modules(self):
required_module_list = sorted([q.strip() for q in """
actions_module
alias_module
asis_module
auth_basic_module
auth_digest_module
authn_alias_module
authn_anon_module
authn_dbd_module
authn_dbm_module
authn_default_module
authn_file_module
authz_dbm_module
authz_default_module
authz_groupfile_module
authz_host_module
authz_owner_module
authz_user_module
autoindex_module
bucketeer_module
cache_module
case_filter_in_module
case_filter_module
cern_meta_module
cgi_module
cgid_module
charset_lite_module
core_module
dav_fs_module
dav_module
dbd_module
deflate_module
dir_module
disk_cache_module
dumpio_module
echo_module
env_module
expires_module
ext_filter_module
filter_module
headers_module
http_module
ident_module
imagemap_module
include_module
info_module
log_config_module
log_forensic_module
logio_module
mime_magic_module
mime_module
mpm_prefork_module
negotiation_module
optional_fn_export_module
optional_fn_import_module
optional_hook_export_module
optional_hook_import_module
proxy_ajp_module
proxy_balancer_module
proxy_connect_module
proxy_ftp_module
proxy_http_module
proxy_module
proxy_scgi_module
reqtimeout_module
rewrite_module
setenvif_module
so_module
speling_module
ssl_module
status_module
substitute_module
unique_id_module
userdir_module
usertrack_module
version_module
vhost_alias_module
""".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(required_module_list, loaded_module_list)
def test_ld_module_mod_actions(self):
self.assertLibraryList('parts/apache/modules/mod_actions.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_alias(self):
self.assertLibraryList('parts/apache/modules/mod_alias.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_asis(self):
self.assertLibraryList('parts/apache/modules/mod_asis.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_auth_basic(self):
self.assertLibraryList('parts/apache/modules/mod_auth_basic.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_auth_digest(self):
self.assertLibraryList('parts/apache/modules/mod_auth_digest.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_authn_alias(self):
self.assertLibraryList('parts/apache/modules/mod_authn_alias.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_authn_anon(self):
self.assertLibraryList('parts/apache/modules/mod_authn_anon.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_authn_dbd(self):
self.assertLibraryList('parts/apache/modules/mod_authn_dbd.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_authn_dbm(self):
self.assertLibraryList('parts/apache/modules/mod_authn_dbm.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_authn_default(self):
self.assertLibraryList('parts/apache/modules/mod_authn_default.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_authn_file(self):
self.assertLibraryList('parts/apache/modules/mod_authn_file.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_authz_dbm(self):
self.assertLibraryList('parts/apache/modules/mod_authz_dbm.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_authz_default(self):
self.assertLibraryList('parts/apache/modules/mod_authz_default.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_authz_groupfile(self):
self.assertLibraryList('parts/apache/modules/mod_authz_groupfile.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_authz_host(self):
self.assertLibraryList('parts/apache/modules/mod_authz_host.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_authz_owner(self):
self.assertLibraryList('parts/apache/modules/mod_authz_owner.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_authz_user(self):
self.assertLibraryList('parts/apache/modules/mod_authz_user.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_autoindex(self):
self.assertLibraryList('parts/apache/modules/mod_autoindex.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_bucketeer(self):
self.assertLibraryList('parts/apache/modules/mod_bucketeer.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_cache(self):
self.assertLibraryList('parts/apache/modules/mod_cache.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_case_filter(self):
self.assertLibraryList('parts/apache/modules/mod_case_filter.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_case_filter_in(self):
self.assertLibraryList('parts/apache/modules/mod_case_filter_in.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_cern_meta(self):
self.assertLibraryList('parts/apache/modules/mod_cern_meta.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_cgi(self):
self.assertLibraryList('parts/apache/modules/mod_cgi.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_cgid(self):
self.assertLibraryList('parts/apache/modules/mod_cgid.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_charset_lite(self):
self.assertLibraryList('parts/apache/modules/mod_charset_lite.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_dav(self):
self.assertLibraryList('parts/apache/modules/mod_dav.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_dav_fs(self):
self.assertLibraryList('parts/apache/modules/mod_dav_fs.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_dbd(self):
self.assertLibraryList('parts/apache/modules/mod_dbd.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_deflate(self):
self.assertLibraryList('parts/apache/modules/mod_deflate.so', ['libpthread', 'libc', 'libz'], self.apache_rpath)
def test_ld_module_mod_dir(self):
self.assertLibraryList('parts/apache/modules/mod_dir.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_disk_cache(self):
self.assertLibraryList('parts/apache/modules/mod_disk_cache.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_dumpio(self):
self.assertLibraryList('parts/apache/modules/mod_dumpio.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_echo(self):
self.assertLibraryList('parts/apache/modules/mod_echo.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_env(self):
self.assertLibraryList('parts/apache/modules/mod_env.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_expires(self):
self.assertLibraryList('parts/apache/modules/mod_expires.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_ext_filter(self):
self.assertLibraryList('parts/apache/modules/mod_ext_filter.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_filter(self):
self.assertLibraryList('parts/apache/modules/mod_filter.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_headers(self):
self.assertLibraryList('parts/apache/modules/mod_headers.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_ident(self):
self.assertLibraryList('parts/apache/modules/mod_ident.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_imagemap(self):
self.assertLibraryList('parts/apache/modules/mod_imagemap.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_include(self):
self.assertLibraryList('parts/apache/modules/mod_include.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_info(self):
self.assertLibraryList('parts/apache/modules/mod_info.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_log_config(self):
self.assertLibraryList('parts/apache/modules/mod_log_config.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_log_forensic(self):
self.assertLibraryList('parts/apache/modules/mod_log_forensic.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_logio(self):
self.assertLibraryList('parts/apache/modules/mod_logio.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_mime(self):
self.assertLibraryList('parts/apache/modules/mod_mime.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_mime_magic(self):
self.assertLibraryList('parts/apache/modules/mod_mime_magic.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_negotiation(self):
self.assertLibraryList('parts/apache/modules/mod_negotiation.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_optional_fn_export(self):
self.assertLibraryList('parts/apache/modules/mod_optional_fn_export.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_optional_fn_import(self):
self.assertLibraryList('parts/apache/modules/mod_optional_fn_import.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_optional_hook_export(self):
self.assertLibraryList('parts/apache/modules/mod_optional_hook_export.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_optional_hook_import(self):
self.assertLibraryList('parts/apache/modules/mod_optional_hook_import.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_proxy(self):
self.assertLibraryList('parts/apache/modules/mod_proxy.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_proxy_ajp(self):
self.assertLibraryList('parts/apache/modules/mod_proxy_ajp.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_proxy_balancer(self):
self.assertLibraryList('parts/apache/modules/mod_proxy_balancer.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_proxy_connect(self):
self.assertLibraryList('parts/apache/modules/mod_proxy_connect.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_proxy_ftp(self):
self.assertLibraryList('parts/apache/modules/mod_proxy_ftp.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_proxy_http(self):
self.assertLibraryList('parts/apache/modules/mod_proxy_http.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_proxy_scgi(self):
self.assertLibraryList('parts/apache/modules/mod_proxy_scgi.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_reqtimeout(self):
self.assertLibraryList('parts/apache/modules/mod_reqtimeout.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_rewrite(self):
self.assertLibraryList('parts/apache/modules/mod_rewrite.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_module_mod_setenvif(self):
self.assertLibraryList('parts/apache/modules/mod_setenvif.so', ['libpthread', 'libc'],
self.apache_rpath)
def test_ld_module_mod_speling(self):
self.assertLibraryList('parts/apache/modules/mod_speling.so', ['libpthread', 'libc'],
self.apache_rpath)
def test_ld_module_mod_ssl(self):
self.assertLibraryList('parts/apache/modules/mod_ssl.so',[
'libc',
'libcrypto',
'libdl',
'libpthread',
'libssl',
], self.apache_rpath)
def test_ld_module_mod_status(self):
self.assertLibraryList('parts/apache/modules/mod_status.so', ['libpthread', 'libc'],
self.apache_rpath)
def test_ld_module_mod_substitute(self):
self.assertLibraryList('parts/apache/modules/mod_substitute.so', ['libpthread', 'libc'],
self.apache_rpath)
def test_ld_module_mod_unique_id(self):
self.assertLibraryList('parts/apache/modules/mod_unique_id.so', ['libpthread', 'libc'],
self.apache_rpath)
def test_ld_module_mod_userdir(self):
self.assertLibraryList('parts/apache/modules/mod_userdir.so', ['libpthread', 'libc'],
self.apache_rpath)
def test_ld_module_mod_usertrack(self):
self.assertLibraryList('parts/apache/modules/mod_usertrack.so', ['libpthread', 'libc'],
self.apache_rpath)
def test_ld_module_mod_version(self):
self.assertLibraryList('parts/apache/modules/mod_version.so', ['libpthread', 'libc'],
self.apache_rpath)
def test_ld_module_mod_vhost_alias(self):
self.assertLibraryList('parts/apache/modules/mod_vhost_alias.so', ['libpthread', 'libc'], self.apache_rpath)
def test_ld_apr_dbd_sqlite3(self):
self.assertLibraryList('parts/apache/lib/apr-util-1/apr_dbd_sqlite3.so', [
'libc',
'libpthread',
'libsqlite3',
], self.apache_rpath)
class AssertOpenssl(AssertSoftwareMixin):
def test_ld_openssl(self):
self.assertLibraryList('parts/openssl/bin/openssl', ['libc', 'libcrypto', 'libdl', 'libssl'], ['openssl'])
class AssertCyrusSasl(AssertSoftwareMixin):
def test_ld_pluginviewer(self):
self.assertLibraryList('parts/cyrus-sasl/sbin/pluginviewer', [
'libc',
'libdl',
'libresolv',
'libsasl2',
], [
'cyrus-sasl',
'zlib',
])
def test_ld_libsasl2(self):
self.assertLibraryList('parts/cyrus-sasl/lib/libsasl2.so', [
'libc',
'libdl',
'libresolv',
], [
])
def test_ld_sasl2_libanonymous(self):
self.assertLibraryList('parts/cyrus-sasl/lib/sasl2/libanonymous.so', [
'libc',
'libresolv',
], [
])
def test_ld_sasl2_libcrammd5(self):
self.assertLibraryList('parts/cyrus-sasl/lib/sasl2/libcrammd5.so', [
'libc',
'libresolv',
], [
])
def test_ld_sasl2_libplain(self):
self.assertLibraryList('parts/cyrus-sasl/lib/sasl2/libplain.so', [
'libc',
'libcrypt',
'libresolv',
], [
])
class AssertGettext(AssertSoftwareMixin):
def test_ld_libintl(self):
self.assertLibraryList('parts/gettext/lib/libintl.so', [
'libc',
], [
'libxml2',
'ncurses',
'zlib',
])
def test_ld_libasprintf(self):
self.assertLibraryList('parts/gettext/lib/libasprintf.so', [
'libc',
'libgcc_s',
'libm',
'libstdc++',
], [
'libxml2',
'ncurses',
'zlib',
])
def test_ld_libgettextlib(self):
self.assertLibraryList('parts/gettext/lib/libgettextlib.so', [
'libc',
'libdl',
'libintl',
'libm',
'libncurses',
'libxml2',
'libz',
], [
'gettext',
'libxml2',
'ncurses',
'zlib',
])
def test_ld_libgettextpo(self):
self.assertLibraryList('parts/gettext/lib/libgettextpo.so', [
'libc',
'libintl',
], [
'gettext',
'libxml2',
'ncurses',
'zlib',
])
def test_ld_libgettextsrc(self):
self.assertLibraryList('parts/gettext/lib/libgettextsrc.so', [
'libc',
'libdl',
'libgettextlib-0.18.1',
'libintl',
'libm',
'libncurses',
'libxml2',
'libz',
], [
'gettext',
'libxml2',
'ncurses',
'zlib',
])
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')
class AssertLibxslt(AssertSoftwareMixin):
def test_ld_xsltproc(self):
self.assertLibraryList('parts/libxslt/bin/xsltproc', [
'libc',
'libdl',
'libexslt',
'libm',
'libxml2',
'libxslt',
'libz',
], [
'libxml2',
'libxslt',
'zlib',
])
class AssertNcurses(AssertSoftwareMixin):
def test_ld_ncurses(self):
self.assertLibraryList('parts/ncurses/lib/libncurses.so', [
'libc',
'libdl',
], [
'ncurses',
])
def test_ld_ncursesw(self):
self.assertLibraryList('parts/ncurses/lib/libncursesw.so', [
'libc',
'libdl',
], [
'ncurses',
])
def test_ld_reset(self):
self.assertLibraryList('parts/ncurses/bin/reset', [
'libc',
'libncursesw',
], [
'ncurses',
])
class AssertW3m(AssertSoftwareMixin):
def test_ld_w3m(self):
self.assertLibraryList('parts/w3m/bin/w3m', [
'libc',
'libcrypto',
'libgc',
'libm',
'libncurses',
'libssl',
], [
'garbage-collector',
'ncurses',
'openssl',
'zlib',
])
class AssertVarnish(AssertSoftwareMixin):
def test_ld_varnishd(self):
self.assertLibraryList('parts/varnish/sbin/varnishd', [
'libc',
'libdl',
'libm',
'libnsl',
'libpthread',
'libvarnish',
'libvarnishcompat',
'libvcl',
], [
'ncurses',
'varnish',
])
self.assertLibraryList('parts/varnish-2.1/sbin/varnishd', [
'libc',
'libdl',
'libm',
'libnsl',
'libpthread',
'libvarnish',
'libvarnishcompat',
'libvcl',
], [
'ncurses',
'varnish-2.1',
])
def test_ld_varnishtop(self):
self.assertLibraryList('parts/varnish/bin/varnishtop', [
'libc',
'libncurses',
'libpthread',
'libvarnish',
'libvarnishapi',
'libvarnishcompat',
], [
'ncurses',
'varnish',
])
self.assertLibraryList('parts/varnish-2.1/bin/varnishtop', [
'libc',
'libncurses',
'libpthread',
'libvarnish',
'libvarnishapi',
'libvarnishcompat',
], [
'ncurses',
'varnish-2.1',
])
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',
])
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',
])
class AssertPopt(AssertSoftwareMixin):
def test_ld_libpopt(self):
self.assertLibraryList('parts/popt/lib/libpopt.so', [
'libc',
], [
])
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',
], [
])
class AssertPysvn(AssertSoftwareMixin):
def test_ld_pysvn(self):
self.assertLibraryList('develop-eggs/%s/pysvn/_pysvn_%s.so' % (
self.getDevelopEggName('pysvn', '1.7.4nxd006'),
python_version.replace('.', '_')), [
'libc',
'libgcc_s',
'libm',
'libresolv',
'libstdc++',
'libsvn_client-1',
'libsvn_diff-1',
'libsvn_repos-1',
], [
'subversion'
])
class AssertLxml(AssertSoftwareMixin):
def test_ld_etree_so(self):
egg_name = self.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 = self.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',
])
class AssertFile(AssertSoftwareMixin):
def test_ld_file(self):
self.assertLibraryList('parts/file/bin/file', [
'libc',
'libmagic',
'libz',
], [
'file',
'zlib',
])
def test_ld_libmagic(self):
self.assertLibraryList('parts/file/lib/libmagic.so', [
'libc',
'libz',
], [
'zlib',
])
class AssertImagemagick(AssertSoftwareMixin):
core_lib_list = [
'libbz2',
'libc',
'libdl',
'libfontconfig',
'libfreetype',
'libjasper',
'libjbig',
'libjpeg',
'libltdl',
'libm',
'libpng15',
'libpthread',
'libtiff',
'libxml2',
'libz',
]
core_rpath_list = [
'bzip2',
'fontconfig',
'freetype',
'jasper',
'jbigkit',
'libjpeg',
'libpng',
'libtiff',
'libtool',
'libxml2',
'zlib',
]
lib_rpath_list = core_rpath_list + [
'imagemagick',
]
lib_lib_list = core_lib_list + [
'libMagickCore',
]
bin_lib_list = lib_lib_list + [
'libMagickWand',
]
def test_ld_libMagickCore(self):
self.assertLibraryList('parts/imagemagick/lib/libMagickCore.so',
self.core_lib_list, self.core_rpath_list)
def test_ld_libMagickWand(self):
self.assertLibraryList('parts/imagemagick/lib/libMagickWand.so',
self.lib_lib_list, self.lib_rpath_list)
def test_ld_animate(self):
self.assertLibraryList('parts/imagemagick/bin/animate',
self.bin_lib_list, self.lib_rpath_list)
def test_ld_compare(self):
self.assertLibraryList('parts/imagemagick/bin/compare',
self.bin_lib_list, self.lib_rpath_list)
def test_ld_composite(self):
self.assertLibraryList('parts/imagemagick/bin/composite',
self.bin_lib_list, self.lib_rpath_list)
def test_ld_conjure(self):
self.assertLibraryList('parts/imagemagick/bin/conjure',
self.bin_lib_list, self.lib_rpath_list)
def test_ld_convert(self):
self.assertLibraryList('parts/imagemagick/bin/convert',
self.bin_lib_list, self.lib_rpath_list)
def test_ld_display(self):
self.assertLibraryList('parts/imagemagick/bin/display',
self.bin_lib_list, self.lib_rpath_list)
def test_ld_identify(self):
self.assertLibraryList('parts/imagemagick/bin/identify',
self.bin_lib_list, self.lib_rpath_list)
def test_ld_import(self):
self.assertLibraryList('parts/imagemagick/bin/import',
self.bin_lib_list, self.lib_rpath_list)
def test_ld_mogrify(self):
self.assertLibraryList('parts/imagemagick/bin/mogrify',
self.bin_lib_list, self.lib_rpath_list)
def test_ld_montage(self):
self.assertLibraryList('parts/imagemagick/bin/montage',
self.bin_lib_list, self.lib_rpath_list)
def test_ld_stream(self):
self.assertLibraryList('parts/imagemagick/bin/stream',
self.bin_lib_list, self.lib_rpath_list)
class AssertJbigkit(AssertSoftwareMixin):
def test_ld_libjbig(self):
self.assertLibraryList('parts/jbigkit/lib/libjbig.so',[
'libc',
], [])
def test_ld_libjbig85(self):
self.assertLibraryList('parts/jbigkit/lib/libjbig85.so',[
'libc',
], [])
class AssertLibtiff(AssertSoftwareMixin):
def test_ld_libtiff(self):
self.assertLibraryList('parts/libtiff/lib/libtiff.so', [
'libc',
'libjbig',
'libjpeg',
'libm',
'libz',
], [
'jbigkit',
'libjpeg',
'zlib',
])
def test_ld_libtiffxx(self):
self.assertLibraryList('parts/libtiff/lib/libtiffxx.so', [
'libc',
'libgcc_s',
'libjbig',
'libjpeg',
'libm',
'libstdc++',
'libtiff',
'libz',
], [
'jbigkit',
'libjpeg',
'libtiff',
'zlib',
])
class AssertLibjpeg(AssertSoftwareMixin):
def test_ld_libjpeg(self):
self.assertLibraryList('parts/libjpeg/lib/libjpeg.so',[
'libc',
], [])
class AssertLibpng(AssertSoftwareMixin):
def test_ld_libpng12(self):
self.assertLibraryList('parts/libpng12/lib/libpng12.so',[
'libc',
'libm',
'libz',
], [
'zlib',
])
self.assertLibraryList('parts/libpng12/lib/libpng.so',[
'libc',
'libm',
'libz',
], [
'zlib',
])
def test_ld_libpng15(self):
self.assertLibraryList('parts/libpng/lib/libpng15.so',[
'libc',
'libm',
'libz',
], [
'zlib',
])
self.assertLibraryList('parts/libpng/lib/libpng.so',[
'libc',
'libm',
'libz',
], [
'zlib',
])
class AssertJasper(AssertSoftwareMixin):
def test_ld_libjasper(self):
self.assertLibraryList('parts/jasper/lib/libjasper.so',[
'libc',
'libjpeg',
'libm',
], [
'libjpeg',
])
class AssertFreetype(AssertSoftwareMixin):
def test_ld_libfreetype(self):
self.assertLibraryList('parts/freetype/lib/libfreetype.so',[
'libc',
'libz',
], [
'zlib',
])
class AssertGhostscript(AssertSoftwareMixin):
def test_ld_gs(self):
self.assertLibraryList('parts/ghostscript/bin/gs',[
'libc',
'libdl',
'libfontconfig',
'libm',
'libpthread',
'libstdc++',
'libtiff',
], [
'fontconfig',
'libjpeg',
'libtiff',
])
class AssertFontconfig(AssertSoftwareMixin):
core_lib_list = [
'libc',
'libfreetype',
'libm',
'libxml2',
'libz',
]
core_rpath_list = [
'freetype',
'libxml2',
'zlib',
]
def test_ld_libfontconfig(self):
self.assertLibraryList('parts/fontconfig/lib/libfontconfig.so',
self.core_lib_list, self.core_rpath_list)
lib_list = core_lib_list + ['libfontconfig']
rpath_list = core_rpath_list + ['fontconfig']
def test_ld_fccache(self):
self.assertLibraryList('parts/fontconfig/bin/fc-cache', self.lib_list,
self.rpath_list)
def test_ld_fccat(self):
self.assertLibraryList('parts/fontconfig/bin/fc-cat', self.lib_list,
self.rpath_list)
def test_ld_fclist(self):
self.assertLibraryList('parts/fontconfig/bin/fc-list', self.lib_list,
self.rpath_list)
def test_ld_fcmatch(self):
self.assertLibraryList('parts/fontconfig/bin/fc-match', self.lib_list,
self.rpath_list)
def test_ld_fcquery(self):
self.assertLibraryList('parts/fontconfig/bin/fc-query', self.lib_list,
self.rpath_list)
def test_ld_fcscan(self):
self.assertLibraryList('parts/fontconfig/bin/fc-scan', self.lib_list,
self.rpath_list)
class AssertSphinx(AssertSoftwareMixin):
core_lib_list = [
'libc',
'libexpat',
'libgcc_s',
'libm',
'libmysqlclient',
'libpthread',
'librt',
'libstdc++',
'libz',
]
core_rpath_list = [
'libexpat',
'zlib'
]
core_additional_rpath_list = [
os.path.join(os.path.abspath(os.curdir), 'parts', 'mariadb', 'lib', 'mysql')
]
def test_ld_sphinx(self):
for i in ('indexer', 'indextool', 'search', 'searchd', 'spelldump'):
self.assertLibraryList('parts/sphinx/bin/%s' % i,
self.core_lib_list, self.core_rpath_list, self.core_additional_rpath_list)
class AssertOpenldap(AssertSoftwareMixin):
core_lib_list = [
'libc',
'libresolv',
]
core_rpath_list = [
'cyrus-sasl',
'openssl',
]
lib_lib_list = core_lib_list + [
'libcrypto',
'liblber-2.4',
'libsasl2',
'libssl',
]
lib_rpath_list = core_rpath_list + [
'openldap',
]
bin_lib_list = core_lib_list + [
'libcrypto',
'libdl',
'libsasl2',
'libssl',
]
bin_rpath_list = core_rpath_list
def test_ld_liblber(self):
self.assertLibraryList('parts/openldap/lib/liblber.so',
self.core_lib_list,
self.core_rpath_list)
def test_ld_libldap(self):
self.assertLibraryList('parts/openldap/lib/libldap.so',
self.lib_lib_list, self.lib_rpath_list)
def test_ld_libldap_r(self):
self.assertLibraryList('parts/openldap/lib/libldap_r.so',
self.lib_lib_list + ['libpthread'], self.lib_rpath_list)
def test_ld_ldapcompare(self):
self.assertLibraryList('parts/openldap/bin/ldapcompare',
self.bin_lib_list, self.bin_rpath_list)
def test_ld_ldapdelete(self):
self.assertLibraryList('parts/openldap/bin/ldapdelete',
self.bin_lib_list, self.bin_rpath_list)
def test_ld_ldapexop(self):
self.assertLibraryList('parts/openldap/bin/ldapexop',
self.bin_lib_list, self.bin_rpath_list)
def test_ld_ldapmodify(self):
self.assertLibraryList('parts/openldap/bin/ldapmodify',
self.bin_lib_list, self.bin_rpath_list)
def test_ld_ldapmodrdn(self):
self.assertLibraryList('parts/openldap/bin/ldapmodrdn',
self.bin_lib_list, self.bin_rpath_list)
def test_ld_ldappasswd(self):
self.assertLibraryList('parts/openldap/bin/ldappasswd',
self.bin_lib_list, self.bin_rpath_list)
def test_ld_ldapsearch(self):
self.assertLibraryList('parts/openldap/bin/ldapsearch',
self.bin_lib_list, self.bin_rpath_list)
def test_ld_ldapurl(self):
self.assertLibraryList('parts/openldap/bin/ldapurl',
self.bin_lib_list, self.bin_rpath_list)
def test_ld_ldapwhoami(self):
self.assertLibraryList('parts/openldap/bin/ldapwhoami',
self.bin_lib_list, self.bin_rpath_list)
class AssertGlib(AssertSoftwareMixin):
core_lib_list = [
'libc',
'libintl',
]
core_rpath_list = [
'gettext',
'zlib',
]
rpath_list = [
'gettext',
'glib',
'zlib',
]
def test_ld_libglib(self):
self.assertLibraryList('parts/glib/lib/libglib-2.0.so',
self.core_lib_list + [
'libdl',
'librt',
], [
'gettext',
'zlib',
])
def test_ld_libgmodule(self):
self.assertLibraryList('parts/glib/lib/libgmodule-2.0.so',
self.core_lib_list + [
'libdl',
'libglib-2.0',
'librt',
], self.rpath_list)
def test_ld_libgobject(self):
self.assertLibraryList('parts/glib/lib/libgobject-2.0.so',
self.core_lib_list + [
'libglib-2.0',
'libgthread-2.0',
'libpthread',
'librt',
], self.rpath_list)
def test_ld_libgthread(self):
self.assertLibraryList('parts/glib/lib/libgthread-2.0.so',
self.core_lib_list + [
'libglib-2.0',
'libpthread',
'librt',
], self.rpath_list)
def test_ld_libgio(self):
self.assertLibraryList('parts/glib/lib/libgio-2.0.so',
self.core_lib_list + [
'libdl',
'libglib-2.0',
'libgmodule-2.0',
'libgobject-2.0',
'libgthread-2.0',
'libpthread',
'libresolv',
'librt',
'libz',
], self.rpath_list)
def test_ld_gdbus(self):
self.assertLibraryList('parts/glib/bin/gdbus',
self.core_lib_list + [
'libdl',
'libgio-2.0',
'libglib-2.0',
'libgmodule-2.0',
'libgobject-2.0',
'libgthread-2.0',
'libpthread',
'libresolv',
'librt',
'libz',
], self.rpath_list)
def test_ld_gioquerymodules(self):
self.assertLibraryList('parts/glib/bin/gio-querymodules',
self.core_lib_list + [
'libdl',
'libgio-2.0',
'libglib-2.0',
'libgmodule-2.0',
'libgobject-2.0',
'libgthread-2.0',
'libpthread',
'libresolv',
'librt',
'libz',
], self.rpath_list)
def test_ld_glibcompileschemas(self):
self.assertLibraryList('parts/glib/bin/glib-compile-schemas',
self.core_lib_list + [
'libglib-2.0',
'librt',
], self.rpath_list)
def test_ld_glibgenmarshal(self):
self.assertLibraryList('parts/glib/bin/glib-genmarshal',
self.core_lib_list + [
'libglib-2.0',
'libgthread-2.0',
'libpthread',
'librt',
], self.rpath_list)
def test_ld_gobjectquery(self):
self.assertLibraryList('parts/glib/bin/gobject-query',
self.core_lib_list + [
'libglib-2.0',
'libgobject-2.0',
'libgthread-2.0',
'libpthread',
'librt',
], self.rpath_list)
def test_ld_gsettings(self):
self.assertLibraryList('parts/glib/bin/gsettings',
self.core_lib_list + [
'libdl',
'libgio-2.0',
'libglib-2.0',
'libgmodule-2.0',
'libgobject-2.0',
'libgthread-2.0',
'libpthread',
'libresolv',
'librt',
'libz',
], self.rpath_list)
def test_ld_gtester(self):
self.assertLibraryList('parts/glib/bin/gtester',
self.core_lib_list + [
'libglib-2.0',
'librt',
], self.rpath_list)
class AssertLibuuid(AssertSoftwareMixin):
def test_ld_libuuid(self):
self.assertLibraryList('parts/libuuid/lib/libuuid.so',
[
'libc',
],
[])
class AssertGraphviz(AssertSoftwareMixin):
def test_ld_dot(self):
self.assertLibraryList('parts/graphviz/bin/dot', [
'libc',
'libcdt',
'libdl',
'libgraph',
'libgvc',
'libm',
'libpathplan',
'libxdot',
'libz',
], [
'zlib',
'graphviz',
])
def test_ld_libgvc(self):
self.assertLibraryList('parts/graphviz/lib/libgvc.so', [
'libc',
'libcdt',
'libdl',
'libgraph',
'libm',
'libpathplan',
'libxdot',
'libz',
], [
'zlib',
'graphviz',
])
def test_ld_libgvplugin_gd(self):
self.assertLibraryList('parts/graphviz/lib/graphviz/libgvplugin_gd.so', [
'libc',
'libcdt',
'libdl',
'libfontconfig',
'libfreetype',
'libgvc',
'libgraph',
'libm',
'libpathplan',
'libpng15',
'libxdot',
'libxml2',
'libz',
], [
'fontconfig',
'freetype',
'graphviz',
'libpng',
'libxml2',
'zlib',
])
class AssertPkgconfig(AssertSoftwareMixin):
def test_ld_pkgconfig(self):
self.assertLibraryList('parts/pkgconfig/bin/pkg-config', [
'libc',
'libglib-2.0',
'libintl',
'libpopt',
], [
'gettext',
'glib',
'popt',
])
class AssertM4(AssertSoftwareMixin):
def test_ld_pkgconfig(self):
self.assertLibraryList('parts/m4/bin/m4', [
'libc',
], [
])
class AssertStunnel(AssertSoftwareMixin):
def test_ld_stunnel(self):
self.assertLibraryList('parts/stunnel/bin/stunnel', [
'libc',
'libcrypto',
'libdl',
'libnsl',
'libpthread',
'libssl',
'libutil',
'libz',
], [
'openssl',
'zlib',
])
def test_ld_libstunnel(self):
self.assertLibraryList('parts/stunnel/lib/stunnel/libstunnel.so', [
'libc',
'libcrypto',
'libdl',
'libnsl',
'libpthread',
'libssl',
'libutil',
'libz',
], [
'openssl',
'zlib',
])
class AssertPython27(AssertSoftwareMixin):
# .2 could be read from current buildout
parts_name = 'rebootstrap.2.parts'
python_path = parts_name + '/python2.7'
rpath_list = [
'bzip2',
'gdbm',
'gettext',
'ncurses',
'openssl',
'readline',
'sqlite3',
'zlib',
]
def test_ld_dyn_dbm(self):
self.assertLibraryList(self.python_path+'/lib/python2.7/lib-dynload/dbm.so', [
'libc',
'libgdbm',
'libgdbm_compat',
'libpthread',
], self.rpath_list)
def test_ld_dyn_locale(self):
self.assertLibraryList(self.python_path+'/lib/python2.7/lib-dynload/_locale.so', [
'libc',
'libintl',
'libpthread',
], self.rpath_list)
def test_ld_dyn_readline(self):
self.assertLibraryList(self.python_path+'/lib/python2.7/lib-dynload/readline.so', [
'libc',
'libncursesw',
'libreadline',
'libpthread',
], self.rpath_list)
def test_ld_dyn_sqlite3(self):
self.assertLibraryList(self.python_path+'/lib/python2.7/lib-dynload/_sqlite3.so', [
'libc',
'libsqlite3',
'libpthread',
], self.rpath_list)
def test_ld_dyn_ssl(self):
self.assertLibraryList(self.python_path+'/lib/python2.7/lib-dynload/_ssl.so', [
'libc',
'libssl',
'libcrypto',
'libpthread',
], self.rpath_list)
def test_no_failed_ext_lib(self):
self.assertEquals([],
glob(self.python_path+'/lib/python2.7/lib-dynload/*_failed.so'))
# tests for Zope-2.12 buildout only
if python_version >= '2.6':
class AssertPython26(AssertSoftwareMixin):
# .1 could be read from current buildout
parts_name = 'parts'
python_path = parts_name + '/python%s' % python_version
rpath_list = [
'bzip2',
'gdbm',
'gettext',
'ncurses',
'openssl',
'readline',
'sqlite3',
'zlib',
]
def test_ld_dyn_dbm(self):
self.assertLibraryList(self.python_path+'/lib/python%s/lib-dynload/dbm.so' % python_version, [
'libc',
'libgdbm',
'libgdbm_compat',
'libpthread',
], self.rpath_list)
def test_ld_dyn_locale(self):
self.assertLibraryList(self.python_path+'/lib/python%s/lib-dynload/_locale.so' % python_version, [
'libc',
'libintl',
'libpthread',
], self.rpath_list)
def test_ld_dyn_readline(self):
self.assertLibraryList(self.python_path+'/lib/python%s/lib-dynload/readline.so' % python_version, [
'libc',
'libncursesw',
'libreadline',
'libpthread',
], self.rpath_list)
def test_ld_dyn_sqlite3(self):
self.assertLibraryList(self.python_path+'/lib/python%s/lib-dynload/_sqlite3.so' % python_version, [
'libc',
'libsqlite3',
'libpthread',
], self.rpath_list)
def test_ld_dyn_ssl(self):
self.assertLibraryList(self.python_path+'/lib/python%s/lib-dynload/_ssl.so' % python_version, [
'libc',
'libssl',
'libcrypto',
'libpthread',
], self.rpath_list)
def test_no_failed_ext_lib(self):
self.assertEquals([],
glob(self.python_path+'/lib/python%s/lib-dynload/*_failed.so' % python_version))
class AssertItools(AssertSoftwareMixin):
def test_ld_parserso(self):
self.assertLibraryList('parts/itools/lib/itools/xml/parser.so', ['libc', 'libglib-2.0', 'libpthread'], ['glib'])
class AssertCurl(AssertSoftwareMixin):
def test_ld_curl(self):
self.assertLibraryList('parts/curl/bin/curl', [
'libc',
'libcurl',
'librt',
'libz',
], [
'curl',
'openssl',
'zlib',
])
def test_ld_libcurl(self):
self.assertLibraryList('parts/curl/lib/libcurl.so', [
'libc',
'libcrypto',
'libdl',
'librt',
'libssl',
'libz',
], [
'openssl',
'zlib',
])
class AssertGit(AssertSoftwareMixin):
def test_ld_git(self):
self.assertLibraryList('parts/git/bin/git', [
'libc',
'libcrypto',
'libpthread',
'libz',
], [
'openssl',
'zlib',
])
def test_ld_git_http_fetch(self):
self.assertLibraryList('parts/git/libexec/git-core/git-http-fetch', [
'libc',
'libcrypto',
'libcurl',
'libpthread',
'libz',
], [
'curl',
'openssl',
'zlib',
])
# tests for Zope-8 buildout only
elif python_version == '2.4':
class AssertPython24(AssertSoftwareMixin):
# .1 could be read from current buildout
parts_name = 'parts'
python_path = parts_name + '/python%s' % python_version
rpath_list = [
'bzip2',
'gdbm',
'gettext',
'ncurses',
'openssl',
'readline',
'sqlite3',
'zlib',
]
def test_ld_dyn_dbm(self):
self.assertLibraryList(self.python_path+'/lib/python%s/lib-dynload/dbm.so' % python_version, [
'libc',
'libgdbm',
'libgdbm_compat',
'libpthread',
], self.rpath_list)
def test_ld_dyn_locale(self):
self.assertLibraryList(self.python_path+'/lib/python%s/lib-dynload/_locale.so' % python_version, [
'libc',
'libintl',
'libpthread',
], self.rpath_list)
def test_ld_dyn_readline(self):
self.assertLibraryList(self.python_path+'/lib/python%s/lib-dynload/readline.so' % python_version, [
'libc',
'libncursesw',
'libreadline',
'libpthread',
], self.rpath_list)
def test_ld_dyn_ssl(self):
self.assertLibraryList(self.python_path+'/lib/python%s/lib-dynload/_ssl.so' % python_version, [
'libc',
'libssl',
'libcrypto',
'libpthread',
], self.rpath_list)
def test_no_failed_ext_lib(self):
self.assertEquals([],
glob(self.python_path+'/lib/python%s/lib-dynload/*_failed.so' % python_version))
class AssertItools(AssertSoftwareMixin):
def test_ld_parserso(self):
egg_name = self.getDevelopEggName('itools', '0.20.8')
self.assertLibraryList('develop-eggs/%s/itools/xml/parser.so' % (egg_name), ['libc', 'libglib-2.0', 'libpthread'], ['glib'])
class AssertElfLinkedInternally(AssertSoftwareMixin):
def test(self):
result_dict = {}
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):
# stuff in parts/*/share/ will only be static things
if 'share' in dirpath or '.svn' in dirpath:
continue
for filename in filelist:
# skip some not needed places
if any([q in dirpath for q in SKIP_PART_LIST]):
continue
# we only care about two kind of files:
# 1. files without extensions
# 2. .so files
spl = filename.rsplit('.', 1)
if len(spl) > 1 and 'so' not in spl:
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
self.assertSoftwareDictEmpty(result_dict)
if __name__ == '__main__':
unittest.main()
[buildout]
extends = profiles/deployment.cfg
parts =
software-links
supervisor-instance
timmy
[timmy]
recipe = zc.recipe.egg
eggs = erp5.timmy
SearchText/*_parsetab.py
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment