Exemplo n.º 1
0
def test_blob_value():
    """
	Test BLOB values.
	"""
    lib.backup_and_restore(
        lambda context: put_values(lib.SET, "key", BLOB_VALUES), None,
        lambda context: check_values(lib.SET, "key", BLOB_VALUES))
Exemplo n.º 2
0
def test_string_value():
    """
	Test string values.
	"""
    lib.backup_and_restore(
        lambda context: put_values(lib.SET, "key", STRING_VALUES), None,
        lambda context: check_values(lib.SET, "key", STRING_VALUES))
def test_bin_name():
    """
	Test bin names.
	"""
    lib.backup_and_restore(
        lambda context: put_bins(lib.SET, "key", BIN_NAMES, u"foobar"), None,
        lambda context: check_bins(lib.SET, "key", BIN_NAMES, u"foobar"))
Exemplo n.º 4
0
def test_string_key_stored():
    """
	Test string keys, store the user key.
	"""
    lib.backup_and_restore(
        lambda context: put_keys(lib.SET, STRING_KEYS, u"foobar", True), None,
        lambda context: check_keys(lib.SET, STRING_KEYS, u"foobar", True))
Exemplo n.º 5
0
def test_blob_key_stored():
    """
	Test BLOB keys, store the user key.
	"""
    lib.backup_and_restore(
        lambda context: put_keys(lib.SET, BLOB_KEYS, u"foobar", True), None,
        lambda context: check_keys(lib.SET, BLOB_KEYS, u"foobar", True))
Exemplo n.º 6
0
def test_geo_index():
    """
	Tests geo indexes across all set names, index names, and index paths.
	"""
    lib.backup_and_restore(
        lambda context: create_indexes(lib.create_geo_index), None,
        lambda context: check_indexes(lib.check_geo_index, (0.0, 0.0)))
Exemplo n.º 7
0
def test_integer_key_stored():
    """
	Test integer keys, store the user key.
	"""
    lib.backup_and_restore(
        lambda context: put_keys(lib.SET, INTEGER_KEYS, u"foobar", True), None,
        lambda context: check_keys(lib.SET, INTEGER_KEYS, u"foobar", True))
Exemplo n.º 8
0
def test_set_name():
    """
	Test set names.
	"""
    lib.backup_and_restore(
        lambda context: put_sets(SET_NAMES, "key", u"value", u"value"), None,
        lambda context: check_sets(SET_NAMES, "key", u"value", u"value"))
Exemplo n.º 9
0
def test_integer_value():
    """
	Test integer values.
	"""
    lib.backup_and_restore(
        lambda context: put_values(lib.SET, "key", INTEGER_VALUES), None,
        lambda context: check_values(lib.SET, "key", INTEGER_VALUES))
Exemplo n.º 10
0
def test_no_policy():
    """
	Tests restore without any policy options.
	"""
    lib.backup_and_restore(lambda context: fill_bins(),
                           lambda context: prepare_bins(),
                           lambda context: check_bins_no_policy(), None, None)
Exemplo n.º 11
0
def test_string_index():
    """
	Tests string indexes across all set names, index names, and index paths.
	"""
    lib.backup_and_restore(
        lambda context: create_indexes(lib.create_string_index), None,
        lambda context: check_indexes(lib.check_simple_index, u"foobar"))
Exemplo n.º 12
0
def test_geo_value():
    """
	Test geo values.
	"""
    lib.backup_and_restore(
        lambda context: put_values(lib.SET, "key", GEO_VALUES), None,
        lambda context: check_values(lib.SET, "key", GEO_VALUES))
Exemplo n.º 13
0
def test_double_value():
    """
	Test double values.
	"""
    lib.backup_and_restore(
        lambda context: put_values(lib.SET, "key", DOUBLE_VALUES), None,
        lambda context: check_values(lib.SET, "key", DOUBLE_VALUES))
