Files
ardupilot/Tools/renode/tests
Andrew Tridgell 371990d846 Tools: mark Renode Python scripts executable
The pre-commit CI job rejects twelve Renode files whose Python shebangs are not matched by executable Git modes. Set their executable bits to match the other scripts and tests without changing file contents.
2026-09-05 20:44:29 +10:00
..

Renode flight tests

CI runs a single physics flight, the CubeOrangePlus QuadPlane mission, with the IMU, compass and barometer set fitted to a real CubeOrangePlus. Run it from the repository root:

Tools/renode/tests/fetch_renode.sh
Tools/renode/tests/test_physics_flight.py quadplane --renode build/renode/renode

CI also runs the complete Python test directory:

python3 -m pytest -q Tools/renode/tests

The reset and flash-model tests use build/renode/renode, or the executable specified by RENODE, and skip when neither is available.

The plane and copter scenarios and the CubeOrange SITL-on-hardware mission are not run by CI but remain available for local use:

Tools/renode/tests/test_physics_flight.py plane --renode build/renode/renode
Tools/renode/tests/test_physics_flight.py copter --renode build/renode/renode
Tools/renode/tests/test_mission.py

The fetch helper downloads the latest package for the host architecture from https://firmware.ardupilot.org/Tools/Renode/. It verifies the package size and SHA-256 against latest.json before extracting it. Set RENODE_PACKAGE_BASE_URL to use another package mirror, or set RENODE_SOURCE_REVISION to require a specific 40-character source revision. RENODE_PACKAGE_SHA256 additionally requires the package checksum to match a trusted value. CI pins both values in test_renode.yml; update both when changing the Renode package.

run.py downloads the SVD matching the exact MCU in the compiled hwdef.dat from https://firmware.ardupilot.org/Tools/Renode/data/SVD/, verifies its size and SHA-256, and caches it under ~/.cache/ardupilot/renode/data/SVD/. Use RENODE_DATA_CACHE to choose another cache or RENODE_DATA_BASE_URL to use a mirror.

The mission test builds Copter with Tools/scripts/sitl-on-hardware/sitl-on-hw.py, uploads and flies a four-waypoint mission, lands, downloads the DataFlash log over MAVLink, and validates the recorded flight. Test state, Renode output, and the downloaded flight.BIN are retained under build/renode-test/. The physics flights build the vehicle firmware and the renode-physics sidecar, fly a mission against it, and check that the detected sensor IDs match the real hardware before arming.

During development, reuse an existing firmware build with --skip-build, or pass APJ, BIN, HEX, or ELF firmware with --firmware. Supplying firmware skips the board firmware build but still builds the physics sidecar unless --skip-build is also used.

To boot a scenario and attach a ground station yourself, use --interactive:

Tools/renode/tests/test_physics_flight.py quadplane --interactive --skip-build

The command prints the MAVLink TCP endpoint, runs at real-time pace, and keeps Renode and the physics sidecar alive until Ctrl-C. Add --usb to export the emulated flight-controller USB device over USB/IP and automatically attach it to the Linux VHCI controller. Perform the one-time host setup first with sudo Tools/renode/usbip_attach.py --install-rules; attachment status is saved in usbip.log in the test artifact directory. Add --gdb to open an xterm running GDB; execution is halted at reset until continue is entered. GDB requires ELF firmware because APJ, BIN, and HEX images do not contain the ELF symbols needed by the debugger. When the harness builds firmware, --gdb automatically adds -g to the waf configure command. With --skip-build, the selected ELF must already contain debug symbols.