Skip to content
Merged
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
12 changes: 12 additions & 0 deletions ros-z-tests/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,15 @@ pub fn check_rmw_zenoh_available() -> bool {
.map(|status| status.success())
.unwrap_or(false)
}

/// Check if demo_nodes_cpp package is available
#[allow(dead_code)]
pub fn check_demo_nodes_cpp_available() -> bool {
Command::new("ros2")
.args(["pkg", "prefix", "demo_nodes_cpp"])
.stdout(Stdio::null())
.stderr(Stdio::null())
.status()
.map(|status| status.success())
.unwrap_or(false)
}
8 changes: 8 additions & 0 deletions ros-z-tests/tests/service_interop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ fn test_ros2_server_ros_z_client() {
panic!("ros2 CLI not available");
}

if !check_demo_nodes_cpp_available() {
panic!(
"demo_nodes_cpp package not found!\n\
Please install it with: apt install ros-$ROS_DISTRO-demo-nodes-cpp\n\
Or ensure ROS environment is sourced: source /opt/ros/$ROS_DISTRO/setup.bash"
);
}

ensure_zenohd_running();

println!("\n=== Test: ROS2 server <-> ros-z client ===");
Expand Down
Loading