Skip to content

Commit 4f3c5aa

Browse files
committed
test_mv.rs: Remove ignore from test_mv_broken_symlink_to_another_fs
1 parent 6d1df56 commit 4f3c5aa

File tree

1 file changed

+4
-39
lines changed

1 file changed

+4
-39
lines changed

tests/by-util/test_mv.rs

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -623,56 +623,21 @@ fn test_mv_symlink_into_target() {
623623
ucmd.arg("dir-link").arg("dir").succeeds();
624624
}
625625

626-
#[cfg(all(unix, not(target_os = "android")))]
627-
#[ignore = "requires sudo"]
626+
#[cfg(target_os = "linux")]
628627
#[test]
629628
fn test_mv_broken_symlink_to_another_fs() {
630629
let scene = TestScenario::new(util_name!());
631630

632631
scene.fixtures.mkdir("foo");
633-
634-
let output = scene
635-
.cmd("sudo")
636-
.env("PATH", env!("PATH"))
637-
.args(&["-E", "--non-interactive", "ls"])
638-
.run();
639-
println!("test output: {output:?}");
640-
641-
let mount = scene
642-
.cmd("sudo")
643-
.env("PATH", env!("PATH"))
644-
.args(&[
645-
"-E",
646-
"--non-interactive",
647-
"mount",
648-
"none",
649-
"-t",
650-
"tmpfs",
651-
"foo",
652-
])
653-
.run();
654-
655-
if !mount.succeeded() {
656-
print!("Test skipped; requires root user");
657-
return;
658-
}
659-
660-
scene.fixtures.mkdir("bar");
661-
scene.fixtures.symlink_file("nonexistent", "bar/baz");
662-
632+
scene.fixtures.symlink_file("missing", "foo/dangling");
633+
let dest = "/dev/shm/foo";
663634
scene
664635
.ucmd()
665-
.arg("bar")
666636
.arg("foo")
637+
.arg(dest)
667638
.succeeds()
668639
.no_stderr()
669640
.no_stdout();
670-
671-
scene
672-
.cmd("sudo")
673-
.env("PATH", env!("PATH"))
674-
.args(&["-E", "--non-interactive", "umount", "foo"])
675-
.succeeds();
676641
}
677642

678643
#[test]

0 commit comments

Comments
 (0)