diff --git a/tests/NATS.Client.Core.Tests/resources/certs/ca-cert.pem b/tests/NATS.Client.Core.Tests/resources/certs/ca-cert.pem index 5dac9e375..e39dfa045 100644 --- a/tests/NATS.Client.Core.Tests/resources/certs/ca-cert.pem +++ b/tests/NATS.Client.Core.Tests/resources/certs/ca-cert.pem @@ -1,31 +1,29 @@ ------BEGIN CERTIFICATE----- -MIIFZzCCA0+gAwIBAgIUBMoKM9CcrbMaShKQg6VBHJJEYgIwDQYJKoZIhvcNAQEL -BQAwQzELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAk5DMQwwCgYDVQQHDANSVFAxDDAK -BgNVBAoMA2FwcDELMAkGA1UEAwwCY2EwHhcNMjIwOTExMDIxOTMwWhcNMzIwOTA4 -MDIxOTMwWjBDMQswCQYDVQQGEwJVUzELMAkGA1UECAwCTkMxDDAKBgNVBAcMA1JU -UDEMMAoGA1UECgwDYXBwMQswCQYDVQQDDAJjYTCCAiIwDQYJKoZIhvcNAQEBBQAD -ggIPADCCAgoCggIBAOkLxt3m2H7npRzU+6zkVtuvkkqrm164O8Khl7MyPoF00LA6 -EDTT+qKOtTzlKx5hXWQcYgkSjuldWDyu8nCWWmfXKnCLG5WNa45LBCPrKeJDCa4k -V+4csZ3l1A2UV2a/IQg91W6KHKpHW3IfOkPePXPPUCb95sYqaAw9pw+h/V1jvoCX -egNLgJxFEYk8qMAF3TrQJbzkigJXvC4gNl+7IbnmqE022FPci3hmPqTUDkr7VHqY -KrUPlrV+lERl46xBdcs1QAVr4NrX8tKLNSyHaCbmg45thpt2JXjHqGUo4/Vq3lJU -TtIb+FWywkAbyB9g8o6ECRwcq8ZR1anHAbhSHraDoU846jurMNLXrI2UNsk6kH1y -fy0n/Hbt514RjRYsG2n/QHGG4vae07Q5fmGPhgKduKoV49p0c8bN2RcmAIVj8CMb -HlpbwS7oH7UEi8e+Ic3fPaaoyVuDXdGq6mC8q7Z+Cj/n/AvZK/vxOXJ6yuKjsXuD -5LB+Rf92AbWgjUvh9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9A6dAZvc899pIl/DsbmvZk26IglV6s4yxZqIsC6Bw6 +CfBaJuPjsJjEHJcBEyRQ7pcIxQsHmHC/bd/58FKf5N2DoaZDjF6U/eGDZj7T9Hkl +cyshAWdkGV58yhlqnrSIG6ovy8wrj6px3cPXG6qM0GopT8GSull9R1kAjVcB9p32 +C8rwvmQeRrIUivOduzrhG2kRrqGgPSvkWqTscI9Z7nu5cCIzIcC7QA2UWOixUVDe +ENxhECEvR9BpBZqlZLC0Ihi/zBHlXq+6cAdv61hkAh6mhgaZZjx302gjxGy+c7p8 +UBhfGa5dGY+0dJhPWAPAtfX41PQ/Hc85GYkTEVJbP0q60MCegQfvIc4boPG7Mw+Y +FLjhGtBtBF696P6IZpNryV6WjZxi6WWAfqSoTH5GvZR0t1XLvIloizkRODmbcJxA +5my/DBCnUBxrH++yFJs3wd7VCESd+SFJSZQJTDwq/ICrrb71tBqhuUo6uNoEUJ0z +iVikrvjc3JtrnvE+lj56vtzVZ0l6DvNzyihHbPrjq58z3ETeKza/KjZcdLpygIUL +COhwGCxq/fFVJE6wItAVLhYh90yNirIP5b3750jUirjjq75fXfuQbQoE5w+BMByx +PS1vntJkJ6BSgW5vOk9UOGSUYAQAwR28cVD4fL9/GA== +-----END CERTIFICATE----- diff --git a/tests/NATS.Client.Core.Tests/resources/certs/client-cert.pem b/tests/NATS.Client.Core.Tests/resources/certs/client-cert.pem index f557ddd82..12f2355e0 100644 --- a/tests/NATS.Client.Core.Tests/resources/certs/client-cert.pem +++ b/tests/NATS.Client.Core.Tests/resources/certs/client-cert.pem @@ -1,29 +1,27 @@ ------BEGIN CERTIFICATE----- -MIIE/jCCAuYCAQEwDQYJKoZIhvcNAQELBQAwQzELMAkGA1UEBhMCVVMxCzAJBgNV -BAgMAk5DMQwwCgYDVQQHDANSVFAxDDAKBgNVBAoMA2FwcDELMAkGA1UEAwwCY2Ew -HhcNMjIwOTExMDIxOTMzWhcNMzIwOTA4MDIxOTMzWjBHMQswCQYDVQQGEwJVUz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ICATE----- diff --git a/tests/NATS.Client.Core.Tests/resources/certs/client-key.pem b/tests/NATS.Client.Core.Tests/resources/certs/client-key.pem index e82b0a073..4a60250cc 100644 --- a/tests/NATS.Client.Core.Tests/resources/certs/client-key.pem +++ b/tests/NATS.Client.Core.Tests/resources/certs/client-key.pem @@ -1,52 +1,52 @@ ------BEGIN PRIVATE KEY----- -MIIJQQIBADANBgkqhkiG9w0BAQEFAASCCSswggknAgEAAoICAQCbIWIItokuzp+k -jFwGzITr87MnsfUfnp9SRbSqGX32vU+nzi83eQMSraAWwDMCMkoUJPkFSJ/QljtG -XbSRyjStwppz6fCmxY/5OCqBPHyFBHtOHNgUO/zXYw5YgdJV36MLDmZCMJT9VZwi -hUFCMjP10TjraCntiHEvawnIJ76NdZ6gnYqJGva+5og4tvF5AWF5QHmau1TxVTed -mL3R+C6F+5YDfE3KzffmjgA+zHlAmmiIX1tEXaweKVA3ZgZQkZX19QIh8gmmE/F1 -TDjTy5F8tsEg/4ddRmazvCoo8gW97sriIqXHQ++ytjiJpOpRAh2HvKghePZhEeBm -/S3vdPvi/Bs4MMm1tlC8azaBuodj9J0yUWLH/xqor+7mQaSMI0NylnblPmf4lBoY -6zTetW77odr2LfkDbKYMq43aaLgp6BAxwYidaeu/xup2xNrY3A8As7ZNAe3f3dzq -hGXDSYeMb5iFXNSIS8Ohf3hbhu2uCoDABB6Tg8XupiMFQShEGk2MR9iqaMhW98K4 -dio9rBBGk51Bh+YpdeWvkTAfZity4/uQNNC5CDQYDpcjN7N0xg7NAs+l8IbbxXA7 -El55NMQ5oJXJ0cxg/8z6afSf4TbJ0Os1YUqx/f//HhPT2SRpWNouvGl+d2MY+VVU -YH+hXGmQWhnVOPMmC+MCQpBZOhtlwwIDAQABAoICAC03N7nOaoHIG+P8PT6GEiAr -8gYZ6paCx3FVe+kwcPSgDT2d7Uk/7lNdZBH9h2CWg90HQcX2ew5zG2fRHDZ6N4yF -8jri7w/M+b/sTQdKOAkVW1NTOO/85B9rcdz+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ty3dF +Gen9r72nsPFS4QiElQsM0lkiFO67c7wxlFXTe+c4aCLi/dJryhDb4fRZdgrIQGK6 +gT97TVbm5OLj8sEqIpQ5kCe20zA+jLyemUroLYnwdp74RqZUFeGKnCyTULx69RPE +zj4a+bmQYBKivrhr/JdpwOB9g+bezjHarR+MgagjysRXWBl6VtgP/nRe3Zq31fn0 +lKUoTwgaDe6CaEi3GC1M/SDoDp2y/g== +-----END PRIVATE KEY----- diff --git a/tests/NATS.Client.Core.Tests/resources/certs/generate.sh b/tests/NATS.Client.Core.Tests/resources/certs/generate.sh new file mode 100644 index 000000000..ced3bf46c --- /dev/null +++ b/tests/NATS.Client.Core.Tests/resources/certs/generate.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +set -e + +# -subj values may fail on Windows if running under MSYSGIT +# Make sure to disable POSIX-to-Windows path conversion e.g. +# export MSYS_NO_PATHCONV=1 +# + +rm -rf store +mkdir store + +echo ================================ +echo CA +echo ================================ +openssl genrsa -out store/ca.key 4096 +openssl req -x509 -sha256 -new -nodes -key store/ca.key -days 3650 -out store/ca.crt -subj '/CN=ca' +openssl x509 -noout -text -in store/ca.crt +cp store/ca.crt ca-cert.pem + +echo ================================ +echo SERVER +echo ================================ +cat < store/server.ext +authorityKeyIdentifier=keyid,issuer +basicConstraints=CA:FALSE +keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment +subjectAltName = @alt_names +[alt_names] +DNS.1 = localhost +IP.1 = 127.0.0.1 +IP.2 = ::1 +EOF +openssl req -new -nodes -out store/server.csr -newkey rsa:4096 -keyout store/server.key -subj '/CN=localhost' +openssl x509 -req -in store/server.csr -CA store/ca.crt -CAkey store/ca.key -CAcreateserial -out store/server.crt -days 3650 -sha256 -extfile store/server.ext +openssl x509 -noout -text -in store/server.crt +cp store/server.crt server-cert.pem +cp store/server.key server-key.pem + +echo ================================ +echo CLIENT +echo ================================ +openssl req -new -nodes -out store/client.csr -newkey rsa:4096 -keyout store/client.key -subj '/CN=client' +openssl x509 -req -in store/client.csr -CA store/ca.crt -CAkey store/ca.key -CAcreateserial -out store/client.crt -days 3650 -sha256 +openssl x509 -noout -text -in store/client.crt +cp store/client.crt client-cert.pem +cp store/client.key client-key.pem + +rm -rf store diff --git a/tests/NATS.Client.Core.Tests/resources/certs/server-cert.pem b/tests/NATS.Client.Core.Tests/resources/certs/server-cert.pem index 501d14fd3..0dca69ec7 100644 --- a/tests/NATS.Client.Core.Tests/resources/certs/server-cert.pem +++ b/tests/NATS.Client.Core.Tests/resources/certs/server-cert.pem @@ -1,31 +1,30 @@ ------BEGIN CERTIFICATE----- -MIIFYDCCA0igAwIBAgIBATANBgkqhkiG9w0BAQsFADBDMQswCQYDVQQGEwJVUzEL -MAkGA1UECAwCTkMxDDAKBgNVBAcMA1JUUDEMMAoGA1UECgwDYXBwMQswCQYDVQQD -DAJjYTAeFw0yMjA5MTEwMjE5MzJaFw0zMjA5MDgwMjE5MzJaMEoxCzAJBgNVBAYT -AlVTMQswCQYDVQQIDAJOQzEMMAoGA1UEBwwDUlRQMQwwCgYDVQQKDANhcHAxEjAQ -BgNVBAMMCWxvY2FsaG9zdDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB -ALZGDLpQf+SNbk4ZYHkG4smLw8J1v34nglZmQ3ovDbkWwd2jWAsHbQg/9hFAE320 -X7lyLjKJYfsZvK1SgBr9fRr7w8hVyBycYUmKNlu/XLQzavfznQS1VJkCXegFpVuw -eqbzCQQG0oQdef7VDVss82tlyGykbxsdyuAgOQgh+phe5jxHucAIRupt7qwYiu3Z -Y+9dwP2NF41jxkUiMGOBcyK77KGGVBNoEcCMjaSfCW/bHA5svK/jNBUIb1znkNS9 -W16UJ4Fyy5c1FIZkvr2Wm1Vt0ynWkG8DjDbcg52tdruWPyTU4j0k5K4v8duYoF49 -7KXoi/WmKLHHeneqLvj8YeWV1HdpXElqSYDexyqhgXf2sYCZus98ESLGyTa5MmPE -t/+X1U+I7uJVsWV/WAZhTBsLuiomr/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sG +A1UdDwQEAwIE8DAsBgNVHREEJTAjgglsb2NhbGhvc3SHBH8AAAGHEAAAAAAAAAAA +AAAAAAAAAAEwDQYJKoZIhvcNAQELBQADggIBAFSAyqIkye2t/wYe3s7+xNB8gd6t +5CCNUdv2JHzWIa26oiu3jXPBUXyoHuyLM/k64uqfqR9Vwig6X5EsnD1UG2Gw94Le +nMPNPctEEwi4GjXno7cKemcdBjuDrT97BXUD9ptdXKVJ59noSveQvR/gr9LkMo42 +WZLH8RGUuzn0KH6JHihwPotxKzxoTUmyO/M7O6UEYgA94goQTouRrFLMeemZPrl3 +9IvmwlYsiVAZyNqygGPENrr6JOTEL0Ol4bnh3KdO7yWCaJvSGC6F4ViEg+kFRUOC +zzdtxpgOS7RkkpZ041SnDn2IGtm8JkzUHo+qIU5X6NxUbQSU0wqFQVcseLG1AmW6 +6bWe2mR8cox+y8rk0b/om9m/e1pDjmXKAKSwNJ77WnGKcs2FS6PFi6pi4wdDrXIP +/zqkHOYlftKxTBgkR9J9hz3gECOQeKUpo9dZFEJJHAGAfZMQC2H73pCwz/kliwi+ +7IwoMS9pzGssRYbtRhYHWy1ZErRokSgBnDE381vUCYQMpDed+tKMjbv3camGZNNk +qpQAukZVKzV9BCrAFhUI/xTCzJ51Ec8Si/trnIGEAmJMHUwYEkuTVIbjRSS1TGr3 +Dc8PaCIq0gDkCyx0SUyOByD2lxHz9S7qQjy8VhKaQkqRLRPr6ewbZaih7RnYqQQt +3uhhts+hrn4lihEK +-----END CERTIFICATE----- diff --git a/tests/NATS.Client.Core.Tests/resources/certs/server-key.pem b/tests/NATS.Client.Core.Tests/resources/certs/server-key.pem index dfc3f7e29..8ceeccc95 100644 --- a/tests/NATS.Client.Core.Tests/resources/certs/server-key.pem +++ b/tests/NATS.Client.Core.Tests/resources/certs/server-key.pem @@ -1,52 +1,52 @@ ------BEGIN PRIVATE KEY----- -MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQC2Rgy6UH/kjW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Client.JetStream.Tests/ClusterTests.cs b/tests/NATS.Client.JetStream.Tests/ClusterTests.cs new file mode 100644 index 000000000..9f1bd0510 --- /dev/null +++ b/tests/NATS.Client.JetStream.Tests/ClusterTests.cs @@ -0,0 +1,29 @@ +using NATS.Client.Core.Tests; + +namespace NATS.Client.JetStream.Tests; + +public class ClusterTests +{ + private readonly ITestOutputHelper _output; + + public ClusterTests(ITestOutputHelper output) => _output = output; + + [Fact] + public async Task Form_a_local_cluster() + { + await using var cluster = new NatsCluster(new NullOutputHelper(), TransportType.Tcp, (i, b) => b.WithServerName($"n{i}").UseJetStream()); + await using var nats = cluster.Server1.CreateClientConnection(); + + await nats.PingAsync(); + + var urls = nats.ServerInfo!.ClientConnectUrls!.ToList(); + + Assert.Equal(3, urls.Count); + + foreach (var url in urls) + { + _output.WriteLine(url); + Assert.Matches(@"127\.0\.0\.1", url); + } + } +} diff --git a/tests/NATS.Client.JetStream.Tests/OrderedConsumerTest.cs b/tests/NATS.Client.JetStream.Tests/OrderedConsumerTest.cs index 7387e20d4..c28151280 100644 --- a/tests/NATS.Client.JetStream.Tests/OrderedConsumerTest.cs +++ b/tests/NATS.Client.JetStream.Tests/OrderedConsumerTest.cs @@ -41,6 +41,47 @@ public async Task Consume_test() } } + [Fact] + public async Task Consume_reconnect_publish() + { + var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30)); + await using var server = NatsServer.StartJS(); + await using var nats = server.CreateClientConnection(); + var js = new NatsJSContext(nats); + + var stream = await js.CreateStreamAsync("s1", new[] { "s1.*" }, cts.Token); + + for (var i = 0; i < 100; i++) + { + if (i % 10 == 0) + { + await server.RestartAsync(); + } + + (await js.PublishAsync("s1.foo", i, cancellationToken: cts.Token)).EnsureSuccess(); + } + + (await js.PublishAsync("s1.foo", -1, cancellationToken: cts.Token)).EnsureSuccess(); + + var consumer = (NatsJSOrderedConsumer)await stream.CreateOrderedConsumerAsync(cancellationToken: cts.Token); + + var consumeOpts = new NatsJSConsumeOpts + { + MaxMsgs = 3, + Expires = TimeSpan.FromSeconds(3), + }; + var count = 0; + await foreach (var msg in consumer.ConsumeAsync(opts: consumeOpts, cancellationToken: cts.Token)) + { + if (msg.Data == -1) + break; + Assert.Equal(count, msg.Data); + count++; + } + + Assert.Equal(100, count); + } + [Fact] public async Task Fetch_test() { diff --git a/tests/NATS.Client.TestUtilities/NatsServer.cs b/tests/NATS.Client.TestUtilities/NatsServer.cs index a772758e9..86df6c55f 100644 --- a/tests/NATS.Client.TestUtilities/NatsServer.cs +++ b/tests/NATS.Client.TestUtilities/NatsServer.cs @@ -4,6 +4,7 @@ using System.Text.RegularExpressions; using Cysharp.Diagnostics; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; namespace NATS.Client.Core.Tests; @@ -25,16 +26,18 @@ public class NatsServer : IAsyncDisposable private static readonly string NatsServerPath = $"nats-server{Ext}"; private static readonly Version Version; - private readonly CancellationTokenSource _cancellationTokenSource = new(); - private readonly string? _configFileName; + private CancellationTokenSource? _cancellationTokenSource; + private string? _configFileName; private readonly string? _jetStreamStoreDir; private readonly ITestOutputHelper _outputHelper; - private readonly Task _processOut; - private readonly Task _processErr; + private Task _processOut; + private Task _processErr; private readonly TransportType _transportType; private readonly OutputHelperLoggerFactory _loggerFactory; private int _disposed; + public Process ServerProcess { get; private set; } + static NatsServer() { var process = new Process @@ -59,6 +62,7 @@ private NatsServer(ITestOutputHelper outputHelper, NatsServerOpts opts) _outputHelper = outputHelper; _transportType = opts.TransportType; Opts = opts; + _loggerFactory = new OutputHelperLoggerFactory(_outputHelper, this); if (opts.EnableJetStream) { @@ -66,12 +70,17 @@ private NatsServer(ITestOutputHelper outputHelper, NatsServerOpts opts) Directory.CreateDirectory(_jetStreamStoreDir); opts.JetStreamStoreDir = _jetStreamStoreDir; } + } - (_configFileName, var config, var cmd) = GetCmd(opts); + public void StartServerProcess() + { + _cancellationTokenSource = new CancellationTokenSource(); - outputHelper.WriteLine("ProcessStart: " + cmd + Environment.NewLine + config); - var (p, stdout, stderr) = ProcessX.GetDualAsyncEnumerable(cmd); + (_configFileName, var config, var cmd) = GetCmd(Opts); + _outputHelper.WriteLine("ProcessStart: " + cmd + Environment.NewLine + config); + var (p, stdout, stderr) = ProcessX.GetDualAsyncEnumerable(cmd); + ServerProcess = p; _processOut = EnumerateWithLogsAsync(stdout, _cancellationTokenSource.Token); _processErr = EnumerateWithLogsAsync(stderr, _cancellationTokenSource.Token); @@ -83,7 +92,7 @@ private NatsServer(ITestOutputHelper outputHelper, NatsServerOpts opts) { try { - await client.ConnectAsync("localhost", Opts.ServerPort, _cancellationTokenSource.Token); + await client.ConnectAsync("127.0.0.1", Opts.ServerPort, _cancellationTokenSource.Token); if (client.Connected) return; } @@ -106,17 +115,16 @@ private NatsServer(ITestOutputHelper outputHelper, NatsServerOpts opts) _processErr.GetAwaiter().GetResult(); // throw exception } - outputHelper.WriteLine("OK to Process Start, Port:" + Opts.ServerPort); - _loggerFactory = new OutputHelperLoggerFactory(_outputHelper, this); + _outputHelper.WriteLine("OK to Process Start, Port:" + Opts.ServerPort); } public NatsServerOpts Opts { get; } public string ClientUrl => _transportType switch { - TransportType.Tcp => $"nats://localhost:{Opts.ServerPort}", - TransportType.Tls => $"tls://localhost:{Opts.ServerPort}", - TransportType.WebSocket => $"ws://localhost:{Opts.WebSocketPort}", + TransportType.Tcp => $"nats://127.0.0.1:{Opts.ServerPort}", + TransportType.Tls => $"tls://127.0.0.1:{Opts.ServerPort}", + TransportType.WebSocket => $"ws://127.0.0.1:{Opts.WebSocketPort}", _ => throw new ArgumentOutOfRangeException(), }; @@ -178,6 +186,7 @@ public static NatsServer Start(ITestOutputHelper outputHelper, NatsServerOpts op try { server = new NatsServer(outputHelper, opts); + server.StartServerProcess(); nats = server.CreateClientConnection(clientOpts ?? NatsOpts.Default, reTryCount: 3); #pragma warning disable CA2012 return server; @@ -196,6 +205,44 @@ public static NatsServer Start(ITestOutputHelper outputHelper, NatsServerOpts op throw new Exception("Can't start nats-server and connect to it"); } + public async ValueTask RestartAsync() + { + var t1 = ServerProcess.StartTime; + + await StopAsync(); + StartServerProcess(); + + var t2 = ServerProcess.StartTime; + + if (t1 == t2) + throw new Exception("Can't restart nats-server"); + } + + public async ValueTask StopAsync() + { + try + { + _cancellationTokenSource?.Cancel(); // trigger of process kill. + _cancellationTokenSource?.Dispose(); + + var processLogs = await _processErr; // wait for process exit, nats output info to stderror + if (processLogs.Length != 0) + { + _outputHelper.WriteLine("Process Logs of " + Opts.ServerPort); + foreach (var item in processLogs) + { + _outputHelper.WriteLine(item); + } + } + } + catch (OperationCanceledException) + { + } + catch (ObjectDisposedException) + { + } + } + public async ValueTask DisposeAsync() { if (Interlocked.Increment(ref _disposed) != 1) @@ -203,10 +250,11 @@ public async ValueTask DisposeAsync() return; } - _cancellationTokenSource.Cancel(); // trigger of process kill. - _cancellationTokenSource.Dispose(); try { + _cancellationTokenSource?.Cancel(); // trigger of process kill. + _cancellationTokenSource?.Dispose(); + var processLogs = await _processErr; // wait for process exit, nats output info to stderror if (processLogs.Length != 0) { @@ -220,6 +268,9 @@ public async ValueTask DisposeAsync() catch (OperationCanceledException) { } + catch (ObjectDisposedException) + { + } finally { if (_configFileName != null) @@ -258,7 +309,7 @@ public async ValueTask DisposeAsync() var client = new NatsConnection((options ?? NatsOpts.Default) with { LoggerFactory = _loggerFactory, - Url = $"nats://localhost:{proxy.Port}", + Url = $"nats://127.0.0.1:{proxy.Port}", ConnectTimeout = TimeSpan.FromSeconds(10), }); @@ -398,22 +449,29 @@ public record LogMessage( public class NatsCluster : IAsyncDisposable { - public NatsCluster(ITestOutputHelper outputHelper, TransportType transportType) + private readonly ITestOutputHelper _outputHelper; + + public NatsCluster(ITestOutputHelper outputHelper, TransportType transportType, Action? configure = default) { - var opts1 = new NatsServerOptsBuilder() + _outputHelper = outputHelper; + + var builder1 = new NatsServerOptsBuilder() .UseTransport(transportType) - .EnableClustering() - .Build(); + .EnableClustering(); + configure?.Invoke(1, builder1); + var opts1 = builder1.Build(); - var opts2 = new NatsServerOptsBuilder() + var builder2 = new NatsServerOptsBuilder() .UseTransport(transportType) - .EnableClustering() - .Build(); + .EnableClustering(); + configure?.Invoke(2, builder2); + var opts2 = builder2.Build(); - var opts3 = new NatsServerOptsBuilder() + var builder3 = new NatsServerOptsBuilder() .UseTransport(transportType) - .EnableClustering() - .Build(); + .EnableClustering(); + configure?.Invoke(3, builder3); + var opts3 = builder3.Build(); // By querying the ports we set the values lazily on all the opts. outputHelper.WriteLine($"opts1.ServerPort={opts1.ServerPort}"); @@ -444,8 +502,13 @@ public NatsCluster(ITestOutputHelper outputHelper, TransportType transportType) opt.SetRoutes(routes); } + _outputHelper.WriteLine($"Starting server 1..."); Server1 = NatsServer.Start(outputHelper, opts1); + + _outputHelper.WriteLine($"Starting server 2..."); Server2 = NatsServer.Start(outputHelper, opts2); + + _outputHelper.WriteLine($"Starting server 3..."); Server3 = NatsServer.Start(outputHelper, opts3); } @@ -457,8 +520,13 @@ public NatsCluster(ITestOutputHelper outputHelper, TransportType transportType) public async ValueTask DisposeAsync() { + _outputHelper.WriteLine($"Stopping server 1..."); await Server1.DisposeAsync(); + + _outputHelper.WriteLine($"Stopping server 2..."); await Server2.DisposeAsync(); + + _outputHelper.WriteLine($"Stopping server 3..."); await Server3.DisposeAsync(); } } diff --git a/tests/NATS.Client.TestUtilities/NatsServerOpts.cs b/tests/NATS.Client.TestUtilities/NatsServerOpts.cs index 913186cae..fde2ad45b 100644 --- a/tests/NATS.Client.TestUtilities/NatsServerOpts.cs +++ b/tests/NATS.Client.TestUtilities/NatsServerOpts.cs @@ -18,6 +18,7 @@ public sealed class NatsServerOptsBuilder private bool _enableTls; private bool _tlsFirst; private bool _enableJetStream; + private string? _serverName; private string? _tlsServerCertFile; private string? _tlsServerKeyFile; private string? _tlsCaFile; @@ -32,6 +33,7 @@ public sealed class NatsServerOptsBuilder EnableTls = _enableTls, TlsFirst = _tlsFirst, EnableJetStream = _enableJetStream, + ServerName = _serverName, TlsServerCertFile = _tlsServerCertFile, TlsServerKeyFile = _tlsServerKeyFile, TlsCaFile = _tlsCaFile, @@ -85,6 +87,12 @@ public NatsServerOptsBuilder UseTransport(TransportType transportType, bool tlsF return this; } + public NatsServerOptsBuilder WithServerName(string serverName) + { + _serverName = serverName; + return this; + } + public NatsServerOptsBuilder UseJetStream() { _enableJetStream = true; @@ -137,6 +145,10 @@ public NatsServerOpts() public bool EnableJetStream { get; init; } + public string? ServerName { get; init; } + + public string? ServerHost { get; init; } = "127.0.0.1"; + public string? JetStreamStoreDir { get; set; } public bool ServerDisposeReturnsPorts { get; init; } = true; @@ -170,7 +182,13 @@ public string ConfigFileContents get { var sb = new StringBuilder(); - sb.AppendLine($"port: {ServerPort}"); + + if (ServerName != null) + { + sb.AppendLine($"server_name: {ServerName}"); + } + + sb.AppendLine($"listen: {ServerHost}:{ServerPort}"); if (Trace) { @@ -190,7 +208,7 @@ public string ConfigFileContents { sb.AppendLine("cluster {"); sb.AppendLine(" name: nats"); - sb.AppendLine($" port: {ClusteringPort}"); + sb.AppendLine($" listen: {ServerHost}:{ClusteringPort}"); sb.AppendLine($" routes: [{_routes}]"); sb.AppendLine("}"); } @@ -234,7 +252,7 @@ public string ConfigFileContents public void SetRoutes(IEnumerable options) { - _routes = string.Join(",", options.Select(o => $"nats://localhost:{o.ClusteringPort}")); + _routes = string.Join(",", options.Select(o => $"nats://127.0.0.1:{o.ClusteringPort}")); } public void Dispose()