@@ -19,7 +19,6 @@ use std::ffi::CString;
19
19
use std:: fs:: DirBuilder ;
20
20
use std:: fs:: { self , File } ;
21
21
use std:: io:: Write ;
22
- use std:: mem;
23
22
use std:: os:: unix:: prelude:: * ;
24
23
#[ cfg( not( target_os = "redox" ) ) ]
25
24
use std:: path:: Path ;
@@ -336,11 +335,17 @@ macro_rules! execve_test_factory(
336
335
}
337
336
}
338
337
338
+ // These tests frequently fail on musl, probably due to
339
+ // https://github.com/nix-rust/nix/issues/555
340
+ #[ cfg_attr( target_env = "musl" , ignore) ]
339
341
#[ test]
340
342
fn test_cstr_ref( ) {
341
343
common_test( syscall_cstr_ref) ;
342
344
}
343
345
346
+ // These tests frequently fail on musl, probably due to
347
+ // https://github.com/nix-rust/nix/issues/555
348
+ #[ cfg_attr( target_env = "musl" , ignore) ]
344
349
#[ test]
345
350
fn test_cstring( ) {
346
351
common_test( syscall_cstring) ;
@@ -356,6 +361,8 @@ cfg_if!{
356
361
execve_test_factory!( test_fexecve, fexecve, File :: open( "/system/bin/sh" ) . unwrap( ) . into_raw_fd( ) ) ;
357
362
} else if #[ cfg( any( target_os = "freebsd" ,
358
363
target_os = "linux" ) ) ] {
364
+ // These tests frequently fail on musl, probably due to
365
+ // https://github.com/nix-rust/nix/issues/555
359
366
execve_test_factory!( test_execve, execve, CString :: new( "/bin/sh" ) . unwrap( ) . as_c_str( ) ) ;
360
367
execve_test_factory!( test_fexecve, fexecve, File :: open( "/bin/sh" ) . unwrap( ) . into_raw_fd( ) ) ;
361
368
} else if #[ cfg( any( target_os = "dragonfly" ,
@@ -378,11 +385,14 @@ execve_test_factory!(test_execvpe, execvpe, &CString::new("sh").unwrap());
378
385
cfg_if ! {
379
386
if #[ cfg( target_os = "android" ) ] {
380
387
use nix:: fcntl:: AtFlags ;
381
- execve_test_factory!( test_execveat_empty, execveat, File :: open( "/system/bin/sh" ) . unwrap( ) . into_raw_fd( ) ,
388
+ execve_test_factory!( test_execveat_empty, execveat,
389
+ File :: open( "/system/bin/sh" ) . unwrap( ) . into_raw_fd( ) ,
382
390
"" , AtFlags :: AT_EMPTY_PATH ) ;
383
- execve_test_factory!( test_execveat_relative, execveat, File :: open( "/system/bin/" ) . unwrap( ) . into_raw_fd( ) ,
391
+ execve_test_factory!( test_execveat_relative, execveat,
392
+ File :: open( "/system/bin/" ) . unwrap( ) . into_raw_fd( ) ,
384
393
"./sh" , AtFlags :: empty( ) ) ;
385
- execve_test_factory!( test_execveat_absolute, execveat, File :: open( "/" ) . unwrap( ) . into_raw_fd( ) ,
394
+ execve_test_factory!( test_execveat_absolute, execveat,
395
+ File :: open( "/" ) . unwrap( ) . into_raw_fd( ) ,
386
396
"/system/bin/sh" , AtFlags :: empty( ) ) ;
387
397
} else if #[ cfg( all( target_os = "linux" , any( target_arch ="x86_64" , target_arch ="x86" ) ) ) ] {
388
398
use nix:: fcntl:: AtFlags ;
@@ -466,9 +476,7 @@ fn test_fchown() {
466
476
fchown ( fd, uid, gid) . unwrap ( ) ;
467
477
fchown ( fd, uid, None ) . unwrap ( ) ;
468
478
fchown ( fd, None , gid) . unwrap ( ) ;
469
-
470
- mem:: drop ( path) ;
471
- fchown ( fd, uid, gid) . unwrap_err ( ) ;
479
+ fchown ( 999999999 , uid, gid) . unwrap_err ( ) ;
472
480
}
473
481
474
482
#[ test]
0 commit comments