test: validate grpc data connections with local docker and opcua cli
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
FROM python:3.13-slim
|
||||
WORKDIR /fixture
|
||||
COPY scripts/validation/grpc-data/device/server.py /fixture/server.py
|
||||
ARG DEVICE_TREE_HASH
|
||||
RUN test -n "$DEVICE_TREE_HASH" && printf '%s\n' "$DEVICE_TREE_HASH" > /fixture/source-hash
|
||||
EXPOSE 5020 8080
|
||||
USER 65534:65534
|
||||
ENTRYPOINT ["python", "-u", "/fixture/server.py"]
|
||||
|
||||
@@ -27,6 +27,9 @@ class DeviceState:
|
||||
self._lock = threading.RLock()
|
||||
self._registers = {0: 0, 10: 7, 11: 11, 12: 13}
|
||||
self._registers.update({address: 0 for address in range(20, 64)})
|
||||
self._registers.update({24: 7, 25: 11, 26: 13})
|
||||
text = b"grpc data source"
|
||||
self._registers.update({40 + offset // 2: int.from_bytes(text[offset:offset + 2], "big") for offset in range(0, len(text), 2)})
|
||||
self._effect_total = 0
|
||||
self._read_total = 0
|
||||
self._request_total = 0
|
||||
|
||||
Reference in New Issue
Block a user