Skip to content

Commit

Permalink
fix: test case ut_lind_fs_mmap_chardev
Browse files Browse the repository at this point in the history
  • Loading branch information
lind committed Oct 24, 2024
1 parent 815991c commit 0478a60
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/tests/fs_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,9 +623,12 @@ pub mod fs_tests {
let _thelock = setup::lock_and_init();

let cage = interface::cagetable_getref(1);

// We are creating /dev/zero manually in this test since we are in the sandbox env.
// In a real system, /dev/zero typically exists as a special device file.
// Make the folder if it doesn't exist
let _ = cage.mkdir_syscall("/dev", S_IRWXA);
//Opening a character device file `/dev/zero`.
let fd = cage.open_syscall("/dev/zero", O_RDWR, S_IRWXA);
let fd = cage.open_syscall("/dev/zero", O_RDWR | O_CREAT, S_IRWXA);
//Writing into that file's first 9 bytes.
assert_eq!(cage.write_syscall(fd, str2cbuf("Test text"), 9), 9);

Expand Down

0 comments on commit 0478a60

Please sign in to comment.