Skip to content

Commit 0a9018b

Browse files
authored
Rollup merge of #148135 - hax0kartik:fix-vx-unix-sock, r=Mark-Simulacrum
Ignore unix socket related tests for VxWorks Unix Sockets are not implemented in VxWorks, and therefore, ignore testcases related to UnixDatagram, UnixListener and UnixStream.
2 parents 2afb64e + ff13880 commit 0a9018b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

library/std/src/os/unix/net/tests.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ macro_rules! or_panic {
2424

2525
#[test]
2626
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
27+
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
2728
fn basic() {
2829
let dir = tmpdir();
2930
let socket_path = dir.path().join("sock");
@@ -51,6 +52,7 @@ fn basic() {
5152
}
5253

5354
#[test]
55+
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
5456
fn vectored() {
5557
let (mut s1, mut s2) = or_panic!(UnixStream::pair());
5658

@@ -71,6 +73,7 @@ fn vectored() {
7173
}
7274

7375
#[test]
76+
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
7477
fn pair() {
7578
let msg1 = b"hello";
7679
let msg2 = b"world!";
@@ -95,6 +98,7 @@ fn pair() {
9598

9699
#[test]
97100
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
101+
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
98102
fn try_clone() {
99103
let dir = tmpdir();
100104
let socket_path = dir.path().join("sock");
@@ -122,6 +126,7 @@ fn try_clone() {
122126

123127
#[test]
124128
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
129+
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
125130
fn iter() {
126131
let dir = tmpdir();
127132
let socket_path = dir.path().join("sock");
@@ -144,6 +149,7 @@ fn iter() {
144149
}
145150

146151
#[test]
152+
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
147153
fn long_path() {
148154
let dir = tmpdir();
149155
let socket_path = dir.path().join(
@@ -173,6 +179,7 @@ fn long_path() {
173179
#[cfg(not(target_os = "nto"))]
174180
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
175181
#[cfg_attr(target_os = "cygwin", ignore)] // Cygwin connect needs handshake
182+
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
176183
fn timeouts() {
177184
let dir = tmpdir();
178185
let socket_path = dir.path().join("sock");
@@ -202,6 +209,7 @@ fn timeouts() {
202209
#[test]
203210
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
204211
#[cfg_attr(target_os = "cygwin", ignore)] // Cygwin connect needs handshake
212+
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
205213
fn test_read_timeout() {
206214
let dir = tmpdir();
207215
let socket_path = dir.path().join("sock");
@@ -223,6 +231,7 @@ fn test_read_timeout() {
223231
#[test]
224232
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
225233
#[cfg_attr(target_os = "cygwin", ignore)] // Cygwin connect needs handshake
234+
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
226235
fn test_read_with_timeout() {
227236
let dir = tmpdir();
228237
let socket_path = dir.path().join("sock");
@@ -252,6 +261,7 @@ fn test_read_with_timeout() {
252261
#[test]
253262
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
254263
#[cfg_attr(target_os = "cygwin", ignore)] // Cygwin connect needs handshake
264+
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
255265
fn test_unix_stream_timeout_zero_duration() {
256266
let dir = tmpdir();
257267
let socket_path = dir.path().join("sock");
@@ -272,6 +282,7 @@ fn test_unix_stream_timeout_zero_duration() {
272282

273283
#[test]
274284
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
285+
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
275286
fn test_unix_datagram() {
276287
let dir = tmpdir();
277288
let path1 = dir.path().join("sock1");
@@ -290,6 +301,7 @@ fn test_unix_datagram() {
290301
#[test]
291302
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
292303
#[cfg_attr(target_os = "cygwin", ignore)] // Cygwin autobinds an address
304+
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
293305
fn test_unnamed_unix_datagram() {
294306
let dir = tmpdir();
295307
let path1 = dir.path().join("sock1");
@@ -308,6 +320,7 @@ fn test_unnamed_unix_datagram() {
308320

309321
#[test]
310322
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
323+
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
311324
fn test_unix_datagram_connect_to_recv_addr() {
312325
let dir = tmpdir();
313326
let path1 = dir.path().join("sock1");
@@ -334,6 +347,7 @@ fn test_unix_datagram_connect_to_recv_addr() {
334347
#[test]
335348
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
336349
#[cfg_attr(target_os = "cygwin", ignore)] // Cygwin autobinds an address
350+
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
337351
fn test_connect_unix_datagram() {
338352
let dir = tmpdir();
339353
let path1 = dir.path().join("sock1");
@@ -361,6 +375,7 @@ fn test_connect_unix_datagram() {
361375

362376
#[test]
363377
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
378+
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
364379
fn test_unix_datagram_recv() {
365380
let dir = tmpdir();
366381
let path1 = dir.path().join("sock1");
@@ -378,6 +393,7 @@ fn test_unix_datagram_recv() {
378393
}
379394

380395
#[test]
396+
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
381397
fn datagram_pair() {
382398
let msg1 = b"hello";
383399
let msg2 = b"world!";
@@ -404,6 +420,7 @@ fn datagram_pair() {
404420
// when passed zero Durations
405421
#[test]
406422
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
423+
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
407424
fn test_unix_datagram_timeout_zero_duration() {
408425
let dir = tmpdir();
409426
let path = dir.path().join("sock");
@@ -562,6 +579,7 @@ fn test_abstract_no_pathname_and_not_unnamed() {
562579

563580
#[test]
564581
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
582+
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
565583
fn test_unix_stream_peek() {
566584
let (txdone, rxdone) = crate::sync::mpsc::channel();
567585

@@ -595,6 +613,7 @@ fn test_unix_stream_peek() {
595613

596614
#[test]
597615
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
616+
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
598617
fn test_unix_datagram_peek() {
599618
let dir = tmpdir();
600619
let path1 = dir.path().join("sock");
@@ -620,6 +639,7 @@ fn test_unix_datagram_peek() {
620639

621640
#[test]
622641
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
642+
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
623643
fn test_unix_datagram_peek_from() {
624644
let dir = tmpdir();
625645
let path1 = dir.path().join("sock");

0 commit comments

Comments
 (0)