summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2017-07-02 04:40:38 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2017-07-02 04:40:38 +0000
commita8baf55c102c6f059ceb6f6d8272b78610ae14c8 (patch)
treec134d245dad68b073079efe4c09e4301b4e90c7d
parent274b09eee1cdac51ceea9238d2e584babae48720 (diff)
parent899d20bf5013f8fc30c3fb5d0ee887d00a717385 (diff)
downloadnix-a8baf55c102c6f059ceb6f6d8272b78610ae14c8.zip
Merge #633
633: Skip the mount tests on kernel 4.4.0 r=asomers Some versions of that kernel have a known bug with tmpfs in namespaces. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1659087 Fixes #610
-rw-r--r--test/test_mount.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test_mount.rs b/test/test_mount.rs
index 42670216..57ff2106 100644
--- a/test/test_mount.rs
+++ b/test/test_mount.rs
@@ -17,6 +17,7 @@ mod test_mount {
use libc::{EACCES, EROFS};
+ use nix::errno::Errno;
use nix::mount::{mount, umount, MsFlags, MS_BIND, MS_RDONLY, MS_NOEXEC};
use nix::sched::{unshare, CLONE_NEWNS, CLONE_NEWUSER};
use nix::sys::stat::{self, S_IRWXU, S_IRWXG, S_IRWXO, S_IXUSR, S_IXGRP, S_IXOTH};
@@ -49,6 +50,23 @@ exit 23";
.write(true)
.mode((S_IRWXU | S_IRWXG | S_IRWXO).bits())
.open(&test_path)
+ .or_else(|e|
+ if Errno::from_i32(e.raw_os_error().unwrap()) == Errno::EOVERFLOW {
+ // Skip tests on certain Linux kernels which have a bug
+ // regarding tmpfs in namespaces.
+ // Ubuntu 14.04 and 16.04 are known to be affected; 16.10 is
+ // not. There is no legitimate reason for open(2) to return
+ // EOVERFLOW here.
+ // https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1659087
+ let stderr = io::stderr();
+ let mut handle = stderr.lock();
+ writeln!(handle, "Buggy Linux kernel detected. Skipping test.")
+ .unwrap();
+ process::exit(0);
+ } else {
+ panic!("open failed: {}", e);
+ }
+ )
.and_then(|mut f| f.write(SCRIPT_CONTENTS))
.unwrap_or_else(|e| panic!("write failed: {}", e));