def benchmark_pre (tid, test_cfg, bench_cfg, session) : if not 'job_service_url' in test_cfg : raise saga.NoSuccess ('no job service URL configured') if not 'load' in bench_cfg : raise saga.NoSuccess ('no benchmark load configured') host = saga.Url(test_cfg['job_service_url']).host n_j = int(bench_cfg['iterations']) load = int(bench_cfg['load']) exe = '/bin/sleep' ssh = subprocess ("ssh %s" % host, stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.STDOUT) # find the ssh prompt stdin = ssh.communicate[0] stdout = ssh.communicate[1] while <stdin> ~! /'>$'/io : time.sleep (0.1) # setup is done return {'ssh' : ssh, 'cmd' : "%s %s" % (executable, load)}
def benchmark_pre (tid, app_cfg, bench_cfg) : if not 'saga.tests' in app_cfg : raise saga.NoSuccess ('no tests configured') if not 'job_service_url' in app_cfg['saga.tests'] : raise saga.NoSuccess ('no job service URL configured') host = str(app_cfg['saga.tests']['job_service_url']) app_cfg['host'] = host
def benchmark_pre(tid, test_cfg, bench_cfg, session): if not 'job_service_url' in test_cfg: raise saga.NoSuccess('no job service URL configured') if not 'load' in bench_cfg: raise saga.NoSuccess('no benchmark load configured') host = test_cfg['job_service_url'] n_j = int(bench_cfg['iterations']) load = int(bench_cfg['load']) js = saga.job.Service(host, session=session) jd = saga.job.Description() jd.executable = '/bin/sleep' jd.arguments = [load] return {'js': js, 'jd': jd}
def benchmark_pre (tid, app_cfg, bench_cfg) : if not 'saga.tests' in app_cfg : raise saga.NoSuccess ('no tests configured') if not 'job_service_url' in app_cfg['saga.tests'] : raise saga.NoSuccess ('no job service URL configured') if not 'load' in bench_cfg : raise saga.NoSuccess ('no test load configured') host = str(app_cfg['saga.tests']['job_service_url']) load = int(bench_cfg['load']) js = saga.job.Service (host) jd = saga.job.Description() jd.executable = '/bin/sleep' jd.arguments = [load] app_cfg['js'] = js app_cfg['jd'] = jd
def benchmark_pre(test_cfg, bench_cfg, session): if not 'job_service_url' in test_cfg: saga.NoSuccess('no job service URL configured') return {'host': test_cfg['job_service_url'], 'session': session}