File tree 1 file changed +13
-1
lines changed
uefi-test-runner/src/proto/network
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
// SPDX-License-Identifier: MIT OR Apache-2.0
2
2
3
3
use core:: ops:: DerefMut ;
4
+ use uefi:: proto:: device_path:: DevicePath ;
5
+ use uefi:: proto:: device_path:: text:: { AllowShortcuts , DisplayOnly } ;
4
6
use uefi:: proto:: network:: MacAddress ;
5
7
use uefi:: proto:: network:: snp:: { InterruptStatus , NetworkState , ReceiveFlags , SimpleNetwork } ;
6
8
use uefi:: { Status , boot} ;
@@ -39,11 +41,21 @@ pub fn test() {
39
41
info ! ( "Testing the simple network protocol" ) ;
40
42
41
43
let handles = boot:: find_handles :: < SimpleNetwork > ( ) . unwrap_or_default ( ) ;
42
-
43
44
for handle in handles {
44
45
let Ok ( mut simple_network) = boot:: open_protocol_exclusive :: < SimpleNetwork > ( handle) else {
45
46
continue ;
46
47
} ;
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
+ }
47
59
48
60
assert_eq ! (
49
61
simple_network. mode( ) . state,
You can’t perform that action at this time.
0 commit comments