Skip to content

Commit b9e9fea

Browse files
committed
add rng device on qemu + passing rng test
1 parent 02533fe commit b9e9fea

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

uefi-test-runner/src/proto/rng.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@ use uefi::table::boot::{BootServices, OpenProtocolAttributes, OpenProtocolParams
55
pub fn test(image: Handle, bt: &BootServices) {
66
info!("Running rng protocol test");
77

8+
let handle = *bt
9+
.find_handles::<Rng>()
10+
.expect_success("Failed to get Rng handles")
11+
.first()
12+
.expect("No Rng handles");
13+
814
let rng = bt
915
.open_protocol::<Rng>(
1016
OpenProtocolParams {
11-
handle: image,
17+
handle,
1218
agent: image,
1319
controller: None,
1420
},

xtask/src/qemu.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ pub fn run_qemu(arch: UefiArch, opt: &QemuOpt) -> Result<()> {
277277
// QEMU by defaults enables a ton of devices which slow down boot.
278278
cmd.arg("-nodefaults");
279279

280+
cmd.args(&["-device", "virtio-rng-pci"]);
281+
280282
match arch {
281283
UefiArch::AArch64 => {
282284
// Use a generic ARM environment. Sadly qemu can't emulate a

0 commit comments

Comments
 (0)