Ejemplo n.º 1
0
def test_recovered_keys(session, recovery):
    """Testing that after recovery operation keys, which had to be recovered,
    are recovered and have correct data."""
    for key in recovery["keys"]["recovered"]:
        for group in session.groups:
            result = session.read_data_from_groups(key, [group]).get()[0]
            assert_that(key, equal_to(get_sha1(result.data)),
                        "The recovered data mismatch by sha1 hash")
Ejemplo n.º 2
0
def test_consistent_keys(session, recovery):
    """Testing that after recovery operation keys, which were availabe in all groups,
    are still available in all groups and have correct data."""
    for key in recovery["keys"]["consistent"]:
        for group in session.groups:
            result = session.read_data_from_groups(key, [group]).get()[0]
            assert_that(key, equal_to(get_sha1(result.data)),
                        "After recovering the data mismatch by sha1 hash")
Ejemplo n.º 3
0
def test_inconsistent_keys(session, recovery, dropped_groups):
    """Testing that after recovery operation keys, which were available in some specific groups,
    are still available in these groups and have correct data."""
    available_groups = [group for group in session.groups
                        if group not in dropped_groups]
    for key in recovery["keys"]["inconsistent"]:
        for group in available_groups:
            result = session.read_data_from_groups(key, [group]).get()[0]
            assert_that(key, equal_to(get_sha1(result.data)),
                        "After recovering the data mismatch by sha1 hash")
Ejemplo n.º 4
0
 def __init__(self, data):
     self.expected_sha1 = get_sha1(data)
Ejemplo n.º 5
0
 def describe_mismatch(self, item, mismatch_description):
     mismatch_description.append_text(get_sha1(str(item)))
Ejemplo n.º 6
0
 def _matches(self, item):
     result_sha1 = get_sha1(str(item))
     return result_sha1 == self.expected_sha1