Skip to content

Commit a7ba1b8

Browse files
psumberasunfishcode
authored andcommitted
Fixes tests on Solaris. (#1228)
Remaining two failing tests need more investigation: unix::test_unix_msg_with_combo unix_alloc::test_unix_msg_with_combo
1 parent aa53615 commit a7ba1b8

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

src/backend/libc/c.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub(crate) const O_LARGEFILE: c_int = linux_raw_sys::general::O_LARGEFILE as _;
9494

9595
// Gated under `_LARGEFILE_SOURCE` but automatically set by the kernel.
9696
// <https://github.com/illumos/illumos-gate/blob/fb2cb638e5604b214d8ea8d4f01ad2e77b437c17/usr/src/ucbhead/sys/fcntl.h#L64>
97-
#[cfg(target_os = "illumos")]
97+
#[cfg(solarish)]
9898
pub(crate) const O_LARGEFILE: c_int = 0x2000;
9999

100100
// TODO: This is new in Linux 6.11; remove when linux-raw-sys is updated.

src/backend/libc/fs/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ bitflags! {
334334
/// Note that rustix and/or libc will automatically set this flag when appropriate on
335335
/// `open(2)` and friends, thus typical users do not need to care about it.
336336
/// It will may be reported in return of `fcntl_getfl`, though.
337-
#[cfg(any(linux_kernel, target_os = "illumos"))]
337+
#[cfg(any(linux_kernel, solarish))]
338338
const LARGEFILE = bitcast!(c::O_LARGEFILE);
339339

340340
/// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>

tests/fs/file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ fn test_file() {
114114

115115
// Clear `O_LARGEFILE`, which may be set by rustix on 32-bit Linux or
116116
// automatically by some kernel on 64-bit (Linux and illumos).
117-
#[cfg(any(linux_kernel, target_os = "illumos"))]
117+
#[cfg(any(linux_kernel, solarish))]
118118
let fl = fl - rustix::fs::OFlags::LARGEFILE;
119119

120120
assert_eq!(fl, rustix::fs::OFlags::empty());

tests/net/dgram.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ fn net_dgram_v6_bind_any() {
345345
}
346346

347347
/// Test `sendto` with calling `connect`, on platforms which support that.
348-
#[cfg(not(any(bsd, target_os = "illumos")))]
348+
#[cfg(not(any(bsd, solarish)))]
349349
#[test]
350350
fn net_dgram_v4_connect_sendto() {
351351
crate::init();
@@ -439,7 +439,7 @@ fn net_dgram_v4_sendto() {
439439
}
440440

441441
/// Similar, but with V6.
442-
#[cfg(not(any(bsd, target_os = "illumos")))]
442+
#[cfg(not(any(bsd, solarish)))]
443443
#[test]
444444
fn net_dgram_v6_connect_sendto() {
445445
crate::init();
@@ -533,7 +533,7 @@ fn net_dgram_v6_sendto() {
533533
}
534534

535535
/// Test `sendto_any` with calling connect, on platforms which support that.
536-
#[cfg(not(any(bsd, target_os = "illumos")))]
536+
#[cfg(not(any(bsd, solarish)))]
537537
#[test]
538538
fn net_dgram_v4_connect_sendto_any() {
539539
crate::init();
@@ -621,7 +621,7 @@ fn net_dgram_v4_sendto_any() {
621621
}
622622

623623
/// Similar, but with V6.
624-
#[cfg(not(any(bsd, target_os = "illumos")))]
624+
#[cfg(not(any(bsd, solarish)))]
625625
#[test]
626626
fn net_dgram_v6_connect_sendto_any() {
627627
crate::init();

tests/net/sockopt.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,9 @@ fn test_sockopts_ipv4() {
312312
assert_eq!(sockopt::get_socket_domain(&s).unwrap(), AddressFamily::INET);
313313
assert_ne!(sockopt::get_ip_ttl(&s).unwrap(), 0);
314314
assert_ne!(sockopt::get_ip_ttl(&s).unwrap(), 77);
315-
#[cfg(not(any(bsd, windows, target_os = "illumos")))]
315+
#[cfg(not(any(bsd, windows, solarish)))]
316316
assert!(sockopt::get_ip_multicast_loop(&s).unwrap());
317-
#[cfg(not(any(bsd, windows, target_os = "illumos")))]
317+
#[cfg(not(any(bsd, windows, solarish)))]
318318
assert_eq!(sockopt::get_ip_multicast_ttl(&s).unwrap(), 1);
319319

320320
// Set the ip ttl.
@@ -323,7 +323,7 @@ fn test_sockopts_ipv4() {
323323
// Check the ip ttl.
324324
assert_eq!(sockopt::get_ip_ttl(&s).unwrap(), 77);
325325

326-
#[cfg(not(any(bsd, windows, target_os = "illumos")))]
326+
#[cfg(not(any(bsd, windows, solarish)))]
327327
{
328328
// Set the multicast loop flag;
329329
sockopt::set_ip_multicast_loop(&s, false).unwrap();

tests/net/unix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ fn do_test_unix_msg(addr: SocketAddrUnix) {
220220
// Don't ask me why, but this was seen to fail on FreeBSD.
221221
// `SocketAddrUnix::path()` returned `None` for some reason.
222222
// illumos and NetBSD too.
223-
#[cfg(not(any(target_os = "freebsd", target_os = "illumos", target_os = "netbsd")))]
223+
#[cfg(not(any(solarish, target_os = "freebsd", target_os = "netbsd")))]
224224
assert_eq!(
225225
Some(rustix::net::SocketAddrAny::Unix(addr.clone())),
226226
result.address

tests/net/unix_alloc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ fn do_test_unix_msg(addr: SocketAddrUnix) {
218218
// Don't ask me why, but this was seen to fail on FreeBSD.
219219
// `SocketAddrUnix::path()` returned `None` for some reason.
220220
// illumos and NetBSD too.
221-
#[cfg(not(any(target_os = "freebsd", target_os = "illumos", target_os = "netbsd")))]
221+
#[cfg(not(any(solarish, target_os = "freebsd", target_os = "netbsd")))]
222222
assert_eq!(
223223
Some(rustix::net::SocketAddrAny::Unix(addr.clone())),
224224
result.address

0 commit comments

Comments
 (0)