Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: spdm-requester-emu: Remove the hello packet #113

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions test/spdm-requester-emu/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,39 +63,6 @@ extern crate alloc;
use alloc::sync::Arc;
use core::ops::DerefMut;

#[maybe_async::maybe_async]
async fn send_receive_hello(
stream: Arc<Mutex<TcpStream>>,
transport_encap: Arc<Mutex<dyn common::SpdmTransportEncap + Send + Sync>>,
transport_type: u32,
) {
println!("send test");
let mut payload = [0u8; 1024];

let mut transport_encap = transport_encap.lock();
let transport_encap = transport_encap.deref_mut();
let used = transport_encap
.encap(
Arc::new(b"Client Hello!\0"),
Arc::new(Mutex::new(&mut payload[..])),
false,
)
.await
.unwrap();

let _buffer_size = spdm_emu::spdm_emu::send_message(
stream.clone(),
transport_type,
SOCKET_SPDM_COMMAND_TEST,
&payload[0..used],
);
let mut buffer = [0u8; config::RECEIVER_BUFFER_SIZE];
let (_transport_type, _command, _payload) =
spdm_emu::spdm_emu::receive_message(stream, &mut buffer[..], ST1)
.await
.unwrap();
}

#[maybe_async::maybe_async]
async fn send_receive_stop(
stream: Arc<Mutex<TcpStream>>,
Expand Down Expand Up @@ -1535,16 +1502,6 @@ fn emu_main_inner() {
SOCKET_TRANSPORT_TYPE_MCTP
};

#[cfg(not(feature = "is_sync"))]
block_on(Box::pin(send_receive_hello(
socket.clone(),
transport_encap.clone(),
transport_type,
)));

#[cfg(feature = "is_sync")]
send_receive_hello(socket.clone(), transport_encap.clone(), transport_type);

let socket_io_transport = SocketIoTransport::new(socket.clone());
let socket_io_transport: Arc<Mutex<dyn SpdmDeviceIo + Send + Sync>> =
Arc::new(Mutex::new(socket_io_transport));
Expand Down
Loading