@@ -19,7 +19,6 @@ use std::ffi::CString;
1919use std:: fs:: DirBuilder ;
2020use std:: fs:: { self , File } ;
2121use std:: io:: Write ;
22- use std:: mem;
2322use std:: os:: unix:: prelude:: * ;
2423#[ cfg( not( target_os = "redox" ) ) ]
2524use std:: path:: Path ;
@@ -336,11 +335,17 @@ macro_rules! execve_test_factory(
336335 }
337336 }
338337
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) ]
339341 #[ test]
340342 fn test_cstr_ref( ) {
341343 common_test( syscall_cstr_ref) ;
342344 }
343345
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) ]
344349 #[ test]
345350 fn test_cstring( ) {
346351 common_test( syscall_cstring) ;
@@ -356,6 +361,8 @@ cfg_if!{
356361 execve_test_factory!( test_fexecve, fexecve, File :: open( "/system/bin/sh" ) . unwrap( ) . into_raw_fd( ) ) ;
357362 } else if #[ cfg( any( target_os = "freebsd" ,
358363 target_os = "linux" ) ) ] {
364+ // These tests frequently fail on musl, probably due to
365+ // https://github.com/nix-rust/nix/issues/555
359366 execve_test_factory!( test_execve, execve, CString :: new( "/bin/sh" ) . unwrap( ) . as_c_str( ) ) ;
360367 execve_test_factory!( test_fexecve, fexecve, File :: open( "/bin/sh" ) . unwrap( ) . into_raw_fd( ) ) ;
361368 } else if #[ cfg( any( target_os = "dragonfly" ,
@@ -378,11 +385,14 @@ execve_test_factory!(test_execvpe, execvpe, &CString::new("sh").unwrap());
378385cfg_if ! {
379386 if #[ cfg( target_os = "android" ) ] {
380387 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( ) ,
382390 "" , 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( ) ,
384393 "./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( ) ,
386396 "/system/bin/sh" , AtFlags :: empty( ) ) ;
387397 } else if #[ cfg( all( target_os = "linux" , any( target_arch ="x86_64" , target_arch ="x86" ) ) ) ] {
388398 use nix:: fcntl:: AtFlags ;
@@ -466,9 +476,7 @@ fn test_fchown() {
466476 fchown ( fd, uid, gid) . unwrap ( ) ;
467477 fchown ( fd, uid, None ) . unwrap ( ) ;
468478 fchown ( fd, None , gid) . unwrap ( ) ;
469-
470- mem:: drop ( path) ;
471- fchown ( fd, uid, gid) . unwrap_err ( ) ;
479+ fchown ( 999999999 , uid, gid) . unwrap_err ( ) ;
472480}
473481
474482#[ test]
0 commit comments