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] [instance-profile]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 928e0850bd68162c1b72e7281b59a4ee md5sum = 4dc7ebc5f38baca776f520e7f5ccf9a7
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"type": "string", "type": "string",
"default": "" "default": ""
}, },
"md5sum": { "runtime_plc_md5sum": {
"description": "The md5sum of the downloaded gzipped PLC source project program file. If empty, md5sum is not checked.", "description": "The md5sum of the downloaded gzipped PLC source project program file. If empty, md5sum is not checked.",
"type": "string", "type": "string",
"default": "" "default": ""
......
...@@ -18,7 +18,7 @@ offline = true ...@@ -18,7 +18,7 @@ offline = true
recipe = slapos.recipe.build:download-unpacked recipe = slapos.recipe.build:download-unpacked
offline = false offline = false
url = ${instance-parameter:configuration.runtime_plc_url} url = ${instance-parameter:configuration.runtime_plc_url}
md5sum = ${instance-parameter:configuration.md5sum} md5sum = ${instance-parameter:configuration.runtime_plc_md5sum}
[instance-parameter] [instance-parameter]
recipe = slapos.cookbook:slapconfiguration recipe = slapos.cookbook:slapconfiguration
......
...@@ -71,17 +71,17 @@ class BeremizRuntimeTestCase(SlapOSInstanceTestCase): ...@@ -71,17 +71,17 @@ class BeremizRuntimeTestCase(SlapOSInstanceTestCase):
for process in supervisor.getAllProcessInfo()] for process in supervisor.getAllProcessInfo()]
self.assertIn('beremiz-runtime-on-watch', process_names) self.assertIn('beremiz-runtime-on-watch', process_names)
def check_connexion(self, ip, port): def check_connection(self, ip, port):
connexion_list = [] # test node debug connection_list = [] # test node debug
for connexion in psutil.net_connections(kind='tcp4'): for connection in psutil.net_connections(kind='tcp4'):
# test node debug # test node debug
if connexion.laddr.port == port: if connection.laddr.port == port:
connexion_list.append(connexion) connection_list.append(connection)
# debug end # 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 return True
# test node debug # test node debug
print(connexion_list) print(connection_list)
test_path = self.computer_partition_root_path 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: with open(os.path.join(test_path, '.' + os.path.basename(test_path) + '_beremiz-runtime.log')) as log_file:
print(log_file.readlines()[-15:]) print(log_file.readlines()[-15:])
...@@ -89,4 +89,13 @@ class BeremizRuntimeTestCase(SlapOSInstanceTestCase): ...@@ -89,4 +89,13 @@ class BeremizRuntimeTestCase(SlapOSInstanceTestCase):
return False return False
def test_opc_ua(self): 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