-
Notifications
You must be signed in to change notification settings - Fork 229
Expand file tree
/
Copy pathramdisk.rs
More file actions
42 lines (35 loc) · 1005 Bytes
/
ramdisk.rs
File metadata and controls
42 lines (35 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
use std::path::Path;
use bootloader_test_runner::run_test_kernel_with_ramdisk;
use tempfile::NamedTempFile;
static RAMDISK_PATH: &str = "tests/ramdisk.txt";
#[test]
fn basic_boot() {
run_test_kernel_with_ramdisk(
env!("CARGO_BIN_FILE_TEST_KERNEL_RAMDISK_basic_boot"),
Some(Path::new(RAMDISK_PATH)),
);
}
#[test]
fn check_ramdisk() {
run_test_kernel_with_ramdisk(
env!("CARGO_BIN_FILE_TEST_KERNEL_RAMDISK_ramdisk"),
Some(Path::new(RAMDISK_PATH)),
);
}
#[test]
fn memory_map() {
run_test_kernel_with_ramdisk(
env!("CARGO_BIN_FILE_TEST_KERNEL_RAMDISK_memory_map"),
Some(Path::new(RAMDISK_PATH)),
);
}
#[test]
fn large_ramdisk() {
// Create a large file to act as the RAM disk.
let ramdisk = NamedTempFile::new().unwrap();
ramdisk.as_file().set_len(1024 * 1024 * 16).unwrap();
run_test_kernel_with_ramdisk(
env!("CARGO_BIN_FILE_TEST_KERNEL_RAMDISK_large_ramdisk"),
Some(ramdisk.as_ref()),
);
}