Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/check_cores_without_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

include(${CMAKE_CURRENT_LIST_DIR}/../../src/ros2_medkit_fault_reporter/cmake/fault_reporter_core.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/../../src/ros2_medkit_fault_manager/cmake/fault_manager_core.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/../../src/ros2_medkit_gateway/cmake/gateway_core.cmake)

add_executable(check_cores_without_ros main.cpp)
target_link_libraries(check_cores_without_ros PRIVATE fault_reporter_core fault_manager_core)
target_link_libraries(check_cores_without_ros PRIVATE fault_reporter_core fault_manager_core gateway_core)
1 change: 1 addition & 0 deletions scripts/check_cores_without_ros/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ WORKDIR /src
COPY src/ros2_medkit_fault_detection src/ros2_medkit_fault_detection
COPY src/ros2_medkit_fault_reporter src/ros2_medkit_fault_reporter
COPY src/ros2_medkit_fault_manager src/ros2_medkit_fault_manager
COPY src/ros2_medkit_gateway src/ros2_medkit_gateway
COPY scripts/check_cores_without_ros scripts/check_cores_without_ros
RUN CXX=g++-9 cmake -S scripts/check_cores_without_ros -B /tmp/b && cmake --build /tmp/b
RUN ldd /tmp/b/check_cores_without_ros | tee /tmp/ldd.txt && ! grep -q rclcpp /tmp/ldd.txt
Expand Down
17 changes: 11 additions & 6 deletions scripts/check_cores_without_ros/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
# check_cores_without_ros

Checks that the ROS-free cores (fault reporter core, fault manager core) build and run
without ROS. It builds them with plain CMake and gcc 9 on Ubuntu 20.04, the oldest compiler
the cores are checked with, then runs a small program that links them. The check fails if
the binary links `rclcpp`.
Checks that the ROS-free cores (fault reporter core, fault manager core, gateway core) build and
run without ROS. It builds them with plain CMake and gcc 9 on Ubuntu 20.04, the oldest compiler
the cores are checked with, then runs a small program that links them. The program also starts
the gateway REST server over minimal `GatewayServices` and reads `/api/v1/health`, `/api/v1/` and `/api/v1/version-info`. The check
fails if the binary links `rclcpp`.

```bash
scripts/check_cores_without_ros/run.sh
```

The CMake file includes `cmake/fault_reporter_core.cmake` and `cmake/fault_manager_core.cmake` by path, as the ament builds do. The image installs only g++-9, cmake, make and the dev packages of SQLite3, OpenSSL, nlohmann_json and
yaml-cpp. libpqxx is not installed, so the PostgreSQL backend is not built.
The CMake file includes `cmake/fault_reporter_core.cmake`, `cmake/fault_manager_core.cmake` and
`cmake/gateway_core.cmake` by path, as the ament builds do. The image installs only g++-9,
cmake, make and the dev packages of SQLite3, OpenSSL, nlohmann_json and yaml-cpp. libpqxx is
not installed, so the PostgreSQL backend is not built.

## What `main.cpp` checks

- Gateway: with `server_name`, `vendor_name` and `server_version` set in `RestConfig`, `GET /api/v1/` returns the name and version, and `GET /api/v1/version-info` returns the vendor name and version.

- Reporter core: a report below the local filter threshold is filtered, the next one reaches the sink, a PASSED report is
filtered by the same threshold, an empty fault code is not forwarded.
- Fault manager storage: a FAILED report creates a CONFIRMED fault, and `list_faults` returns it with its nanosecond time.
Expand Down
Loading
Loading