Commit 66790ad3 authored by Lucas Carvalho's avatar Lucas Carvalho

Compile all possible modules. And test if they are loaded correctly.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33409 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fe8e6ebf
...@@ -5,4 +5,26 @@ parts = apache ...@@ -5,4 +5,26 @@ parts = apache
# inspired on http://old.aclark.net/team/aclark/blog/a-lamp-buildout-for-wordpress-and-other-php-apps/ # inspired on http://old.aclark.net/team/aclark/blog/a-lamp-buildout-for-wordpress-and-other-php-apps/
recipe = hexagonit.recipe.cmmi recipe = hexagonit.recipe.cmmi
url = http://apache.multidist.com/httpd/httpd-2.2.14.tar.gz url = http://apache.multidist.com/httpd/httpd-2.2.14.tar.gz
configure-options = --enable-so configure-options = --enable-authn-alias
--enable-bucketeer
--enable-cache
--enable-case-filter
--enable-case-filter-in
--enable-cgid
--enable-charset-lite
--enable-disk-cache
--enable-echo
--enable-mods-shared=all
--enable-optional-fn-import
--enable-optional-fn-export
--enable-optional-hook-export
--enable-optional-hook-import
--enable-proxy
--enable-proxy-connect
--enable-proxy-ftp
--enable-proxy-http
--enable-proxy-scgi
--enable-proxy-ajp
--enable-proxy-balancer
--enable-so
--enable-ssl
"""
TODO: Add copyright.
"""
import unittest import unittest
import sys, os, tempfile, stat, subprocess import sys, os, tempfile, stat, subprocess
def createCleanList(s): def createCleanList(s):
"""
TODO: Add doc string.
"""
return sorted([q.strip() for q in s.split() if len(q.strip()) > 0]) return sorted([q.strip() for q in s.split() if len(q.strip()) > 0])
class AssertPythonSoftware(unittest.TestCase): class AssertPythonSoftware(unittest.TestCase):
"""
TODO: Add doc string.
"""
def test_python_version(self): def test_python_version(self):
"""
TODO: Add doc string.
"""
self.assertEqual((2,4), sys.version_info[:2]) self.assertEqual((2,4), sys.version_info[:2])
def test_use_generated_python(self): def test_use_generated_python(self):
"""
TODO: Add doc string.
"""
fd, name = tempfile.mkstemp() fd, name = tempfile.mkstemp()
try: try:
f = os.fdopen(fd, 'w') f = os.fdopen(fd, 'w')
...@@ -27,6 +45,9 @@ print sys.version_info[:2] ...@@ -27,6 +45,9 @@ print sys.version_info[:2]
os.unlink(name) os.unlink(name)
def test_required_libraries(self): def test_required_libraries(self):
"""
TODO: Add doc string.
"""
required_library_list = createCleanList(""" required_library_list = createCleanList("""
ERP5Diff ERP5Diff
MySQLdb MySQLdb
...@@ -65,96 +86,121 @@ print sys.version_info[:2] ...@@ -65,96 +86,121 @@ print sys.version_info[:2]
'Python libraries not found:\n'+'\n'.join(failed_library_list)) 'Python libraries not found:\n'+'\n'.join(failed_library_list))
class AssertLddLibs(unittest.TestCase): class AssertLddLibs(unittest.TestCase):
"""
TODO: Add doc string.
"""
def test_tritonn_senna(self): def test_tritonn_senna(self):
"""
TODO: Add doc string.
"""
result = os.system("ldd parts/mysql-tritonn-5.0/libexec/mysqld | grep -q " result = os.system("ldd parts/mysql-tritonn-5.0/libexec/mysqld | grep -q "
"'parts/senna/lib/libsenna.so.0'") "'parts/senna/lib/libsenna.so.0'")
self.assertEqual(result, 0) self.assertEqual(result, 0)
def test_MySQLdb(self): def test_MySQLdb(self):
"""
TODO: Add doc string.
"""
result = os.system("ldd develop-eggs/MySQL_python-1.2.3c1-py2.4-linux-x86" result = os.system("ldd develop-eggs/MySQL_python-1.2.3c1-py2.4-linux-x86"
"_64.egg/_mysql.so | grep -q 'parts/mysql-tritonn-5.0/lib/mysql/libmys" "_64.egg/_mysql.so | grep -q 'parts/mysql-tritonn-5.0/lib/mysql/libmys"
"qlclient_r.so'") "qlclient_r.so'")
self.assertEqual(result, 0) self.assertEqual(result, 0)
def test_memcached_libevent(self): def test_memcached_libevent(self):
"""
TODO: Add doc string.
"""
result = os.system("ldd parts/memcached/bin/memcached | grep -q 'parts/li" result = os.system("ldd parts/memcached/bin/memcached | grep -q 'parts/li"
"bevent/lib/libevent'") "bevent/lib/libevent'")
class AssertApache(unittest.TestCase): class AssertApache(unittest.TestCase):
"""
TODO: Add doc string.
"""
def test_modules(self): def test_modules(self):
"""
TODO: Add doc string.
"""
required_module_list = createCleanList(""" required_module_list = createCleanList("""
mod_authn_default.so authn_default_module
mod_log_config.so log_config_module
mod_proxy_http.so proxy_http_module
mod_authn_alias.so authn_alias_module
mod_authz_dbm.so authz_dbm_module
mod_case_filter_in.so case_filter_in_module
mod_imagemap.so imagemap_module
mod_setenvif.so setenvif_module
mod_include.so include_module
mod_charset_lite.so charset_lite_module
mod_info.so info_module
mod_cache.so cache_module
mod_actions.so actions_module
mod_proxy_connect.so proxy_connect_module
mod_auth_digest.so auth_digest_module
mod_unique_id.so unique_id_module
mod_mime_magic.so mime_magic_module
mod_disk_cache.so disk_cache_module
mod_mime.so mime_module
mod_usertrack.so usertrack_module
mod_asis.so asis_module
mod_optional_hook_import.so optional_hook_import_module
mod_negotiation.so negotiation_module
mod_proxy.so proxy_module
mod_authz_default.so authz_default_module
mod_ext_filter.so ext_filter_module
mod_auth_basic.so auth_basic_module
mod_authz_owner.so authz_owner_module
mod_authn_anon.so authn_anon_module
mod_rewrite.so rewrite_module
mod_proxy_balancer.so proxy_balancer_module
mod_substitute.so substitute_module
mod_filter.so filter_module
mod_expires.so expires_module
mod_autoindex.so autoindex_module
mod_status.so status_module
mod_cgid.so cgid_module
mod_version.so version_module
mod_echo.so echo_module
mod_optional_fn_export.so optional_fn_export_module
mod_optional_fn_import.so optional_fn_import_module
mod_ident.so ident_module
mod_cgi.so cgi_module
mod_bucketeer.so bucketeer_module
mod_optional_hook_export.so optional_hook_export_module
mod_vhost_alias.so vhost_alias_module
mod_ssl.so ssl_module
mod_authz_user.so authz_user_module
mod_env.so env_module
mod_logio.so logio_module
mod_proxy_ftp.so proxy_ftp_module
mod_example.so cern_meta_module
mod_cern_meta.so authz_groupfile_module
mod_authz_groupfile.so dir_module
mod_dir.so log_forensic_module
mod_log_forensic.so alias_module
mod_alias.so deflate_module
mod_deflate.so authn_dbm_module
mod_authn_dbm.so case_filter_module
mod_case_filter.so authz_host_module
mod_authz_host.so headers_module
mod_headers.so dumpio_module
mod_dumpio.so speling_module
mod_speling.so authn_file_module
mod_authn_file.so
""") """)
parts_path_prefix = os.path.join(os.path.dirname(__file__), '../parts')
result = os.popen("%s/apache/bin/httpd -M" % parts_path_prefix)
loaded_module_list = [module_name for module_name in result.read().split()
if module_name.endswith('module')]
result.close()
failed_module_list = [] failed_module_list = []
for module in required_module_list: for module in required_module_list:
if not os.path.exists('parts/apache/modules/%s' % module): if module not in loaded_module_list:
failed_module_list.append(module) failed_module_list.append(module)
self.assertEqual([], failed_module_list, self.assertEqual([], failed_module_list,
'Apache modules not found:\n'+'\n'.join(failed_module_list)) 'Apache modules not found:\n'+'\n'.join(failed_module_list))
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
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