Commit 7b43c950 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

software/beremiz-runtime: fix when md5sum option is not present

Also, md5sum option has been renamed runtime_plc_md5sum.

This is a fixup of 7df1d5fe.
parent bb0b3873
[instance-profile]
filename = instance.cfg.in
md5sum = 928e0850bd68162c1b72e7281b59a4ee
md5sum = 4dc7ebc5f38baca776f520e7f5ccf9a7
......@@ -8,7 +8,7 @@
"type": "string",
"default": ""
},
"md5sum": {
"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,7 +18,7 @@ offline = true
recipe = slapos.recipe.build:download-unpacked
offline = false
url = ${instance-parameter:configuration.runtime_plc_url}
md5sum = ${instance-parameter:configuration.md5sum}
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"
}
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