Mercurial > crates > systemd-socket
view tests/systemd.rs @ 28:cfef4593e207
Run `cargo fmt`.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Sat, 19 Apr 2025 01:33:50 -0400 |
parents | bc76507dd878 |
children |
line wrap: on
line source
// This integration test requires presence of systemd-socket-activate use std::ffi::OsStr; use std::io; use std::process::{Child, Command}; mod comm; enum Test {} impl comm::Test for Test { const SOCKET_ADDR: &'static str = "systemd://secret_socket_of_satoshi_nakamoto"; fn spawn_slave(program_name: &OsStr) -> io::Result<Child> { Command::new("systemd-socket-activate") .arg("-l") .arg("127.0.0.1:4242") .arg("--fdname=secret_socket_of_satoshi_nakamoto") .arg("--setenv=SYSTEMD_SOCKET_INTEGRATION_TEST=slave") .arg(program_name) .spawn() } } #[test] #[cfg_attr( not(all(target_os = "linux", feature = "enable_systemd")), should_panic )] fn main() { comm::main::<Test>(); }