Skip to content

Commit 77526e8

Browse files
Fensteernobody
authored andcommitted
test_tcp_congestion only on x86 and x86_64
1 parent b7b096a commit 77526e8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/sys/test_sockopt.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use rand::{thread_rng, Rng};
22
use nix::sys::socket::{socket, sockopt, getsockopt, setsockopt, AddressFamily, SockType, SockFlag, SockProtocol};
3-
use std::ffi::OsString;
43

54
#[test]
65
fn test_so_buf() {
@@ -15,9 +14,15 @@ fn test_so_buf() {
1514
assert!(actual >= bufsize);
1615
}
1716

17+
// The CI doesn't supported getsockopt and setsockopt on emulated processors
1818
#[test]
19-
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
19+
#[cfg(all(
20+
any(target_arch = "x86", target_arch = "x86_64"),
21+
any(target_os = "freebsd", target_os = "linux")
22+
))]
2023
fn test_tcp_congestion() {
24+
use std::ffi::OsString;
25+
2126
let fd = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), None).unwrap();
2227

2328
let val = getsockopt(fd, sockopt::TcpCongestion).unwrap();

0 commit comments

Comments
 (0)