def test_fail_unsuccessful_nodes(self): dgm = DeploymentGroupManager(yaml.safe_load(GROUPS_YAML), node_lookup) group = dgm._all_groups.get('control-nodes') dgm.fail_unsuccessful_nodes(group, []) assert not dgm.evaluate_group_succ_criteria('control-nodes', Stage.DEPLOYED) assert group.stage == Stage.FAILED
def test_evaluate_group_succ_criteria(self): dgm = DeploymentGroupManager(yaml.safe_load(GROUPS_YAML), node_lookup) group = dgm._all_groups.get('control-nodes') nodes = ["node{}".format(i) for i in range(1, 12)] for node in nodes: dgm.mark_node_prepared(node) dgm.fail_unsuccessful_nodes(group, nodes) assert dgm.evaluate_group_succ_criteria('control-nodes', Stage.PREPARED) assert group.stage == Stage.PREPARED for node in nodes: dgm.mark_node_deployed(node) assert dgm.evaluate_group_succ_criteria('control-nodes', Stage.DEPLOYED) assert group.stage == Stage.DEPLOYED
def test_process_deployment_groups(self): """Test the core processing loop of the drydock_nodes module""" dgm = DeploymentGroupManager(yaml.safe_load(tdgm.GROUPS_YAML), node_lookup) _process_deployment_groups( dgm, _gen_pe_func('all-success', stand_alone=True), _gen_pe_func('all-success', stand_alone=True)) assert not dgm.critical_groups_failed() for group in dgm.group_list(): assert dgm.evaluate_group_succ_criteria(group.name, Stage.DEPLOYED)