diff --git a/component/pygolang/buildout.cfg b/component/pygolang/buildout.cfg index 336e9dd4834ac3f9555f2e637e57f5813f3c1ea0..827e7ef96adfd398dc5eb95f0aa00ed904d2dac4 100644 --- a/component/pygolang/buildout.cfg +++ b/component/pygolang/buildout.cfg @@ -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 diff --git a/setup.py b/setup.py index 2adc01921c3c25725ea9932c9290262e638f69ed..45ff9d219a22dbc37ecaaf72ff2790c84ad6de59 100755 --- a/setup.py +++ b/setup.py @@ -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() diff --git a/slapos/recipe/pbs.py b/slapos/recipe/pbs.py index 100b9b096de7e47c042b5a75fec4abac107d577b..ef60c326f41f688f3990502b8f92bf871278f699 100644 --- a/slapos/recipe/pbs.py +++ b/slapos/recipe/pbs.py @@ -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 diff --git a/slapos/recipe/re6stnet/re6stnet.py b/slapos/recipe/re6stnet/re6stnet.py index 6b00dbbfa21fdabcb9c6bd91e8eb2ae134dcb2c8..8da32689fb6bb7311ed02d9d4803185170b1480e 100644 --- a/slapos/recipe/re6stnet/re6stnet.py +++ b/slapos/recipe/re6stnet/re6stnet.py @@ -1,5 +1,4 @@ # -*- 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): diff --git a/software/beremiz-runtime/buildout.hash.cfg b/software/beremiz-runtime/buildout.hash.cfg index 6622d13a664a4f26119a4339d18ec4014f16b9dd..940424a60c47fa741bb70639688b9241d98dc1e6 100644 --- a/software/beremiz-runtime/buildout.hash.cfg +++ b/software/beremiz-runtime/buildout.hash.cfg @@ -1,3 +1,3 @@ [instance-profile] filename = instance.cfg.in -md5sum = 9da5ea88824bdbf233d65c756b4cadbc +md5sum = 4dc7ebc5f38baca776f520e7f5ccf9a7 diff --git a/software/beremiz-runtime/instance-input-schema.json b/software/beremiz-runtime/instance-input-schema.json index c3a47eac0b5c3f88e73ee71cc1b088d2b2f57131..516204cc479e6bd5b5fd41dd4f994d3072e13305 100644 --- a/software/beremiz-runtime/instance-input-schema.json +++ b/software/beremiz-runtime/instance-input-schema.json @@ -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": "" } } } diff --git a/software/beremiz-runtime/instance.cfg.in b/software/beremiz-runtime/instance.cfg.in index eb2f3099fce1b2696ae170e7a2154b1da0666291..383617ff707fc02178f5d6f8b4f78f0083909c38 100644 --- a/software/beremiz-runtime/instance.cfg.in +++ b/software/beremiz-runtime/instance.cfg.in @@ -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 diff --git a/software/beremiz-runtime/test/test.py b/software/beremiz-runtime/test/test.py index 7cb3731d088396c050f2a379d8a95c4136d6412b..387112498b12cf67bfcdc9d74293909c6ee80e89 100644 --- a/software/beremiz-runtime/test/test.py +++ b/software/beremiz-runtime/test/test.py @@ -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" + } + diff --git a/software/clammit/buildout.hash.cfg b/software/clammit/buildout.hash.cfg index 0a39384db5fc7beb9ca69095dff54af19594e5fd..9769dcaa4dded0a8de0c8342de4bc0454cd6d895 100644 --- a/software/clammit/buildout.hash.cfg +++ b/software/clammit/buildout.hash.cfg @@ -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 diff --git a/software/clammit/clamd.conf.in b/software/clammit/clamd.conf.in index 473cae8c0bb838f8065f862e89fdf20732fc6f27..bf60d54834c45c0fa4d0cfb73a3bedd15a5cf000 100644 --- a/software/clammit/clamd.conf.in +++ b/software/clammit/clamd.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 diff --git a/software/clammit/instance.cfg.in b/software/clammit/instance.cfg.in index ba939e4714e4205062651f0af0b5d9319249718e..4ff3969a82294bdc539aa69caeef5414aea12442 100644 --- a/software/clammit/instance.cfg.in +++ b/software/clammit/instance.cfg.in @@ -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 diff --git a/software/erp5/software-py3.cfg b/software/erp5/software-py3.cfg index 770d754c987044116eed155138ae016f72d1775b..0a0b109ac2571d0c701087c95f373af2cdcdacc3 100644 --- a/software/erp5/software-py3.cfg +++ b/software/erp5/software-py3.cfg @@ -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 diff --git a/software/erp5/software-py3.cfg.json b/software/erp5/software-py3.cfg.json deleted file mode 120000 index 002a426ba10aa447f9a0ef3215187fa5d2f70151..0000000000000000000000000000000000000000 --- a/software/erp5/software-py3.cfg.json +++ /dev/null @@ -1 +0,0 @@ -software.cfg.json \ No newline at end of file diff --git a/software/erp5/software-py3.cfg.json b/software/erp5/software-py3.cfg.json new file mode 100644 index 0000000000000000000000000000000000000000..25b9055b27e846be9e394d1c6f35b662b0489f27 --- /dev/null +++ b/software/erp5/software-py3.cfg.json @@ -0,0 +1,14 @@ +{ + "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 + } + } +} diff --git a/software/erp5/software.cfg b/software/erp5/software.cfg index 7fe89cdbd85d18d1816d55d3a90058fc40acfd3f..eda164ec6c1bab61d7e71993eac4533804801f56 100644 --- a/software/erp5/software.cfg +++ b/software/erp5/software.cfg @@ -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 diff --git a/software/kvm/instance-kvm-cluster-input-schema.json b/software/kvm/instance-kvm-cluster-input-schema.json index ce511f86bb3d24e120ab75288f664dfb936f2241..930ee94e3b5d0fabfd015c16d11864379db181f8 100644 --- a/software/kvm/instance-kvm-cluster-input-schema.json +++ b/software/kvm/instance-kvm-cluster-input-schema.json @@ -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" } ] }, diff --git a/software/kvm/instance-kvm-input-schema.json b/software/kvm/instance-kvm-input-schema.json index 6f2fcdb32f94bca7afe009753777370369f16342..cc77fdf0b344c6c0e40fc38c932779c7c300e215 100644 --- a/software/kvm/instance-kvm-input-schema.json +++ b/software/kvm/instance-kvm-input-schema.json @@ -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" } ] }, diff --git a/software/slapos-testing/buildout.hash.cfg b/software/slapos-testing/buildout.hash.cfg index f61add779f3c94aea96ea724483cd608655958a6..14b00cad6165ed41179524b9e314580b103f3f23 100644 --- a/software/slapos-testing/buildout.hash.cfg +++ b/software/slapos-testing/buildout.hash.cfg @@ -15,4 +15,4 @@ [template] filename = instance.cfg -md5sum = 9493b2789de783c375920eec74252499 +md5sum = 5f5378550470b551d280dd432878a0ba diff --git a/software/slapos-testing/instance.cfg b/software/slapos-testing/instance.cfg index 92c66d1cbf5d31c457a0f50c24071444f975854e..589adf88e998c8099749e1116291eea155595ad2 100644 --- a/software/slapos-testing/instance.cfg +++ b/software/slapos-testing/instance.cfg @@ -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, ) diff --git a/software/slapos-testing/test/test.py b/software/slapos-testing/test/test.py index 7517962878b34cce9a54fba4c5f052d9058a7652..420491f2376156d66bffff76a4c25de6a77896af 100644 --- a/software/slapos-testing/test/test.py +++ b/software/slapos-testing/test/test.py @@ -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())) diff --git a/stack/resilient/buildout.hash.cfg b/stack/resilient/buildout.hash.cfg index 13fdab9b04dc23bd2ae89ea44969c67088b8db61..002423fee3313221a924730eb7c1c67cf86d6aa9 100644 --- a/stack/resilient/buildout.hash.cfg +++ b/stack/resilient/buildout.hash.cfg @@ -14,7 +14,7 @@ # not need these here). [pbsready] filename = pbsready.cfg.in -md5sum = e24d0567cda7c72e39f6c8fcb0ede7ab +md5sum = 5fec0e5f892aaf06beb814e24e514cae [pbsready-import] filename = pbsready-import.cfg.in diff --git a/stack/resilient/pbsready.cfg.in b/stack/resilient/pbsready.cfg.in index 4e2b7c0c1540babda04fb87b5a977ca5038e76e2..1709f26a4834bfaf666610810c9f80ff5c104bbf 100644 --- a/stack/resilient/pbsready.cfg.in +++ b/stack/resilient/pbsready.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