Add some tests for running basic server functionality
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user