def test_node_sent_upgrade_successful_no_protocol_version(testNodeClass, looper, nodeSet, nodeIds): ''' Test that each node sends NODE_UPGRADE Success event (because it sees SUCCESS in Upgrade log) Upgrade log already created START event (see fixture above emulating real upgrade) ''' check_node_sent_acknowledges_upgrade(looper, nodeSet, nodeIds, allowed_actions=[COMPLETE], ledger_size=len(nodeSet), expected_version=version)
def test_node_sent_upgrade_successful(looper, nodeSet, nodeIds): ''' Test that each node sends NODE_UPGRADE Success event (because it sees SUCCESS in Upgrade log) Upgrade log already created START event (see fixture above emulating real upgrade) ''' check_node_sent_acknowledges_upgrade(looper, nodeSet, nodeIds, allowed_actions=[COMPLETE], ledger_size=len(nodeSet), expected_version=version)
def test_node_sent_upgrade_fail(looper, nodeSet, nodeIds): ''' Test that each node sends NODE_UPGRADE Fail event (because it sees FAIL in Upgrade log) Upgrade log already created START event (see fixture above emulating real upgrade) ''' check_node_sent_acknowledges_upgrade(looper, nodeSet, nodeIds, allowed_actions=[FAIL], ledger_size=len(nodeSet), expected_version=INVALID_VERSION)
def test_node_sent_upgrade_fail(looper, nodeSet, nodeIds): ''' Test that each node sends NODE_UPGRADE Fail event (because it sees FAIL in Upgrade log) Upgrade log already created START event (see fixture above emulating real upgrade) ''' check_node_sent_acknowledges_upgrade(looper, nodeSet, nodeIds, allowed_actions=[FAIL], ledger_size=len(nodeSet), expected_version=INVALID_VERSION)
def test_node_sent_upgrade_in_progress_no_protocol_version(looper, nodeSet, nodeIds, validUpgrade): ''' Test that each node sends NODE_UPGRADE In Progress event (because it sees scheduledUpgrade in the Upgrader) ''' version = validUpgrade['version'] for node, node_id in zip(nodeSet, nodeIds): node.upgrader.scheduledAction = (version, validUpgrade['schedule'][node_id], "upgrade_id") node.notify_upgrade_start() check_node_sent_acknowledges_upgrade(looper, nodeSet, nodeIds, allowed_actions=[IN_PROGRESS], ledger_size=len(nodeSet), expected_version=version)
def test_node_sent_upgrade_in_progress_no_protocol_version( looper, nodeSet, nodeIds, validUpgrade): ''' Test that each node sends NODE_UPGRADE In Progress event (because it sees scheduledUpgrade in the Upgrader) ''' version = validUpgrade['version'] for node, node_id in zip(nodeSet, nodeIds): node.upgrader.scheduledUpgrade = (version, validUpgrade['schedule'][node_id], "upgrade_id") node.notify_upgrade_start() check_node_sent_acknowledges_upgrade(looper, nodeSet, nodeIds, allowed_actions=[IN_PROGRESS], ledger_size=len(nodeSet), expected_version=version)
def test_node_sent_upgrade_in_progress(looper, nodeSet, nodeIds, validUpgrade): ''' Test that each node sends NODE_UPGRADE In Progress event (because it sees scheduledUpgrade in the Upgrader) ''' clear_config_ledger(nodeSet) version = validUpgrade['version'] for node in nodeSet: node_id = node.poolManager.get_nym_by_name(node.name) node.upgrader.scheduledAction = UpgradeLogData( dateutil.parser.parse(validUpgrade['schedule'][node_id]), version, "upgrade_id", validUpgrade['package']) node.notify_upgrade_start() check_node_sent_acknowledges_upgrade(looper, nodeSet, nodeIds, allowed_actions=[IN_PROGRESS], ledger_size=len(nodeSet), expected_version=version)