Exemplo n.º 14
0
def test_integer_index():
    """
	Tests integer indexes across all set names, index names, and index paths.
	"""
    lib.backup_and_restore(
        lambda context: create_indexes(lib.create_integer_index), None,
        lambda context: check_indexes(lib.check_simple_index, 12345))
Exemplo n.º 15
0
def test_no_gen():
    """
	Tests restore with --no-generation.
	"""
    lib.backup_and_restore(lambda context: fill_bins(),
                           lambda context: prepare_bins(),
                           lambda context: check_bins_no_gen(), None,
                           ["--no-generation"])
Exemplo n.º 16
0
def test_unique():
    """
	Tests restore with --unique.
	"""
    lib.backup_and_restore(lambda context: fill_bins(),
                           lambda context: prepare_bins(),
                           lambda context: check_bins_unique(), None,
                           ["--unique"])
Exemplo n.º 17
0
def test_list_value():
    """
	Test list values. As they are BLOBs, we don't need that much variation
	here.
	"""
    lib.backup_and_restore(
        lambda context: put_values(lib.SET, "key", LIST_VALUES), None,
        lambda context: check_values(lib.SET, "key", LIST_VALUES))
Exemplo n.º 18
0
def test_blob_key_stored_compact():
    """
	Test BLOB keys, store the user key, pass --compact to backup.
	"""
    lib.backup_and_restore(
        lambda context: put_keys(lib.SET, BLOB_KEYS, u"foobar", True), None,
        lambda context: check_keys(lib.SET, BLOB_KEYS, u"foobar", True),
        ["--compact"])
Exemplo n.º 19
0
def test_blob_value_compact():
    """
	Test BLOB values, pass --compact to backup.
	"""
    lib.backup_and_restore(
        lambda context: put_values(lib.SET, "key", BLOB_VALUES), None,
        lambda context: check_values(lib.SET, "key", BLOB_VALUES),
        ["--compact"])
Exemplo n.º 20
0
def test_geo_index():
	"""
	Tests geo indexes across all set names, index names, and index paths.
	"""
	lib.backup_and_restore(
		lambda context: create_indexes(lib.create_geo_index),
		None,
		lambda context: check_indexes(lib.check_geo_index, (0.0, 0.0))
	)
Exemplo n.º 21
0
def test_no_ttl():
	"""
	Test without a TTL.
	"""
	lib.backup_and_restore(
		lambda context: put_ttl(0, None),
		None,
		lambda context: check_ttl(0, None)
	)
Exemplo n.º 22
0
def test_string_index():
	"""
	Tests string indexes across all set names, index names, and index paths.
	"""
	lib.backup_and_restore(
		lambda context: create_indexes(lib.create_string_index),
		None,
		lambda context: check_indexes(lib.check_simple_index, u"foobar")
	)
Exemplo n.º 23
0
def test_udf_file():
	"""
	Test UDF files.
	"""
	lib.backup_and_restore(
		lambda context: put_udf_files(context, COMMENTS),
		None,
		check_udf_files
	)
Exemplo n.º 24
0
def test_integer_index():
	"""
	Tests integer indexes across all set names, index names, and index paths.
	"""
	lib.backup_and_restore(
		lambda context: create_indexes(lib.create_integer_index),
		None,
		lambda context: check_indexes(lib.check_simple_index, 12345)
	)
Exemplo n.º 25
0
def test_ttl():
	"""
	Test TTL without a delay.
	"""
	lib.backup_and_restore(
		lambda context: put_ttl(1, 100),
		None,
		lambda context: check_ttl(1, (90, 100))
	)
Exemplo n.º 26
0
def test_bin_name():
	"""
	Test bin names.
	"""
	lib.backup_and_restore(
		lambda context: put_bins(lib.SET, "key", BIN_NAMES, u"foobar"),
		None,
		lambda context: check_bins(lib.SET, "key", BIN_NAMES, u"foobar")
	)
