Add some tests for running basic server functionality
Some checks failed
Build and test / check (push) Failing after 1m9s
Build and test / build (push) Successful in 1m34s
Build and test / test (push) Successful in 1m58s
Build and test / docs (push) Successful in 3m28s

This commit is contained in:
2026-02-09 11:11:19 +09:00
parent a5e5235c56
commit 8697809974
2 changed files with 25 additions and 0 deletions

View File

@@ -474,5 +474,11 @@ mod tests {
assert_eq!(user_entry.sessions[0].host, "host.example.com");
}
#[test]
fn test_finger_root() {
let user_entry = get_local_user("root").unwrap().unwrap();
assert_eq!(user_entry.username, "root");
}
// TODO: test serialization roundtrip
}

View File

@@ -240,3 +240,22 @@ pub async fn rwhod_packet_sender_task(
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_determine_relevant_interfaces() {
let interfaces = determine_relevant_interfaces().unwrap();
for interface in interfaces {
println!("Interface: {} Address: {}", interface.name, interface.addr);
}
}
#[test]
fn test_generate_rwhod_status_update() {
let status_update = generate_rwhod_status_update().unwrap();
println!("{:?}", status_update);
}
}