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

47 lines
1.2 KiB
C#
Raw Normal View History

using CodexContractsPlugin;
using CodexTests;
using GethPlugin;
using NUnit.Framework;
2023-09-12 13:43:30 +00:00
using Utils;
namespace Tests.DownloadConnectivityTests
{
[TestFixture]
public class FullyConnectedDownloadTests : AutoBootstrapDistTest
{
[Test]
public void MetricsDoesNotInterfereWithPeerDownload()
{
2023-09-13 12:24:43 +00:00
AddCodex(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);
AddCodex(2, s => s.EnableMarketplace(geth, contracts, 10.Eth(), 1000.TestTokens()));
2023-09-12 13:43:30 +00:00
AssertAllNodesConnected();
}
[Test]
[Combinatorial]
public void FullyConnectedDownloadTest(
[Values(3, 5)] int numberOfNodes,
[Values(10, 80)] int sizeMBs)
{
AddCodex(numberOfNodes);
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
}
}
}