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

Function test_handshake_hello_worker_info

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

Source from the content-addressed store, hash-verified

140
141#[tokio::test]
142async fn test_handshake_hello_worker_info() {
143 let mock = MockWorker::bind().await;
144 let addr = mock.addr();
145 let worker = tokio::spawn(async move { mock.handle_one(None).await });
146
147 let (mut stream, info) = connect_and_handshake(addr, None).await;
148
149 assert_eq!(info.device, "cpu");
150 assert!(!info.version.is_empty());
151
152 // Goodbye
153 Message::Goodbye.to_writer(&mut stream).await.unwrap();
154 let (_, resp) = Message::from_reader(&mut stream).await.unwrap();
155 assert!(matches!(resp, Message::WorkerInfo(_)));
156
157 drop(stream);
158 let _ = worker.await;
159}
160
161#[tokio::test]
162async fn test_handshake_with_auth() {

Callers

nothing calls this directly

Calls 4

connect_and_handshakeFunction · 0.85
addrMethod · 0.80
handle_oneMethod · 0.80
to_writerMethod · 0.80

Tested by

no test coverage detected