Skip to content

Commit

Permalink
bug/modbus_constructor (#657)
Browse files Browse the repository at this point in the history
* Pin all required packages
Update modbus constructor to prevent error
Add full trace logging for general errors in tests

* Fix pylint issue

---------

Co-authored-by: Jacob Boddey <[email protected]>
  • Loading branch information
jhughesbiot and jboddey authored Aug 4, 2024
1 parent 3b7b337 commit e803708
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions modules/test/base/python/src/test_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import os
import util
from datetime import datetime
import traceback

LOGGER = None
RESULTS_DIR = '/runtime/output/'
Expand Down Expand Up @@ -113,6 +114,7 @@ def run_tests(self):
except Exception as e: # pylint: disable=W0718
LOGGER.error(f'An error occurred whilst running {test["name"]}')
LOGGER.error(e)
traceback.print_exc()
else:
LOGGER.info(f'Test {test["name"]} not implemented. Skipping')
test['result'] = 'Error'
Expand Down
8 changes: 4 additions & 4 deletions modules/test/protocol/python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Required for BACnet protocol tests
netifaces
BAC0
pytz
netifaces==0.11.0
BAC0==23.7.3
pytz==2024.1

# Required for Modbus protocol tests
pymodbus
pymodbus==3.7.0
2 changes: 1 addition & 1 deletion modules/test/protocol/python/src/protocol_modbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def __init__(self, log, device_ip, config):
self._discrete_input_enabled = False

# Initialize the modbus client
self.client = ModbusClient(device_ip, self._port)
self.client = ModbusClient(host=device_ip, port=self._port)

# Connections created from this method are simple socket connections
# and aren't indicative of valid modbus
Expand Down

0 comments on commit e803708

Please sign in to comment.