def teardown_after_file_creation_test(client, files_number, dir_path): logging_time = time.time() + LOGGING_INTERVAL for i in xrange(files_number): rm(client, os.path.join(dir_path, 'file{}'.format(i))) if time.time() >= logging_time: flushed_print("\t\t\tDeleted {}nth file".format(i)) logging_time = time.time() + LOGGING_INTERVAL
def test_sysbench(self, context, clients, params): user_directio = "u1" user_proxy = "u2" client_directio = context.get_client(user_directio, "client-directio") client_proxy = context.get_client(user_proxy, "client-proxy") threads = params['threads']['value'] files_number = params['files_number']['value'] total_size = params['total_size']['value'] mode = params['mode']['value'] validate = params['validate']['value'] events = params['events']['value'] report_interval = params['report_interval']['value'] time = params['time']['value'] file_block_size = params['file_block_size']['value'] dir_path_directio = mkdtemp(client_directio, dir=client_directio.absolute_path("s1")) dir_path_proxy = mkdtemp(client_proxy, dir=client_proxy.absolute_path("s1")) print("\n################################## DIRECT-IO client (%s) ##################################\n"%(mode)) execute_sysbench_test(client_directio, user_directio, threads, total_size, files_number, mode, validate, events, report_interval, time, file_block_size, dir_path_directio) print("\n################################## PROXY-IO client (%s) ##################################\n"%(mode)) execute_sysbench_test(client_proxy, user_proxy, threads, total_size, files_number, mode, validate, events, report_interval, time, file_block_size, dir_path_proxy) rm(client_directio, dir_path_directio, recursive=True, force=True) rm(client_proxy, dir_path_proxy, recursive=True, force=True)
def test_files_creation(self, context, clients, params): user_directio = "u1" user_proxy = "u2" client_directio = context.get_client(user_directio, 'client-directio') client_proxy = context.get_client(user_proxy, 'client-proxy') files_number = params['files_number']['value'] empty_files = params['empty_files']['value'] for client in (client_directio, client_proxy): conn = client.rpyc_connection conn._config['sync_request_timeout'] = RPYC_TIMEOUT dir_path_directio = mkdtemp(client_directio, dir=client_directio.absolute_path('s1')) dir_path_proxy = mkdtemp(client_proxy, dir=client_proxy.absolute_path('s1')) dir_path_host = mkdtemp(client_proxy, dir=user_home_dir(user_proxy)) test_result1 = execute_file_creation_test(client_directio, files_number, empty_files, dir_path_directio, 'direct IO') test_result2 = execute_file_creation_test(client_proxy, files_number, empty_files, dir_path_proxy, 'cluster-proxy') test_result3 = execute_file_creation_test(client_proxy, files_number, empty_files, dir_path_host, 'host system') # removal of entire directory tree can take several minutes, so as to # evade connection timeout while removing everything at once, # rm files one at time instead teardown_after_file_creation_test(client_directio, files_number, dir_path_directio) teardown_after_file_creation_test(client_proxy, files_number, dir_path_proxy) teardown_after_file_creation_test(client_proxy, files_number, dir_path_host) rm(client_directio, dir_path_directio, recursive=True, force=True) rm(client_proxy, dir_path_proxy, recursive=True, force=True) rm(client_proxy, dir_path_host, recursive=True, force=True) return test_result1 + test_result2 + test_result3
def test_files_creation(self, context, clients, params): user_directio = "u1" user_proxy = "u2" client_directio = context.get_client(user_directio, 'client-directio') client_proxy = context.get_client(user_proxy, 'client-proxy') files_number = params['files_number']['value'] empty_files = params['empty_files']['value'] dir_path_directio = mkdtemp(client_directio, dir=client_directio.absolute_path('s1')) dir_path_proxy = mkdtemp(client_proxy, dir=client_proxy.absolute_path('s1')) dir_path_host = mkdtemp(client_proxy, dir=user_home_dir(user_proxy)) test_result1 = execute_file_creation_test(client_directio, files_number, empty_files, dir_path_directio, 'direct IO') test_result2 = execute_file_creation_test(client_proxy, files_number, empty_files, dir_path_proxy, 'cluster-proxy') test_result3 = execute_file_creation_test(client_proxy, files_number, empty_files, dir_path_host, 'host system') # removal of entire directory tree can take several minutes, so as to # evade connection timeout while removing everything at once, # rm files one at time instead teardown_after_file_creation_test(client_directio, files_number, dir_path_directio) teardown_after_file_creation_test(client_proxy, files_number, dir_path_proxy) teardown_after_file_creation_test(client_proxy, files_number, dir_path_host) rm(client_directio, dir_path_directio, recursive=True, force=True) rm(client_proxy, dir_path_proxy, recursive=True, force=True) rm(client_proxy, dir_path_host, recursive=True, force=True) return test_result1 + test_result2 + test_result3
def test_dd(self, context, clients, params): size = params['size']['value'] size_unit = params['size']['unit'] block_size = params['block_size']['value'] block_size_unit = params['block_size']['unit'] user_directio = "u1" user_proxy = "u2" client_directio = context.get_client(user_directio, "client-directio") client_proxy = context.get_client(user_proxy, "client-proxy") test_file_directio = mkstemp(client_directio, dir=client_directio.absolute_path("s1")) test_file_proxy = mkstemp(client_proxy, dir=client_proxy.absolute_path("s1")) test_file_host = mkstemp(client_proxy, dir=user_home_dir(user_proxy)) test_result1 = execute_dd_test(client_directio, user_directio, test_file_directio, block_size, block_size_unit, size, size_unit, "direct IO") test_result2 = execute_dd_test(client_proxy, user_proxy, test_file_proxy, block_size, block_size_unit, size, size_unit, "cluster-proxy") test_result3 = execute_dd_test(client_proxy, user_proxy, test_file_host, block_size, block_size_unit, size, size_unit, "host system") rm(client_directio, test_file_directio, recursive=True, force=True) rm(client_proxy, test_file_proxy, recursive=True, force=True) rm(client_proxy, test_file_host, recursive=True, force=True) return test_result1 + test_result2 + test_result3
def test_sysbench(self, context, clients, params): user_directio = "u1" user_proxy = "u2" client_directio = context.get_client(user_directio, "client-directio") client_proxy = context.get_client(user_proxy, "client-proxy") threads_number = params['threads_number']['value'] files_number = params['files_number']['value'] total_size = params['total_size']['value'] mode = params['mode']['value'] dir_path_directio = mkdtemp(client_directio, dir=client_directio.absolute_path("s1")) dir_path_proxy = mkdtemp(client_proxy, dir=client_proxy.absolute_path("s1")) dir_path_host = mkdtemp(client_proxy, dir=user_home_dir(user_proxy)) test_result1 = execute_sysbench_test(client_directio, user_directio, threads_number, total_size, files_number, mode, dir_path_directio, "direct IO") test_result2 = execute_sysbench_test(client_proxy, user_proxy, threads_number, total_size, files_number, mode, dir_path_proxy, "cluster-proxy") test_result3 = execute_sysbench_test(client_proxy, user_proxy, threads_number, total_size, files_number, mode, dir_path_host, "host system") rm(client_directio, dir_path_directio, recursive=True, force=True) rm(client_proxy, dir_path_proxy, recursive=True, force=True) rm(client_proxy, dir_path_host, recursive=True, force=True) return test_result1 + test_result2 + test_result3
def test_concurrent_files_creation(self, context, clients, params): user_directio = "u1" user_proxy = "u2" client_directio = context.get_client(user_directio, 'client-directio') client_proxy = context.get_client(user_proxy, 'client-proxy') files_number = params['files_number']['value'] empty_files = params['empty_files']['value'] threads_num = params['threads_num']['value'] dir_path_directio = mkdtemp(client_directio, dir=client_directio.absolute_path('s1')) dir_path_proxy = mkdtemp(client_proxy, dir=client_proxy.absolute_path('s1')) dir_path_host = mkdtemp(client_proxy, dir=user_home_dir(user_proxy)) test_result1 = _execute_test(client_directio, files_number, empty_files, threads_num, dir_path_directio, 'direct IO') test_result2 = _execute_test(client_proxy, files_number, empty_files, threads_num, dir_path_proxy, 'cluster-proxy') test_result3 = _execute_test(client_proxy, files_number, empty_files, threads_num, dir_path_host, 'host system') # removal of entire directory tree can take several minutes so as to # evade connection timeout while removing everything at once, # rm files one at time instead _teardown_after_test(client_directio, files_number, dir_path_directio) _teardown_after_test(client_proxy, files_number, dir_path_proxy) _teardown_after_test(client_proxy, files_number, dir_path_host) rm(client_directio, dir_path_directio, recursive=True, force=True) rm(client_proxy, dir_path_proxy, recursive=True, force=True) rm(client_proxy, dir_path_host, recursive=True, force=True) return test_result1 + test_result2 + test_result3
def condition(): rm(client, path)
def teardown_after_file_creation_test(client, files_number, dir_path): for i in xrange(files_number): rm(client, os.path.join(dir_path, 'file{}'.format(i)))
def condition(): rm(client, path, recursive=True, force=True)