Merge pull request #3729 from jtattermusch/csharp_args_spec

Make C# interop tests args parsing compliant with spec.
pull/3739/head
Michael Lumish 9 years ago
commit 0712527999
  1. 12
      src/csharp/Grpc.IntegrationTesting/InteropClient.cs
  2. 7
      src/csharp/Grpc.IntegrationTesting/InteropServer.cs
  3. 6
      tools/run_tests/run_interop_tests.py

@ -66,11 +66,13 @@ namespace Grpc.IntegrationTesting
[Option("test_case", DefaultValue = "large_unary")]
public string TestCase { get; set; }
[Option("use_tls")]
public bool UseTls { get; set; }
// Deliberately using nullable bool type to allow --use_tls=true syntax (as opposed to --use_tls)
[Option("use_tls", DefaultValue = false)]
public bool? UseTls { get; set; }
[Option("use_test_ca")]
public bool UseTestCa { get; set; }
// Deliberately using nullable bool type to allow --use_test_ca=true syntax (as opposed to --use_test_ca)
[Option("use_test_ca", DefaultValue = false)]
public bool? UseTestCa { get; set; }
[Option("default_service_account", Required = false)]
public string DefaultServiceAccount { get; set; }
@ -134,7 +136,7 @@ namespace Grpc.IntegrationTesting
private async Task<ChannelCredentials> CreateCredentialsAsync()
{
var credentials = options.UseTls ? TestCredentials.CreateTestClientCredentials(options.UseTestCa) : ChannelCredentials.Insecure;
var credentials = options.UseTls.Value ? TestCredentials.CreateTestClientCredentials(options.UseTestCa.Value) : ChannelCredentials.Insecure;
if (options.TestCase == "jwt_token_creds")
{

@ -54,8 +54,9 @@ namespace Grpc.IntegrationTesting
[Option("port", DefaultValue = 8070)]
public int Port { get; set; }
[Option("use_tls")]
public bool UseTls { get; set; }
// Deliberately using nullable bool type to allow --use_tls=true syntax (as opposed to --use_tls)
[Option("use_tls", DefaultValue = false)]
public bool? UseTls { get; set; }
[HelpOption]
public string GetUsage()
@ -99,7 +100,7 @@ namespace Grpc.IntegrationTesting
string host = "0.0.0.0";
int port = options.Port;
if (options.UseTls)
if (options.UseTls.Value)
{
server.Ports.Add(host, port, TestCredentials.CreateTestServerCredentials());
}

@ -100,17 +100,17 @@ class CSharpLanguage:
def cloud_to_prod_args(self):
return (self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS +
['--use_tls'])
['--use_tls=true'])
def cloud_to_cloud_args(self):
return (self.client_cmdline_base + _CLOUD_TO_CLOUD_BASE_ARGS +
['--use_tls', '--use_test_ca'])
['--use_tls=true', '--use_test_ca=true'])
def cloud_to_prod_env(self):
return _SSL_CERT_ENV
def server_args(self):
return ['mono', 'Grpc.IntegrationTesting.Server.exe', '--use_tls']
return ['mono', 'Grpc.IntegrationTesting.Server.exe', '--use_tls=true']
def __str__(self):
return 'csharp'

Loading…
Cancel
Save