Adds check for block verification failures
This commit is contained in:
parent
09554da362
commit
8fc8a3f7cf
|
@ -94,6 +94,8 @@ namespace CodexTests.BasicTests
|
|||
|
||||
AssertBalance(contracts, seller, Is.GreaterThan(sellerInitialBalance), "Seller was not paid for storage.");
|
||||
AssertBalance(contracts, buyer, Is.LessThan(buyerInitialBalance), "Buyer was not charged for storage.");
|
||||
|
||||
CheckLogForErrors(seller, buyer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ using Utils;
|
|||
namespace CodexTests.BasicTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class OneClientTests : DistTest
|
||||
public class OneClientTests : CodexDistTest
|
||||
{
|
||||
[Test]
|
||||
public void OneClientTest()
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
using CodexPlugin;
|
||||
using DistTestCore;
|
||||
using NUnit.Framework;
|
||||
using Utils;
|
||||
|
||||
namespace CodexTests.BasicTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class TwoClientTests : DistTest
|
||||
public class TwoClientTests : CodexDistTest
|
||||
{
|
||||
[Test]
|
||||
public void TwoClientTest()
|
||||
|
@ -51,6 +50,7 @@ namespace CodexTests.BasicTests
|
|||
var downloadedFile = secondary.DownloadContent(contentId);
|
||||
|
||||
testFile.AssertIsEqual(downloadedFile);
|
||||
CheckLogForErrors(primary, secondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,6 +85,19 @@ namespace CodexTests
|
|||
AssertHelpers.RetryAssert(constraint, () => contracts.GetTestTokenBalance(codexNode), nameof(AssertBalance) + msg);
|
||||
}
|
||||
|
||||
public void CheckLogForErrors(params ICodexNode[] nodes)
|
||||
{
|
||||
foreach (var node in nodes) CheckLogForErrors(node);
|
||||
}
|
||||
|
||||
public void CheckLogForErrors(ICodexNode node)
|
||||
{
|
||||
var log = Ci.DownloadLog(node);
|
||||
|
||||
log.AssertLogDoesNotContain("Block validation failed");
|
||||
log.AssertLogDoesNotContain("ERR ");
|
||||
}
|
||||
|
||||
protected virtual void OnCodexSetup(ICodexSetup setup)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -9,5 +9,10 @@ namespace DistTestCore
|
|||
{
|
||||
Assert.That(log.DoesLogContain(expectedString), $"Did not find '{expectedString}' in log.");
|
||||
}
|
||||
|
||||
public static void AssertLogDoesNotContain(this IDownloadedLog log, string unexpectedString)
|
||||
{
|
||||
Assert.That(!log.DoesLogContain(unexpectedString), $"Did find '{unexpectedString}' in log.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue