[AZ-1124] Add PT-10 gRPC stream perf scenario
ci/woodpecker/push/01-test Pipeline failed
ci/woodpecker/push/02-build-push unknown status

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-06-26 11:26:14 +03:00
parent a0449f79d0
commit 7dac986996
15 changed files with 598 additions and 11 deletions
@@ -1,3 +1,5 @@
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using Grpc.Core;
using Grpc.Net.Client;
using Satellite.V1;
@@ -8,15 +10,65 @@ public static class GrpcTestHelpers
{
public static GrpcChannel CreateChannel(string apiUrl)
{
var handler = new SocketsHttpHandler
{
EnableMultipleHttp2Connections = true,
};
var caCertPath = ResolveCaCertPath();
if (!string.IsNullOrEmpty(caCertPath))
{
var caCert = X509Certificate2.CreateFromPemFile(caCertPath);
handler.SslOptions = new SslClientAuthenticationOptions
{
RemoteCertificateValidationCallback = (_, certificate, _, errors) =>
{
if (errors == SslPolicyErrors.None)
{
return true;
}
if (certificate is null)
{
return false;
}
using var chain = new X509Chain();
chain.ChainPolicy.TrustMode = X509ChainTrustMode.CustomRootTrust;
chain.ChainPolicy.CustomTrustStore.Add(caCert);
chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck;
return chain.Build(new X509Certificate2(certificate));
},
};
}
return GrpcChannel.ForAddress(apiUrl, new GrpcChannelOptions
{
HttpHandler = new SocketsHttpHandler
{
EnableMultipleHttp2Connections = true,
},
HttpHandler = handler,
});
}
private static string? ResolveCaCertPath()
{
var explicitPath = Environment.GetEnvironmentVariable("PERF_CA_CERT");
if (!string.IsNullOrWhiteSpace(explicitPath) && File.Exists(explicitPath))
{
return explicitPath;
}
var projectRoot = Environment.GetEnvironmentVariable("PROJECT_ROOT");
if (!string.IsNullOrWhiteSpace(projectRoot))
{
var defaultPath = Path.Combine(projectRoot, "certs", "api.crt");
if (File.Exists(defaultPath))
{
return defaultPath;
}
}
return null;
}
public static RouteTileDelivery.RouteTileDeliveryClient CreateClient(string apiUrl, string jwtToken)
{
var channel = CreateChannel(apiUrl);