cs-codex-dist-tests/Tests/BasicTests/NetworkIsolationTest.cs

50 lines
1.0 KiB
C#
Raw Normal View History

2023-05-04 06:25:48 +00:00
using DistTestCore;
using NUnit.Framework;
using Utils;
namespace Tests.BasicTests
{
[Ignore("not a real test!")]
[TestFixture]
public class NetworkIsolationTest : DistTest
{
private IOnlineCodexNode? node = null;
// net isolation: only on real cluster?
[Test]
public void SetUpANodeAndWait()
{
node = SetupCodexNode();
while (node != null)
{
Time.Sleep(TimeSpan.FromSeconds(5));
}
}
[Test]
public void ForeignNodeConnects()
{
var myNode = SetupCodexNode();
while (node == null)
{
Time.Sleep(TimeSpan.FromSeconds(1));
}
myNode.ConnectToPeer(node);
var testFile = GenerateTestFile(1.MB());
var contentId = node.UploadFile(testFile);
var downloadedFile = myNode.DownloadContent(contentId);
testFile.AssertIsEqual(downloadedFile);
node = null;
}
}
}