Exemplo n.º 27
0
def test_integer_key_stored():
	"""
	Test integer keys, store the user key.
	"""
	lib.backup_and_restore(
		lambda context: put_keys(lib.SET, INTEGER_KEYS, u"foobar", True),
		None,
		lambda context: check_keys(lib.SET, INTEGER_KEYS, u"foobar", True)
	)
Exemplo n.º 28
0
def test_string_key_stored():
	"""
	Test string keys, store the user key.
	"""
	lib.backup_and_restore(
		lambda context: put_keys(lib.SET, STRING_KEYS, u"foobar", True),
		None,
		lambda context: check_keys(lib.SET, STRING_KEYS, u"foobar", True)
	)
Exemplo n.º 29
0
def test_set_name():
	"""
	Test set names.
	"""
	lib.backup_and_restore(
		lambda context: put_sets(SET_NAMES, "key", u"value", u"value"),
		None,
		lambda context: check_sets(SET_NAMES, "key", u"value", u"value")
	)
Exemplo n.º 30
0
def test_blob_key_stored():
	"""
	Test BLOB keys, store the user key.
	"""
	lib.backup_and_restore(
		lambda context: put_keys(lib.SET, BLOB_KEYS, u"foobar", True),
		None,
		lambda context: check_keys(lib.SET, BLOB_KEYS, u"foobar", True)
	)
Exemplo n.º 31
0
def test_string_value():
	"""
	Test string values.
	"""
	lib.backup_and_restore(
		lambda context: put_values(lib.SET, "key", STRING_VALUES),
		None,
		lambda context: check_values(lib.SET, "key", STRING_VALUES)
	)
Exemplo n.º 32
0
def test_double_value():
	"""
	Test double values.
	"""
	lib.backup_and_restore(
		lambda context: put_values(lib.SET, "key", DOUBLE_VALUES),
		None,
		lambda context: check_values(lib.SET, "key", DOUBLE_VALUES)
	)
Exemplo n.º 33
0
def test_geo_value():
	"""
	Test geo values.
	"""
	lib.backup_and_restore(
		lambda context: put_values(lib.SET, "key", GEO_VALUES),
		None,
		lambda context: check_values(lib.SET, "key", GEO_VALUES)
	)
Exemplo n.º 34
0
def test_integer_value():
	"""
	Test integer values.
	"""
	lib.backup_and_restore(
		lambda context: put_values(lib.SET, "key", INTEGER_VALUES),
		None,
		lambda context: check_values(lib.SET, "key", INTEGER_VALUES)
	)
Exemplo n.º 35
0
def test_blob_value():
	"""
	Test BLOB values.
	"""
	lib.backup_and_restore(
		lambda context: put_values(lib.SET, "key", BLOB_VALUES),
		None,
		lambda context: check_values(lib.SET, "key", BLOB_VALUES)
	)
Exemplo n.º 36
0
def test_blob_key_stored_compact():
	"""
	Test BLOB keys, store the user key, pass --compact to backup.
	"""
	lib.backup_and_restore(
		lambda context: put_keys(lib.SET, BLOB_KEYS, u"foobar", True),
		None,
		lambda context: check_keys(lib.SET, BLOB_KEYS, u"foobar", True),
		["--compact"]
	)
Exemplo n.º 37
0
def test_ttl_delay_10():
	"""
	Test TTL with a 10 second delay.
	"""
	lib.backup_and_restore(
		lambda context: put_ttl(2, 100),
		None,
		lambda context: check_ttl(2, (80, 90)),
		restore_delay=10
	)
Exemplo n.º 38
0
def test_list_value():
	"""
	Test list values. As they are BLOBs, we don't need that much variation
	here.
	"""
	lib.backup_and_restore(
		lambda context: put_values(lib.SET, "key", LIST_VALUES),
		None,
		lambda context: check_values(lib.SET, "key", LIST_VALUES)
	)
