def test_bar_namespace(self): """ Asserts namespace config output with heading, header & parameters. TODO: test for values as well """ if not TestShowConfig.is_bar_present: return exp_heading = "~~bar Namespace Configuration" exp_header = "NODE" exp_params_bar = [ 'allow-nonxdr-writes', 'allow-xdr-writes', 'conflict-resolution-policy', 'default-ttl', 'disallow-null-setname', 'enable-xdr', 'evict-tenths-pct', 'high-water-disk-pct', 'high-water-memory-pct', ('ldt-enabled', None), ('ldt-page-size', None), 'memory-size', 'ns-forward-xdr-writes', 'read-consistency-level-override', ('repl-factor', 'replication-factor'), 'sets-enable-xdr', 'single-bin', 'stop-writes-pct', ('total-bytes-memory', None), 'write-commit-level-override' ] actual_heading, actual_header, actual_params = test_util.parse_output( TestShowConfig.bar_namespace_config) self.assertTrue(exp_heading in actual_heading) self.assertTrue(exp_header in actual_header) self.assertTrue( test_util.check_for_subset(actual_params, exp_params_bar))
def test_xdr(self): """ Asserts XDR config output with heading, header & parameters. TODO: test for values as well """ exp_heading = "~~XDR Configuration" exp_header = "NODE" exp_params = [ 'enable-xdr', 'xdr-batch-num-retry', 'xdr-batch-retry-sleep', 'xdr-check-data-before-delete', 'xdr-compression-threshold', 'xdr-digestlog-size', 'xdr-forward-with-gencheck', 'xdr-hotkey-maxskip', 'xdr-info-timeout', 'xdr-local-port', 'xdr-max-recs-inflight', 'xdr-namedpipe-path', 'xdr-nw-timeout', 'xdr-read-mode', 'xdr-read-threads', 'xdr-ship-delay', 'xdr-shipping-enabled', 'xdr-timeout', 'xdr-write-batch-size' ] actual_heading, actual_header, actual_params = test_util.parse_output(TestShowConfig.xdr_config) self.assertTrue(exp_heading in actual_heading) self.assertTrue(exp_header in actual_header) self.assertTrue(set(exp_params).issubset(set(actual_params)))
def test_network(self): """ This test will assert network output on heading, header, parameters. TODO: test for values as well """ exp_heading = "~~Network Configuration" exp_header = "NODE" exp_params = [('fabric-keepalive-enabled', 'fabric.keepalive-enabled'), ('fabric-keepalive-intvl', 'fabric.keepalive-intvl'), ('fabric-keepalive-probes', 'fabric.keepalive-probes'), ('fabric-keepalive-time', 'fabric.keepalive-time'), ('fabric-port', 'fabric.port'), ('heartbeat-address', 'heartbeat.address', 'heartbeat.addresses', None), ('heartbeat-interval', 'heartbeat.interval'), ('heartbeat-mode', 'heartbeat.mode'), ('heartbeat-port', 'heartbeat.port', None), ('heartbeat-protocol', 'heartbeat.protocol'), ('heartbeat-timeout', 'heartbeat.timeout'), ('network-info-port', 'info.port'), ('reuse-address', 'service.reuse-address', None), ('service-address', 'service.address'), ('service-port','service.port')] actual_heading, actual_header, actual_params = test_util.parse_output(TestShowConfig.network_config) self.assertTrue(exp_heading in actual_heading) self.assertTrue(exp_header in actual_header) self.assertTrue(test_util.check_for_subset(actual_params, exp_params))
def test_bar_ttl(self): """ Asserts TTL Distribution in Seconds for bar namespace with heading, header & parameters. TODO: test for values as well """ if not TestShowDistribution.is_bar_present: return exp_heading = "~~bar - TTL Distribution in Seconds" exp_header = """Percentage of records having ttl less than or equal to value measured in Seconds Node 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%""" actual_heading, actual_header, actual_params = test_util.parse_output( TestShowDistribution.bar_ttl_distri, horizontal=True, mearge_header=False) if 'Node' not in actual_header: actual_header += ' ' + TestShowDistribution.bar_ttl_distri.split( '\n')[3] exp_header = ' '.join(exp_header.split()) actual_header = ' '.join([ item for item in actual_header.split() if not item.startswith('\x1b') ]) self.assertTrue(exp_heading in actual_heading) self.assertEqual(exp_header.strip(), actual_header.strip())
def test_write_latency(self): """ Asserts <b> writes_master latency <b> output with heading, header & no of node processed(based on row count). TODO: test for values as well """ exp_heading = "~~write Latency~~" exp_header= ['Node', 'Time Span', 'Ops/Sec', '%>1Ms', '%>8Ms', '%>64Ms'] exp_no_of_rows = len(TestShowLatency.rc.cluster._live_nodes) actual_heading, actual_header, actual_no_of_rows = test_util.parse_output(TestShowLatency.write_latency, horizontal = True) if actual_heading: self.assertTrue(exp_heading in actual_heading) if actual_header: self.assertEqual(exp_header, actual_header) if actual_no_of_rows: self.assertEqual(exp_no_of_rows, int(actual_no_of_rows.strip()))
def test_namespace_usage(self): """ This test will assert <b> info namespace usage </b> output for heading, headerline1, headerline2 displayed in output TODO: test for values as well """ exp_heading = "~~Namespace Usage Information" exp_header = [ 'Node', 'Namespace', 'Total Records', 'Expirations,Evictions', 'Stop Writes', 'Disk Used', 'Disk Used%', 'HWM Disk%', 'Mem Used', 'Mem Used%', 'HWM Mem%', 'Stop Writes%', ] actual_heading, actual_header, actual_no_of_rows = test_util.parse_output( TestInfo.namespace_usage_info, horizontal=True) self.assertTrue(test_util.check_for_subset(actual_header, exp_header)) self.assertTrue(exp_heading in actual_heading)
def test_network(self): """ This test will assert network output on heading, header, parameters. TODO: test for values as well """ exp_heading = "~~Network Configuration" exp_header = "NODE" exp_params = [('fabric-keepalive-enabled', 'fabric.keepalive-enabled'), ('fabric-keepalive-intvl', 'fabric.keepalive-intvl'), ('fabric-keepalive-probes', 'fabric.keepalive-probes'), ('fabric-keepalive-time', 'fabric.keepalive-time'), ('fabric-port', 'fabric.port'), ('heartbeat-address', 'heartbeat.address', 'heartbeat.addresses', None), ('heartbeat-interval', 'heartbeat.interval'), ('heartbeat-mode', 'heartbeat.mode'), ('heartbeat-port', 'heartbeat.port', None), ('heartbeat-protocol', 'heartbeat.protocol'), ('heartbeat-timeout', 'heartbeat.timeout'), ('network-info-port', 'info.port'), ('reuse-address', 'service.reuse-address', None), ('service-address', 'service.address'), ('service-port', 'service.port')] actual_heading, actual_header, actual_params = test_util.parse_output( TestShowConfig.network_config) self.assertTrue(exp_heading in actual_heading) self.assertTrue(exp_header in actual_header) self.assertTrue(test_util.check_for_subset(actual_params, exp_params))
def test_reads_latency(self): """ Asserts <b> reads latency <b> output with heading, header & no of node processed(based on row count). TODO: test for values as well """ exp_heading = [("~~reads Latency~~", "~~read Latency~~")] exp_header= ['Node', 'Time Span', 'Ops/Sec', '%>1Ms', '%>8Ms', '%>64Ms'] exp_no_of_rows = len(TestShowLatency.rc.cluster._live_nodes) actual_heading, actual_header, actual_no_of_rows = test_util.parse_output(TestShowLatency.reads_latency, horizontal = True) if actual_heading: self.assertTrue(test_util.check_for_subset(actual_heading, exp_heading)) if actual_header: self.assertEqual(exp_header, actual_header) if actual_no_of_rows: self.assertEqual(exp_no_of_rows, int(actual_no_of_rows.strip()))
def test_test_namespace(self): """ Asserts namespace config output with heading, header & parameters. ToDo: test for values as well """ exp_heading = "~~test Namespace Configuration~~" exp_header = "NODE" exp_params_test = [ 'allow-nonxdr-writes', 'allow-xdr-writes', 'cold-start-evict-ttl', 'conflict-resolution-policy', 'default-ttl', 'disallow-null-setname', 'enable-xdr', 'evict-tenths-pct', 'high-water-disk-pct', 'high-water-memory-pct', 'ldt-enabled', 'ldt-page-size', 'max-ttl', 'memory-size', 'ns-forward-xdr-writes', 'read-consistency-level-override', 'repl-factor', 'sets-enable-xdr', 'single-bin', 'stop-writes-pct', 'total-bytes-memory', 'write-commit-level-override' ] actual_heading, actual_header, actual_params = test_util.parse_output( TestShowConfig.test_namespace_config) self.assertTrue(exp_heading in actual_heading) self.assertTrue(exp_header in actual_header) self.assertTrue(set(exp_params_test).issubset(set(actual_params)))
def test_test_namespace(self): """ Asserts namespace config output with heading, header & parameters. TODO: test for values as well """ exp_heading = "~~test Namespace Configuration" exp_header = "NODE" exp_params_test = [ 'allow-nonxdr-writes', 'allow-xdr-writes', 'conflict-resolution-policy', 'default-ttl', 'disallow-null-setname', 'enable-xdr', 'evict-tenths-pct', 'high-water-disk-pct', 'high-water-memory-pct', ('ldt-enabled', None), ('ldt-page-size', None), 'memory-size', 'ns-forward-xdr-writes', 'read-consistency-level-override', ('repl-factor', 'replication-factor'), 'sets-enable-xdr', 'single-bin', 'stop-writes-pct', ('total-bytes-memory', None), 'write-commit-level-override' ] actual_heading, actual_header, actual_params = test_util.parse_output(TestShowConfig.test_namespace_config) self.assertTrue(exp_heading in actual_heading) self.assertTrue(exp_header in actual_header) self.assertTrue(test_util.check_for_subset(actual_params, exp_params_test))
def test_xdr(self): """ This test will assert <b> test Namespace Statistics </b> output for heading, header and parameters. TODO: test for values as well """ exp_heading = "~~XDR Statistics" exp_header = "NODE" exp_params = [ 'cur_throughput', 'err_ship_client', 'err_ship_conflicts', 'err_ship_server', 'esmt-bytes-shipped', 'esmt-bytes-shipped-compression', 'esmt-ship-compression', 'free-dlog-pct', 'latency_avg_dlogread', 'latency_avg_dlogwrite', 'latency_avg_ship', 'local_recs_fetch_avg_latency', 'local_recs_fetched', 'local_recs_migration_retry', 'local_recs_notfound', 'noship_recs_dup_intrabatch', 'noship_recs_expired', 'noship_recs_genmismatch', 'noship_recs_notmaster', 'noship_recs_unknown_namespace', 'perdc_timediff_lastship_cur_secs', 'stat_dlog_fread', 'stat_dlog_fseek', 'stat_dlog_fwrite', 'stat_dlog_read', 'stat_dlog_write', 'stat_pipe_reads_diginfo', 'stat_recs_dropped', 'stat_recs_localprocessed', 'stat_recs_logged', 'stat_recs_outstanding', 'stat_recs_relogged', 'stat_recs_replprocessed', 'stat_recs_shipped', 'stat_recs_shipping', 'timediff_lastship_cur_secs', 'total-recs-dlog', 'used-recs-dlog', 'xdr-uptime', 'xdr_deletes_canceled', 'xdr_deletes_relogged', 'xdr_deletes_shipped', ] actual_heading, actual_header, actual_params = test_util.parse_output( TestShowStatistics.xdr_stats) self.assertTrue(exp_heading in actual_heading) self.assertTrue(exp_header in actual_header) self.assertTrue(set(exp_params).issubset(set(actual_params)))
def test_xdr(self): """ This test will assert <b> test Namespace Statistics </b> output for heading, header and parameters. TODO: test for values as well """ exp_heading = "~~XDR Statistics" exp_header = "NODE" exp_params = [ 'cur_throughput', 'err_ship_client', 'err_ship_conflicts', 'err_ship_server', 'esmt-bytes-shipped', 'esmt-bytes-shipped-compression', 'esmt-ship-compression', 'free-dlog-pct', 'latency_avg_dlogread', 'latency_avg_dlogwrite', 'latency_avg_ship', 'local_recs_fetch_avg_latency', 'local_recs_fetched', 'local_recs_migration_retry', 'local_recs_notfound', 'noship_recs_dup_intrabatch', 'noship_recs_expired', 'noship_recs_genmismatch', 'noship_recs_notmaster', 'noship_recs_unknown_namespace', 'perdc_timediff_lastship_cur_secs', 'stat_dlog_fread', 'stat_dlog_fseek', 'stat_dlog_fwrite', 'stat_dlog_read', 'stat_dlog_write', 'stat_pipe_reads_diginfo', 'stat_recs_dropped', 'stat_recs_localprocessed', 'stat_recs_logged', 'stat_recs_outstanding', 'stat_recs_relogged', 'stat_recs_replprocessed', 'stat_recs_shipped', 'stat_recs_shipping', 'timediff_lastship_cur_secs', 'total-recs-dlog', 'used-recs-dlog', 'xdr-uptime', 'xdr_deletes_canceled', 'xdr_deletes_relogged', 'xdr_deletes_shipped', ] actual_heading, actual_header, actual_params = test_util.parse_output(TestShowStatistics.xdr_stats) self.assertTrue(exp_heading in actual_heading) self.assertTrue(exp_header in actual_header) self.assertTrue(set(exp_params).issubset(set(actual_params)))
def test_test_bin(self): """ This test will assert <b> test Bin Statistics </b> output for heading, header and parameters. TODO: test for values as well """ exp_heading = "~test Bin Statistics" exp_header = "NODE" exp_params = [('bin-names-quota','bin_names_quota'), ('num-bin-names','bin_names')] actual_heading, actual_header, actual_params = test_util.parse_output(TestShowStatistics.test_bin_stats) self.assertTrue(exp_heading in actual_heading) self.assertTrue(exp_header in actual_header) self.assertTrue(test_util.check_for_subset(actual_params, exp_params))
def test_test_bin(self): """ This test will assert <b> test Bin Statistics </b> output for heading, header and parameters. ToDo: test for values as well """ exp_heading = "~test Bin Statistics~" exp_header = "NODE" exp_params = ['bin-names-quota', 'num-bin-names'] actual_heading, actual_header, actual_params = test_util.parse_output( TestShowStatistics.test_bin_stats) self.assertTrue(exp_heading in actual_heading) self.assertTrue(exp_header in actual_header) self.assertEqual(set(exp_params), set(actual_params))
def test_writes_master_latency(self): """ Asserts <b> writes_master latency <b> output with heading, header & no of node processed(based on row count). ToDo: test for values as well """ exp_heading = "~~writes_master Latency~~" exp_header = ['Node', 'Time Span', 'Ops/Sec', '>1Ms', '>8Ms', '>64Ms'] exp_no_of_rows = len(TestShowLatency.rc.cluster._live_nodes) actual_heading, actual_header, actual_no_of_rows = test_util.parse_output( TestShowLatency.writes_master_latency, horizontal=True) self.assertTrue(exp_heading in actual_heading) self.assertEqual(exp_header, actual_header) self.assertEqual(exp_no_of_rows, int(actual_no_of_rows.strip()))
def test_test_bin(self): """ This test will assert <b> test Bin Statistics </b> output for heading, header and parameters. TODO: test for values as well """ exp_heading = "~test Bin Statistics" exp_header = "NODE" exp_params = [('bin-names-quota', 'bin_names_quota'), ('num-bin-names', 'bin_names')] actual_heading, actual_header, actual_params = test_util.parse_output( TestShowStatistics.test_bin_stats) self.assertTrue(exp_heading in actual_heading) self.assertTrue(exp_header in actual_header) self.assertTrue(test_util.check_for_subset(actual_params, exp_params))
def test_service(self): """ Asserts service config output with heading, header & parameters. TODO: test for values as well """ exp_heading = "~~Service Configuration" exp_header = "NODE" exp_params = [ ('allow-inline-transactions', None), 'batch-max-requests', 'batch-priority', 'batch-threads', ('fabric-workers', None), 'info-threads', ('ldt-benchmarks', None), ('max-msgs-per-type', None), ('memory-accounting', None), ('microbenchmarks', None), 'migrate-max-num-incoming', ('migrate-rx-lifetime-ms', None), 'migrate-threads', 'nsup-delete-sleep', 'nsup-period', 'nsup-startup-evict', ('paxos-max-cluster-size', None), ('paxos-protocol', None), ('paxos-recovery-policy', None), ('paxos-retransmit-period', None), 'paxos-single-replica-limit', 'prole-extra-ttl', 'proto-fd-idle-ms', 'proto-fd-max', 'proto-slow-netio-sleep-ms', 'query-batch-size', 'query-bufpool-size', 'query-in-transaction-thread', 'query-long-q-max-size', 'query-priority', 'query-rec-count-bound', 'query-req-in-query-thread', 'query-req-max-inflight', 'query-short-q-max-size', 'query-threads', 'query-threshold', 'query-worker-threads', ('replication-fire-and-forget', None), ('respond-client-on-master-completion', None), 'service-threads', ('sindex-data-max-memory', None), ('snub-nodes', None), ('storage-benchmarks', None), 'ticker-interval', 'transaction-max-ms', 'transaction-pending-limit', 'transaction-queues', ('transaction-repeatable-read', None), 'transaction-retry-ms', 'transaction-threads-per-queue', ('udf-runtime-gmax-memory', None), ('udf-runtime-max-memory', None), ('use-queue-per-device', None), ('write-duplicate-resolution-disable', None) ] actual_heading, actual_header, actual_params = test_util.parse_output( TestShowConfig.service_config) self.assertTrue(exp_heading in actual_heading) self.assertTrue(exp_header in actual_header) self.assertTrue(test_util.check_for_subset(actual_params, exp_params))
def test_namespace_object(self): """ This test will assert <b> info namespace Object </b> output for heading, headerline1, headerline2 displayed in output TODO: test for values as well """ exp_heading = "~~Namespace Object Information" exp_header = [ 'Namespace', 'Node', 'Total Records', 'Repl Factor', 'Objects (Master,Prole,Non-Replica)', 'Tombstones (Master,Prole,Non-Replica)', 'Pending Migrates', ('Rack ID', None) ] actual_heading, actual_header, actual_no_of_rows = test_util.parse_output( TestInfo.namespace_object_info, horizontal=True) self.assertTrue(test_util.check_for_subset(actual_header, exp_header)) self.assertTrue(exp_heading in actual_heading)
def test_xdr(self): """ This test will assert <b> info Namespace </b> output for heading, headerline1, headerline2 and no of row displayed in output TODO: test for values as well """ exp_heading = "~~XDR Information" exp_header = [ 'Node', 'Build', 'Data Shipped', 'Free Dlog%', 'Lag (sec)', 'Req Outstanding', 'Req Relog', 'Req Shipped', 'Cur Throughput', 'Avg Latency', 'Xdr Uptime' ] exp_no_of_rows = len(TestInfo.rc.cluster.nodes) actual_heading, actual_header, actual_no_of_rows = test_util.parse_output( TestInfo.xdr_info, horizontal=True) self.assertEqual(exp_header, actual_header) self.assertTrue(exp_heading in actual_heading)
def test_sindex(self): """ This test will assert <b> info sindex </b> output for heading, headerline1, headerline2 and no of row displayed in output TODO: test for values as well """ exp_heading = '~~Secondary Index Information' exp_header = [ 'Node', 'Index Name', 'Namespace', 'Set', 'Bins', 'Num Bins', 'Bin Type', 'State', 'Sync State' ] exp_no_of_rows = len(TestInfo.rc.cluster.nodes) actual_heading, actual_header, actual_no_of_rows = test_util.parse_output( TestInfo.sindex_info, horizontal=True) self.assertTrue(exp_heading in actual_heading) self.assertEqual(exp_header, actual_header)
def test_network(self): """ This test will assert <b> info Network </b> output for heading, headerline1, headerline2 and no of row displayed in output TODO: test for values as well """ exp_heading = "~~Network Information" exp_header = [ 'Node', 'Node Id', 'Ip', 'Build', 'Cluster Size', 'Cluster Key', 'Cluster Integrity', 'Principal', 'Client Conns', 'Uptime' ] exp_no_of_rows = len(TestInfo.rc.cluster.nodes) actual_heading, actual_header, actual_no_of_rows = test_util.parse_output( TestInfo.network_info, horizontal=True) self.assertTrue(exp_heading in actual_heading) self.assertTrue(set(exp_header).issubset(actual_header)) self.assertEqual(exp_no_of_rows, int(actual_no_of_rows.strip()))
def test_test_ttl(self): """ Asserts TTL Distribution in Seconds for test namespace with heading, header & parameters. TODO: test for values as well """ exp_heading = "~~test - TTL Distribution in Seconds" exp_header = """Percentage of records having ttl less than or equal to value measured in Seconds Node 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%""" actual_heading, actual_header, actual_params = test_util.parse_output(TestShowDistribution.test_ttl_distri, horizontal=True, mearge_header = False) if 'Node' not in actual_header: actual_header += ' ' + TestShowDistribution.test_ttl_distri.split('\n')[3] exp_header = ' '.join(exp_header.split()) actual_header = ' '.join([item for item in actual_header.split() if not item.startswith('\x1b')]) self.assertTrue(exp_heading in actual_heading) self.assertEqual(exp_header.strip(), actual_header.strip())
def test_namespace_object(self): """ This test will assert <b> info namespace Object </b> output for heading, headerline1, headerline2 displayed in output TODO: test for values as well """ exp_heading = "~~Namespace Object Information" exp_header = [ 'Namespace', 'Node', 'Total Records', 'Repl Factor', 'Objects (Master,Prole,Non-Replica)', 'Tombstones (Master,Prole,Non-Replica)', 'Pending Migrates', ('Rack ID', None) ] actual_heading, actual_header, actual_no_of_rows = test_util.parse_output(TestInfo.namespace_object_info, horizontal = True) self.assertTrue(test_util.check_for_subset(actual_header, exp_header)) self.assertTrue(exp_heading in actual_heading)
def test_proxy_latency(self): """ Asserts <b> proxy latency <b> output with heading, header & no of node processed(based on row count). TODO: test for values as well """ exp_heading = "~~proxy Latency~~" exp_header = [ 'Node', 'Time Span', 'Ops/Sec', '%>1Ms', '%>8Ms', '%>64Ms' ] exp_no_of_rows = len(TestShowLatency.rc.cluster._live_nodes) actual_heading, actual_header, actual_no_of_rows = test_util.parse_output( TestShowLatency.proxy_latency, horizontal=True) if actual_heading: self.assertTrue(exp_heading in actual_heading) if actual_header: self.assertEqual(exp_header, actual_header) if actual_no_of_rows: self.assertEqual(exp_no_of_rows, int(actual_no_of_rows.strip()))
def test_sindex(self): """ This test will assert <b> info sindex </b> output for heading, headerline1, headerline2 and no of row displayed in output TODO: test for values as well """ exp_heading = '~~Secondary Index Information' exp_header = ['Node', 'Index Name', 'Namespace', 'Set', 'Bins', 'Num Bins', 'Bin Type', 'State', 'Sync State'] exp_no_of_rows = len(TestInfo.rc.cluster.nodes) actual_heading, actual_header, actual_no_of_rows = test_util.parse_output(TestInfo.sindex_info, horizontal = True) self.assertTrue(exp_heading in actual_heading) self.assertEqual(exp_header, actual_header)
def test_xdr(self): """ This test will assert <b> info Namespace </b> output for heading, headerline1, headerline2 and no of row displayed in output TODO: test for values as well """ exp_heading = "~~XDR Information" exp_header = ['Node', 'Build', 'Data Shipped', 'Free Dlog%', 'Lag (sec)', 'Req Outstanding', 'Req Relog', 'Req Shipped', 'Cur Throughput', 'Avg Latency', 'Xdr Uptime'] exp_no_of_rows = len(TestInfo.rc.cluster.nodes) actual_heading, actual_header, actual_no_of_rows = test_util.parse_output(TestInfo.xdr_info, horizontal = True) self.assertEqual(exp_header, actual_header) self.assertTrue(exp_heading in actual_heading)
def test_network(self): """ This test will assert network output on heading, header, parameters. ToDo: test for values as well """ exp_heading = "~~Network Configuration~~" exp_header = "NODE" exp_params = [ 'fabric-keepalive-enabled', 'fabric-keepalive-intvl', 'fabric-keepalive-probes', 'fabric-keepalive-time', 'fabric-port', 'heartbeat-address', 'heartbeat-interval', 'heartbeat-mode', 'heartbeat-port', 'heartbeat-protocol', 'heartbeat-timeout', 'network-info-port', 'reuse-address', 'service-address', 'service-port' ] actual_heading, actual_header, actual_params = test_util.parse_output( TestShowConfig.network_config) self.assertTrue(exp_heading in actual_heading) self.assertTrue(exp_header in actual_header) self.assertTrue(set(exp_params).issubset(set(actual_params)))
def test_xdr(self): """ Asserts XDR config output with heading, header & parameters. TODO: test for values as well """ exp_heading = "~~XDR Configuration" exp_header = "NODE" exp_params = [ 'enable-xdr', 'xdr-batch-num-retry', 'xdr-batch-retry-sleep', 'xdr-check-data-before-delete', 'xdr-compression-threshold', 'xdr-digestlog-size', 'xdr-forward-with-gencheck', 'xdr-hotkey-maxskip', 'xdr-info-timeout', 'xdr-local-port', 'xdr-max-recs-inflight', 'xdr-namedpipe-path', 'xdr-nw-timeout', 'xdr-read-mode', 'xdr-read-threads', 'xdr-ship-delay', 'xdr-shipping-enabled', 'xdr-timeout', 'xdr-write-batch-size' ] actual_heading, actual_header, actual_params = test_util.parse_output( TestShowConfig.xdr_config) self.assertTrue(exp_heading in actual_heading) self.assertTrue(exp_header in actual_header) self.assertTrue(set(exp_params).issubset(set(actual_params)))
def test_namespace_usage(self): """ This test will assert <b> info namespace usage </b> output for heading, headerline1, headerline2 displayed in output TODO: test for values as well """ exp_heading = "~~Namespace Usage Information" exp_header = [ 'Node', 'Namespace', 'Total Records', 'Expirations,Evictions', 'Stop Writes', 'Disk Used', 'Disk Used%', 'HWM Disk%', 'Mem Used', 'Mem Used%', 'HWM Mem%', 'Stop Writes%', ] actual_heading, actual_header, actual_no_of_rows = test_util.parse_output(TestInfo.namespace_usage_info, horizontal = True) self.assertTrue(test_util.check_for_subset(actual_header, exp_header)) self.assertTrue(exp_heading in actual_heading)
def test_namespace(self): """ This test will assert <b> info Namespace </b> output for heading, headerline1, headerline2 and no of row displayed in output ToDo: test for values as well """ exp_heading = "~~Namespace Information~~" exp_header = [ 'Node', 'Namespace', 'Evictions', 'Master Objects', 'Replica Objects', 'Repl Factor', 'Stop Writes', 'HWM Disk%', 'Mem Used', 'Mem Used%', 'HWM Mem%', 'Stop Writes%'] exp_no_of_rows = len(TestInfo.rc.cluster.nodes) actual_heading, actual_header, actual_no_of_rows = test_util.parse_output(TestInfo.namespace_info, horizontal = True) self.assertTrue(set(exp_header).issubset(set(actual_header))) self.assertTrue(exp_heading in actual_heading)
def test_network(self): """ This test will assert <b> info Network </b> output for heading, headerline1, headerline2 and no of row displayed in output TODO: test for values as well """ exp_heading = "~~Network Information" exp_header = [ 'Node', 'Node Id', 'Ip', 'Build', 'Cluster Size', 'Cluster Key', 'Cluster Integrity', 'Principal', 'Client Conns', 'Uptime'] exp_no_of_rows = len(TestInfo.rc.cluster.nodes) actual_heading, actual_header, actual_no_of_rows = test_util.parse_output(TestInfo.network_info, horizontal = True) self.assertTrue(exp_heading in actual_heading) self.assertTrue(set(exp_header).issubset(actual_header)) self.assertEqual(exp_no_of_rows, int(actual_no_of_rows.strip()))
def test_service(self): """ Asserts service config output with heading, header & parameters. TODO: test for values as well """ exp_heading = "~~Service Configuration" exp_header = "NODE" exp_params = [ ('allow-inline-transactions', None), 'batch-max-requests', 'batch-priority', 'batch-threads', ('fabric-workers', None), 'info-threads', ('ldt-benchmarks', None), ('max-msgs-per-type', None), ('memory-accounting', None), ('microbenchmarks', None), 'migrate-max-num-incoming', ('migrate-rx-lifetime-ms', None), 'migrate-threads', 'nsup-startup-evict', ('paxos-max-cluster-size', None), ('paxos-protocol', None), ('paxos-recovery-policy', None), ('paxos-retransmit-period', None), 'paxos-single-replica-limit', 'proto-fd-idle-ms', 'proto-fd-max', 'proto-slow-netio-sleep-ms', 'query-batch-size', 'query-bufpool-size', 'query-in-transaction-thread', 'query-long-q-max-size', 'query-priority', 'query-rec-count-bound', 'query-req-in-query-thread', 'query-req-max-inflight', 'query-short-q-max-size', 'query-threads', 'query-threshold', 'query-worker-threads', ('replication-fire-and-forget', None), ('respond-client-on-master-completion', None), 'service-threads', ('sindex-data-max-memory', None), ('snub-nodes', None), ('storage-benchmarks', None), 'ticker-interval', 'transaction-max-ms', ('transaction-pending-limit', None), 'transaction-queues', ('transaction-repeatable-read', None), 'transaction-retry-ms', 'transaction-threads-per-queue', ('udf-runtime-gmax-memory', None), ('udf-runtime-max-memory', None), ('use-queue-per-device', None), ('write-duplicate-resolution-disable', None) ] actual_heading, actual_header, actual_params = test_util.parse_output(TestShowConfig.service_config) self.assertTrue(exp_heading in actual_heading) self.assertTrue(exp_header in actual_header) self.assertTrue(test_util.check_for_subset(actual_params, exp_params))
def test_test_namespace(self): """ This test will assert <b> test Namespace Statistics </b> output for heading, header and parameters. TODO: test for values as well """ exp_heading = "~test Namespace Statistics" exp_header = "NODE" exp_params = [ 'allow-nonxdr-writes', 'allow-xdr-writes', ('available-bin-names', 'available_bin_names'), 'conflict-resolution-policy', ('current-time', 'current_time'), ('data-used-bytes-memory', 'memory_used_data_bytes'), 'default-ttl', 'disallow-null-setname', 'enable-xdr', 'evict-tenths-pct', ('evicted-objects', 'evicted_objects'), ('expired-objects', 'expired_objects'), ('free-pct-memory', 'memory_free_pct'), 'high-water-disk-pct', 'high-water-memory-pct', ('hwm-breached', 'hwm_breached'), ('index-used-bytes-memory', 'memory_used_index_bytes'), ('ldt-enabled', None), ('ldt-page-size', None), ('master-objects', 'master_objects'), ('master-sub-objects', 'master_sub_objects', None), ('max-void-time', 'max_void_time', None), 'memory-size', ('migrate-rx-partitions-initial','migrate_rx_partitions_initial', None), ('migrate-rx-partitions-remaining','migrate_rx_partitions_remaining', None), ('migrate-tx-partitions-imbalance','migrate_tx_partitions_imbalance', None), ('migrate-tx-partitions-initial','migrate_tx_partitions_initial', None), ('migrate-tx-partitions-remaining','migrate_tx_partitions_remaining', None), ('non-expirable-objects', 'non_expirable_objects'), 'ns-forward-xdr-writes', ('nsup-cycle-duration', 'nsup_cycle_duration'), ('nsup-cycle-sleep-pct', 'nsup_cycle_sleep_pct', None), 'objects', ('prole-objects', 'prole_objects'), ('prole-sub-objects', 'prole_sub_objects', None), 'read-consistency-level-override', ('repl-factor', 'replication-factor'), ('set-deleted-objects', 'set_deleted_objects', None), 'sets-enable-xdr', ('sindex-used-bytes-memory', 'memory_used_sindex_bytes'), 'single-bin', ('stop-writes', 'stop_writes'), 'stop-writes-pct', ('sub-objects', 'sub_objects', None), ('total-bytes-memory', None), ('type', None), ('used-bytes-memory', 'memory_used_bytes'), 'write-commit-level-override', ] actual_heading, actual_header, actual_params = test_util.parse_output(TestShowStatistics.test_namespace_stats) self.assertTrue(exp_heading in actual_heading) self.assertTrue(exp_header in actual_header) self.assertTrue(test_util.check_for_subset(actual_params, exp_params))
def test_service(self): """ This test will assert <b> Service Statistics </b> output for heading, header and parameters. TODO: test for values as well """ exp_heading = "~Service Statistics" exp_header = "NODE" exp_params = [ ('batch_errors', 'batch_error'), 'batch_initiate', 'batch_queue', 'batch_timeout', ('batch_tree_count', None), 'client_connections', 'cluster_integrity', 'cluster_key', 'cluster_size', ('data-used-bytes-memory', None), ('err_duplicate_proxy_request', None), ('err_out_of_space', None), ('err_replica_non_null_node', None), ('err_replica_null_node', None), ('err_rw_cant_put_unique', None), ('err_rw_pending_limit', None), ('err_rw_request_not_found', None), ('err_storage_queue_full', None), ('err_sync_copy_null_master', None), ('err_tsvc_requests', None), ('err_write_fail_bin_exists', None), ('err_write_fail_bin_name', None), ('err_write_fail_bin_not_found', None), ('err_write_fail_forbidden', None), ('err_write_fail_generation', None), ('err_write_fail_incompatible_type', None), ('err_write_fail_key_exists', None), ('err_write_fail_key_mismatch', None), ('err_write_fail_not_found', None), ('err_write_fail_parameter', None), ('err_write_fail_prole_delete', None), ('err_write_fail_prole_generation', None), ('err_write_fail_prole_unknown', None), ('err_write_fail_record_too_big', None), ('err_write_fail_unknown', None), ('fabric_msgs_rcvd', None), ('fabric_msgs_sent', None), ('free-pct-disk', None), ('free-pct-memory', None), 'heartbeat_received_foreign', 'heartbeat_received_self', ('index-used-bytes-memory', None), 'info_queue', 'objects', ('ongoing_write_reqs', None), ('partition_absent', None), ('partition_actual', None), ('partition_desync', None), ('partition_object_count', None), ('partition_ref_count', None), ('partition_replica', None), 'paxos_principal', ('proxy_action', None), 'proxy_in_progress', ('proxy_initiate', None), ('proxy_retry', None), ('proxy_retry_new_dest', None), ('proxy_retry_q_full', None), ('proxy_retry_same_dest', None), ('proxy_unproxy', None), ('query_abort', None), ('query_agg', None), ('query_agg_abort', None), ('query_agg_avg_rec_count', None), ('query_agg_err', None), ('query_agg_success', None), ('query_avg_rec_count', None), ('query_fail', None), ('query_long_queue_full', None), 'query_long_running', ('query_lookup_abort', None), ('query_lookup_avg_rec_count', None), ('query_lookup_err', None), ('query_lookup_success', None), ('query_lookups', None), ('query_reqs', None), ('query_short_queue_full', None), 'query_short_running', ('query_success', None), ('queue', 'tsvc_queue'), ('read_dup_prole', None), 'reaped_fds', ('record_locks', None), ('record_refs', None), ('rw_err_ack_badnode', None), ('rw_err_ack_internal', None), ('rw_err_ack_nomatch', None), ('rw_err_dup_cluster_key', None), ('rw_err_dup_internal', None), ('rw_err_dup_send', None), ('rw_err_write_cluster_key', None), ('rw_err_write_internal', None), ('rw_err_write_send', None), ('sindex-used-bytes-memory', None), ('sindex_gc_activity_dur', None), 'sindex_gc_garbage_cleaned', 'sindex_gc_garbage_found', ('sindex_gc_inactivity_dur', None), 'sindex_gc_list_creation_time', 'sindex_gc_list_deletion_time', 'sindex_gc_objects_validated', 'sindex_ucgarbage_found', ('stat_cluster_key_err_ack_dup_trans_reenqueue', None), ('stat_delete_success', None), ('stat_deleted_set_objects', None), ('stat_duplicate_operation', None), ('stat_evicted_objects', None), ('stat_evicted_objects_time', None), ('stat_expired_objects', None), ('stat_ldt_proxy', None), ('stat_nsup_deletes_not_shipped', None), ('stat_proxy_errs', None), ('stat_proxy_reqs', None), ('stat_proxy_reqs_xdr', None), ('stat_proxy_success', None), ('stat_read_errs_notfound', None), ('stat_read_errs_other', None), ('stat_read_reqs', None), ('stat_read_reqs_xdr', None), ('stat_read_success', None), ('stat_rw_timeout', None), ('stat_write_errs', None), ('stat_write_errs_notfound', None), ('stat_write_errs_other', None), ('stat_write_reqs', None), ('stat_write_reqs_xdr', None), ('stat_write_success', None), ('stat_zero_bin_records', None), ('storage_defrag_corrupt_record', None), ('sub-records', 'sub_objects', None), 'system_free_mem_pct', 'system_swapping', ('total-bytes-disk', None), ('total-bytes-memory', None), ('transactions', None), ('tree_count', None), ('udf_delete_err_others', None), ('udf_delete_reqs', None), ('udf_delete_success', None), ('udf_lua_errs', None), ('udf_query_rec_reqs', None), ('udf_read_errs_other', None), ('udf_read_reqs', None), ('udf_read_success', None), ('udf_replica_writes', None), ('udf_scan_rec_reqs', None), ('udf_write_err_others', None), ('udf_write_reqs', None), ('udf_write_success', None), 'uptime', ('used-bytes-disk', None), ('used-bytes-memory', None), ('waiting_transactions', None), ('write_master', None), ('write_prole', None) ] actual_heading, actual_header, actual_params = test_util.parse_output(TestShowStatistics.service_stats) self.assertTrue(exp_heading in actual_heading) self.assertTrue(exp_header in actual_header) self.assertTrue(test_util.check_for_subset(actual_params, exp_params))
def test_test_namespace(self): """ This test will assert <b> test Namespace Statistics </b> output for heading, header and parameters. ToDo: test for values as well """ exp_heading = "~test Namespace Statistics~" exp_header = "NODE" exp_params = [ 'allow-nonxdr-writes', 'allow-xdr-writes', 'available-bin-names', 'cold-start-evict-ttl', 'conflict-resolution-policy', 'current-time', 'data-used-bytes-memory', 'default-ttl', 'disallow-null-setname', 'enable-xdr', 'evict-tenths-pct', 'evicted-objects', 'expired-objects', 'free-pct-memory', 'high-water-disk-pct', 'high-water-memory-pct', 'hwm-breached', 'index-used-bytes-memory', 'ldt-enabled', 'ldt-page-size', 'master-objects', 'master-sub-objects', 'max-ttl', 'max-void-time', 'memory-size', 'non-expirable-objects', 'ns-forward-xdr-writes', 'nsup-cycle-duration', 'nsup-cycle-sleep-pct', 'objects', 'prole-objects', 'prole-sub-objects', 'read-consistency-level-override', 'repl-factor', 'set-deleted-objects', 'sets-enable-xdr', 'sindex-used-bytes-memory', 'single-bin', 'stop-writes', 'stop-writes-pct', 'sub-objects', 'total-bytes-memory', 'type', 'used-bytes-memory', 'write-commit-level-override', ] actual_heading, actual_header, actual_params = test_util.parse_output( TestShowStatistics.test_namespace_stats) self.assertTrue(exp_heading in actual_heading) self.assertTrue(exp_header in actual_header) self.assertTrue(set(exp_params).issubset(set(actual_params)))
def test_service(self): """ This test will assert <b> Service Statistics </b> output for heading, header and parameters. TODO: test for values as well """ exp_heading = "~Service Statistics" exp_header = "NODE" exp_params = [ ('batch_errors', 'batch_error'), 'batch_initiate', 'batch_queue', 'batch_timeout', ('batch_tree_count', None), 'client_connections', 'cluster_integrity', 'cluster_key', 'cluster_size', ('data-used-bytes-memory', None), ('err_duplicate_proxy_request', None), ('err_out_of_space', None), ('err_replica_non_null_node', None), ('err_replica_null_node', None), ('err_rw_cant_put_unique', None), ('err_rw_pending_limit', None), ('err_rw_request_not_found', None), ('err_storage_queue_full', None), ('err_sync_copy_null_master', None), ('err_tsvc_requests', None), ('err_write_fail_bin_exists', None), ('err_write_fail_bin_name', None), ('err_write_fail_bin_not_found', None), ('err_write_fail_forbidden', None), ('err_write_fail_generation', None), ('err_write_fail_incompatible_type', None), ('err_write_fail_key_exists', None), ('err_write_fail_key_mismatch', None), ('err_write_fail_not_found', None), ('err_write_fail_parameter', None), ('err_write_fail_prole_delete', None), ('err_write_fail_prole_generation', None), ('err_write_fail_prole_unknown', None), ('err_write_fail_record_too_big', None), ('err_write_fail_unknown', None), ('fabric_msgs_rcvd', None), ('fabric_msgs_sent', None), ('free-pct-disk', None), ('free-pct-memory', None), 'heartbeat_received_foreign', 'heartbeat_received_self', ('index-used-bytes-memory', None), 'info_queue', 'objects', ('ongoing_write_reqs', None), ('partition_absent', None), ('partition_actual', None), ('partition_desync', None), ('partition_object_count', None), ('partition_ref_count', None), ('partition_replica', None), 'paxos_principal', ('proxy_action', None), 'proxy_in_progress', ('proxy_initiate', None), ('proxy_retry', None), ('proxy_retry_new_dest', None), ('proxy_retry_q_full', None), ('proxy_retry_same_dest', None), ('proxy_unproxy', None), ('query_abort', None), ('query_agg', None), ('query_agg_abort', None), ('query_agg_avg_rec_count', None), ('query_agg_err', None), ('query_agg_success', None), ('query_avg_rec_count', None), ('query_fail', None), ('query_long_queue_full', None), 'query_long_running', ('query_lookup_abort', None), ('query_lookup_avg_rec_count', None), ('query_lookup_err', None), ('query_lookup_success', None), ('query_lookups', None), ('query_reqs', None), ('query_short_queue_full', None), 'query_short_running', ('query_success', None), ('queue', 'tsvc_queue'), ('read_dup_prole', None), 'reaped_fds', ('record_locks', None), ('record_refs', None), ('rw_err_ack_badnode', None), ('rw_err_ack_internal', None), ('rw_err_ack_nomatch', None), ('rw_err_dup_cluster_key', None), ('rw_err_dup_internal', None), ('rw_err_dup_send', None), ('rw_err_write_cluster_key', None), ('rw_err_write_internal', None), ('rw_err_write_send', None), ('sindex-used-bytes-memory', None), ('sindex_gc_activity_dur', None), 'sindex_gc_garbage_cleaned', 'sindex_gc_garbage_found', ('sindex_gc_inactivity_dur', None), 'sindex_gc_list_creation_time', 'sindex_gc_list_deletion_time', 'sindex_gc_objects_validated', 'sindex_ucgarbage_found', ('stat_cluster_key_err_ack_dup_trans_reenqueue', None), ('stat_delete_success', None), ('stat_deleted_set_objects', None), ('stat_duplicate_operation', None), ('stat_evicted_objects', None), ('stat_evicted_objects_time', None), ('stat_expired_objects', None), ('stat_ldt_proxy', None), ('stat_nsup_deletes_not_shipped', None), ('stat_proxy_errs', None), ('stat_proxy_reqs', None), ('stat_proxy_reqs_xdr', None), ('stat_proxy_success', None), ('stat_read_errs_notfound', None), ('stat_read_errs_other', None), ('stat_read_reqs', None), ('stat_read_reqs_xdr', None), ('stat_read_success', None), ('stat_rw_timeout', None), ('stat_write_errs', None), ('stat_write_errs_notfound', None), ('stat_write_errs_other', None), ('stat_write_reqs', None), ('stat_write_reqs_xdr', None), ('stat_write_success', None), ('stat_zero_bin_records', None), ('storage_defrag_corrupt_record', None), ('sub-records', 'sub_objects', None), 'system_free_mem_pct', 'system_swapping', ('total-bytes-disk', None), ('total-bytes-memory', None), ('transactions', None), ('tree_count', None), ('udf_delete_err_others', None), ('udf_delete_reqs', None), ('udf_delete_success', None), ('udf_lua_errs', None), ('udf_query_rec_reqs', None), ('udf_read_errs_other', None), ('udf_read_reqs', None), ('udf_read_success', None), ('udf_replica_writes', None), ('udf_scan_rec_reqs', None), ('udf_write_err_others', None), ('udf_write_reqs', None), ('udf_write_success', None), 'uptime', ('used-bytes-disk', None), ('used-bytes-memory', None), ('waiting_transactions', None), ('write_master', None), ('write_prole', None) ] actual_heading, actual_header, actual_params = test_util.parse_output( TestShowStatistics.service_stats) self.assertTrue(exp_heading in actual_heading) self.assertTrue(exp_header in actual_header) self.assertTrue(test_util.check_for_subset(actual_params, exp_params))
def test_test_namespace(self): """ This test will assert <b> test Namespace Statistics </b> output for heading, header and parameters. TODO: test for values as well """ exp_heading = "~test Namespace Statistics" exp_header = "NODE" exp_params = [ 'allow-nonxdr-writes', 'allow-xdr-writes', ('available-bin-names', 'available_bin_names'), 'conflict-resolution-policy', ('current-time', 'current_time'), ('data-used-bytes-memory', 'memory_used_data_bytes'), 'default-ttl', 'disallow-null-setname', 'enable-xdr', 'evict-tenths-pct', ('evicted-objects', 'evicted_objects'), ('expired-objects', 'expired_objects'), ('free-pct-memory', 'memory_free_pct'), 'high-water-disk-pct', 'high-water-memory-pct', ('hwm-breached', 'hwm_breached'), ('index-used-bytes-memory', 'memory_used_index_bytes'), ('ldt-enabled', None), ('ldt-page-size', None), ('master-objects', 'master_objects'), ('master-sub-objects', 'master_sub_objects', None), ('max-void-time', 'max_void_time', None), 'memory-size', ('migrate-rx-partitions-initial', 'migrate_rx_partitions_initial', None), ('migrate-rx-partitions-remaining', 'migrate_rx_partitions_remaining', None), ('migrate-tx-partitions-imbalance', 'migrate_tx_partitions_imbalance', None), ('migrate-tx-partitions-initial', 'migrate_tx_partitions_initial', None), ('migrate-tx-partitions-remaining', 'migrate_tx_partitions_remaining', None), ('non-expirable-objects', 'non_expirable_objects'), 'ns-forward-xdr-writes', ('nsup-cycle-duration', 'nsup_cycle_duration'), ('nsup-cycle-sleep-pct', 'nsup_cycle_sleep_pct', None), 'objects', ('prole-objects', 'prole_objects'), ('prole-sub-objects', 'prole_sub_objects', None), 'read-consistency-level-override', ('repl-factor', 'replication-factor'), ('set-deleted-objects', 'set_deleted_objects', None), 'sets-enable-xdr', ('sindex-used-bytes-memory', 'memory_used_sindex_bytes'), 'single-bin', ('stop-writes', 'stop_writes'), 'stop-writes-pct', ('sub-objects', 'sub_objects', None), ('total-bytes-memory', None), ('type', None), ('used-bytes-memory', 'memory_used_bytes'), 'write-commit-level-override', ] actual_heading, actual_header, actual_params = test_util.parse_output( TestShowStatistics.test_namespace_stats) self.assertTrue(exp_heading in actual_heading) self.assertTrue(exp_header in actual_header) self.assertTrue(test_util.check_for_subset(actual_params, exp_params))