Same tests as the ECU matures


Run it
git clone https://github.com/remotivelabs/remotivelabs-topology-examples.git
cd remotivelabs-topology-examples
remotive topology build -f ethernet_p2p/instances/model.instance.yaml build
docker compose -f build/ethernet-p2p-model/docker-compose.yml up --build
In a second terminal, run the tests with cd ethernet_p2p/tests and uv run pytest -s -vv.
An ECU under development usually starts as a model, becomes software in a container and ends up as hardware. With RemotiveTopology the tests stay the same through all three: only the instance file that says how the ECU runs changes.
In this example ECUB is a gateway that forwards frames from ECUA on one Ethernet network (NET1) to ECUC on
another (NET2). The test sets signals on ECUA and checks that the same values arrive at ECUC.
- Ethernet peer-to-peer example
- Platform with two Ethernet channels: network.platform.yaml
ECUBas a behavioral model: model.instance.yaml and the modelECUBas a plain UDP script in a container: container.instance.yamlECUBoutside Docker, as external hardware would be: external.instance.yaml and ecub.py- The tests: tests/pytest
Build and start the model variant, then run the tests in a second terminal:
remotive topology build -f ethernet_p2p/instances/model.instance.yaml build
docker compose -f build/ethernet-p2p-model/docker-compose.yml up --build
# in another terminal
cd ethernet_p2p/tests
uv run pytest -s -vv
Notice:
- Swap
modelforcontainerorexternalin both commands to test the other variants. The external variant also needs host network setup, see the example README. - The test only talks to
ECUAandECUC, which is why it doesn't change whenECUBdoes.