* Added verbose TCP test logic
* Cleaned up output, removed source IP address
* Consolidated detailed output logic into ProcessConnectionByTCPPort()
* Updated existing tests with -Quiet switch
* Improved output formatting, changed logic to match
* Error handling and logic improvements
* Updated tests to match new output
* Updated logic, tcp tests now run once by default
* Moved TcpConnectionTestResult enum into TcpTestStatus class
* Removed unnecessary whitespace
* Wrapped TcpClient() in Using statement
* Appended missing period on comments
* Change TcpTestStatus to TcpPortStatus for better clarity
* Set default count back to 4
* Move stopwatch reset into finally block
* Change TcpConnectionTestResult.New to TcpConnectionTestResult.None
* Formatting fixes
* Increase column size for Result output
* Update logic for -quiet option
* Change "TestNum" property to "Id"
* Change Destination and DestinationAddress to Target and TargetAddress in TcpPortStatus
* Implement new form of using declaration
* Fix indentation
* Update output, improve logic and update tests
* Add CancellationToken to allow cancel before timeout
* Assign testResult.Connected to client.Connected
* Move TcpPortStatus object creation to after connection test
* Remove delay from final connection test in loop
* Move Count logic from ProcessConnectionByTCPPort into own function
* Fix small formatting error
* Add handling for TaskCanceledException
* Remove redundant CancellationToken getter
* Clean up handling of SocketException
* Increase readability of final loop check
* Remove unnecessary TimeSpan invocation
* Rename cancellationTokenSource to match convention
* Move SetCountForTcpTest() into BeginProcessing()
* Added nameof to Count check
* Removed explicit type declaration for TcpClient
* Move delay and timeout evaluation out of the cycle
* Remove redundant CancellationTokenSource
* Initialize detailed SwitchParameter
* Add check for Detailed parameter
* Remove redundant tests for non-detailed output
* Add return after first boolean output
* Update tests with new detailed parameter set
---------
Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
WebListener.exe (which was already being built) is sufficient to start web listener. Remove the dependency on `dotnet` being present to start the web listener.
Use `Start-Process` instead of `Start-Job` to launch the WebListener.
- Add VSTS CI for Windows
- Disable `Access-denied test for Get-Item C:\windows\appcompat\Programs\Install -ErrorAction Stop`, because the path does not always exist
- https://github.com/PowerShell/PowerShell/issues/7553
- Disable `Should give .sys file if the fullpath is specified with hidden and force parameter`, because pagefile.sys doesn't always exist and other files don't meet test's requirement.
- https://github.com/PowerShell/PowerShell/issues/7554
- Disable some `Test-Connection` tests for same reasons they failed on VSTS Linux
- https://github.com/PowerShell/PowerShell/issues/7555
- Disable `Test-FileCatalog should pass when catalog is in the same folder as files being tested`, because the CmdLet does not work in that scenario
- Also, give details needed to investigate when the test fails
- https://github.com/PowerShell/PowerShell/issues/7556
- Update `appveyor.psm1` to work with VSTS
- Update `HelpersRemoting.psm1` `New-RemoteSession` to work for CimSession (discovered an issue during the investigation)
- Update `Test wildcard with drive relative directory path` to work when there are multiple drives
- Disable on non-windows machines since the test is assuming drive letters
- Update `New-CimSession` Tests to requireAdmin
- Also, make sure session name is a string
- Add functions to save and restore psoptions
- update `.gitatttributes` so files clone like they do on appveyor
Update Start-PSPester and Start-PSxUnit to upload test results when running in VSTS
Disable tests which require non-root using when running as root
remove verifications in Test-Connection tests which verify buggy behavior
Skip tests which don't behave correctly in VSTS (due to running in a container?)
- Test-Connection - #7528
- Set-Date - #7529
Convert ShouldBeErrorId to Should -Throw -ErrorId in PowerShell tests.
Get rid of try { } catch { } formula to assert that errors were thrown.
Small fixes in tests to obey the new Pester -Parameter syntax.
The Test-Connection cmdlet works on Windows and Unix.
Implemented:
Ping
Continues Ping
Traceroute
Detect MTU size (seems don't work on Unix because of .Net Core issue)
Connect to TCP port
Not jet implemented:
I'm putting this off for the future.
Detect blackhole routers
PingPath
Additional considerations
As you can see in the tests .Net Core has issues in API implementation. As a result, some tests are skipped on Unix. There is also one issue on Windows. Related comments added to tests.
I'm going to open an issue(s) in CoreFX repo.
I think we should break the feedback into two parts:
scripting functionality
interactive functionality (display output)
Now I have implemented the output to the screen as the progress bar and as text (without ETS) - we have to decide what is best to use.
Since DCOM is not supported in corefx there was a great deal of dead code in the computer cmdlets.
This PR removes all vestiges of DCOM support from:
- Rename-Computer
- Restart-Computer
- Stop-Computer
removing about 4500 lines of dead code. Also, tests are updated to provide more complete coverage.
I also removed test-connection completely to make way for @iSazonov upcoming PR to improve coverage in tests, I created some test hook code which will test the cmdlet code without actually calling the WMI method to restart/rename/stop the system