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

thrift: filter integration tests #3679

Merged

Conversation

zuercher
Copy link
Member

Provides a set of python scripts that allows an integration test to run a Thrift client and server. The scripts handle all the Thrift transports and protocols we expect Envoy to eventually handle.

Adds envoy_extension_cc_test_library to test/extensions/extensions_build_system.bzl. I believe this is necessary to successfully exclude the thrift_proxy from builds. Adds more descriptive names to parameterized tests.

Implements an integration test for the Thrift sniffing filter, which uncovered some compact protocol bugs, which are also fixed in this PR along with matching unit test coverage.

Risk Level: Low - introduces some new dependencies, but they are not part of any build path beyond the thrift_proxy
Testing: integration tests
Docs Changes: n/a
Relates to: #2247

zuercher added 5 commits June 20, 2018 11:20
Signed-off-by: Stephan Zuercher <stephan@turbinelabs.io>
Signed-off-by: Stephan Zuercher <stephan@turbinelabs.io>
Signed-off-by: Stephan Zuercher <stephan@turbinelabs.io>
Signed-off-by: Stephan Zuercher <stephan@turbinelabs.io>
Signed-off-by: Stephan Zuercher <stephan@turbinelabs.io>
import os
import argparse
import io
import sys
Copy link
Member

Choose a reason for hiding this comment

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

hyper nit: sort imports

proxy supports (or will eventually support):

Transports: framed, unframed, header
Protocols: binary, compact, json, ttwitter/finagle
Copy link
Member

Choose a reason for hiding this comment

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

typo or is it really ttwitter?

Copy link
Member Author

Choose a reason for hiding this comment

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

sys.exit("invalid unix domain socket: {}".format(cfg.addr))
socket = TSocket.TSocket(unix_socket=cfg.addr)
else:
(host, port) = cfg.addr.split(":")
Copy link
Member

Choose a reason for hiding this comment

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

this will raise ValueError if cfg.addr has no :

zuercher added 3 commits June 21, 2018 09:22
Signed-off-by: Stephan Zuercher <stephan@turbinelabs.io>
Signed-off-by: Stephan Zuercher <stephan@turbinelabs.io>
Signed-off-by: Stephan Zuercher <stephan@turbinelabs.io>
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

@htuch @alyssawilk FYI this might create important issues for you. Do you want to check this real quick? Presumably you can just not-build/delete all of this code on import?

@alyssawilk
Copy link
Contributor

I believe with the new extension logic we should be able to not-build fairly easily. I'm also not sure we've tested that.

@mrice32 @PiotrSikora (current and next import rotation)

@zuercher
Copy link
Member Author

Do you want me to hold off merging until you've had a chance to check it?

@alyssawilk
Copy link
Contributor

alyssawilk commented Jun 26, 2018

I'd say if @tschroed (swapped rotation with our-Matt) doesn't respond in the next 15 minutes you're good to go

@tschroed
Copy link
Contributor

I'm already in the pain cave trying to reconcile some weird bazel versus blaze dysfunction. What's one more log on the fire? :)

@zuercher zuercher merged commit 56a047b into envoyproxy:master Jun 26, 2018
@zuercher zuercher deleted the stephan/thrift-filter-integration-tests branch July 19, 2018 20:54
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.

6 participants