if not cluster.spreadFundsAndValidate(10): errorExit("Failed to spread and validate funds.") Print("Wait on cluster sync.") if not cluster.waitOnClusterSync(): errorExit("Cluster sync wait failed.") Print ("Relaunch dead cluster nodes instances.") if cluster.relaunchEosInstances() is False: errorExit("Failed to relaunch Eos instances") Print("nodeos instances relaunched.") Print ("Resyncing cluster nodes.") if not cluster.waitOnClusterSync(): errorExit("Cluster never synchronized") Print ("Cluster synched") Print("Spread funds and validate") if not cluster.spreadFundsAndValidate(10): errorExit("Failed to spread and validate funds.") Print("Wait on cluster sync.") if not cluster.waitOnClusterSync(): errorExit("Cluster sync wait failed.") testSuccessful=True finally: TestHelper.shutdown(cluster, walletMgr, testSuccessful, killEosInstances, killEosInstances, keepLogs, killAll, dumpErrorDetails) exit(0)
errorExit("Cluster in bad state, received None node") Print("Kill cluster nodes.") cluster.killall(allInstances=killAll) Print("Restart nodeos repeatedly to ensure dirty database flag sticks.") timeout=3 for i in range(1,4): Print("Attempt %d." % (i)) ret = runNodeosAndGetOutput(timeout) assert(ret) assert(isinstance(ret, tuple)) assert(ret[0]) assert(ret[1]) assert(isinstance(ret[1], dict)) # pylint: disable=unsubscriptable-object stderr= ret[1]["stderr"] retCode=ret[1]["returncode"] assert retCode == 2, "actual return code: %s" % str(retCode) assert("database dirty flag set" in stderr) if debug: Print("Setting test result to success.") testSuccessful=True finally: if debug: Print("Cleanup in finally block.") TestHelper.shutdown(cluster, None, testSuccessful, killEosInstances, False, keepLogs, killAll, dumpErrorDetails) if debug: Print("Exiting test, exit value 0.") exit(0)
assert (ret) assert (isinstance(ret, tuple)) if not ret[0]: errorExit( "Failed to startup nodmtp successfully on try number %d" % (i)) assert (ret[1]) assert (isinstance(ret[1], dict)) # pylint: disable=unsubscriptable-object stderr = ret[1]["stderr"] retCode = ret[1]["returncode"] expectedRetCode = 2 if retCode != expectedRetCode: errorExit( "Expected return code to be %d, but instead received %d." % (expectedRetCode, retCode)) db_dirty_msg = "database dirty flag set" if db_dirty_msg not in stderr: errorExit( "stderr should have contained \"%s\" but it did not. stderr=\n%s" % (db_dirty_msg, stderr)) if debug: Print("Setting test result to success.") testSuccessful = True finally: if debug: Print("Cleanup in finally block.") TestHelper.shutdown(cluster, None, testSuccessful, killmtpInstances, False, keepLogs, killAll, dumpErrorDetails) if debug: Print("Exiting test, exit value 0.") exit(0)
Print("Analyzing the producers from the saved LIB to the current highest head and verify they match now") analyzeBPs(blockProducers0, blockProducers1, expectDivergence=False) resolvedKillBlockProducer=None for prod in blockProducers0: if prod["blockNum"]==killBlockNum: resolvedKillBlockProducer = prod["prod"] if resolvedKillBlockProducer is None: Utils.errorExit("Did not find find block %s (the original divergent block) in blockProducers0, test setup is wrong. blockProducers0: %s" % (killBlockNum, ", ".join(blockProducers))) Print("Fork resolved and determined producer %s for block %s" % (resolvedKillBlockProducer, killBlockNum)) blockProducers0=[] blockProducers1=[] testSuccessful=True finally: TestHelper.shutdown(cluster, walletMgr, testSuccessful=testSuccessful, killEosInstances=killEosInstances, killWallet=killWallet, keepLogs=keepLogs, cleanRun=killAll, dumpErrorDetails=dumpErrorDetails) if not testSuccessful: Print(Utils.FileDivider) Print("Compare Blocklog") cluster.compareBlockLogs() Print(Utils.FileDivider) Print("Print Blocklog") cluster.printBlockLog() Print(Utils.FileDivider) exit(0)
cluster.enumivoAccount, cluster.defproduceraAccount, cluster.defproducerbAccount ]) if wallet is None: errorExit("Failed to create wallet %s" % (walletName)) Print("Populate wallet with %d accounts." % (accountsCount)) if not cluster.populateWallet(accountsCount, wallet): errorExit("Wallet initialization failed.") defproduceraAccount = cluster.defproduceraAccount defproducerbAccount = cluster.defproducerbAccount enumivoAccount = cluster.enumivoAccount Print("Create accounts.") if not cluster.createAccounts(enumivoAccount): errorExit("Accounts creation failed.") Print("Spread funds and validate") if not cluster.spreadFundsAndValidate(10): errorExit("Failed to spread and validate funds.") print("Funds spread validated") testSuccessful = True finally: TestHelper.shutdown(cluster, walletMgr, testSuccessful, killEnuInstances, killWallet, False, killAll, dumpErrorDetails) exit(0)