2023-09-12 15:43:30 +02:00
|
|
|
|
using CodexPlugin;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using Utils;
|
|
|
|
|
|
2023-10-09 16:59:52 +02:00
|
|
|
|
namespace CodexTests.BasicTests
|
2023-09-12 15:43:30 +02:00
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
2023-12-12 14:18:26 +01:00
|
|
|
|
public class OneClientTests : CodexDistTest
|
2023-09-12 15:43:30 +02:00
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void OneClientTest()
|
|
|
|
|
{
|
2024-05-09 09:32:48 +02:00
|
|
|
|
var primary = StartCodex();
|
2023-09-12 15:43:30 +02:00
|
|
|
|
|
|
|
|
|
PerformOneClientTest(primary);
|
2024-06-06 10:31:31 +02:00
|
|
|
|
|
|
|
|
|
LogNodeStatus(primary);
|
2023-09-12 15:43:30 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void RestartTest()
|
|
|
|
|
{
|
2024-05-09 09:32:48 +02:00
|
|
|
|
var primary = StartCodex();
|
2023-09-12 15:43:30 +02:00
|
|
|
|
|
2024-03-13 10:57:26 +01:00
|
|
|
|
primary.Stop(waitTillStopped: true);
|
2023-09-12 15:43:30 +02:00
|
|
|
|
|
2024-05-09 09:32:48 +02:00
|
|
|
|
primary = StartCodex();
|
2023-09-12 15:43:30 +02:00
|
|
|
|
|
|
|
|
|
PerformOneClientTest(primary);
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-19 11:51:59 +02:00
|
|
|
|
private void PerformOneClientTest(ICodexNode primary)
|
2023-09-12 15:43:30 +02:00
|
|
|
|
{
|
|
|
|
|
var testFile = GenerateTestFile(1.MB());
|
|
|
|
|
|
|
|
|
|
var contentId = primary.UploadFile(testFile);
|
|
|
|
|
|
|
|
|
|
var downloadedFile = primary.DownloadContent(contentId);
|
|
|
|
|
|
|
|
|
|
testFile.AssertIsEqual(downloadedFile);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|