From 563806c15d7b82b2fe3bf2b78700693872961799 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Tue, 2 May 2017 18:45:35 -0700 Subject: [PATCH] Change native execution tests to use df instead of stty (#3685) when automating test execution, some environments don't have a tty which causes the tests to fail. df is just as good a test as stty as it is also guaranteed to be present. This change also allows the tests to be run on OSX --- .../NativeExecution/NativeLinuxCommands.Tests.ps1 | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/powershell/Language/Scripting/NativeExecution/NativeLinuxCommands.Tests.ps1 b/test/powershell/Language/Scripting/NativeExecution/NativeLinuxCommands.Tests.ps1 index a546ba694e..88d2a78ea6 100644 --- a/test/powershell/Language/Scripting/NativeExecution/NativeLinuxCommands.Tests.ps1 +++ b/test/powershell/Language/Scripting/NativeExecution/NativeLinuxCommands.Tests.ps1 @@ -1,9 +1,6 @@ if ( $IsWindows ) { $PesterSkipOrPending = @{ Skip = $true } } -elseif ( $IsOSX ) { - $PesterSkipOrPending = @{ Pending = $true } -} else { $PesterSkipOrPending = @{} } @@ -27,15 +24,15 @@ Describe "NativeLinuxCommands" -tags "CI" { } It "Should not redirect standard input if native command is the first command in pipeline (1)" @PesterSkipOrPending { - stty | ForEach-Object -Begin { $out = @() } -Process { $out += $_ } + df | ForEach-Object -Begin { $out = @() } -Process { $out += $_ } $out.Length -gt 0 | Should Be $true - $out[0] -like "speed * baud; line =*" | Should Be $true + $out[0] -like "Filesystem*Available*" | Should Be $true } It "Should not redirect standard input if native command is the first command in pipeline (2)" @PesterSkipOrPending { - $out = stty + $out = df $out.Length -gt 0 | Should Be $true - $out[0] -like "speed * baud; line =*" | Should Be $true + $out[0] -like "Filesystem*Available*" | Should Be $true } }