2026-04-17 15:03:22 +10:00
|
|
|
|
using LogosStorageClient;
|
|
|
|
|
|
using StoragePlugin;
|
2025-04-25 15:42:13 +02:00
|
|
|
|
using NUnit.Framework;
|
2023-09-12 15:43:30 +02:00
|
|
|
|
|
2026-04-17 15:03:22 +10:00
|
|
|
|
namespace LogosStorageTests
|
2023-09-12 15:43:30 +02:00
|
|
|
|
{
|
2026-04-17 15:03:22 +10:00
|
|
|
|
public class AutoBootstrapDistTest : LogosStorageDistTest
|
2023-09-12 15:43:30 +02:00
|
|
|
|
{
|
2025-04-25 11:08:38 +02:00
|
|
|
|
private bool isBooting = false;
|
2024-09-24 10:10:59 +02:00
|
|
|
|
|
2026-04-17 15:03:22 +10:00
|
|
|
|
public IStorageNode BootstrapNode { get; private set; } = null!;
|
2025-04-25 15:42:13 +02:00
|
|
|
|
|
|
|
|
|
|
[SetUp]
|
|
|
|
|
|
public void SetupBootstrapNode()
|
2023-09-12 15:43:30 +02:00
|
|
|
|
{
|
2025-04-25 15:42:13 +02:00
|
|
|
|
isBooting = true;
|
2026-04-17 15:03:22 +10:00
|
|
|
|
BootstrapNode = StartLogosStorage(s => s.WithName("BOOTSTRAP_" + GetTestNamespace()));
|
2025-04-25 15:42:13 +02:00
|
|
|
|
isBooting = false;
|
2025-04-23 14:18:11 +02:00
|
|
|
|
}
|
2025-04-22 17:11:34 +02:00
|
|
|
|
|
2025-04-25 15:42:13 +02:00
|
|
|
|
[TearDown]
|
|
|
|
|
|
public void TearDownBootstrapNode()
|
2025-04-23 14:18:11 +02:00
|
|
|
|
{
|
2025-04-25 15:42:13 +02:00
|
|
|
|
BootstrapNode.Stop(waitTillStopped: false);
|
2025-04-23 14:18:11 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-17 15:03:22 +10:00
|
|
|
|
protected override void OnLogosStorageSetup(ILogosStorageSetup setup)
|
2025-04-23 14:18:11 +02:00
|
|
|
|
{
|
2025-04-25 11:08:38 +02:00
|
|
|
|
if (isBooting) return;
|
|
|
|
|
|
|
|
|
|
|
|
var node = BootstrapNode;
|
|
|
|
|
|
if (node != null) setup.WithBootstrapNode(node);
|
2023-09-12 15:43:30 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|