Commit 52ac5e0b authored by Jérome Perrin's avatar Jérome Perrin

Update Release Candidate

parents f35e6966 b2096c96
Pipeline #14556 failed with stage
in 0 seconds
...@@ -14,7 +14,7 @@ recipe = slapos.recipe.build:gitclone ...@@ -14,7 +14,7 @@ recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/cloudooo.git repository = https://lab.nexedi.com/nexedi/cloudooo.git
branch = master branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
revision = bf99e5dea3ecf45c59083085540316c48cfa5488 revision = be6c35c0156e028f31da3ccb205afc6f95728d97
[cloudooo] [cloudooo]
recipe = zc.recipe.egg recipe = zc.recipe.egg
......
...@@ -28,7 +28,7 @@ from setuptools import setup, find_packages ...@@ -28,7 +28,7 @@ from setuptools import setup, find_packages
import glob import glob
import os import os
version = '1.0.171' version = '1.0.184'
name = 'slapos.cookbook' name = 'slapos.cookbook'
long_description = open("README.rst").read() long_description = open("README.rst").read()
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# not need these here). # not need these here).
[template-cloudooo] [template-cloudooo]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 6e4431cf4b0a0d034402604b1e2844c0 md5sum = e986de01a57161b32425f1cd3ccac924
[template-cloudooo-instance] [template-cloudooo-instance]
filename = instance-cloudooo.cfg.in filename = instance-cloudooo.cfg.in
......
...@@ -6,7 +6,7 @@ eggs-directory = {{ eggs_directory }} ...@@ -6,7 +6,7 @@ eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }} develop-eggs-directory = {{ develop_eggs_directory }}
offline = true offline = true
[slap-parameters] [slap-configuration]
recipe = slapos.cookbook:slapconfiguration recipe = slapos.cookbook:slapconfiguration
computer = ${slap-connection:computer-id} computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id} partition = ${slap-connection:partition-id}
...@@ -19,10 +19,10 @@ recipe = slapos.recipe.template:jinja2 ...@@ -19,10 +19,10 @@ recipe = slapos.recipe.template:jinja2
rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename} rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
extra-context = extra-context =
context = context =
key ipv6_set slap-parameters:ipv6 key ipv6_set slap-configuration:ipv6
key eggs_directory buildout:eggs-directory key eggs_directory buildout:eggs-directory
key develop_eggs_directory buildout:develop-eggs-directory key develop_eggs_directory buildout:develop-eggs-directory
key slapparameter_dict slap-parameters:configuration key slapparameter_dict slap-configuration:configuration
${:extra-context} ${:extra-context}
[cloudooo-dynamic-template-parameter-dict] [cloudooo-dynamic-template-parameter-dict]
...@@ -38,18 +38,10 @@ filename = instance-cloudooo.cfg ...@@ -38,18 +38,10 @@ filename = instance-cloudooo.cfg
extensions = jinja2.ext.do extensions = jinja2.ext.do
extra-context = extra-context =
section parameter_dict cloudooo-dynamic-template-parameter-dict section parameter_dict cloudooo-dynamic-template-parameter-dict
key ipv4_set slap-parameters:ipv4 key ipv4_set slap-configuration:ipv4
import itertools itertools import itertools itertools
[switch-softwaretype] [switch-softwaretype]
recipe = slapos.cookbook:softwaretype recipe = slapos.cookbook:switch-softwaretype
default = ${cloudooo-dynamic-template:rendered} default = cloudooo-dynamic-template:rendered
RootSoftwareInstance = ${:default}
[slap-connection]
# part to migrate to new - separated words
computer-id = ${slap_connection:computer_id}
partition-id = ${slap_connection:partition_id}
server-url = ${slap_connection:server_url}
software-release-url = ${slap_connection:software_release_url}
key-file = ${slap_connection:key_file}
cert-file = ${slap_connection:cert_file}
...@@ -197,14 +197,14 @@ class SlowHTTPServer(ManagedHTTPServer): ...@@ -197,14 +197,14 @@ class SlowHTTPServer(ManagedHTTPServer):
log_message = logging.getLogger(__name__ + '.SlowHandler').info log_message = logging.getLogger(__name__ + '.SlowHandler').info
class TestAccessLog(BalancerTestCase, CrontabMixin): class TestLog(BalancerTestCase, CrontabMixin):
"""Check access logs emitted by balancer """Check logs emitted by balancer
""" """
__partition_reference__ = 'l' __partition_reference__ = 'l'
@classmethod @classmethod
def _getInstanceParameterDict(cls): def _getInstanceParameterDict(cls):
# type: () -> Dict # type: () -> Dict
parameter_dict = super(TestAccessLog, cls)._getInstanceParameterDict() parameter_dict = super(TestLog, cls)._getInstanceParameterDict()
# use a slow server instead # use a slow server instead
parameter_dict['dummy_http_server'] = [[cls.getManagedResource("slow_web_server", SlowHTTPServer).netloc, 1, False]] parameter_dict['dummy_http_server'] = [[cls.getManagedResource("slow_web_server", SlowHTTPServer).netloc, 1, False]]
return parameter_dict return parameter_dict
...@@ -284,6 +284,22 @@ class TestAccessLog(BalancerTestCase, CrontabMixin): ...@@ -284,6 +284,22 @@ class TestAccessLog(BalancerTestCase, CrontabMixin):
self.assertTrue(os.path.exists(rotated_log_file + '.xz')) self.assertTrue(os.path.exists(rotated_log_file + '.xz'))
self.assertFalse(os.path.exists(rotated_log_file)) self.assertFalse(os.path.exists(rotated_log_file))
def test_error_log(self):
# stop backend server
backend_server = self.getManagedResource("slow_web_server", SlowHTTPServer)
self.addCleanup(backend_server.open)
backend_server.close()
# after a while, balancer should detect and log this event in error log
time.sleep(5)
self.assertEqual(
requests.get(self.default_balancer_url, verify=False).status_code,
requests.codes.service_unavailable)
with open(os.path.join(self.computer_partition_root_path, 'var', 'log', 'apache-error.log')) as error_log_file:
error_line = error_log_file.read().splitlines()[-1]
self.assertIn('proxy family_default has no server available!', error_line)
# this log also include a timestamp
self.assertRegexpMatches(error_line, r'\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}')
class BalancerCookieHTTPServer(ManagedHTTPServer): class BalancerCookieHTTPServer(ManagedHTTPServer):
"""An HTTP Server which can set balancer cookie. """An HTTP Server which can set balancer cookie.
......
...@@ -94,4 +94,4 @@ md5sum = 3f4f7e49c504cbf610fc5dc462713dfc ...@@ -94,4 +94,4 @@ md5sum = 3f4f7e49c504cbf610fc5dc462713dfc
[template-rsyslogd-cfg] [template-rsyslogd-cfg]
filename = rsyslogd.cfg.in filename = rsyslogd.cfg.in
md5sum = 7030e42b50e03f24e036b7785bd6159f md5sum = c34a9ee48b875148ea3f0d82cf853810
...@@ -7,7 +7,6 @@ module( ...@@ -7,7 +7,6 @@ module(
# Also cut out first empty space in msg, which is related to rsyslogd # Also cut out first empty space in msg, which is related to rsyslogd
# internal and end up cutting on 8k, as it's default of $MaxMessageSize # internal and end up cutting on 8k, as it's default of $MaxMessageSize
template(name="rawoutput" type="string" string="%msg:2:8192%\n") template(name="rawoutput" type="string" string="%msg:2:8192%\n")
$ActionFileDefaultTemplate rawoutput
$FileCreateMode 0600 $FileCreateMode 0600
$DirCreateMode 0700 $DirCreateMode 0700
...@@ -15,5 +14,5 @@ $Umask 0022 ...@@ -15,5 +14,5 @@ $Umask 0022
$WorkDirectory {{ parameter_dict['spool-directory'] }} $WorkDirectory {{ parameter_dict['spool-directory'] }}
local0.=info {{ parameter_dict['access-log-file'] }} local0.=info {{ parameter_dict['access-log-file'] }};rawoutput
local0.warning {{ parameter_dict['error-log-file'] }} local0.warning {{ parameter_dict['error-log-file'] }}
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