Run test against increasing file sizes

This commit is contained in:
benbierens 2023-08-08 10:45:16 +02:00
parent 598dc766fa
commit eaf5db5e91
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
2 changed files with 15 additions and 1 deletions

View File

@ -38,6 +38,11 @@ namespace DistTestCore
{
private const long Kilo = 1024;
public static ByteSize Bytes(this long i)
{
return new ByteSize(i);
}
public static ByteSize KB(this long i)
{
return new ByteSize(i * Kilo);
@ -58,6 +63,11 @@ namespace DistTestCore
return (i * Kilo).GB();
}
public static ByteSize Bytes(this int i)
{
return new ByteSize(i);
}
public static ByteSize KB(this int i)
{
return Convert.ToInt64(i).KB();

View File

@ -61,17 +61,21 @@ namespace Tests.BasicTests
}
}
private ByteSize fileSize = 10.MB();
private void PerformTest(IOnlineCodexNode primary, IOnlineCodexNode secondary)
{
ScopedTestFiles(() =>
{
var testFile = GenerateTestFile(1000.MB());
var testFile = GenerateTestFile(fileSize);
var contentId = primary.UploadFile(testFile);
var downloadedFile = secondary.DownloadContent(contentId);
testFile.AssertIsEqual(downloadedFile);
fileSize = (fileSize.SizeInBytes * 2).Bytes();
});
}
}