Exemplo n.º 39
0
def test_blob_value_compact():
	"""
	Test BLOB values, pass --compact to backup.
	"""
	lib.backup_and_restore(
		lambda context: put_values(lib.SET, "key", BLOB_VALUES),
		None,
		lambda context: check_values(lib.SET, "key", BLOB_VALUES),
		["--compact"]
	)
Exemplo n.º 40
0
def test_ldt_replace_no_gen():
	"""
	Tests LDT restore with --replace and --no-generation.
	"""
	lib.backup_and_restore(
		lambda context: fill_ldt_bins(),
		lambda context: prepare_ldt_bins(),
		lambda context: check_ldt_bins_replace_no_gen(),
		None,
		["--replace", "--no-generation"]
	)
Exemplo n.º 41
0
def test_no_policy():
	"""
	Tests restore without any policy options.
	"""
	lib.backup_and_restore(
		lambda context: fill_bins(),
		lambda context: prepare_bins(),
		lambda context: check_bins_no_policy(),
		None,
		None
	)
Exemplo n.º 42
0
def test_restore_bin_list():
	"""
	Tests the --bin-list restore option.
	"""
	lib.backup_and_restore(
		put_data,
		None,
		lambda context: check_data(context, True, True, True, False, True, True, True),
		None,
		["--bin-list", BIN_NAME_1]
	)
Exemplo n.º 43
0
def test_ldt_no_gen_keep_ldt():
	"""
	Tests LDT restore with --no-generation and --keep-ldt.
	"""
	lib.backup_and_restore(
		lambda context: fill_ldt_bins(),
		lambda context: prepare_ldt_bins(),
		lambda context: check_ldt_bins_no_gen_keep_ldt(),
		None,
		["--no-generation", "--keep-ldt"]
	)
Exemplo n.º 44
0
def test_restore_no_udfs():
	"""
	Tests the --no-udfs restore option.
	"""
	lib.backup_and_restore(
		put_data,
		None,
		lambda context: check_data(context, True, True, True, True, True, True, False),
		None,
		["--no-udfs"]
	)
Exemplo n.º 45
0
def test_backup_set():
	"""
	Tests the --set backup option.
	"""
	lib.backup_and_restore(
		put_data,
		None,
		lambda context: check_data(context, True, False, True, True, True, False, True),
		["--set", SET_NAME_1],
		None
	)
Exemplo n.º 46
0
def test_ttl_expired():
	"""
	Make sure that expired records are not restored. Works, because we prevent
	asd from expiring records (low-water-pct set to 10).
	"""
	lib.backup_and_restore(
		lambda context: put_ttl(3, 5),
		None,
		lambda context: check_expired(3),
		restore_delay=10
	)
Exemplo n.º 47
0
def test_backup_no_indexes():
	"""
	Tests the --no-indexes backup option.
	"""
	lib.backup_and_restore(
		put_data,
		None,
		lambda context: check_data(context, True, True, True, True, False, False, True),
		["--no-indexes"],
		None
	)
Exemplo n.º 48
0
def test_no_gen():
	"""
	Tests restore with --no-generation.
	"""
	lib.backup_and_restore(
		lambda context: fill_bins(),
		lambda context: prepare_bins(),
		lambda context: check_bins_no_gen(),
		None,
		["--no-generation"]
	)
Exemplo n.º 49
0
def test_no_filter():
	"""
	Tests backup and restore without any filters.
	"""
	lib.backup_and_restore(
		put_data,
		None,
		lambda context: check_data(context, True, True, True, True, True, True, True),
		None,
		None
	)
Exemplo n.º 50
0
def test_replace():
	"""
	Tests restore with --replace.
	"""
	lib.backup_and_restore(
		lambda context: fill_bins(),
		lambda context: prepare_bins(),
		lambda context: check_bins_replace(),
		None,
		["--replace"]
	)