Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move WebCmdlets HTTPS tests to WebListener #4733

Merged
merged 5 commits into from
Sep 1, 2017

Conversation

markekraus
Copy link
Contributor

@markekraus markekraus commented Aug 31, 2017

Resolves #4719

  • Move badssl.com tests to local WebListener to remove reliance on external site for test.
  • Move HTTPS tests to their own context

Made separate commits to make it a bit easier to see the changes.

@msftclas
Copy link

@markekraus,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by Microsoft. We will now review your pull request.
Thanks,
Microsoft Pull Request Bot

Copy link
Member

@SteveL-MSFT SteveL-MSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purely porting of the code looks fine. Some extra whitespace that came from the original test code.

Select-Object -ExpandProperty Content |
ConvertFrom-Json

$result.Status | Should Be 'FAILED'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space between Status and pipe

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

closed

Select-Object -ExpandProperty Content |
ConvertFrom-Json

$result.Status | Should Be 'OK'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space between Status and pipe

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

closed

$uri = Get-WebListenerUrl -Https -Test 'Cert'
$result = Invoke-RestMethod -Uri $uri -SkipCertificateCheck

$result.Status | Should Be 'FAILED'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space between Status and pipe

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

closed

$certificate = Get-WebListenerClientCertificate
$result = Invoke-RestMethod -uri $uri -Certificate $certificate -SkipCertificateCheck

$result.Status | Should Be 'OK'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space between Status and pipe

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

closed

@SteveL-MSFT
Copy link
Member

AppVeyor failure is due to #4720

Copy link
Member

@JamesWTruher JamesWTruher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this - it's great that we can move these from using off box connections! I have only one non-blocking question below


# Test skipped on macOS pending support for Client Certificate Authentication
# https://github.com/PowerShell/PowerShell/issues/4650
It "Verifies Invoke-WebRequest Certificate Authentication Successful with -Certificate" -skip:$IsOSX {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is eventually going to be run on mac, could you make this -pending:$IsOSX? we track pending tests more closely than skipped tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will switch them to pending. I was asked to "skip" them but perhaps they didn't mean literally to use -skip

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, my bad.


# Test skipped on macOS pending support for Client Certificate Authentication
# https://github.com/PowerShell/PowerShell/issues/4650
It "Verifies Invoke-RestMethod Certificate Authentication Successful with -Certificate" -skip:$IsOSX {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above - not sure whether this should be -pending rather than -skip

@iSazonov iSazonov merged commit 87db370 into PowerShell:master Sep 1, 2017
@iSazonov
Copy link
Collaborator

iSazonov commented Sep 1, 2017

@markekraus Many thanks! I was happy with WebListener, now I am twice happy 😄

@markekraus markekraus deleted the HttpsLocalTests branch September 22, 2017 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants