2023-03-17 10:43:29 +00:00
|
|
|
|
using CodexDistTests.TestCore;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
|
|
namespace CodexDistTests.BasicTests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class DebugEndpointTests : DistTest
|
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetDebugInfo()
|
|
|
|
|
{
|
2023-03-19 09:49:03 +00:00
|
|
|
|
var node = SetupCodexNode().BringOnline();
|
2023-03-17 10:43:29 +00:00
|
|
|
|
|
|
|
|
|
var debugInfo = node.GetDebugInfo();
|
|
|
|
|
|
|
|
|
|
Assert.That(debugInfo.spr, Is.Not.Empty);
|
|
|
|
|
}
|
2023-03-20 08:23:32 +00:00
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void OneClientTest()
|
|
|
|
|
{
|
|
|
|
|
var primary = SetupCodexNode()
|
|
|
|
|
.WithLogLevel(CodexLogLevel.Trace)
|
|
|
|
|
.WithStorageQuota(1024 * 1024 * 2)
|
|
|
|
|
.BringOnline();
|
|
|
|
|
|
|
|
|
|
var testFile = GenerateTestFile(1024 * 1024);
|
|
|
|
|
|
|
|
|
|
var contentId = primary.UploadFile(testFile);
|
|
|
|
|
|
|
|
|
|
var downloadedFile = primary.DownloadContent(contentId);
|
|
|
|
|
|
|
|
|
|
testFile.AssertIsEqual(downloadedFile);
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-19 09:49:03 +00:00
|
|
|
|
//[Test]
|
|
|
|
|
//public void TwoClientTest()
|
|
|
|
|
//{
|
2023-03-19 10:18:56 +00:00
|
|
|
|
// var primary = SetupCodexNode()
|
2023-03-20 08:23:32 +00:00
|
|
|
|
// .WithLogLevel(CodexLogLevel.Trace)
|
|
|
|
|
// .WithStorageQuota(1024 * 1024 * 2)
|
2023-03-19 09:49:03 +00:00
|
|
|
|
// .BringOnline();
|
|
|
|
|
|
2023-03-19 10:18:56 +00:00
|
|
|
|
// var secondary = SetupCodexNode()
|
2023-03-20 08:23:32 +00:00
|
|
|
|
// .WithLogLevel(CodexLogLevel.Trace)
|
2023-03-19 10:18:56 +00:00
|
|
|
|
// .WithBootstrapNode(primary)
|
2023-03-19 09:49:03 +00:00
|
|
|
|
// .BringOnline();
|
|
|
|
|
|
|
|
|
|
// var testFile = GenerateTestFile(1024 * 1024);
|
|
|
|
|
|
2023-03-19 10:18:56 +00:00
|
|
|
|
// var contentId = primary.UploadFile(testFile);
|
2023-03-19 09:49:03 +00:00
|
|
|
|
|
2023-03-19 10:18:56 +00:00
|
|
|
|
// var downloadedFile = secondary.DownloadContent(contentId);
|
2023-03-19 09:49:03 +00:00
|
|
|
|
|
|
|
|
|
// testFile.AssertIsEqual(downloadedFile);
|
|
|
|
|
//}
|
2023-03-17 10:43:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|