Commit fc81994b authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

Update Release Candidate

parents 912cdbc4 bd855c2e
Pipeline #37248 failed with stage
in 0 seconds
......@@ -31,9 +31,9 @@ exe = ${buildout:bin-directory}/gpython
[pygolang-repository]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/pygolang.git
repository = https://lab.nexedi.com/nexedi/pygolang
branch = master
revision = pygolang-0.1-69-g044deb35
revision = pygolang-0.1-77-g9434cf0
location = ${buildout:parts-directory}/pygolang
git-executable = ${git:location}/bin/git
......
......@@ -28,7 +28,7 @@ from setuptools import setup, find_packages
import glob
import os
version = '1.0.367'
version = '1.0.369'
name = 'slapos.cookbook'
long_description = open("README.rst").read()
......
......@@ -236,7 +236,12 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
# Create the rdiff-backup wrapper
# It is useful to separate it from the notifier so that we can run it manually.
remote_schema = '{ssh} -o "ConnectTimeout 300" -p %s {username}@{hostname}'.format(
remote_schema = ('{ssh} '
'-o "ConnectTimeout 300" '
'-o "ServerAliveCountMax 10" '
'-o "ServerAliveInterval 30" '
'-p %s '
'{username}@{hostname}').format(
ssh=self.options['sshclient-binary'],
username=parsed_url.username,
hostname=parsed_url.hostname
......
# -*- coding: utf-8 -*-
import httplib
import logging
import json
import os
......@@ -93,9 +92,6 @@ def requestRemoveToken(client, token_base_path):
reference = reference_key.split('.')[0]
try:
result = client.deleteToken(token)
except httplib.NOT_FOUND:
# Token is alread removed.
result = True
except Exception:
log.debug('Request delete token fail for %s... \n %s' % (request_file,
traceback.format_exc()))
......@@ -119,7 +115,7 @@ def requestRemoveToken(client, token_base_path):
os.unlink(ipv6_file)
else:
log.debug('Bad token. Request add token fail for %s...' % request_file)
log.debug('Bad token. Request remove token fail for %s...' % request_file)
def checkService(client, token_base_path, token_json, computer_partition):
token_dict = loadJsonFile(token_json)
......@@ -128,7 +124,7 @@ def checkService(client, token_base_path, token_json, computer_partition):
return
# Check token status
for slave_reference, token in token_dict.iteritems():
for slave_reference, token in token_dict.items():
log.info("%s %s" % (slave_reference, token))
status_file = os.path.join(token_base_path, '%s.status' % slave_reference)
if not os.path.exists(status_file):
......
[instance-profile]
filename = instance.cfg.in
md5sum = 9da5ea88824bdbf233d65c756b4cadbc
md5sum = 4dc7ebc5f38baca776f520e7f5ccf9a7
......@@ -7,6 +7,11 @@
"description": "The network (http / https) address of the gzipped PLC source project program file.",
"type": "string",
"default": ""
},
"runtime_plc_md5sum": {
"description": "The md5sum of the downloaded gzipped PLC source project program file. If empty, md5sum is not checked.",
"type": "string",
"default": ""
}
}
}
......@@ -18,6 +18,7 @@ offline = true
recipe = slapos.recipe.build:download-unpacked
offline = false
url = ${instance-parameter:configuration.runtime_plc_url}
md5sum = ${instance-parameter:configuration.runtime_plc_md5sum}
[instance-parameter]
recipe = slapos.cookbook:slapconfiguration
......
......@@ -71,17 +71,17 @@ class BeremizRuntimeTestCase(SlapOSInstanceTestCase):
for process in supervisor.getAllProcessInfo()]
self.assertIn('beremiz-runtime-on-watch', process_names)
def check_connexion(self, ip, port):
connexion_list = [] # test node debug
for connexion in psutil.net_connections(kind='tcp4'):
def check_connection(self, ip, port):
connection_list = [] # test node debug
for connection in psutil.net_connections(kind='tcp4'):
# test node debug
if connexion.laddr.port == port:
connexion_list.append(connexion)
if connection.laddr.port == port:
connection_list.append(connection)
# debug end
if connexion.laddr.ip == ip and connexion.laddr.port == port and connexion.status == 'ESTABLISHED':
if connection.laddr.ip == ip and connection.laddr.port == port and connection.status == 'ESTABLISHED':
return True
# test node debug
print(connexion_list)
print(connection_list)
test_path = self.computer_partition_root_path
with open(os.path.join(test_path, '.' + os.path.basename(test_path) + '_beremiz-runtime.log')) as log_file:
print(log_file.readlines()[-15:])
......@@ -89,4 +89,13 @@ class BeremizRuntimeTestCase(SlapOSInstanceTestCase):
return False
def test_opc_ua(self):
self.assertTrue(self.check_connexion('127.0.0.1', 4840))
self.assertTrue(self.check_connection('127.0.0.1', 4840))
class BeremizRuntimeWithMd5sumTestCase(BeremizRuntimeTestCase):
@classmethod
def getInstanceParameterDict(cls):
return {
"runtime_plc_url": "https://lab.nexedi.com/nexedi/osie/-/raw/dd9aea8012376124ad216e3516e4f33945d14fc5/Beremiz/beremiz_test_opc_ua/bin/beremiz_test_opc_ua.tgz",
"runtime_plc_md5sum": "6c918cc80505f65b2bd20cdd7f40ba68"
}
......@@ -15,11 +15,11 @@
[instance.cfg.in]
filename = instance.cfg.in
md5sum = da846d59eb75a82d0d392c396517e76d
md5sum = d7b01c5ad2817c893c429d3fdd9a28a3
[clamd.conf.in]
filename = clamd.conf.in
md5sum = bdd237340b052e97b19218c5b6098cb8
md5sum = 098c0631a70929bb5bb9e57871346e99
[freshclam.conf.in]
filename = freshclam.conf.in
......
......@@ -12,3 +12,13 @@ LocalSocketMode 660
ReadTimeout 30
# MaxScanTime is in milliseconds.
MaxScanTime 60000
ExtendedDetectionInfo yes
StreamMaxLength 25M
AlertExceedsMax yes
AlertBrokenExecutables yes
AlertBrokenMedia yes
AlertEncrypted yes
AlertEncryptedArchive yes
AlertEncryptedDoc yes
AlertOLE2Macros yes
AlertPartitionIntersection yes
......@@ -15,6 +15,7 @@ parts =
clamd-parts =
clamd
clamd-socket-promise
clamd-logrotate
freshclam-parts =
freshclam
......@@ -97,6 +98,12 @@ hash-files =
hash-existing-files =
{{ buildout.directory }}/.completed
[clamd-socket-promise]
<= monitor-promise-base
promise = check_command_execute
name = check_clamd_socket.py
config-command = test -S ${clam-config:clamd-socket-file}
[clamd-logrotate]
<= logrotate-entry-base
name = clamd
......
......@@ -19,6 +19,3 @@ develop = true
# The requirement ('msgpack<1,>=0.5.6') is not allowed by your [versions] constraint (1.0.5)
revision = c4443632e3541c064f5b43096099f4a8b74cbf58
[template-zope]
link-binary +=
${python3:location}/bin/2to3
software.cfg.json
\ No newline at end of file
{
"name": "ERP5",
"description": "ERP5, Open-Source ERP (using python3)",
"serialisation": "json-in-xml",
"software-type": {
"default": {
"title": "Default",
"software-type": "default",
"request": "instance-erp5-input-schema.json",
"response": "instance-erp5-output-schema.json",
"index": 0
}
}
}
......@@ -3,9 +3,6 @@ extends =
../../stack/erp5/buildout.cfg
../../stack/slapos-py2.cfg
[template-zope]
link-binary +=
${python2.7:location}/bin/2to3
# Test Suite: ERP5.UnitTest-Master ran at 2024/09/27 17:16:50.045835 UTC
......
......@@ -509,6 +509,12 @@
"https://shacache.nxdcdn.com/6c355def68b3c0427f21598cb054ffc893568902f205601ac60f192854769b31bc9cff8eeb6ce99ef975a8fb887d8d3e56fc6cd5ea5cb4b3bba1175c520047cb#57088b77f795ca44b00971e44782ee23"
],
"title": "FreeBSD 12.1 RELEASE bootonly x86_64"
},
{
"const": [
"https://shacache.nxdcdn.com/e72e03bbcc4c54ce4b8d5f360b47dab9ee514d754e8d78c403626cf000d6ae98d808b3bcff2201e3cf49c1be1b0f308f1cb5ed81676adcb1837dfc811d2451ac"
],
"title": "SUSE Linux Enterprise Server 15 SP6 x86_64"
}
]
},
......
......@@ -369,6 +369,12 @@
"https://shacache.nxdcdn.com/6c355def68b3c0427f21598cb054ffc893568902f205601ac60f192854769b31bc9cff8eeb6ce99ef975a8fb887d8d3e56fc6cd5ea5cb4b3bba1175c520047cb#57088b77f795ca44b00971e44782ee23"
],
"title": "FreeBSD 12.1 RELEASE bootonly x86_64"
},
{
"const": [
"https://shacache.nxdcdn.com/e72e03bbcc4c54ce4b8d5f360b47dab9ee514d754e8d78c403626cf000d6ae98d808b3bcff2201e3cf49c1be1b0f308f1cb5ed81676adcb1837dfc811d2451ac"
],
"title": "SUSE Linux Enterprise Server 15 SP6 x86_64"
}
]
},
......
......@@ -15,4 +15,4 @@
[template]
filename = instance.cfg
md5sum = 9493b2789de783c375920eec74252499
md5sum = 5f5378550470b551d280dd432878a0ba
......@@ -102,17 +102,6 @@ template = inline:#!/bin/sh
python -m unittest discover -v
rendered = $${re6stnet:location}/test-runner.sh
# XXX: Quick fix for tests failing due to python -E unknown option.
# When gpython:main supports -E, move back to using that instead.
[real-python-with-eggs]
recipe = slapos.recipe.template
inline =
#!/bin/sh
export PYTHONPATH=$(python -c "import sys; print(':'.join(p for p in sys.path if p))")
python=$(python -c "import sys; print(sys._gpy_underlying_executable)")
exec $python "$@"
output = $${buildout:bin-directory}/$${:_buildout_section_name_}
[slapos-test-runner-nxdtest-environment.sh]
recipe = slapos.recipe.template
output = $${create-directory:etc}/$${:_buildout_section_name_}
......@@ -182,9 +171,9 @@ inline =
)
TestCase(
"slapos.recipe.template",
# ['$${real-python-with-eggs:output}', '-m', 'unittest', 'slapos.recipe.template.tests.test_suite'],
# ['python', '-m', 'unittest', 'slapos.recipe.template.tests.test_suite'],
# XXX some test fail when running with unittest, so we keep using setup.py test
['$${real-python-with-eggs:output}', 'setup.py', 'test'],
['python', 'setup.py', 'test'],
cwd="""$${slapos.recipe.template:location}""",
summaryf=UnitTest.summary,
)
......@@ -216,7 +205,7 @@ inline =
)
TestCase(
"slapos.rebootstrap",
['$${real-python-with-eggs:output}', '-m', 'unittest', '-v', 'slapos.rebootstrap.tests.test_suite'],
['python', '-m', 'unittest', '-v', 'slapos.rebootstrap.tests.test_suite'],
cwd="""$${slapos.rebootstrap:location}""",
summaryf=UnitTest.summary,
)
......
......@@ -51,17 +51,30 @@ def setUpModule():
)
class SlaposTestingTestCase(SlapOSInstanceTestCase):
@classmethod
def requestDefaultInstance(cls, state='started'):
# This method is called for requesting and destroying (state='destroyed').
for name, url in zip(software_files, software_urls):
cls.slap.request(
computer_partition = cls.slap.request(
software_release=url,
software_type=None, # default
partition_reference='Instance_of_' + name,
partition_parameter_kw=cls._instance_parameter_dict,
state=state,
)
# one of the requested computer partitions
# to satisfy slapos.testing.testcase (slapos.core < 1.13.0)
# and to make it call waitForInstance (slapos.core >= 1.13.0).
return computer_partition
def test():
# Just test that each version of the software compiled and instantiates.
pass
def test(self):
# Just test that each version of the software compiles and instantiates.
# Check that all expected instances have been requested.
cp = self.slap.computer.getComputerPartitionList()
requested = {
p.getSoftwareRelease()._software_release: p.getConnectionParameterDict()
for p in self.slap.computer.getComputerPartitionList()
if p.getState() == 'started'
}
self.assertEqual(set(requested.keys()), set(software_urls))
self.assertTrue(all('environment-script' in d for d in requested.values()))
......@@ -14,7 +14,7 @@
# not need these here).
[pbsready]
filename = pbsready.cfg.in
md5sum = e24d0567cda7c72e39f6c8fcb0ede7ab
md5sum = 5fec0e5f892aaf06beb814e24e514cae
[pbsready-import]
filename = pbsready-import.cfg.in
......
......@@ -172,7 +172,6 @@ config-command = $${notifier-stalled-promise-bin:wrapper-path}
#--
#-- OpenSSH.
[resilient-sshd-config]
# XXX: Add timeout support
recipe = slapos.recipe.template
output = $${directory:etc}/resilient-sshd.conf
path_pid = $${directory:run}/resilient-sshd.pid
......@@ -186,6 +185,8 @@ inline =
PasswordAuthentication no
PubkeyAuthentication yes
ForceCommand $${rdiff-backup-server:wrapper}
ClientAliveInterval 30
ClientAliveCountMax 10
[sshd-raw-server]
recipe = slapos.cookbook:wrapper
......
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