public async Task TestGetPluginInfo() { var ic = new Identity.IdentityClient(TestHelper.CreateChannel()); var response = await ic.GetPluginInfoAsync(new GetPluginInfoRequest(), null); Assert.Equal("csi-azurefile", response.Name); Assert.Equal("1.0.0-alpha1", response.VendorVersion); }
static async Task Main(string[] args) { AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true); var httpClientHandler = new HttpClientHandler(); // Return `true` to allow certificates that are untrusted/invalid //httpClientHandler.ServerCertificateCustomValidationCallback = // HttpClientHandler.DangerousAcceptAnyServerCertificateValidator; var httpClient = new HttpClient(httpClientHandler); using var channel = GrpcChannel.ForAddress("http://127.0.0.1:5216", new GrpcChannelOptions { HttpClient = httpClient }); await Task.Delay(2000); var client = new Identity.IdentityClient(channel); var info = await client.GetPluginInfoAsync(new GetPluginInfoRequest { }); Console.WriteLine($"Plugin Name: {info.Name}"); Console.ReadLine(); }