def test_upgrade_does_not_get_into_loop_if_reinstall(
        looper,
        tconf,
        nodeSet,
        validUpgrade,
        trustee,
        trusteeWallet,
        monkeypatch):
    new_version = bumpedVersion()
    upgr1 = deepcopy(validUpgrade)
    upgr1[VERSION] = new_version
    upgr1[REINSTALL] = True

    # An upgrade scheduled, it should pass
    ensureUpgradeSent(looper, trustee, trusteeWallet, upgr1)
    looper.run(
        eventually(
            checkUpgradeScheduled,
            nodeSet,
            upgr1[VERSION],
            retryWait=1,
            timeout=waits.expectedUpgradeScheduled()))

    # here we make nodes think they have upgraded successfully
    monkeypatch.setattr(sovrin_node.__metadata__, '__version__', new_version)
    check_no_loop(nodeSet, UpgradeLog.UPGRADE_SUCCEEDED)
Ejemplo n.º 2
0
def test_upgrade_does_not_get_into_loop_if_failed(looper, tconf, nodeSet,
                                                  validUpgrade, trustee,
                                                  trusteeWallet, monkeypatch):
    new_version = bumpedVersion()
    upgr1 = deepcopy(validUpgrade)
    upgr1[VERSION] = new_version

    # An upgrade scheduled, it should pass
    ensureUpgradeSent(looper, trustee, trusteeWallet, upgr1)
    looper.run(
        eventually(
            checkUpgradeScheduled,
            nodeSet,
            upgr1[VERSION],
            retryWait=1,
            timeout=waits.expectedUpgradeScheduled()))

    # we have not patched sovrin_node version so nodes think the upgrade had
    # failed
    check_no_loop(nodeSet, UpgradeLog.UPGRADE_FAILED)