Adds three-client test to check discovery relaying

This commit is contained in:
benbierens 2023-07-13 09:20:24 +02:00
parent 1ef65f00f9
commit 1f8fc52cb1
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
2 changed files with 29 additions and 3 deletions

View File

@ -64,9 +64,9 @@ namespace ContinuousTests
{ {
cancelToken.ThrowIfCancellationRequested(); cancelToken.ThrowIfCancellationRequested();
log.Log($"Checking '{n.Address.Host}'..."); log.Log($"Checking {n.Container.Name} @ '{n.Address.Host}:{n.Address.Port}'...");
if (EnsureOnline(n)) if (EnsureOnline(log, n))
{ {
log.Log("OK"); log.Log("OK");
} }
@ -82,12 +82,14 @@ namespace ContinuousTests
} }
} }
private bool EnsureOnline(CodexAccess n) private bool EnsureOnline(BaseLog log, CodexAccess n)
{ {
try try
{ {
var info = n.GetDebugInfo(); var info = n.GetDebugInfo();
if (info == null || string.IsNullOrEmpty(info.id)) return false; if (info == null || string.IsNullOrEmpty(info.id)) return false;
log.Log($"Codex version: '{info.codex.version}' revision: '{info.codex.revision}'");
} }
catch catch
{ {

View File

@ -0,0 +1,24 @@
using DistTestCore;
using NUnit.Framework;
namespace Tests.BasicTests
{
[TestFixture]
public class ThreeClientTest : AutoBootstrapDistTest
{
[Test]
public void ThreeClient()
{
var primary = SetupCodexNode();
var secondary = SetupCodexNode();
var testFile = GenerateTestFile(10.MB());
var contentId = primary.UploadFile(testFile);
var downloadedFile = secondary.DownloadContent(contentId);
testFile.AssertIsEqual(downloadedFile);
}
}
}