Skip to content

Commit f5ccf27

Browse files
committed
integration-test: SNP: print device path
1 parent baf173e commit f5ccf27

File tree

1 file changed

+13
-1
lines changed
  • uefi-test-runner/src/proto/network

1 file changed

+13
-1
lines changed

uefi-test-runner/src/proto/network/snp.rs

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

33
use core::ops::DerefMut;
4+
use uefi::proto::device_path::text::{AllowShortcuts, DisplayOnly};
5+
use uefi::proto::device_path::DevicePath;
46
use uefi::proto::network::snp::{InterruptStatus, NetworkState, ReceiveFlags, SimpleNetwork};
57
use uefi::proto::network::MacAddress;
68
use uefi::{boot, Status};
@@ -47,11 +49,21 @@ pub fn test() {
4749
info!("Testing the simple network protocol");
4850

4951
let handles = boot::find_handles::<SimpleNetwork>().unwrap_or_default();
50-
5152
for handle in handles {
5253
let Ok(mut simple_network) = boot::open_protocol_exclusive::<SimpleNetwork>(handle) else {
5354
continue;
5455
};
56+
// Print device path
57+
{
58+
let simple_network_dvp = boot::open_protocol_exclusive::<DevicePath>(handle)
59+
.expect("Should have device path");
60+
log::info!(
61+
"Network interface: {}",
62+
simple_network_dvp
63+
.to_string(DisplayOnly(true), AllowShortcuts(true))
64+
.unwrap()
65+
);
66+
}
5567

5668
assert_eq!(
5769
simple_network.mode().state,

0 commit comments

Comments
 (0)