MCPcopy Create free account
hub / github.com/evilsocket/cake / test_handshake_with_auth

Function test_handshake_with_auth

cake-core/tests/protocol.rs:162–174  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

160
161#[tokio::test]
162async fn test_handshake_with_auth() {
163 let mock = MockWorker::bind().await;
164 let addr = mock.addr();
165 let key = "test-cluster-key-123";
166 let key_owned = key.to_string();
167 let worker = tokio::spawn(async move { mock.handle_one(Some(&key_owned)).await });
168
169 let (stream, info) = connect_and_handshake(addr, Some(key)).await;
170 assert_eq!(info.device, "cpu");
171
172 drop(stream);
173 let _ = worker.await;
174}
175
176#[tokio::test]
177async fn test_handshake_auth_wrong_key() {

Callers

nothing calls this directly

Calls 3

connect_and_handshakeFunction · 0.85
addrMethod · 0.80
handle_oneMethod · 0.80

Tested by

no test coverage detected