mirror of
https://github.com/ceph/ceph
synced 2025-03-29 23:09:47 +00:00
qa: move get_valgrind_args to qa
This method is unused in the teuthology repo. The helper method better belongs here where it is more easily modified. Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
parent
38bb60b1e0
commit
3681e3a1a8
@ -21,7 +21,7 @@ import socket
|
||||
import yaml
|
||||
|
||||
from paramiko import SSHException
|
||||
from tasks.ceph_manager import CephManager, write_conf
|
||||
from tasks.ceph_manager import CephManager, write_conf, get_valgrind_args
|
||||
from tarfile import ReadError
|
||||
from tasks.cephfs.filesystem import Filesystem
|
||||
from teuthology import misc as teuthology
|
||||
@ -1385,9 +1385,7 @@ def run_daemon(ctx, config, type_):
|
||||
valgrind_args = config['valgrind'][type_]
|
||||
if role in config['valgrind']:
|
||||
valgrind_args = config['valgrind'][role]
|
||||
run_cmd = teuthology.get_valgrind_args(testdir, role,
|
||||
run_cmd,
|
||||
valgrind_args)
|
||||
run_cmd = get_valgrind_args(testdir, role, run_cmd, valgrind_args)
|
||||
|
||||
run_cmd.extend(run_cmd_tail)
|
||||
log_path = f'/var/log/ceph/{cluster_name}-{type_}.{id_}.log'
|
||||
|
@ -5,7 +5,7 @@ Ceph FUSE client task
|
||||
import contextlib
|
||||
import logging
|
||||
|
||||
from teuthology import misc as teuthology
|
||||
from teuthology import misc
|
||||
from tasks.cephfs.fuse_mount import FuseMount
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
@ -78,7 +78,7 @@ def task(ctx, config):
|
||||
log.info('Running ceph_fuse task...')
|
||||
|
||||
if config is None:
|
||||
ids = teuthology.all_roles_of_type(ctx.cluster, 'client')
|
||||
ids = misc.all_roles_of_type(ctx.cluster, 'client')
|
||||
client_roles = [f'client.{id_}' for id_ in ids]
|
||||
config = dict([r, dict()] for r in client_roles)
|
||||
elif isinstance(config, list):
|
||||
@ -90,8 +90,8 @@ def task(ctx, config):
|
||||
raise ValueError(f"Invalid config object: {config} ({config.__class__})")
|
||||
log.info(f"config is {config}")
|
||||
|
||||
clients = list(teuthology.get_clients(ctx=ctx, roles=client_roles))
|
||||
testdir = teuthology.get_testdir(ctx)
|
||||
clients = list(misc.get_clients(ctx=ctx, roles=client_roles))
|
||||
testdir = misc.get_testdir(ctx)
|
||||
all_mounts = getattr(ctx, 'mounts', {})
|
||||
mounted_by_me = {}
|
||||
skipped = {}
|
||||
@ -113,7 +113,7 @@ def task(ctx, config):
|
||||
client_config[k] = v
|
||||
# mount specific overrides
|
||||
client_config_overrides = overrides.get(entity)
|
||||
teuthology.deep_merge(client_config, client_config_overrides)
|
||||
misc.deep_merge(client_config, client_config_overrides)
|
||||
log.info(f"{entity} config is {client_config}")
|
||||
|
||||
remotes.add(remote)
|
||||
|
@ -68,6 +68,63 @@ def write_conf(ctx, conf_path=DEFAULT_CONF_PATH, cluster='ceph'):
|
||||
teuthology.feed_many_stdins_and_close(conf_fp, writes)
|
||||
run.wait(writes)
|
||||
|
||||
def get_valgrind_args(testdir, name, preamble, v, exit_on_first_error=True):
|
||||
"""
|
||||
Build a command line for running valgrind.
|
||||
|
||||
testdir - test results directory
|
||||
name - name of daemon (for naming hte log file)
|
||||
preamble - stuff we should run before valgrind
|
||||
v - valgrind arguments
|
||||
"""
|
||||
if v is None:
|
||||
return preamble
|
||||
if not isinstance(v, list):
|
||||
v = [v]
|
||||
|
||||
# https://tracker.ceph.com/issues/44362
|
||||
preamble.extend([
|
||||
'env', 'OPENSSL_ia32cap=~0x1000000000000000',
|
||||
])
|
||||
|
||||
val_path = '/var/log/ceph/valgrind'
|
||||
if '--tool=memcheck' in v or '--tool=helgrind' in v:
|
||||
extra_args = [
|
||||
'valgrind',
|
||||
'--trace-children=no',
|
||||
'--child-silent-after-fork=yes',
|
||||
'--soname-synonyms=somalloc=*tcmalloc*',
|
||||
'--num-callers=50',
|
||||
'--suppressions={tdir}/valgrind.supp'.format(tdir=testdir),
|
||||
'--xml=yes',
|
||||
'--xml-file={vdir}/{n}.log'.format(vdir=val_path, n=name),
|
||||
'--time-stamp=yes',
|
||||
'--vgdb=yes',
|
||||
]
|
||||
else:
|
||||
extra_args = [
|
||||
'valgrind',
|
||||
'--trace-children=no',
|
||||
'--child-silent-after-fork=yes',
|
||||
'--soname-synonyms=somalloc=*tcmalloc*',
|
||||
'--suppressions={tdir}/valgrind.supp'.format(tdir=testdir),
|
||||
'--log-file={vdir}/{n}.log'.format(vdir=val_path, n=name),
|
||||
'--time-stamp=yes',
|
||||
'--vgdb=yes',
|
||||
]
|
||||
if exit_on_first_error:
|
||||
extra_args.extend([
|
||||
# at least Valgrind 3.14 is required
|
||||
'--exit-on-first-error=yes',
|
||||
'--error-exitcode=42',
|
||||
])
|
||||
args = [
|
||||
'cd', testdir,
|
||||
run.Raw('&&'),
|
||||
] + preamble + extra_args + v
|
||||
log.debug('running %s under valgrind with args %s', name, args)
|
||||
return args
|
||||
|
||||
|
||||
def mount_osd_data(ctx, remote, cluster, osd):
|
||||
"""
|
||||
|
@ -5,11 +5,11 @@ import logging
|
||||
from io import StringIO
|
||||
from textwrap import dedent
|
||||
|
||||
from teuthology import misc
|
||||
from teuthology.contextutil import MaxWhileTries
|
||||
from teuthology.contextutil import safe_while
|
||||
from teuthology.orchestra import run
|
||||
from teuthology.orchestra.run import CommandFailedError
|
||||
from tasks.ceph_manager import get_valgrind_args
|
||||
from tasks.cephfs.mount import CephFSMount
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
@ -95,13 +95,13 @@ class FuseMount(CephFSMount):
|
||||
|
||||
cwd = self.test_dir
|
||||
if self.client_config.get('valgrind') is not None:
|
||||
run_cmd = misc.get_valgrind_args(
|
||||
run_cmd = get_valgrind_args(
|
||||
self.test_dir,
|
||||
'client.{id}'.format(id=self.client_id),
|
||||
run_cmd,
|
||||
self.client_config.get('valgrind'),
|
||||
)
|
||||
cwd = None # misc.get_valgrind_args chdir for us
|
||||
cwd = None # get_valgrind_args chdir for us
|
||||
|
||||
netns_prefix = ['sudo', 'nsenter',
|
||||
'--net=/var/run/netns/{0}'.format(self.netns_name)]
|
||||
|
@ -8,6 +8,7 @@ from teuthology.orchestra import run
|
||||
from teuthology import misc
|
||||
from teuthology.exceptions import ConfigError
|
||||
from teuthology.task import Task
|
||||
from tasks.ceph_manager import get_valgrind_args
|
||||
from tasks.util import get_remote_for_role
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
@ -42,7 +43,7 @@ class CephFSMirror(Task):
|
||||
]
|
||||
|
||||
if 'valgrind' in self.config:
|
||||
args = misc.get_valgrind_args(
|
||||
args = get_valgrind_args(
|
||||
testdir, 'cephfs-mirror-{id}'.format(id=self.client),
|
||||
args, self.config.get('valgrind'))
|
||||
|
||||
|
@ -7,6 +7,7 @@ import logging
|
||||
from teuthology.exceptions import ConfigError
|
||||
from teuthology.parallel import parallel
|
||||
from teuthology import misc as teuthology
|
||||
from tasks.ceph_manager import get_valgrind_args
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -62,7 +63,7 @@ def _run_one_client(ctx, config, role):
|
||||
teuthology.deep_merge(config, overrides.get('rbd_fsx', {}))
|
||||
|
||||
if config.get('valgrind'):
|
||||
args = teuthology.get_valgrind_args(
|
||||
args = get_valgrind_args(
|
||||
testdir,
|
||||
'fsx_{id}'.format(id=role),
|
||||
args,
|
||||
|
@ -8,6 +8,7 @@ from teuthology.orchestra import run
|
||||
from teuthology import misc
|
||||
from teuthology.exceptions import ConfigError
|
||||
from teuthology.task import Task
|
||||
from tasks.ceph_manager import get_valgrind_args
|
||||
from tasks.util import get_remote_for_role
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
@ -85,7 +86,7 @@ class RBDMirror(Task):
|
||||
]
|
||||
|
||||
if 'valgrind' in self.config:
|
||||
args = misc.get_valgrind_args(
|
||||
args = get_valgrind_args(
|
||||
testdir,
|
||||
'rbd-mirror-{id}'.format(id=self.client),
|
||||
args,
|
||||
|
@ -9,6 +9,7 @@ from teuthology.orchestra import run
|
||||
from teuthology import misc as teuthology
|
||||
from teuthology import contextutil
|
||||
from teuthology.exceptions import ConfigError
|
||||
from tasks.ceph_manager import get_valgrind_args
|
||||
from tasks.util import get_remote_for_role
|
||||
from tasks.util.rgw import rgwadmin, wait_for_radosgw
|
||||
from tasks.util.rados import (create_ec_pool,
|
||||
@ -153,7 +154,7 @@ def start_rgw(ctx, config, clients):
|
||||
])
|
||||
|
||||
if client_config.get('valgrind'):
|
||||
cmd_prefix = teuthology.get_valgrind_args(
|
||||
cmd_prefix = get_valgrind_args(
|
||||
testdir,
|
||||
client_with_cluster,
|
||||
cmd_prefix,
|
||||
|
Loading…
Reference in New Issue
Block a user