File tree Expand file tree Collapse file tree 6 files changed +25
-7
lines changed
Expand file tree Collapse file tree 6 files changed +25
-7
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,9 @@ fn test_fifo_symlink() {
9898}
9999
100100#[ test]
101- #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
101+ // TODO(#7542): Re-enable on Android once we figure out why setting limit is broken.
102+ // #[cfg(any(target_os = "linux", target_os = "android"))]
103+ #[ cfg( target_os = "linux" ) ]
102104fn test_closes_file_descriptors ( ) {
103105 // Each file creates a pipe, which has two file descriptors.
104106 // If they are not closed then five is certainly too many.
Original file line number Diff line number Diff line change @@ -81,11 +81,13 @@ fn test_env_version() {
8181}
8282
8383#[ test]
84+ #[ cfg( unix) ]
8485fn test_env_permissions ( ) {
86+ // Try to execute `empty` in test fixture, that does not have exec permission.
8587 new_ucmd ! ( )
86- . arg ( "." )
88+ . arg ( "./empty " )
8789 . fails_with_code ( 126 )
88- . stderr_is ( "env: '.': Permission denied\n " ) ;
90+ . stderr_is ( "env: './empty ': Permission denied\n " ) ;
8991}
9092
9193#[ test]
Original file line number Diff line number Diff line change @@ -1090,7 +1090,9 @@ fn test_merge_batch_size() {
10901090}
10911091
10921092#[ test]
1093- #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
1093+ // TODO(#7542): Re-enable on Android once we figure out why setting limit is broken.
1094+ // #[cfg(any(target_os = "linux", target_os = "android"))]
1095+ #[ cfg( target_os = "linux" ) ]
10941096fn test_merge_batch_size_with_limit ( ) {
10951097 use rlimit:: Resource ;
10961098 // Currently need...
Original file line number Diff line number Diff line change @@ -1627,7 +1627,9 @@ fn test_round_robin() {
16271627}
16281628
16291629#[ test]
1630- #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
1630+ // TODO(#7542): Re-enable on Android once we figure out why rlimit is broken.
1631+ // #[cfg(any(target_os = "linux", target_os = "android"))]
1632+ #[ cfg( target_os = "linux" ) ]
16311633fn test_round_robin_limited_file_descriptors ( ) {
16321634 new_ucmd ! ( )
16331635 . args ( & [ "-n" , "r/40" , "onehundredlines.txt" ] )
Original file line number Diff line number Diff line change @@ -1215,6 +1215,17 @@ impl TestScenario {
12151215 command
12161216 }
12171217
1218+ /// Returns builder for invoking a command in shell (e.g. sh -c 'cmd').
1219+ /// Paths given are treated relative to the environment's unique temporary
1220+ /// test directory.
1221+ pub fn cmd_shell < S : AsRef < OsStr > > ( & self , cmd : S ) -> UCommand {
1222+ let mut command = UCommand :: new ( ) ;
1223+ // Intentionally leave bin_path unset.
1224+ command. arg ( cmd) ;
1225+ command. temp_dir ( self . tmpd . clone ( ) ) ;
1226+ command
1227+ }
1228+
12181229 /// Returns builder for invoking any uutils command. Paths given are treated
12191230 /// relative to the environment's unique temporary test directory.
12201231 pub fn ccmd < S : AsRef < str > > ( & self , util_name : S ) -> UCommand {
@@ -4052,8 +4063,7 @@ mod tests {
40524063 } ;
40534064
40544065 let ts = TestScenario :: new ( "util" ) ;
4055- ts. cmd ( "sh" )
4056- . args ( & [ "-c" , "umask" ] )
4066+ ts. cmd_shell ( "umask" )
40574067 . umask ( c_umask)
40584068 . succeeds ( )
40594069 . stdout_is ( expected) ;
You can’t perform that action at this time.
0 commit comments