summaryrefslogtreecommitdiff
path: root/test/sys/test_socket.rs
diff options
context:
space:
mode:
authorAlan Somers <asomers@gmail.com>2020-12-02 17:47:35 -0700
committerAlan Somers <asomers@gmail.com>2020-12-06 22:35:30 -0700
commitbf7a5fd606ba48c789bdaf95da2779e46e5f83c6 (patch)
tree5ff9c603b744eff0c5d1763df5220a661087bb5f /test/sys/test_socket.rs
parenta1eb89568e50132339b5e8a1d5166fb5b5f9b0e8 (diff)
downloadnix-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/test_socket.rs')
-rw-r--r--test/sys/test_socket.rs14
1 files changed, 12 insertions, 2 deletions
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};