mirror of
https://github.com/containers/youki
synced 2024-11-23 17:32:15 +01:00
adding test_make_parent_mount_private
This commit is contained in:
parent
c86c6bbdb8
commit
0550888bd3
@ -370,4 +370,28 @@ mod tests {
|
||||
assert_eq!(got.len(), 2);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_make_parent_mount_private() {
|
||||
let tmp_dir = TempDir::new("/tmp/test_make_parent_mount_private").unwrap();
|
||||
let m = Mount::new();
|
||||
assert!(m.make_parent_mount_private(tmp_dir.path()).is_ok());
|
||||
|
||||
let want = MountArgs {
|
||||
source: None,
|
||||
target: PathBuf::from("/"),
|
||||
fstype: None,
|
||||
flags: MsFlags::MS_PRIVATE,
|
||||
data: None,
|
||||
};
|
||||
let got = m
|
||||
.syscall
|
||||
.as_any()
|
||||
.downcast_ref::<TestHelperSyscall>()
|
||||
.unwrap()
|
||||
.get_mount_args();
|
||||
|
||||
assert_eq!(got.len(), 1);
|
||||
assert_eq!(want, got[0]);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user