2
0
mirror of synced 2025-01-22 06:20:29 +00:00
cs-codex-dist-tests/BasicTests/DebugEndpointTests.cs

80 lines
2.4 KiB
C#
Raw Normal View History

using CodexDistTests.TestCore;
using NUnit.Framework;
using System;
namespace CodexDistTests.BasicTests
{
[TestFixture]
public class DebugEndpointTests : DistTest
{
[Test]
public void GetDebugInfo()
{
var dockerImage = new CodexDockerImage();
var node = SetupCodexNode().BringOnline();
var debugInfo = node.GetDebugInfo();
Assert.That(debugInfo.spr, Is.Not.Empty);
Assert.That(debugInfo.codex.revision, Is.EqualTo(dockerImage.GetExpectedImageRevision()));
}
[Test]
public void OneClientTest()
{
var primary = SetupCodexNode()
.WithLogLevel(CodexLogLevel.Trace)
.WithStorageQuota(2.MB())
.BringOnline();
var testFile = GenerateTestFile(1.MB());
var contentId = primary.UploadFile(testFile);
var downloadedFile = primary.DownloadContent(contentId);
testFile.AssertIsEqual(downloadedFile);
}
[Test, UseLongTimeouts]
public void OneClientLargeFileTest()
{
var primary = SetupCodexNode()
.WithLogLevel(CodexLogLevel.Trace)
.WithStorageQuota(100.GB())
.BringOnline();
var testFile = GenerateTestFile(40.GB());
var contentId = primary.UploadFile(testFile);
var downloadedFile = primary.DownloadContent(contentId);
testFile.AssertIsEqual(downloadedFile);
}
//[Test]
//public void TwoClientTest()
//{
2023-03-19 11:18:56 +01:00
// var primary = SetupCodexNode()
// .WithLogLevel(CodexLogLevel.Trace)
// .WithStorageQuota(1024 * 1024 * 2)
// .BringOnline();
2023-03-19 11:18:56 +01:00
// var secondary = SetupCodexNode()
// .WithLogLevel(CodexLogLevel.Trace)
2023-03-19 11:18:56 +01:00
// .WithBootstrapNode(primary)
// .BringOnline();
// var testFile = GenerateTestFile(1024 * 1024);
2023-03-19 11:18:56 +01:00
// var contentId = primary.UploadFile(testFile);
2023-03-19 11:18:56 +01:00
// var downloadedFile = secondary.DownloadContent(contentId);
// testFile.AssertIsEqual(downloadedFile);
//}
}
}