Commit a5b1024e authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

software/beremiz-runtime: move to python3

See !1601
parent ba4cfa3f
[instance-profile]
filename = instance.cfg.in
md5sum = 4b7e36bbb077f91cdde5a4a05502cf71
md5sum = 9da5ea88824bdbf233d65c756b4cadbc
......@@ -8,12 +8,11 @@ parts =
publish-connection-parameter
download-plc
beremiz-runtime
#beremiz-runtime-promise
http-promise
eggs-directory = {{ buildout['eggs-directory'] }}
develop-eggs-directory = {{ buildout['develop-eggs-directory'] }}
offline = true
extends = {{ template_monitor }}
[download-plc]
recipe = slapos.recipe.build:download-unpacked
......@@ -30,8 +29,8 @@ cert = ${slap-connection:cert-file}
configuration.runtime_plc_url =
configuration.runtime_plc_md5sum =
configuration.autostart = 1
configuration.interface = 0.0.0.0
configuration.port = 61248
configuration.interface = 127.0.0.1
configuration.port = 8009
# Create all needed directories, depending on your needs
[directory]
......@@ -41,6 +40,7 @@ etc = ${:home}/etc
var = ${:home}/var
script = ${:etc}/run
service = ${:etc}/service
promise = ${:etc}/promise
log = ${:var}/log
[beremiz-runtime]
......@@ -60,12 +60,11 @@ command-line =
{{ buildout['bin-directory'] }}/pythonwitheggs {{ buildout['directory'] }}/parts/beremiz-source/Beremiz_cli.py -k --project-home ${directory:home}/parts/download-plc/ build transfer run
wrapper-path = ${directory:service}/beremiz-runtime
[beremiz-runtime-promise]
<= monitor-promise-base
module = check_port_listening
name = beremiz-runtime.py
config-hostname= ${instance-parameter:configuration.interface}
config-port = ${instance-parameter:configuration.port}
[http-promise]
recipe = slapos.cookbook:check_port_listening
path = ${directory:promise}/${:_buildout_section_name_}
hostname = ${instance-parameter:configuration.interface}
port = ${instance-parameter:configuration.port}
[publish-connection-parameter]
recipe = slapos.cookbook:publish
......
......@@ -6,16 +6,9 @@ extends =
../../component/open62541/buildout.cfg
../../component/numpy/buildout.cfg
../../component/lxml-python/buildout.cfg
../../component/python-sslpsk/buildout.cfg
../../component/defaults.cfg
../../stack/monitor/buildout.cfg
../../stack/slapos.cfg
# Python2 versions for buildout (keep last)
../../stack/slapos-py2.cfg
parts =
beremiz-source
slapos-cookbook
instance-profile
python-interpreter
......@@ -47,44 +40,38 @@ post-install =
[beremiz-source]
recipe = slapos.recipe.build:gitclone
repository = https://github.com/beremiz/beremiz.git
revision = d0925aa2e32b0143fde5f51eb3ddd3bbb28975ba
revision = 2d061a6
git-executable = ${git:location}/bin/git
[beremiz]
recipe = zc.recipe.egg:develop
egg = beremiz
setup = ${beremiz-source:location}
[nevow-py3-source]
recipe = slapos.recipe.build:gitclone
repository = https://github.com/beremiz/nevow-py3.git
revision = 6deba72
git-executable = ${git:location}/bin/git
[Twisted]
recipe = zc.recipe.egg:custom
egg = Twisted
setup-eggs =
six
pathlib
incremental
[Nevow]
recipe = zc.recipe.egg:develop
egg = Nevow
setup = ${nevow-py3-source:location}
[python-interpreter]
recipe = zc.recipe.egg
interpreter = pythonwitheggs
eggs = click
prompt_toolkit
pygments
bitarray
future
six
Pyro
zeroconf-py2compat
pathlib
Nevow
eggs = aiofiles
aiosqlite
click
erpc
ifaddr
zeroconf
${Nevow:egg}
msgpack
autobahn
${numpy:egg}
${lxml-python:egg}
cycler
opcua
${beremiz:egg}
${Twisted:egg}
${python-sslpsk:egg}
asyncua
Twisted
extra-paths = ${beremiz-source:location}
[instance-profile]
recipe = slapos.recipe.template:jinja2
......@@ -93,45 +80,5 @@ output = ${buildout:directory}/instance.cfg
extensions = jinja2.ext.do
context =
section buildout buildout
raw template_monitor ${monitor2-template:output}
key openssl_location openssl:location
key gcc_location gcc:prefix
[versions]
Twisted = 20.3.0
attrs = 19.2.0
Automat = 0.3.0
zope.interface = 4.4.2
Nevow = 0.14.5
PyHamcrest = 2.0.2
Pyro = 3.16
bitarray = 2.1.3
constantly = 15.1.0
future = 0.18.2
hyperlink = 21.0.0
incremental = 21.3.0
pathlib = 1.0.1
zeroconf-py2compat = 0.19.10
# Required by:
# Automat==0.3.0
characteristic = 14.3.0
# Required by:
# zeroconf-py2compat==0.19.10
ifcfg = 0.21
# Required by:
# hyperlink==21.0.0
typing = 3.10.0.0
autobahn = 19.11.2
txaio = 18.8.1
idna = 2.10
click = 7.1.2
opcua = 0.98.13
trollius = 2.2.1
futures = 3.3.0
cycler = 0.10.0
sslpsk = 1.0.0
Tests for beremiz-runtime software release
##############################################################################
#
# 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.beremiz-runtime'
with open("README.md") as f:
long_description = f.read()
setup(
name=name,
version=version,
description="Test for SlapOS' Osie Coupler",
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',
'psutil',
],
zip_safe=True,
test_suite='test',
)
##############################################################################
# coding: utf-8
#
# Copyright (c) 2022 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 psutil
from slapos.testing.testcase import installSoftwareUrlList, makeModuleSetUpAndTestCaseClass
beremiz_runtime_software_release_url = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software.cfg'))
osie_coupler_software_release_url = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', '..', 'osie-coupler', 'software.cfg'))
_, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.abspath(beremiz_runtime_software_release_url))
def setUpModule():
installSoftwareUrlList(
SlapOSInstanceTestCase,
[beremiz_runtime_software_release_url, osie_coupler_software_release_url],
debug=bool(int(os.environ.get('SLAPOS_TEST_DEBUG', 0))),
)
class BeremizRuntimeTestCase(SlapOSInstanceTestCase):
@classmethod
def requestDefaultInstance(cls, state='started'):
osie_coupler_instance = cls.slap.request(
software_release=osie_coupler_software_release_url,
partition_reference='osie-coupler',
partition_parameter_kw={'mode': 1},
state=state,
)
return super().requestDefaultInstance(state=state)
@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"}
def test_process(self):
with self.slap.instance_supervisor_rpc as supervisor:
process_names = [process['name']
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'):
# test node debug
if connexion.laddr.port == port:
connexion_list.append(connexion)
# debug end
if connexion.laddr.ip == ip and connexion.laddr.port == port and connexion.status == 'ESTABLISHED':
return True
# test node debug
print(connexion_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:])
# debug end
return False
def test_opc_ua(self):
self.assertTrue(self.check_connexion('127.0.0.1', 4840))
......@@ -242,6 +242,11 @@ setup = ${slapos-repository:location}/software/erp5testnode/test/
egg = slapos.test.beremiz_ide
setup = ${slapos-repository:location}/software/beremiz-ide/test/
[slapos.test.beremiz-runtime-setup]
<= setup-develop-egg
egg = slapos.test.beremiz_runtime
setup = ${slapos-repository:location}/software/beremiz-runtime/test/
[slapos.test.mosquitto-setup]
<= setup-develop-egg
egg = slapos.test.mosquitto
......@@ -346,6 +351,7 @@ eggs +=
${slapos.cookbook-setup:egg}
${slapos.test.backupserver-setup:egg}
# ${slapos.test.beremiz-ide-setup:egg}
${slapos.test.beremiz-runtime-setup:egg}
${slapos.test.caucase-setup:egg}
${slapos.test.cloudooo-setup:egg}
${slapos.test.dream-setup:egg}
......@@ -436,6 +442,7 @@ tests =
json-schemas ${slapos.cookbook-setup:setup}
backupserver ${slapos.test.backupserver-setup:setup}
# beremiz-ide ${slapos.test.beremiz-ide-setup:setup}
beremiz-runtime ${slapos.test.beremiz-runtime-setup:setup}
caucase ${slapos.test.caucase-setup:setup}
cloudooo ${slapos.test.cloudooo-setup:setup}
dream ${slapos.test.dream-setup:setup}
......
......@@ -143,8 +143,10 @@ pip = 23.2.1
# Use SlapOS patched zc.recipe.egg (zc.recipe.egg 2.x is for Buildout 2)
zc.recipe.egg = 2.0.8.dev0+slapos002
aiofiles = 23.1.0:whl
aiohttp = 3.8.5:whl
aiosignal = 1.3.1:whl
aiosqlite = 0.19.0:whl
annotated-types = 0.6.0:whl
anyio = 4.3.0:whl
apache-libcloud = 2.4.0
......@@ -155,9 +157,12 @@ asttokens = 2.4.1:whl
async-generator = 1.10
async-lru = 2.0.4:whl
async-timeout = 4.0.3
asyncua = 1.0.4
atomicwrites = 1.4.0
atomize = 0.2.0
attrs = 23.1.0:whl
autobahn = 21.2.1
Automat = 22.10.0:whl
Babel = 2.14.0
backcall = 0.2.0
backports-abc = 0.5
......@@ -182,9 +187,11 @@ collective.recipe.shelloutput = 0.1
collective.recipe.template = 2.2
comm = 0.2.1:whl
configparser = 4.0.2:whl
constantly = 15.1.0
contextlib2 = 0.6.0.post1
croniter = 0.3.25
cryptography = 3.3.2+SlapOSPatched001
cycler = 0.11.0
dataclasses = 0.8
dateparser = 0.7.6
debugpy = 1.8.1
......@@ -195,6 +202,7 @@ dnspython = 1.16.0
entrypoints = 0.3:whl
enum34 = 1.1.10
erp5.util = 0.4.76
erpc = 1.12.0:whl
et-xmlfile = 1.0.1
exceptiongroup = 1.1.3:whl
executing = 2.0.1:whl
......@@ -215,11 +223,14 @@ h5py = 3.11.0
httpcore = 1.0.4:whl
httplib2 = 0.22.0
httpx = 0.27.0:whl
hyperlink = 21.0.0
idna = 3.4:whl
ifaddr = 0.2.0
igmp = 1.0.4
Importing = 1.10
importlib-metadata = 6.8.0:whl
importlib-resources = 5.10.2:whl
incremental = 22.10.0
inotify-simple = 1.1.1
ipaddress = 1.0.23
ipykernel = 6.29.3:whl
......@@ -369,6 +380,8 @@ tornado = 6.4
traitlets = 5.14.1:whl
trio = 0.22.0
trio-websocket = 0.9.2
Twisted = 22.4.0:whl
txaio = 23.1.1
typeguard = 3.0.2:whl
typing-extensions = 4.8.0:whl
tzlocal = 1.5.1
......@@ -392,6 +405,7 @@ zc.buildout.languageserver = 0.11.0
zc.lockfile = 1.4
ZConfig = 3.6.1
zdaemon = 4.2.0
zeroconf = 0.62.0:whl
zipp = 3.12.0:whl
zodburi = 2.5.0
zope.event = 5.0
......
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