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()
This diff is collapsed.
[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