2
0
mirror of synced 2025-02-03 20:23:42 +00:00

52 lines
1.6 KiB
C#
Raw Normal View History

2023-04-17 07:56:08 +02:00
using DistTestCore;
2023-03-23 12:35:03 +01:00
using NUnit.Framework;
2023-04-12 13:53:55 +02:00
namespace TestsLong.BasicTests
2023-03-23 12:35:03 +01:00
{
public class TestInfraTests : DistTest
{
[Test, UseLongTimeouts]
public void TestInfraShouldHave1000AddressSpacesPerPod()
{
2023-04-25 12:52:11 +02:00
var group = SetupCodexNodes(1000, s => s.EnableMetrics()); // Increases use of port address space per node.
2023-03-23 12:35:03 +01:00
var nodeIds = group.Select(n => n.GetDebugInfo().id).ToArray();
Assert.That(nodeIds.Length, Is.EqualTo(nodeIds.Distinct().Count()),
"Not all created nodes provided a unique id.");
}
[Test, UseLongTimeouts]
public void TestInfraSupportsManyConcurrentPods()
{
for (var i = 0; i < 20; i++)
{
2023-04-25 12:52:11 +02:00
var n = SetupCodexNode();
2023-03-23 12:35:03 +01:00
Assert.That(!string.IsNullOrEmpty(n.GetDebugInfo().id));
}
}
[Test, UseLongTimeouts]
public void DownloadConsistencyTest()
{
2023-04-25 12:52:11 +02:00
var primary = SetupCodexNode(s => s
.WithStorageQuota(2.MB()));
2023-03-23 12:35:03 +01:00
var testFile = GenerateTestFile(1.MB());
var contentId = primary.UploadFile(testFile);
var files = new List<TestFile?>();
for (var i = 0; i < 100; i++)
{
files.Add(primary.DownloadContent(contentId));
}
Assert.That(files.All(f => f != null));
Assert.That(files.All(f => f!.GetFileSize() == testFile.GetFileSize()));
foreach (var file in files) file!.AssertIsEqual(testFile);
}
}
}