def test_versions_cassandra_30(self): """retrieve server versions present""" output_log_path = os.path.join(test_dir(), "cassandra30", "system.log") with open(output_log_path, "r") as log: events = list(parser.read_output_log(log)) cassandra_version = None for event in events: if "cassandra_version" in event: cassandra_version = event["cassandra_version"] self.assertEqual(cassandra_version, "3.0.19")
def test_versions_cassandra_311(): """retrieve server versions present""" output_log_path = os.path.join(test_dir(), 'cassandra311', 'system.log') with open(output_log_path, 'r') as log: events = list(parser.read_output_log(log)) cassandra_version = None for event in events: if 'cassandra_version' in event: cassandra_version = event['cassandra_version'] assert cassandra_version == "3.11.5"
def test_parser_output_log(self): """make sure the parse_log gets the configuration from the log""" output_log_path = os.path.join(test_dir(), "output.log") with open(output_log_path, "r") as log: events = list(parser.read_output_log(log)) cpu_cores, threads_per_core, ram_in_mb, heap_size, gc_type = ( None, None, None, None, None, ) disk_access_mode, index_access_mode, commit_log_access_mode = ( None, None, None, ) for event in events: if "cpu_cores" in event: cpu_cores = event["cpu_cores"] if "threads_per_core" in event: threads_per_core = event["threads_per_core"] if "jvm_args" in event: if "-Ddse.system_memory_in_mb" in event["jvm_args"]: for ram in event["jvm_args"][ "-Ddse.system_memory_in_mb"]: # just get the last one ram_in_mb = ram for args in event["jvm_args"]: if args.startswith("-Xmx"): heap_size = "".join(args[4:]) if args == "-XX:+UseG1GC": gc_type = "G1GC" if "logged_disk_access_mode" in event: disk_access_mode = event["logged_disk_access_mode"] if "logged_index_access_mode" in event: index_access_mode = event["logged_index_access_mode"] if "logged_commit_log_access_mode" in event: commit_log_access_mode = event[ "logged_commit_log_access_mode"] self.assertEqual(disk_access_mode, "standard") self.assertEqual(index_access_mode, "standard") self.assertEqual(commit_log_access_mode, "standard") self.assertEqual(cpu_cores, 8) self.assertEqual(threads_per_core, 1) self.assertEqual(ram_in_mb, "15038") self.assertEqual(gc_type, "G1GC") self.assertEqual(heap_size, "3759M")
def test_parser_output_log(): """make sure the parse_log gets the configuration from the log""" output_log_path = os.path.join(test_dir(), 'output.log') with open(output_log_path, 'r') as log: events = list(parser.read_output_log(log)) cpu_cores, threads_per_core, ram_in_mb, heap_size, gc_type = (None, None, None, None, None) disk_access_mode, index_access_mode, commit_log_access_mode = (None, None, None) for event in events: if 'cpu_cores' in event: cpu_cores = event['cpu_cores'] if 'threads_per_core' in event: threads_per_core = event['threads_per_core'] if 'jvm_args' in event: if '-Ddse.system_memory_in_mb' in event['jvm_args']: for ram in event['jvm_args']['-Ddse.system_memory_in_mb']: #just get the last one ram_in_mb = ram for args in event['jvm_args']: if args.startswith('-Xmx'): heap_size = "".join(args[4:]) if args == "-XX:+UseG1GC": gc_type = "G1GC" if 'logged_disk_access_mode' in event: disk_access_mode = event['logged_disk_access_mode'] if 'logged_index_access_mode' in event: index_access_mode = event['logged_index_access_mode'] if 'logged_commit_log_access_mode' in event: commit_log_access_mode = event['logged_commit_log_access_mode'] assert disk_access_mode == "standard" assert index_access_mode == "standard" assert commit_log_access_mode == "standard" assert cpu_cores == 8 assert threads_per_core == 1 assert ram_in_mb == "15038" assert gc_type == "G1GC" assert heap_size == "3759M"
def test_versions_from_output_log(self): """retrieve server versions present""" output_log_path = os.path.join(test_dir(), "output.log") with open(output_log_path, "r") as log: events = list(parser.read_output_log(log)) solr_version = None spark_version = None dse_spark_connector_version = None for event in events: if "spark_version" in event: spark_version = event["spark_version"] if "dse_spark_connector_version" in event: dse_spark_connector_version = event[ "dse_spark_connector_version"] if "solr_version" in event: solr_version = event["solr_version"] if "version" in event: dse_version = event["version"] self.assertEqual(dse_version, "6.7.7") self.assertEqual(solr_version, "6.0.1.2.2647") self.assertEqual(spark_version, "2.2.3.9") self.assertEqual(dse_spark_connector_version, "6.7.7")
def test_versions_from_output_log(): """retrieve server versions present""" output_log_path = os.path.join(test_dir(), 'output.log') with open(output_log_path, 'r') as log: events = list(parser.read_output_log(log)) solr_version = None spark_version = None dse_spark_connector_version = None for event in events: if 'spark_version' in event: spark_version = event['spark_version'] if 'dse_spark_connector_version' in event: dse_spark_connector_version = event[ 'dse_spark_connector_version'] if 'solr_version' in event: solr_version = event['solr_version'] if 'version' in event: dse_version = event['version'] assert dse_version == "6.7.7" assert solr_version == "6.0.1.2.2647" assert spark_version == "2.2.3.9" assert dse_spark_connector_version == "6.7.7"