diff --git a/component/fluentd/buildout.cfg b/component/fluentd/buildout.cfg index 9ada652e453fe6f05220a70b97f0b9ecea9f16da..9d5c633f66777e83699cc25f0bdec0ac39073e28 100644 --- a/component/fluentd/buildout.cfg +++ b/component/fluentd/buildout.cfg @@ -10,9 +10,24 @@ recipe = rubygemsrecipe url = https://rubygems.org/rubygems/rubygems-2.4.8.zip ruby-executable = ${ruby:location}/bin/ruby gems = + msgpack==1.3.3 + cool.io==1.4.6 + http_parser.rb==0.6.0 + sigdump==0.2.4 + serverengine==2.2.3 + strptime==0.1.9 + thread_safe==0.3.6 + tzinfo==1.2.9 + tzinfo-data==1.2021.1 + yajl-ruby==1.4.1 fluentd==0.14.14 + httpclient==2.8.3 + json==2.5.1 + td-client==0.8.85 fluent-plugin-td==0.10.29 -gem-options = --no-ri --no-rdoc --with-icu-lib=${icu:location}/lib/ --with-icu-dir=${icu:location}/ +gem-options = + --with-icu-lib=${icu:location}/lib/ + --with-icu-dir=${icu:location}/ environment = LDFLAGS = -L${icu:location}/lib -Wl,-rpath=${icu:location}/lib CFLAGS = -I${icu:location}/include diff --git a/software/fluentd/software-py2.cfg b/software/fluentd/software-py2.cfg new file mode 100644 index 0000000000000000000000000000000000000000..e16642010a82f76a55b3170a4a099a8e8fccf34c --- /dev/null +++ b/software/fluentd/software-py2.cfg @@ -0,0 +1,6 @@ +[buildout] +extends = + software.cfg + +[python] +part = python2.7 diff --git a/software/fluentd/software.cfg b/software/fluentd/software.cfg index ae21a43229b9004d048f79f06ec35d14cf0a5b1f..361449c4561da75d3b7c7787c95ac7bfcc4170af 100644 --- a/software/fluentd/software.cfg +++ b/software/fluentd/software.cfg @@ -7,6 +7,9 @@ parts = instance-profile slapos-cookbook +[python] +part = python3 + [instance-profile] recipe = slapos.recipe.template:jinja2 template = ${:_profile_base_location_}/instance.cfg.in diff --git a/software/fluentd/test/README.md b/software/fluentd/test/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e1327662e0849258d4a31f13598082a8a8d596db --- /dev/null +++ b/software/fluentd/test/README.md @@ -0,0 +1 @@ +Tests for fluentd Software Release diff --git a/software/fluentd/test/setup.py b/software/fluentd/test/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..b813f24e656013dfc056bc5b0d324195402cd299 --- /dev/null +++ b/software/fluentd/test/setup.py @@ -0,0 +1,52 @@ +############################################################################## +# +# Copyright (c) 2018 Nexedi SA and Contributors. All Rights Reserved. +# +# 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 adviced 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 3 +# 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. +# +############################################################################## +from setuptools import setup, find_packages + +version = '0.0.1.dev0' +name = 'slapos.test.fluentd' +with open("README.md") as f: + long_description = f.read() + +setup(name=name, + version=version, + description="Test for SlapOS' fluentd", + long_description=long_description, + long_description_content_type='text/markdown', + maintainer="Nexedi", + maintainer_email="info@nexedi.com", + url="https://lab.nexedi.com/nexedi/slapos", + packages=find_packages(), + install_requires=[ + 'slapos.core', + 'slapos.libnetworkcache', + 'erp5.util', + 'supervisor', + 'six', + ], + zip_safe=True, + test_suite='test', + ) diff --git a/software/fluentd/test/test.py b/software/fluentd/test/test.py new file mode 100644 index 0000000000000000000000000000000000000000..3a9c37ff53fae5d757a6ef0733ec3f24a50cca13 --- /dev/null +++ b/software/fluentd/test/test.py @@ -0,0 +1,52 @@ +############################################################################## +# +# Copyright (c) 2018 Nexedi SA and Contributors. All Rights Reserved. +# +# 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 adviced 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 3 +# 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 six + +from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass + + +setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass( + os.path.abspath( + os.path.join(os.path.dirname(__file__), '..', + 'software%s.cfg' % ("-py2" if six.PY2 else "")))) + +class FluentdTestCase(SlapOSInstanceTestCase): + __partition_reference__ = 'fluentd' + + def test_process(self): + expected_process_name_list = [ + 'fluentd-service-on-watch', + ] + + with self.slap.instance_supervisor_rpc as supervisor: + process_names = [process['name'] + for process in supervisor.getAllProcessInfo()] + + for expected_process_name in expected_process_name_list: + self.assertIn(expected_process_name, process_names) diff --git a/software/slapos-sr-testing/software.cfg b/software/slapos-sr-testing/software.cfg index c5212f9ad8fbe09fdf7795ae439a0238949008d4..721fd2156f516704704bd00aa4ccb4df46da8db5 100644 --- a/software/slapos-sr-testing/software.cfg +++ b/software/slapos-sr-testing/software.cfg @@ -114,6 +114,11 @@ setup = ${slapos-repository:location}/software/slaprunner/test/ egg = slapos.test.metabase setup = ${slapos-repository:location}/software/metabase/test/ +[slapos.test.fluentd-setup] +<= setup-develop-egg +egg = slapos.test.fluentd +setup = ${slapos-repository:location}/software/fluentd/test/ + [slapos.test.helloworld-setup] <= setup-develop-egg egg = slapos.test.helloworld @@ -236,6 +241,7 @@ extra-eggs = ${slapos.test.jscrawler-setup:egg} ${slapos.test.html5as-setup:egg} ${slapos.test.html5as-base-setup:egg} + ${slapos.test.fluentd-setup:egg} # We don't name this interpreter `python`, so that when we run slapos node # software, installation scripts running `python` use a python without any @@ -289,6 +295,7 @@ tests = # the version of Python that is used to run the test. # Due to a bug in the way promises are run, we may also list some Py3-only SR # here, to check there's no promise issue when slapos node runs with Python 2. + fluentd ${slapos.test.fluentd-setup:setup} kvm ${slapos.test.kvm-setup:setup} slaprunner ${slapos.test.slaprunner-setup:setup} metabase ${slapos.test.metabase-setup:setup} diff --git a/software/wendelin-scalability/test-fluentd-common.cfg b/software/wendelin-scalability/test-fluentd-common.cfg index af1d9c73a989561f64c2cb6da86afe9ad8b86be3..1e30c600040a3d2e8d0d4342428645f1eec3f1a3 100644 --- a/software/wendelin-scalability/test-fluentd-common.cfg +++ b/software/wendelin-scalability/test-fluentd-common.cfg @@ -1,6 +1,6 @@ [buildout] extends = - ../fluentd/software.cfg + ../fluentd/software-py2.cfg test-common.cfg [template-erp5]