Skip to content

Commit a6ea49b

Browse files
committed
add test with large RAM disk
1 parent 8fa77f3 commit a6ea49b

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tests/ramdisk.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use std::path::Path;
22

33
use bootloader_test_runner::run_test_kernel_with_ramdisk;
4+
use tempfile::NamedTempFile;
5+
46
static RAMDISK_PATH: &str = "tests/ramdisk.txt";
57

68
#[test]
@@ -26,3 +28,15 @@ fn memory_map() {
2628
Some(Path::new(RAMDISK_PATH)),
2729
);
2830
}
31+
32+
#[test]
33+
fn large_ramdisk() {
34+
// Create a large file to act as the RAM disk.
35+
let ramdisk = NamedTempFile::new().unwrap();
36+
ramdisk.as_file().set_len(1024 * 1024 * 16).unwrap();
37+
38+
run_test_kernel_with_ramdisk(
39+
env!("CARGO_BIN_FILE_TEST_KERNEL_RAMDISK_basic_boot"),
40+
Some(ramdisk.as_ref()),
41+
);
42+
}

0 commit comments

Comments
 (0)