Skip to content

Commit 88ee82c

Browse files
committed
integration-test: SNP: print device path
1 parent 9236836 commit 88ee82c

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

Lines changed: 13 additions & 1 deletion
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::DevicePath;
5+
use uefi::proto::device_path::text::{AllowShortcuts, DisplayOnly};
46
use uefi::proto::network::MacAddress;
57
use uefi::proto::network::snp::{InterruptStatus, NetworkState, ReceiveFlags, SimpleNetwork};
68
use uefi::{Status, boot};
@@ -39,11 +41,21 @@ pub fn test() {
3941
info!("Testing the simple network protocol");
4042

4143
let handles = boot::find_handles::<SimpleNetwork>().unwrap_or_default();
42-
4344
for handle in handles {
4445
let Ok(mut simple_network) = boot::open_protocol_exclusive::<SimpleNetwork>(handle) else {
4546
continue;
4647
};
48+
// Print device path
49+
{
50+
let simple_network_dvp = boot::open_protocol_exclusive::<DevicePath>(handle)
51+
.expect("Should have device path");
52+
log::info!(
53+
"Network interface: {}",
54+
simple_network_dvp
55+
.to_string(DisplayOnly(true), AllowShortcuts(true))
56+
.unwrap()
57+
);
58+
}
4759

4860
assert_eq!(
4961
simple_network.mode().state,

0 commit comments

Comments
 (0)