diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-09-02 15:15:30 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-09-02 15:15:30 +0000 |
commit | 82b51a2b5dd9b5567d4cf15f4bf931d9e39528d1 (patch) | |
tree | 9c3f8eefb8f022159d27cc2a8ffffbd0ff9d22a0 /test/test_mount.rs | |
parent | 70cce1a384ec21c6ba0ef38d64d2f67333e4b7d7 (diff) | |
parent | ecad72a18e798870ae3591c6ea49a2dd544ba5f3 (diff) | |
download | nix-82b51a2b5dd9b5567d4cf15f4bf931d9e39528d1.zip |
Merge #900
900: deps: update tempfile to 3 r=Susurrus a=ignatenkobrain
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Co-authored-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Diffstat (limited to 'test/test_mount.rs')
-rw-r--r-- | test/test_mount.rs | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/test/test_mount.rs b/test/test_mount.rs index 89416a43..2e4f19cc 100644 --- a/test/test_mount.rs +++ b/test/test_mount.rs @@ -5,7 +5,7 @@ extern crate libc; extern crate nix; -extern crate tempdir; +extern crate tempfile; #[cfg(target_os = "linux")] mod test_mount { @@ -23,7 +23,7 @@ mod test_mount { use nix::sys::stat::{self, Mode}; use nix::unistd::getuid; - use tempdir::TempDir; + use tempfile; static SCRIPT_CONTENTS: &'static [u8] = b"#!/bin/sh exit 23"; @@ -32,8 +32,7 @@ exit 23"; const NONE: Option<&'static [u8]> = None; pub fn test_mount_tmpfs_without_flags_allows_rwx() { - let tempdir = TempDir::new("nix-test_mount") - .unwrap_or_else(|e| panic!("tempdir failed: {}", e)); + let tempdir = tempfile::tempdir().unwrap(); mount(NONE, tempdir.path(), @@ -89,8 +88,7 @@ exit 23"; } pub fn test_mount_rdonly_disallows_write() { - let tempdir = TempDir::new("nix-test_mount") - .unwrap_or_else(|e| panic!("tempdir failed: {}", e)); + let tempdir = tempfile::tempdir().unwrap(); mount(NONE, tempdir.path(), @@ -107,8 +105,7 @@ exit 23"; } pub fn test_mount_noexec_disallows_exec() { - let tempdir = TempDir::new("nix-test_mount") - .unwrap_or_else(|e| panic!("tempdir failed: {}", e)); + let tempdir = tempfile::tempdir().unwrap(); mount(NONE, tempdir.path(), @@ -146,13 +143,11 @@ exit 23"; } pub fn test_mount_bind() { - let tempdir = TempDir::new("nix-test_mount") - .unwrap_or_else(|e| panic!("tempdir failed: {}", e)); + let tempdir = tempfile::tempdir().unwrap(); let file_name = "test"; { - let mount_point = TempDir::new("nix-test_mount") - .unwrap_or_else(|e| panic!("tempdir failed: {}", e)); + let mount_point = tempfile::tempdir().unwrap(); mount(Some(tempdir.path()), mount_point.path(), |