2023-05-10 07:09:31 +00:00
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
|
|
namespace DistTestCore
|
2023-05-01 09:14:42 +00:00
|
|
|
|
{
|
|
|
|
|
public class AutoBootstrapDistTest : DistTest
|
|
|
|
|
{
|
|
|
|
|
public override IOnlineCodexNode SetupCodexBootstrapNode(Action<ICodexSetup> setup)
|
|
|
|
|
{
|
2023-07-14 08:18:37 +00:00
|
|
|
|
throw new Exception("AutoBootstrapDistTest creates and attaches a single bootstrap node for you. " +
|
2023-05-01 09:14:42 +00:00
|
|
|
|
"If you want to control the bootstrap node from your test, please use DistTest instead.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override ICodexNodeGroup SetupCodexNodes(int numberOfNodes, Action<ICodexSetup> setup)
|
|
|
|
|
{
|
2023-05-31 11:34:12 +00:00
|
|
|
|
var codexSetup = CreateCodexSetup(numberOfNodes);
|
2023-05-01 09:14:42 +00:00
|
|
|
|
setup(codexSetup);
|
2023-05-10 07:09:31 +00:00
|
|
|
|
codexSetup.WithBootstrapNode(BootstrapNode);
|
2023-05-01 09:14:42 +00:00
|
|
|
|
return BringOnline(codexSetup);
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-10 07:09:31 +00:00
|
|
|
|
[SetUp]
|
|
|
|
|
public void SetUpBootstrapNode()
|
2023-05-10 06:53:57 +00:00
|
|
|
|
{
|
2023-07-14 08:18:37 +00:00
|
|
|
|
var setup = CreateCodexSetup(1).WithName("BOOTSTRAP");
|
|
|
|
|
BootstrapNode = BringOnline(setup)[0];
|
2023-05-10 06:53:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-05-10 07:09:31 +00:00
|
|
|
|
protected IOnlineCodexNode BootstrapNode { get; private set; } = null!;
|
2023-05-01 09:14:42 +00:00
|
|
|
|
}
|
|
|
|
|
}
|