Mercurial > crates > systemd-socket
view tests/systemd.rs @ 21:f6334887e3c8
Support `tokio` 1.0
Tokio 1.0 was already out for a while and this adds the missing support
for it. Deprecation of 0.2 and 0.3 is planned but they are staying for
now.
author | Martin Habovstiak <martin.habovstiak@gmail.com> |
---|---|
date | Sat, 13 Jul 2024 15:09:13 +0200 |
parents | bc76507dd878 |
children | cfef4593e207 |
line wrap: on
line source
// This integration test requires presence of systemd-socket-activate use std::io; use std::ffi::OsStr; use std::process::{Command, Child}; 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>(); }