mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
Tests: provides easy mount of temp fs (#7249)
This commit is contained in:
parent
3891ee1159
commit
c2505841e0
8 changed files with 82 additions and 26 deletions
|
@ -2288,7 +2288,7 @@ fn test_cp_one_file_system() {
|
|||
use crate::common::util::AtPath;
|
||||
use walkdir::WalkDir;
|
||||
|
||||
let scene = TestScenario::new(util_name!());
|
||||
let mut scene = TestScenario::new(util_name!());
|
||||
let at = &scene.fixtures;
|
||||
|
||||
// Test must be run as root (or with `sudo -E`)
|
||||
|
@ -2304,14 +2304,8 @@ fn test_cp_one_file_system() {
|
|||
let mountpoint_path = &at_src.plus_as_string(TEST_MOUNT_MOUNTPOINT);
|
||||
|
||||
scene
|
||||
.cmd("mount")
|
||||
.arg("-t")
|
||||
.arg("tmpfs")
|
||||
.arg("-o")
|
||||
.arg("size=640k") // ought to be enough
|
||||
.arg("tmpfs")
|
||||
.arg(mountpoint_path)
|
||||
.succeeds();
|
||||
.mount_temp_fs(mountpoint_path)
|
||||
.expect("mounting tmpfs failed");
|
||||
|
||||
at_src.touch(TEST_MOUNT_OTHER_FILESYSTEM_FILE);
|
||||
|
||||
|
@ -2324,7 +2318,7 @@ fn test_cp_one_file_system() {
|
|||
.succeeds();
|
||||
|
||||
// Ditch the mount before the asserts
|
||||
scene.cmd("umount").arg(mountpoint_path).succeeds();
|
||||
scene.umount_temp_fs();
|
||||
|
||||
assert!(!at_dst.file_exists(TEST_MOUNT_OTHER_FILESYSTEM_FILE));
|
||||
// Check if the other files were copied from the source folder hierarchy
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue