about summary refs log tree commit diff
path: root/library/std/src/fs
diff options
context:
space:
mode:
authorPeter Collingbourne <pcc@google.com>2022-10-12 13:43:59 -0700
committerPeter Collingbourne <pcc@google.com>2023-03-02 16:08:51 -0800
commitfed6fceb6f7f73e6870e84a2a3389cb71108f197 (patch)
treed8fc10b2ad3a2831470282226152192ec9e427b5 /library/std/src/fs
parent13471d3b2046cce78181dde6cfc146c09f55e29e (diff)
downloadrust-fed6fceb6f7f73e6870e84a2a3389cb71108f197.tar.gz
rust-fed6fceb6f7f73e6870e84a2a3389cb71108f197.zip
Make std tests pass on newer Android
Newer versions of Android forbid the creation of hardlinks as well as
Unix domain sockets in the /data filesystem via SELinux rules, which
causes several tests depending on this behavior to fail. So let's
skip these tests on Android with an #[ignore] directive.
Diffstat (limited to 'library/std/src/fs')
-rw-r--r--library/std/src/fs/tests.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs
index 909d9bf4093..d0edbfe22ef 100644
--- a/library/std/src/fs/tests.rs
+++ b/library/std/src/fs/tests.rs
@@ -935,6 +935,7 @@ fn readlink_not_symlink() {
 }
 
 #[test]
+#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating hardlinks
 fn links_work() {
     let tmpdir = tmpdir();
     let input = tmpdir.join("in.txt");
@@ -1431,6 +1432,7 @@ fn metadata_access_times() {
 
 /// Test creating hard links to symlinks.
 #[test]
+#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating hardlinks
 fn symlink_hard_link() {
     let tmpdir = tmpdir();
     if !got_symlink_permission(&tmpdir) {