(id: &str, sandbox_id: &str, expires_at_ms: i64, revoked: bool)
| 79 | } |
| 80 | |
| 81 | fn make_session(id: &str, sandbox_id: &str, expires_at_ms: i64, revoked: bool) -> SshSession { |
| 82 | SshSession { |
| 83 | metadata: Some(openshell_core::proto::datamodel::v1::ObjectMeta { |
| 84 | id: id.to_string(), |
| 85 | name: format!("session-{id}"), |
| 86 | created_at_ms: 1000, |
| 87 | labels: HashMap::new(), |
| 88 | resource_version: 0, |
| 89 | }), |
| 90 | sandbox_id: sandbox_id.to_string(), |
| 91 | token: id.to_string(), |
| 92 | expires_at_ms, |
| 93 | revoked, |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | #[tokio::test] |
| 98 | async fn reaper_deletes_expired_sessions() { |
no outgoing calls
no test coverage detected