helper Package

helper Package

bucket_helper Module

class cbtestlib.membase.helper.bucket_helper.BucketOperationHelper
static base_bucket_ratio(servers)
static chunks(l, n)
static create_bucket(serverInfo, name='default', replica=1, port=11210, test_case=None, bucket_ram=-1, password=None)
static create_default_buckets(servers, number_of_replicas=1, assert_on_test=None)
static create_multiple_buckets(server, replica, bucket_ram_ratio=0.66666666666666663, howmany=3, sasl=True, saslPassword='password')
static delete_all_buckets_or_assert(servers, test_case)
static delete_bucket_or_assert(serverInfo, bucket='default', test_case=None)
static keys_dont_exist(server, keys, bucket)
static keys_exist_or_assert(keys, server, bucket_name, test, queue=None)
static keys_exist_or_assert_in_parallel(keys, server, bucket_name, test, concurrency=2)
static load_some_data(serverInfo, fill_ram_percentage=10.0, bucket_name='default')
static verify_data(server, keys, value_equal_to_key, verify_flags, test, debug=False, bucket='default')
static wait_for_bucket_creation(bucket, rest, timeout_in_seconds=120)
static wait_for_bucket_deletion(bucket, rest, timeout_in_seconds=120)
static wait_for_memcached(node, bucket, timeout_in_seconds=300, log='')
static wait_for_vbuckets_ready_state(node, bucket, timeout_in_seconds=300, log_msg='')

checkpoints Module

class cbtestlib.membase.helper.checkpoints.CheckpointStatParser

Bases: object

merge_results(total_results, per_node_result)
parse_one_bucket()
parse_output(output, node)
class cbtestlib.membase.helper.checkpoints.GetCheckpointsHelper

Bases: object

get_checkpoints_from_cluster(master, bucket)
get_checkpoints_node(node, bucket)
monitor_checkpoints(master, bucket, state, interval, max_allowed, command_queue)

cluster_helper Module

class cbtestlib.membase.helper.cluster_helper.ClusterOperationHelper

Bases: object

static add_all_nodes_or_assert(master, all_servers, rest_settings, test_case)
static add_and_rebalance(servers, wait_for_rebalance=True)
static begin_rebalance_in(master, servers, timeout=5)
static begin_rebalance_out(master, servers, timeout=5)
static change_erlang_async(servers, original, modified)
static cleanup_cluster(servers, wait_for_rebalance=True)
static end_rebalance(master)
static find_orchestrator(master)
static flush_os_caches(servers)
static flushctl_set(master, key, val, bucket='default')
static flushctl_set_per_node(server, key, val, bucket='default')
static flushctl_start(servers, username=None, password=None)
static flushctl_stop(servers, username=None, password=None)
static get_mb_stats(servers, key)
static percentile(samples, percentile)
static persistence_verification(servers, bucket, timeout_in_seconds=1260)
static persistence_verification_per_node(rest, bucket, queue=None, timeout=1260)
static remove_and_rebalance(servers, wait_for_rebalance=True)
static set_expiry_pager_sleep_time(master, bucket, value=30)
static set_vbuckets(master, vbuckets)
static start_cluster(servers)
static stop_cluster(servers)
static verify_persistence(servers, test, keys_count=400000, timeout_in_seconds=300)
static wait_for_completion(rest, task_type='indexer')

Wait for ns_server task (defined by task_type argument) to finish.

Known tasks: – indexer – view_compaction

static wait_for_ns_servers_or_assert(servers, testcase)

failover_helper Module

class cbtestlib.membase.helper.failover_helper.FailoverHelper(servers, test)

Bases: object

failover(howmany)
undo_failover(failover_nodes)

rebalance_helper Module

class cbtestlib.membase.helper.rebalance_helper.RebalanceHelper
static begin_rebalance_in(master, servers, timeout=5)
static begin_rebalance_out(master, servers, timeout=5)
static end_rebalance(master)
static getOtpNodeIds(master)
static get_vBuckets_info(master)

return state and count items for all vbuckets for each node format: dict: {u‘1node_ip1’: {‘vb_79’: [‘replica’, ‘0’], ‘vb_78’: [‘active’, ‘0’]..}, u‘1node_ip1’:....}

static log_interesting_taps(node, tap_stats, logger)
static pick_node(master)
static pick_nodes(master, howmany=1)
static print_taps_from_all_nodes(rest, bucket='default')
static rebalance_in(servers, how_many, do_shuffle=True, monitor=True, do_check=True)
static verify_items_count(master, bucket, num_attempt=3, timeout=2)
static verify_maps(vbucket_map_before, vbucket_map_after)
static verify_vBuckets_info(master, bucket='default')

verify vBuckets’ state and items count(for active/replica) in them related to vBucketMap for all nodes in cluster

static wait_for_mc_stats(master, bucket, stat_key, stat_value, timeout_in_seconds=120, verbose=True)
static wait_for_mc_stats_all_nodes(master, bucket, stat_key, stat_value, timeout_in_seconds=120, verbose=True)
static wait_for_mc_stats_no_timeout(master, bucket, stat_key, stat_value, timeout_in_seconds=-1, verbose=True)
static wait_for_persistence(master, bucket, timeout=120)
static wait_for_stats(master, bucket, stat_key, stat_value, timeout_in_seconds=120, verbose=True)
static wait_for_stats_int_value(master, bucket, stat_key, stat_value, option='==', timeout_in_seconds=120, verbose=True)
static wait_for_stats_no_timeout(master, bucket, stat_key, stat_value, timeout_in_seconds=-1, verbose=True)
static wait_for_stats_on_all(master, bucket, stat_key, stat_value, timeout_in_seconds=120, fn=None)
static wait_till_total_numbers_match(master, bucket, timeout_in_seconds=120)

spatial_helper Module

class cbtestlib.membase.helper.spatial_helper.SpatialHelper(testcase, bucket)
cleanup_cluster()
compact(spatial, block=True, timeout=60)
create_index_fun(name, prefix='', fun=None)
delete_docs(num_of_docs, prefix)
get_keys(results)
get_results(spatial, limit=None, extra_params={}, num_expected=None)
info(spatial)
insert_docs(num_of_docs, prefix, extra_values={}, wait_for_persistence=True, return_docs=False)
query_index_for_verification(design_name, inserted, full_docs=False, wait_for_persistence=True)
setup_cluster(do_rebalance=True)
verify_result(inserted, result)
wait_for_persistence(timeout=120)