2023-09-12 13:43:30 +00:00
|
|
|
|
using CodexPlugin;
|
|
|
|
|
using DistTestCore;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
|
|
namespace Tests
|
|
|
|
|
{
|
|
|
|
|
public class AutoBootstrapDistTest : DistTest
|
|
|
|
|
{
|
|
|
|
|
public IOnlineCodexNode AddCodex()
|
|
|
|
|
{
|
|
|
|
|
return AddCodex(s => { });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IOnlineCodexNode AddCodex(Action<ICodexSetup> setup)
|
|
|
|
|
{
|
2023-09-13 06:55:04 +00:00
|
|
|
|
return Ci.SetupCodexNode(s =>
|
2023-09-12 13:43:30 +00:00
|
|
|
|
{
|
|
|
|
|
setup(s);
|
|
|
|
|
s.WithBootstrapNode(BootstrapNode);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ICodexNodeGroup AddCodex(int numberOfNodes)
|
|
|
|
|
{
|
2023-09-13 06:55:04 +00:00
|
|
|
|
return Ci.SetupCodexNodes(numberOfNodes, s => s.WithBootstrapNode(BootstrapNode));
|
2023-09-12 13:43:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ICodexNodeGroup AddCodex(int numberOfNodes, Action<ICodexSetup> setup)
|
|
|
|
|
{
|
2023-09-13 06:55:04 +00:00
|
|
|
|
return Ci.SetupCodexNodes(numberOfNodes, s =>
|
2023-09-12 13:43:30 +00:00
|
|
|
|
{
|
|
|
|
|
setup(s);
|
|
|
|
|
s.WithBootstrapNode(BootstrapNode);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[SetUp]
|
|
|
|
|
public void SetUpBootstrapNode()
|
|
|
|
|
{
|
2023-09-13 06:55:04 +00:00
|
|
|
|
BootstrapNode = Ci.SetupCodexNode(s => s.WithName("BOOTSTRAP"));
|
2023-09-12 13:43:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected IOnlineCodexNode BootstrapNode { get; private set; } = null!;
|
|
|
|
|
}
|
|
|
|
|
}
|