From 0e37b30bec5fb29b5cdf9e75b6932340a817378f Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Thu, 12 Dec 2019 11:53:15 -0500 Subject: [PATCH] chore: Reorganize examples and interop crates (#180) * chore: Reorganize examples and interop crates * fix interop tests --- .github/workflows/CI.yml | 4 ++-- Cargo.toml | 7 +++++-- README.md | 16 ++++++++-------- {tonic-examples => examples}/Cargo.toml | 4 ++-- {tonic-examples => examples}/README.md | 0 {tonic-examples => examples}/build.rs | 0 {tonic-examples => examples}/data/gcp/roots.pem | 0 .../data/route_guide_db.json | 0 {tonic-examples => examples}/data/tls/ca.pem | 0 .../data/tls/client1.key | 0 .../data/tls/client1.pem | 0 .../data/tls/client2.key | 0 .../data/tls/client2.pem | 0 .../data/tls/client_ca.pem | 0 .../data/tls/server.key | 0 .../data/tls/server.pem | 0 .../helloworld-tutorial.md | 0 .../proto/echo/echo.proto | 0 .../proto/google/pubsub/annotations.proto | 0 .../proto/google/pubsub/client.proto | 0 .../proto/google/pubsub/http.proto | 0 .../proto/google/pubsub/pubsub.proto | 0 .../proto/helloworld/helloworld.proto | 0 .../proto/routeguide/route_guide.proto | 0 .../routeguide-tutorial.md | 0 .../src/authentication/client.rs | 0 .../src/authentication/server.rs | 0 .../src/blocking/client.rs | 0 {tonic-examples => examples}/src/gcp/README.md | 0 {tonic-examples => examples}/src/gcp/client.rs | 0 .../src/helloworld/client.rs | 0 .../src/helloworld/server.rs | 0 .../src/load_balance/client.rs | 0 .../src/load_balance/server.rs | 0 .../src/multiplex/client.rs | 0 .../src/multiplex/server.rs | 0 .../src/routeguide/client.rs | 0 .../src/routeguide/data.rs | 0 .../src/routeguide/server.rs | 0 {tonic-examples => examples}/src/tls/client.rs | 0 {tonic-examples => examples}/src/tls/server.rs | 0 .../src/tls_client_auth/client.rs | 0 .../src/tls_client_auth/server.rs | 0 .../src/tracing/client.rs | 0 .../src/tracing/server.rs | 0 {tonic-interop => interop}/Cargo.toml | 0 .../bin/client_darwin_amd64 | Bin .../bin/client_linux_amd64 | Bin .../bin/client_windows_amd64.exe | Bin .../bin/server_darwin_amd64 | Bin .../bin/server_linux_amd64 | Bin .../bin/server_windows_amd64.exe | Bin {tonic-interop => interop}/build.rs | 0 {tonic-interop => interop}/data/README.md | 0 {tonic-interop => interop}/data/ca.pem | 0 .../data/cert-generator/.gitignore | 0 .../data/cert-generator/ca.tf | 0 .../data/cert-generator/server_certs.tf | 0 {tonic-interop => interop}/data/server1.key | 0 {tonic-interop => interop}/data/server1.pem | 0 .../proto/grpc/testing/empty.proto | 0 .../proto/grpc/testing/messages.proto | 0 .../proto/grpc/testing/test.proto | 0 {tonic-interop => interop}/src/bin/client.rs | 2 +- {tonic-interop => interop}/src/bin/server.rs | 4 ++-- {tonic-interop => interop}/src/client.rs | 0 {tonic-interop => interop}/src/lib.rs | 0 {tonic-interop => interop}/src/server.rs | 0 {tonic-interop => interop}/test.sh | 10 +++++----- 69 files changed, 25 insertions(+), 22 deletions(-) rename {tonic-examples => examples}/Cargo.toml (96%) rename {tonic-examples => examples}/README.md (100%) rename {tonic-examples => examples}/build.rs (100%) rename {tonic-examples => examples}/data/gcp/roots.pem (100%) rename {tonic-examples => examples}/data/route_guide_db.json (100%) rename {tonic-examples => examples}/data/tls/ca.pem (100%) rename {tonic-examples => examples}/data/tls/client1.key (100%) rename {tonic-examples => examples}/data/tls/client1.pem (100%) rename {tonic-examples => examples}/data/tls/client2.key (100%) rename {tonic-examples => examples}/data/tls/client2.pem (100%) rename {tonic-examples => examples}/data/tls/client_ca.pem (100%) rename {tonic-examples => examples}/data/tls/server.key (100%) rename {tonic-examples => examples}/data/tls/server.pem (100%) rename {tonic-examples => examples}/helloworld-tutorial.md (100%) rename {tonic-examples => examples}/proto/echo/echo.proto (100%) rename {tonic-examples => examples}/proto/google/pubsub/annotations.proto (100%) rename {tonic-examples => examples}/proto/google/pubsub/client.proto (100%) rename {tonic-examples => examples}/proto/google/pubsub/http.proto (100%) rename {tonic-examples => examples}/proto/google/pubsub/pubsub.proto (100%) rename {tonic-examples => examples}/proto/helloworld/helloworld.proto (100%) rename {tonic-examples => examples}/proto/routeguide/route_guide.proto (100%) rename {tonic-examples => examples}/routeguide-tutorial.md (100%) rename {tonic-examples => examples}/src/authentication/client.rs (100%) rename {tonic-examples => examples}/src/authentication/server.rs (100%) rename tonic-examples/src/helloworld/client-blocking.rs => examples/src/blocking/client.rs (100%) rename {tonic-examples => examples}/src/gcp/README.md (100%) rename {tonic-examples => examples}/src/gcp/client.rs (100%) rename {tonic-examples => examples}/src/helloworld/client.rs (100%) rename {tonic-examples => examples}/src/helloworld/server.rs (100%) rename {tonic-examples => examples}/src/load_balance/client.rs (100%) rename {tonic-examples => examples}/src/load_balance/server.rs (100%) rename {tonic-examples => examples}/src/multiplex/client.rs (100%) rename {tonic-examples => examples}/src/multiplex/server.rs (100%) rename {tonic-examples => examples}/src/routeguide/client.rs (100%) rename {tonic-examples => examples}/src/routeguide/data.rs (100%) rename {tonic-examples => examples}/src/routeguide/server.rs (100%) rename {tonic-examples => examples}/src/tls/client.rs (100%) rename {tonic-examples => examples}/src/tls/server.rs (100%) rename {tonic-examples => examples}/src/tls_client_auth/client.rs (100%) rename {tonic-examples => examples}/src/tls_client_auth/server.rs (100%) rename {tonic-examples => examples}/src/tracing/client.rs (100%) rename {tonic-examples => examples}/src/tracing/server.rs (100%) rename {tonic-interop => interop}/Cargo.toml (100%) rename {tonic-interop => interop}/bin/client_darwin_amd64 (100%) rename {tonic-interop => interop}/bin/client_linux_amd64 (100%) rename {tonic-interop => interop}/bin/client_windows_amd64.exe (100%) rename {tonic-interop => interop}/bin/server_darwin_amd64 (100%) rename {tonic-interop => interop}/bin/server_linux_amd64 (100%) rename {tonic-interop => interop}/bin/server_windows_amd64.exe (100%) rename {tonic-interop => interop}/build.rs (100%) rename {tonic-interop => interop}/data/README.md (100%) rename {tonic-interop => interop}/data/ca.pem (100%) rename {tonic-interop => interop}/data/cert-generator/.gitignore (100%) rename {tonic-interop => interop}/data/cert-generator/ca.tf (100%) rename {tonic-interop => interop}/data/cert-generator/server_certs.tf (100%) rename {tonic-interop => interop}/data/server1.key (100%) rename {tonic-interop => interop}/data/server1.pem (100%) rename {tonic-interop => interop}/proto/grpc/testing/empty.proto (100%) rename {tonic-interop => interop}/proto/grpc/testing/messages.proto (100%) rename {tonic-interop => interop}/proto/grpc/testing/test.proto (100%) rename {tonic-interop => interop}/src/bin/client.rs (98%) rename {tonic-interop => interop}/src/bin/server.rs (92%) rename {tonic-interop => interop}/src/client.rs (100%) rename {tonic-interop => interop}/src/lib.rs (100%) rename {tonic-interop => interop}/src/server.rs (100%) rename {tonic-interop => interop}/test.sh (87%) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 707cfa9f0..afde5a426 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -93,8 +93,8 @@ jobs: run: rustup component add rustfmt - uses: actions/checkout@master - name: Run interop tests - run: ./tonic-interop/test.sh + run: ./interop/test.sh shell: bash - name: Run interop tests with Rustls - run: ./tonic-interop/test.sh --use_tls tls_rustls + run: ./interop/test.sh --use_tls tls_rustls shell: bash diff --git a/Cargo.toml b/Cargo.toml index b3925f10c..d0fbab2e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,9 +2,12 @@ members = [ "tonic", "tonic-build", - "tonic-examples", - "tonic-interop", + # Non-published crates + "examples", + "interop", + + # Tests "tests/included_service", "tests/same_name", "tests/wellknown", diff --git a/README.md b/README.md index b0bffd4eb..cbeb00e2e 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ contains the tools to build clients and servers from [`protobuf`] definitions. ## Getting Started -Examples can be found in [`tonic-examples`] and for more complex scenarios [`tonic-interop`] +Examples can be found in [`examples`] and for more complex scenarios [`interop`] may be a good resource as it shows examples of many of the gRPC features. ### Rust Version @@ -67,9 +67,9 @@ question. If that doesn't work, try opening an [issue] with the question. - [`tonic`](https://github.com/hyperium/tonic/tree/master/tonic): Generic gRPC and HTTP/2 client/server implementation. - [`tonic-build`](https://github.com/hyperium/tonic/tree/master/tonic-build): [`prost`] based service codegen. -- [`tonic-examples`](https://github.com/hyperium/tonic/tree/master/tonic-examples): Example gRPC implementations showing off +- [`examples`](https://github.com/hyperium/tonic/tree/master/examples): Example gRPC implementations showing off tls, load balancing and bi-directional streaming. -- [`tonic-interop`](https://github.com/hyperium/tonic/tree/master/tonic-interop): Interop tests implementation. +- [`interop`](https://github.com/hyperium/tonic/tree/master/interop): Interop tests implementation. ## Contributing @@ -97,11 +97,11 @@ terms or conditions. [`prost`]: https://github.com/danburkert/prost [`protobuf`]: https://developers.google.com/protocol-buffers [`rustls`]: https://github.com/ctz/rustls -[`tonic-examples`]: https://github.com/hyperium/tonic/tree/master/tonic-examples -[`tonic-interop`]: https://github.com/hyperium/tonic/tree/master/tonic-interop -[Examples]: https://github.com/hyperium/tonic/tree/master/tonic-examples +[`tonic-examples`]: https://github.com/hyperium/tonic/tree/master/examples +[`tonic-interop`]: https://github.com/hyperium/tonic/tree/master/interop +[Examples]: https://github.com/hyperium/tonic/tree/master/examples [Website]: https://github.com/hyperium/tonic [Docs]: https://docs.rs/tonic [Chat]: https://discord.gg/6yGkFeN -[routeguide-tutorial]: https://github.com/hyperium/tonic/blob/master/tonic-examples/routeguide-tutorial.md -[helloworld-tutorial]: https://github.com/hyperium/tonic/blob/master/tonic-examples/helloworld-tutorial.md +[routeguide-tutorial]: https://github.com/hyperium/tonic/blob/master/examples/routeguide-tutorial.md +[helloworld-tutorial]: https://github.com/hyperium/tonic/blob/master/examples/helloworld-tutorial.md diff --git a/tonic-examples/Cargo.toml b/examples/Cargo.toml similarity index 96% rename from tonic-examples/Cargo.toml rename to examples/Cargo.toml index 285231179..282a0a46a 100644 --- a/tonic-examples/Cargo.toml +++ b/examples/Cargo.toml @@ -15,8 +15,8 @@ name = "helloworld-client" path = "src/helloworld/client.rs" [[bin]] -name = "helloworld-client-blocking" -path = "src/helloworld/client-blocking.rs" +name = "blocking-client" +path = "src/blocking/client.rs" [[bin]] name = "routeguide-server" diff --git a/tonic-examples/README.md b/examples/README.md similarity index 100% rename from tonic-examples/README.md rename to examples/README.md diff --git a/tonic-examples/build.rs b/examples/build.rs similarity index 100% rename from tonic-examples/build.rs rename to examples/build.rs diff --git a/tonic-examples/data/gcp/roots.pem b/examples/data/gcp/roots.pem similarity index 100% rename from tonic-examples/data/gcp/roots.pem rename to examples/data/gcp/roots.pem diff --git a/tonic-examples/data/route_guide_db.json b/examples/data/route_guide_db.json similarity index 100% rename from tonic-examples/data/route_guide_db.json rename to examples/data/route_guide_db.json diff --git a/tonic-examples/data/tls/ca.pem b/examples/data/tls/ca.pem similarity index 100% rename from tonic-examples/data/tls/ca.pem rename to examples/data/tls/ca.pem diff --git a/tonic-examples/data/tls/client1.key b/examples/data/tls/client1.key similarity index 100% rename from tonic-examples/data/tls/client1.key rename to examples/data/tls/client1.key diff --git a/tonic-examples/data/tls/client1.pem b/examples/data/tls/client1.pem similarity index 100% rename from tonic-examples/data/tls/client1.pem rename to examples/data/tls/client1.pem diff --git a/tonic-examples/data/tls/client2.key b/examples/data/tls/client2.key similarity index 100% rename from tonic-examples/data/tls/client2.key rename to examples/data/tls/client2.key diff --git a/tonic-examples/data/tls/client2.pem b/examples/data/tls/client2.pem similarity index 100% rename from tonic-examples/data/tls/client2.pem rename to examples/data/tls/client2.pem diff --git a/tonic-examples/data/tls/client_ca.pem b/examples/data/tls/client_ca.pem similarity index 100% rename from tonic-examples/data/tls/client_ca.pem rename to examples/data/tls/client_ca.pem diff --git a/tonic-examples/data/tls/server.key b/examples/data/tls/server.key similarity index 100% rename from tonic-examples/data/tls/server.key rename to examples/data/tls/server.key diff --git a/tonic-examples/data/tls/server.pem b/examples/data/tls/server.pem similarity index 100% rename from tonic-examples/data/tls/server.pem rename to examples/data/tls/server.pem diff --git a/tonic-examples/helloworld-tutorial.md b/examples/helloworld-tutorial.md similarity index 100% rename from tonic-examples/helloworld-tutorial.md rename to examples/helloworld-tutorial.md diff --git a/tonic-examples/proto/echo/echo.proto b/examples/proto/echo/echo.proto similarity index 100% rename from tonic-examples/proto/echo/echo.proto rename to examples/proto/echo/echo.proto diff --git a/tonic-examples/proto/google/pubsub/annotations.proto b/examples/proto/google/pubsub/annotations.proto similarity index 100% rename from tonic-examples/proto/google/pubsub/annotations.proto rename to examples/proto/google/pubsub/annotations.proto diff --git a/tonic-examples/proto/google/pubsub/client.proto b/examples/proto/google/pubsub/client.proto similarity index 100% rename from tonic-examples/proto/google/pubsub/client.proto rename to examples/proto/google/pubsub/client.proto diff --git a/tonic-examples/proto/google/pubsub/http.proto b/examples/proto/google/pubsub/http.proto similarity index 100% rename from tonic-examples/proto/google/pubsub/http.proto rename to examples/proto/google/pubsub/http.proto diff --git a/tonic-examples/proto/google/pubsub/pubsub.proto b/examples/proto/google/pubsub/pubsub.proto similarity index 100% rename from tonic-examples/proto/google/pubsub/pubsub.proto rename to examples/proto/google/pubsub/pubsub.proto diff --git a/tonic-examples/proto/helloworld/helloworld.proto b/examples/proto/helloworld/helloworld.proto similarity index 100% rename from tonic-examples/proto/helloworld/helloworld.proto rename to examples/proto/helloworld/helloworld.proto diff --git a/tonic-examples/proto/routeguide/route_guide.proto b/examples/proto/routeguide/route_guide.proto similarity index 100% rename from tonic-examples/proto/routeguide/route_guide.proto rename to examples/proto/routeguide/route_guide.proto diff --git a/tonic-examples/routeguide-tutorial.md b/examples/routeguide-tutorial.md similarity index 100% rename from tonic-examples/routeguide-tutorial.md rename to examples/routeguide-tutorial.md diff --git a/tonic-examples/src/authentication/client.rs b/examples/src/authentication/client.rs similarity index 100% rename from tonic-examples/src/authentication/client.rs rename to examples/src/authentication/client.rs diff --git a/tonic-examples/src/authentication/server.rs b/examples/src/authentication/server.rs similarity index 100% rename from tonic-examples/src/authentication/server.rs rename to examples/src/authentication/server.rs diff --git a/tonic-examples/src/helloworld/client-blocking.rs b/examples/src/blocking/client.rs similarity index 100% rename from tonic-examples/src/helloworld/client-blocking.rs rename to examples/src/blocking/client.rs diff --git a/tonic-examples/src/gcp/README.md b/examples/src/gcp/README.md similarity index 100% rename from tonic-examples/src/gcp/README.md rename to examples/src/gcp/README.md diff --git a/tonic-examples/src/gcp/client.rs b/examples/src/gcp/client.rs similarity index 100% rename from tonic-examples/src/gcp/client.rs rename to examples/src/gcp/client.rs diff --git a/tonic-examples/src/helloworld/client.rs b/examples/src/helloworld/client.rs similarity index 100% rename from tonic-examples/src/helloworld/client.rs rename to examples/src/helloworld/client.rs diff --git a/tonic-examples/src/helloworld/server.rs b/examples/src/helloworld/server.rs similarity index 100% rename from tonic-examples/src/helloworld/server.rs rename to examples/src/helloworld/server.rs diff --git a/tonic-examples/src/load_balance/client.rs b/examples/src/load_balance/client.rs similarity index 100% rename from tonic-examples/src/load_balance/client.rs rename to examples/src/load_balance/client.rs diff --git a/tonic-examples/src/load_balance/server.rs b/examples/src/load_balance/server.rs similarity index 100% rename from tonic-examples/src/load_balance/server.rs rename to examples/src/load_balance/server.rs diff --git a/tonic-examples/src/multiplex/client.rs b/examples/src/multiplex/client.rs similarity index 100% rename from tonic-examples/src/multiplex/client.rs rename to examples/src/multiplex/client.rs diff --git a/tonic-examples/src/multiplex/server.rs b/examples/src/multiplex/server.rs similarity index 100% rename from tonic-examples/src/multiplex/server.rs rename to examples/src/multiplex/server.rs diff --git a/tonic-examples/src/routeguide/client.rs b/examples/src/routeguide/client.rs similarity index 100% rename from tonic-examples/src/routeguide/client.rs rename to examples/src/routeguide/client.rs diff --git a/tonic-examples/src/routeguide/data.rs b/examples/src/routeguide/data.rs similarity index 100% rename from tonic-examples/src/routeguide/data.rs rename to examples/src/routeguide/data.rs diff --git a/tonic-examples/src/routeguide/server.rs b/examples/src/routeguide/server.rs similarity index 100% rename from tonic-examples/src/routeguide/server.rs rename to examples/src/routeguide/server.rs diff --git a/tonic-examples/src/tls/client.rs b/examples/src/tls/client.rs similarity index 100% rename from tonic-examples/src/tls/client.rs rename to examples/src/tls/client.rs diff --git a/tonic-examples/src/tls/server.rs b/examples/src/tls/server.rs similarity index 100% rename from tonic-examples/src/tls/server.rs rename to examples/src/tls/server.rs diff --git a/tonic-examples/src/tls_client_auth/client.rs b/examples/src/tls_client_auth/client.rs similarity index 100% rename from tonic-examples/src/tls_client_auth/client.rs rename to examples/src/tls_client_auth/client.rs diff --git a/tonic-examples/src/tls_client_auth/server.rs b/examples/src/tls_client_auth/server.rs similarity index 100% rename from tonic-examples/src/tls_client_auth/server.rs rename to examples/src/tls_client_auth/server.rs diff --git a/tonic-examples/src/tracing/client.rs b/examples/src/tracing/client.rs similarity index 100% rename from tonic-examples/src/tracing/client.rs rename to examples/src/tracing/client.rs diff --git a/tonic-examples/src/tracing/server.rs b/examples/src/tracing/server.rs similarity index 100% rename from tonic-examples/src/tracing/server.rs rename to examples/src/tracing/server.rs diff --git a/tonic-interop/Cargo.toml b/interop/Cargo.toml similarity index 100% rename from tonic-interop/Cargo.toml rename to interop/Cargo.toml diff --git a/tonic-interop/bin/client_darwin_amd64 b/interop/bin/client_darwin_amd64 similarity index 100% rename from tonic-interop/bin/client_darwin_amd64 rename to interop/bin/client_darwin_amd64 diff --git a/tonic-interop/bin/client_linux_amd64 b/interop/bin/client_linux_amd64 similarity index 100% rename from tonic-interop/bin/client_linux_amd64 rename to interop/bin/client_linux_amd64 diff --git a/tonic-interop/bin/client_windows_amd64.exe b/interop/bin/client_windows_amd64.exe similarity index 100% rename from tonic-interop/bin/client_windows_amd64.exe rename to interop/bin/client_windows_amd64.exe diff --git a/tonic-interop/bin/server_darwin_amd64 b/interop/bin/server_darwin_amd64 similarity index 100% rename from tonic-interop/bin/server_darwin_amd64 rename to interop/bin/server_darwin_amd64 diff --git a/tonic-interop/bin/server_linux_amd64 b/interop/bin/server_linux_amd64 similarity index 100% rename from tonic-interop/bin/server_linux_amd64 rename to interop/bin/server_linux_amd64 diff --git a/tonic-interop/bin/server_windows_amd64.exe b/interop/bin/server_windows_amd64.exe similarity index 100% rename from tonic-interop/bin/server_windows_amd64.exe rename to interop/bin/server_windows_amd64.exe diff --git a/tonic-interop/build.rs b/interop/build.rs similarity index 100% rename from tonic-interop/build.rs rename to interop/build.rs diff --git a/tonic-interop/data/README.md b/interop/data/README.md similarity index 100% rename from tonic-interop/data/README.md rename to interop/data/README.md diff --git a/tonic-interop/data/ca.pem b/interop/data/ca.pem similarity index 100% rename from tonic-interop/data/ca.pem rename to interop/data/ca.pem diff --git a/tonic-interop/data/cert-generator/.gitignore b/interop/data/cert-generator/.gitignore similarity index 100% rename from tonic-interop/data/cert-generator/.gitignore rename to interop/data/cert-generator/.gitignore diff --git a/tonic-interop/data/cert-generator/ca.tf b/interop/data/cert-generator/ca.tf similarity index 100% rename from tonic-interop/data/cert-generator/ca.tf rename to interop/data/cert-generator/ca.tf diff --git a/tonic-interop/data/cert-generator/server_certs.tf b/interop/data/cert-generator/server_certs.tf similarity index 100% rename from tonic-interop/data/cert-generator/server_certs.tf rename to interop/data/cert-generator/server_certs.tf diff --git a/tonic-interop/data/server1.key b/interop/data/server1.key similarity index 100% rename from tonic-interop/data/server1.key rename to interop/data/server1.key diff --git a/tonic-interop/data/server1.pem b/interop/data/server1.pem similarity index 100% rename from tonic-interop/data/server1.pem rename to interop/data/server1.pem diff --git a/tonic-interop/proto/grpc/testing/empty.proto b/interop/proto/grpc/testing/empty.proto similarity index 100% rename from tonic-interop/proto/grpc/testing/empty.proto rename to interop/proto/grpc/testing/empty.proto diff --git a/tonic-interop/proto/grpc/testing/messages.proto b/interop/proto/grpc/testing/messages.proto similarity index 100% rename from tonic-interop/proto/grpc/testing/messages.proto rename to interop/proto/grpc/testing/messages.proto diff --git a/tonic-interop/proto/grpc/testing/test.proto b/interop/proto/grpc/testing/test.proto similarity index 100% rename from tonic-interop/proto/grpc/testing/test.proto rename to interop/proto/grpc/testing/test.proto diff --git a/tonic-interop/src/bin/client.rs b/interop/src/bin/client.rs similarity index 98% rename from tonic-interop/src/bin/client.rs rename to interop/src/bin/client.rs index 2142310c9..487e0eced 100644 --- a/tonic-interop/src/bin/client.rs +++ b/interop/src/bin/client.rs @@ -32,7 +32,7 @@ async fn main() -> Result<(), Box> { .concurrency_limit(30); if matches.use_tls { - let pem = tokio::fs::read("tonic-interop/data/ca.pem").await?; + let pem = tokio::fs::read("interop/data/ca.pem").await?; let ca = Certificate::from_pem(pem); endpoint = endpoint.tls_config( ClientTlsConfig::with_rustls() diff --git a/tonic-interop/src/bin/server.rs b/interop/src/bin/server.rs similarity index 92% rename from tonic-interop/src/bin/server.rs rename to interop/src/bin/server.rs index 1d60a8ff8..67102e588 100644 --- a/tonic-interop/src/bin/server.rs +++ b/interop/src/bin/server.rs @@ -49,8 +49,8 @@ async fn main() -> std::result::Result<(), Box> { }); if matches.use_tls { - let cert = tokio::fs::read("tonic-interop/data/server1.pem").await?; - let key = tokio::fs::read("tonic-interop/data/server1.key").await?; + let cert = tokio::fs::read("interop/data/server1.pem").await?; + let key = tokio::fs::read("interop/data/server1.key").await?; let identity = Identity::from_pem(cert, key); builder = builder.tls_config(ServerTlsConfig::with_rustls().identity(identity)); diff --git a/tonic-interop/src/client.rs b/interop/src/client.rs similarity index 100% rename from tonic-interop/src/client.rs rename to interop/src/client.rs diff --git a/tonic-interop/src/lib.rs b/interop/src/lib.rs similarity index 100% rename from tonic-interop/src/lib.rs rename to interop/src/lib.rs diff --git a/tonic-interop/src/server.rs b/interop/src/server.rs similarity index 100% rename from tonic-interop/src/server.rs rename to interop/src/server.rs diff --git a/tonic-interop/test.sh b/interop/test.sh similarity index 87% rename from tonic-interop/test.sh rename to interop/test.sh index 559749295..b65ebb436 100755 --- a/tonic-interop/test.sh +++ b/interop/test.sh @@ -16,13 +16,13 @@ esac ARG="${1:-""}" -(cd tonic-interop && cargo build --bins) +(cd interop && cargo build --bins) -SERVER="tonic-interop/bin/server_${OS}_amd64${EXT}" +SERVER="interop/bin/server_${OS}_amd64${EXT}" -# TLS_CA="tonic-interop/data/ca.pem" -TLS_CRT="tonic-interop/data/server1.pem" -TLS_KEY="tonic-interop/data/server1.key" +# TLS_CA="interop/data/ca.pem" +TLS_CRT="interop/data/server1.pem" +TLS_KEY="interop/data/server1.key" # run the test server ./"${SERVER}" ${ARG} --tls_cert_file $TLS_CRT --tls_key_file $TLS_KEY &