@@ -0,0 +1,2560 @@
+import time%0A%0Aimport pytest%0A%0Afrom plenum.test import waits%0Afrom plenum.test.helper import checkViewNoForNodes, sdk_send_random_and_check, waitForViewChange%0Afrom plenum.test.node_catchup.helper import ensure_all_nodes_have_same_data%0Afrom plenum.test.pool_transactions.helper import disconnect_node_and_ensure_disconnected, %5C%0A    reconnect_node_and_ensure_connected%0Afrom plenum.test.test_node import ensureElectionsDone, getRequiredInstances, checkNodesConnected, TestViewChanger%0Afrom plenum.test.view_change.helper import ensure_view_change, start_stopped_node%0A%0A%0Adef test_vc_finished_when_less_than_quorum_started(%0A        looper, txnPoolNodeSet, sdk_wallet_client, sdk_pool_handle, tconf, tdir, allPluginsPath):%0A%0A    checkViewNoForNodes(txnPoolNodeSet, 0)%0A%0A    alpha, beta, gamma, delta = txnPoolNodeSet%0A%0A    # Delta and Gamma send InstanceChange for all nodes.%0A    for node in %5Bgamma, delta%5D:%0A        node.view_changer.on_master_degradation()%0A%0A    # Restart Alpha, Beta, Gamma%0A    for i, node in enumerate(%5Balpha, beta, gamma%5D):%0A        node = _restart_node(node, looper, txnPoolNodeSet,%0A                                 tconf, tdir, allPluginsPath)%0A        txnPoolNodeSet%5Bi%5D = node%0A    looper.run(checkNodesConnected(txnPoolNodeSet))%0A    alpha, beta, gamma, delta = txnPoolNodeSet%0A%0A    # Send InstanceChange from Beta for all nodes%0A    beta.view_changer.on_master_degradation()%0A%0A    # Ensure that pool is still functional%0A    sdk_send_random_and_check(looper, txnPoolNodeSet,%0A                              sdk_pool_handle, sdk_wallet_client, 1)%0A    ensure_all_nodes_have_same_data(looper, txnPoolNodeSet)%0A%0A    # Delta and Gamma send InstanceChange for all nodes.%0A    for node in %5Bgamma, delta%5D:%0A        node.view_changer.on_master_degradation()%0A%0A    ensureElectionsDone(looper, txnPoolNodeSet)%0A%0A    # Ensure that pool is still functional%0A    sdk_send_random_and_check(looper, txnPoolNodeSet,%0A                              sdk_pool_handle, sdk_wallet_client, 1)%0A    ensure_all_nodes_have_same_data(looper, txnPoolNodeSet)%0A%0A%0Adef _restart_node(node, looper, txnPoolNodeSet,%0A                  tconf, tdir, allPluginsPath):%0A    disconnect_node_and_ensure_disconnected(looper,%0A                                            txnPoolNodeSet,%0A                                            node.name,%0A                                            stopNode=True)%0A    looper.removeProdable(node)%0A%0A    new_node = start_stopped_node(node, looper,%0A                              tconf, tdir, allPluginsPath)%0A    new_node.view_changer = TestViewChanger(new_node)%0A    return new_node%0A

add test_vc_finished_when_less_than_quorum_started.py