diff options
author | Alan Somers <asomers@gmail.com> | 2020-12-02 17:47:35 -0700 |
---|---|---|
committer | Alan Somers <asomers@gmail.com> | 2020-12-06 22:35:30 -0700 |
commit | bf7a5fd606ba48c789bdaf95da2779e46e5f83c6 (patch) | |
tree | 5ff9c603b744eff0c5d1763df5220a661087bb5f /test/sys | |
parent | a1eb89568e50132339b5e8a1d5166fb5b5f9b0e8 (diff) | |
download | nix-bf7a5fd606ba48c789bdaf95da2779e46e5f83c6.zip |
Switch all builds from Travis to Cirrus
Travis has been super-slow lately (> 6 hours per build). Cirrus is much
faster: about 20 minutes. Cirrus also has slightly better test
coverage, mainly because it doesn't use SECCOMP.
Also,
* Fix the Redox CI build. The old Travis configuration didn't actually
build for Redox, so we never noticed that Redox can't be built with a
stable compiler. Thanks to @coolreader18 for finding this.
* Disable the udp_offload tests on cross-tested platforms. These tests
are failing with ENOPROTOOPT in Cirrus-CI. I suspect it's due to a
lack of support in QEMU. These tests were skipped on Travis because
its kernel was too old.
* Fix require_kernel_version on Cirrus-CI. Cirrus reports the Linux
kernel version as 4.19.112+, which the semver crate can't handle.
* Fix test_setfsuid on Cirrus. When run on Cirrus, it seems like the
file in /tmp gets deleted as soon as it's closed. Probably an
overzealous temporary file cleaner. Use /var/tmp, because no
temporary file cleaner should run in there.
* Skip mount tests on Cirrus. They fail for an unknown reason.
Issue #1351
* Skip the AF_ALG tests on Cirrus-CI
Issue #1352
Diffstat (limited to 'test/sys')
-rw-r--r-- | test/sys/test_ptrace.rs | 2 | ||||
-rw-r--r-- | test/sys/test_socket.rs | 14 | ||||
-rw-r--r-- | test/sys/test_sockopt.rs | 2 | ||||
-rw-r--r-- | test/sys/test_uio.rs | 1 | ||||
-rw-r--r-- | test/sys/test_wait.rs | 1 |
5 files changed, 18 insertions, 2 deletions
diff --git a/test/sys/test_ptrace.rs b/test/sys/test_ptrace.rs index 3b60dd70..38cf408b 100644 --- a/test/sys/test_ptrace.rs +++ b/test/sys/test_ptrace.rs @@ -8,6 +8,8 @@ use nix::sys::ptrace::Options; #[cfg(any(target_os = "android", target_os = "linux"))] use std::mem; +use crate::*; + #[test] fn test_ptrace() { // Just make sure ptrace can be called at all, for now. diff --git a/test/sys/test_socket.rs b/test/sys/test_socket.rs index c5abb7ba..313b2d86 100644 --- a/test/sys/test_socket.rs +++ b/test/sys/test_socket.rs @@ -9,6 +9,8 @@ use std::slice; use std::str::FromStr; use libc::c_char; use tempfile; +#[cfg(any(target_os = "linux", target_os= "android"))] +use crate::*; #[test] pub fn test_inetv4_addr_to_sock_addr() { @@ -237,6 +239,9 @@ mod recvfrom { use nix::sys::socket::sockopt::{UdpGroSegment, UdpGsoSegment}; #[test] + // Disable the test on emulated platforms because it fails in Cirrus-CI. Lack of QEMU + // support is suspected. + #[cfg_attr(not(any(target_arch = "x86_64", target_arch="i686")), ignore)] pub fn gso() { require_kernel_version!(udp_offload::gso, ">= 4.18"); @@ -288,6 +293,9 @@ mod recvfrom { } #[test] + // Disable the test on emulated platforms because it fails in Cirrus-CI. Lack of QEMU + // support is suspected. + #[cfg_attr(not(any(target_arch = "x86_64", target_arch="i686")), ignore)] pub fn gro() { require_kernel_version!(udp_offload::gro, ">= 5.3"); @@ -592,12 +600,13 @@ pub fn test_af_alg_cipher() { ControlMessage, MsgFlags}; use nix::sys::socket::sockopt::AlgSetKey; + skip_if_cirrus!("Fails for an unknown reason Cirrus CI. Bug #1352"); // Travis's seccomp profile blocks AF_ALG // https://docs.docker.com/engine/security/seccomp/ skip_if_seccomp!(test_af_alg_cipher); let alg_type = "skcipher"; - let alg_name = "ctr(aes)"; + let alg_name = "ctr-aes-aesni"; // 256-bits secret key let key = vec![0u8; 32]; // 16-bytes IV @@ -660,6 +669,7 @@ pub fn test_af_alg_aead() { ControlMessage, MsgFlags}; use nix::sys::socket::sockopt::{AlgSetKey, AlgSetAeadAuthSize}; + skip_if_cirrus!("Fails for an unknown reason Cirrus CI. Bug #1352"); // Travis's seccomp profile blocks AF_ALG // https://docs.docker.com/engine/security/seccomp/ skip_if_seccomp!(test_af_alg_aead); @@ -1018,7 +1028,7 @@ fn test_too_large_cmsgspace() { fn test_impl_scm_credentials_and_rights(mut space: Vec<u8>) { use libc::ucred; use nix::sys::uio::IoVec; - use nix::unistd::{pipe, read, write, close, getpid, getuid, getgid}; + use nix::unistd::{pipe, write, close, getpid, getuid, getgid}; use nix::sys::socket::{socketpair, sendmsg, recvmsg, setsockopt, SockType, SockFlag, ControlMessage, ControlMessageOwned, MsgFlags}; diff --git a/test/sys/test_sockopt.rs b/test/sys/test_sockopt.rs index 8e2adced..56065931 100644 --- a/test/sys/test_sockopt.rs +++ b/test/sys/test_sockopt.rs @@ -1,5 +1,7 @@ use rand::{thread_rng, Rng}; use nix::sys::socket::{socket, sockopt, getsockopt, setsockopt, AddressFamily, SockType, SockFlag, SockProtocol}; +#[cfg(any(target_os = "android", target_os = "linux"))] +use crate::*; #[cfg(target_os = "linux")] #[test] diff --git a/test/sys/test_uio.rs b/test/sys/test_uio.rs index 4fa838c9..8d22bf17 100644 --- a/test/sys/test_uio.rs +++ b/test/sys/test_uio.rs @@ -203,6 +203,7 @@ fn test_process_vm_readv() { use nix::unistd::ForkResult::*; use nix::sys::signal::*; use nix::sys::wait::*; + use crate::*; require_capability!(CAP_SYS_PTRACE); let _ = crate::FORK_MTX.lock().expect("Mutex got poisoned by another test"); diff --git a/test/sys/test_wait.rs b/test/sys/test_wait.rs index d1056250..5bb298eb 100644 --- a/test/sys/test_wait.rs +++ b/test/sys/test_wait.rs @@ -67,6 +67,7 @@ mod ptrace { use nix::unistd::*; use nix::unistd::ForkResult::*; use libc::_exit; + use crate::*; fn ptrace_child() -> ! { ptrace::traceme().unwrap(); |