2
0
mirror of synced 2025-01-29 17:55:10 +00:00

47 lines
1.3 KiB
C#
Raw Normal View History

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