def check_large_list(set_name, key, values): """ Ensures that the given key has bins "bin-0" ... "bin-<n>" with the n given large list values. """ bin_names = [u"bin-" + str(index) for index in xrange(len(values))] lib.validate_ldt_record(set_name, key, bin_names, values)
def check_ldt_bins_unique(): """ Verifies LDT restore with --unique. """ lib.validate_ldt_record(lib.SET, "key-1", [u"bin-1", u"bin-2"], [ [u"value-1b1"], [u"value-2b1"]]) lib.validate_ldt_record(lib.SET, "key-2", [u"bin-1", u"bin-2"], [ [u"value-1b1"], [u"value-2b1"]])
def check_ldt_bins_replace_no_gen(): """ Verifies LDT restore with --replace and --no-generation. """ lib.validate_ldt_record(lib.SET, "key-1", [u"bin-1"], [ [u"value-1a1", u"value-1a2", u"value-1a3"]]) lib.validate_ldt_record(lib.SET, "key-2", [u"bin-1"], [ [u"value-1a1", u"value-1a2"]])
def check_ldt_bins_no_gen_keep_ldt(): """ Verifies LDT restore with --no-generation and --keep-ldt. """ lib.validate_ldt_record(lib.SET, "key-1", [u"bin-1", u"bin-2"], [ [u"value-1a1", u"value-1a2", u"value-1a3", u"value-1b1"], [u"value-2b1"]]) lib.validate_ldt_record(lib.SET, "key-2", [u"bin-1", u"bin-2"], [ [u"value-1a1", u"value-1a2", u"value-1b1"], [u"value-2b1"]])
def check_ldt_bins_no_policy(): """ Verifies LDT restore without any policy options. """ lib.validate_ldt_record(lib.SET, "key-1", [u"bin-1", u"bin-2"], [ [u"value-1a1", u"value-1a2", u"value-1a3"], [u"value-2b1"]]) lib.validate_ldt_record(lib.SET, "key-2", [u"bin-1", u"bin-2"], [ [u"value-1b1"], [u"value-2b1"]])