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

62 lines
1.8 KiB
C#
Raw Normal View History

2023-03-21 12:20:21 +00:00
using CodexDistTestCore;
using NUnit.Framework;
2023-03-21 12:20:21 +00:00
namespace Tests.BasicTests
{
[TestFixture]
2023-03-21 12:20:21 +00:00
public class SimpleTests : DistTest
{
[Test]
public void GetDebugInfo()
{
var dockerImage = new CodexDockerImage();
2023-03-21 14:17:48 +00:00
var node = SetupCodexNodes(1).BringOnline()[0];
var debugInfo = node.GetDebugInfo();
Assert.That(debugInfo.spr, Is.Not.Empty);
Assert.That(debugInfo.codex.revision, Is.EqualTo(dockerImage.GetExpectedImageRevision()));
}
[Test]
public void OneClientTest()
{
2023-03-21 14:17:48 +00:00
var primary = SetupCodexNodes(1)
.WithLogLevel(CodexLogLevel.Trace)
.WithStorageQuota(2.MB())
2023-03-21 14:17:48 +00:00
.BringOnline()[0];
var testFile = GenerateTestFile(1.MB());
var contentId = primary.UploadFile(testFile);
var downloadedFile = primary.DownloadContent(contentId);
testFile.AssertIsEqual(downloadedFile);
}
//[Test]
//public void TwoClientTest()
//{
2023-03-19 10:18:56 +00:00
// var primary = SetupCodexNode()
// .WithLogLevel(CodexLogLevel.Trace)
// .WithStorageQuota(1024 * 1024 * 2)
// .BringOnline();
2023-03-19 10:18:56 +00:00
// var secondary = SetupCodexNode()
// .WithLogLevel(CodexLogLevel.Trace)
2023-03-19 10:18:56 +00:00
// .WithBootstrapNode(primary)
// .BringOnline();
// var testFile = GenerateTestFile(1024 * 1024);
2023-03-19 10:18:56 +00:00
// var contentId = primary.UploadFile(testFile);
2023-03-19 10:18:56 +00:00
// var downloadedFile = secondary.DownloadContent(contentId);
// testFile.AssertIsEqual(downloadedFile);
//}
}
}