Skip to content

Fix test for misbehaving server #379

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

Merged

Conversation

Davidde94
Copy link
Collaborator

The misbehaving SOCKS server test was previously passing, but not for the right reason. The invalid data we were sending was never making it off the server thanks to the SOCKSServerHandshakeHandler.

In fact, as long as SOCKSServerHandshakeHandler is present, it isn't possible to send invalid data. So to test the client now we have to add a completely new handler, which exists only to write some nonsense bytes.

The test still passes, but for the right reason, and we now assert the type of error the client throws too.

@Davidde94 Davidde94 requested a review from fabianfett June 21, 2021 13:48
Copy link
Member

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

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

Thanks! Looks good. Let's remove the dead code.

@fabianfett fabianfett added the semver/none No version bump required. label Jun 21, 2021
@Davidde94 Davidde94 requested a review from fabianfett June 21, 2021 13:54
Copy link
Member

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

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

Thanks

@Davidde94 Davidde94 merged commit 711622b into swift-server:main Jun 21, 2021
@Davidde94 Davidde94 deleted the de/fix-socks-misbehaving-server-test branch June 21, 2021 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/none No version bump required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants