def check_data(context, set_1, set_2, bin_1, bin_2, index_1, index_2, udf_file):
	"""
	Verifies that the test data was filtered according to the backup
	and restore options.
	"""
	records = []
	records += check_set(set_1, SET_NAME_1)
	records += check_set(set_2, SET_NAME_2)

	for record in records:
		check_bin(bin_1, record[2], BIN_NAME_1)
		check_bin(bin_2, record[2], BIN_NAME_2)

	check_index(index_1, SET_NAME_1, BIN_NAME_1)
	check_index(index_2, SET_NAME_2, BIN_NAME_2)

	try:
		lib.get_udf_file(context["udf_file"])
		found = True
	except Exception:
		found = False

	if udf_file:
		assert found, "Missing UDF file " + context["udf_file"]
	else:
		assert not found, "Unexpected UDF file " + context["udf_file"]
Пример #2
0
def check_udf_files(context):
	"""
	Retrieves and verifies the UDF files referred to by the context.
	"""
	for path in context:
		content = lib.get_udf_file(path)
		assert lib.eq(content, context[path]), "UDF file %s has invalid content" % path
Пример #3
0
def check_udf_files(context):
    """
	Retrieves and verifies the UDF files referred to by the context.
	"""
    for path in context:
        content = lib.get_udf_file(path)
        assert lib.eq(content,
                      context[path]), "UDF file %s has invalid content" % path