cs-codex-dist-tests/Tests/CodexTests/DownloadConnectivityTests/FullyConnectedDownloadTests.cs

47 lines
1.3 KiB
C#
Raw Normal View History

using CodexContractsPlugin;
using GethPlugin;
using NUnit.Framework;
2023-09-12 13:43:30 +00:00
using Utils;
2023-11-12 09:36:48 +00:00
namespace CodexTests.DownloadConnectivityTests
2023-09-12 13:43:30 +00:00
{
[TestFixture]
public class FullyConnectedDownloadTests : AutoBootstrapDistTest
{
[Test]
public void MetricsDoesNotInterfereWithPeerDownload()
{
2024-05-09 07:32:48 +00:00
StartCodex(2, s => s.EnableMetrics());
2023-09-12 13:43:30 +00:00
AssertAllNodesConnected();
}
[Test]
public void MarketplaceDoesNotInterfereWithPeerDownload()
{
var geth = Ci.StartGethNode(s => s.IsMiner());
var contracts = Ci.StartCodexContracts(geth);
2024-05-09 07:32:48 +00:00
StartCodex(2, s => s.EnableMarketplace(geth, contracts, m => m
.WithInitial(10.Eth(), 1000.TestTokens())));
2023-09-12 13:43:30 +00:00
AssertAllNodesConnected();
}
[Test]
[Combinatorial]
public void FullyConnectedDownloadTest(
2024-02-27 12:55:05 +00:00
[Values(2, 5)] int numberOfNodes,
[Values(1, 10)] int sizeMBs)
2023-09-12 13:43:30 +00:00
{
2024-05-09 07:32:48 +00:00
StartCodex(numberOfNodes);
2023-09-12 13:43:30 +00:00
AssertAllNodesConnected(sizeMBs);
}
private void AssertAllNodesConnected(int sizeMBs = 10)
{
2023-09-13 12:24:43 +00:00
CreatePeerDownloadTestHelpers().AssertFullDownloadInterconnectivity(GetAllOnlineCodexNodes(), sizeMBs.MB());
2023-09-12 13:43:30 +00:00
}
}
}