mirror of
https://github.com/ceph/ceph
synced 2025-04-27 05:08:37 +00:00
Thrashosds: Turn off output when doing dump_ops testing
Needed to add stdout option to pass down to run() Signed-off-by: David Zafman <dzafman@redhat.com>
This commit is contained in:
parent
a2c2c83220
commit
d762fa563e
@ -22,6 +22,10 @@ from teuthology.orchestra.remote import Remote
|
|||||||
from teuthology.orchestra import run
|
from teuthology.orchestra import run
|
||||||
from teuthology.exceptions import CommandFailedError
|
from teuthology.exceptions import CommandFailedError
|
||||||
|
|
||||||
|
try:
|
||||||
|
from subprocess import DEVNULL # py3k
|
||||||
|
except ImportError:
|
||||||
|
DEVNULL = open(os.devnull, 'r+')
|
||||||
|
|
||||||
DEFAULT_CONF_PATH = '/etc/ceph/ceph.conf'
|
DEFAULT_CONF_PATH = '/etc/ceph/ceph.conf'
|
||||||
|
|
||||||
@ -727,11 +731,11 @@ class Thrasher:
|
|||||||
for osd in self.live_osds:
|
for osd in self.live_osds:
|
||||||
# Ignore errors because live_osds is in flux
|
# Ignore errors because live_osds is in flux
|
||||||
self.ceph_manager.osd_admin_socket(osd, command=['dump_ops_in_flight'],
|
self.ceph_manager.osd_admin_socket(osd, command=['dump_ops_in_flight'],
|
||||||
check_status=False, timeout=30)
|
check_status=False, timeout=30, stdout=DEVNULL)
|
||||||
self.ceph_manager.osd_admin_socket(osd, command=['dump_blocked_ops'],
|
self.ceph_manager.osd_admin_socket(osd, command=['dump_blocked_ops'],
|
||||||
check_status=False, timeout=30)
|
check_status=False, timeout=30, stdout=DEVNULL)
|
||||||
self.ceph_manager.osd_admin_socket(osd, command=['dump_historic_ops'],
|
self.ceph_manager.osd_admin_socket(osd, command=['dump_historic_ops'],
|
||||||
check_status=False, timeout=30)
|
check_status=False, timeout=30, stdout=DEVNULL)
|
||||||
gevent.sleep(0)
|
gevent.sleep(0)
|
||||||
|
|
||||||
@log_exc
|
@log_exc
|
||||||
@ -844,14 +848,14 @@ class ObjectStoreTool:
|
|||||||
lines.append(cmd)
|
lines.append(cmd)
|
||||||
return "\n".join(lines)
|
return "\n".join(lines)
|
||||||
|
|
||||||
def run(self, options, args, stdin=None):
|
def run(self, options, args, stdin=None, stdout=StringIO()):
|
||||||
self.manager.kill_osd(self.osd)
|
self.manager.kill_osd(self.osd)
|
||||||
cmd = self.build_cmd(options, args, stdin)
|
cmd = self.build_cmd(options, args, stdin)
|
||||||
self.manager.log(cmd)
|
self.manager.log(cmd)
|
||||||
try:
|
try:
|
||||||
proc = self.remote.run(args=['bash', '-e', '-x', '-c', cmd],
|
proc = self.remote.run(args=['bash', '-e', '-x', '-c', cmd],
|
||||||
check_status=False,
|
check_status=False,
|
||||||
stdout=StringIO(),
|
stdout=stdout,
|
||||||
stderr=StringIO())
|
stderr=StringIO())
|
||||||
proc.wait()
|
proc.wait()
|
||||||
if proc.exitstatus != 0:
|
if proc.exitstatus != 0:
|
||||||
@ -1051,8 +1055,8 @@ class CephManager:
|
|||||||
check_status=False
|
check_status=False
|
||||||
).exitstatus
|
).exitstatus
|
||||||
|
|
||||||
def osd_admin_socket(self, osd_id, command, check_status=True, timeout=0):
|
def osd_admin_socket(self, osd_id, command, check_status=True, timeout=0, stdout=StringIO()):
|
||||||
return self.admin_socket('osd', osd_id, command, check_status, timeout)
|
return self.admin_socket('osd', osd_id, command, check_status, timeout, stdout)
|
||||||
|
|
||||||
def find_remote(self, service_type, service_id):
|
def find_remote(self, service_type, service_id):
|
||||||
"""
|
"""
|
||||||
@ -1068,7 +1072,7 @@ class CephManager:
|
|||||||
service_type, service_id)
|
service_type, service_id)
|
||||||
|
|
||||||
def admin_socket(self, service_type, service_id,
|
def admin_socket(self, service_type, service_id,
|
||||||
command, check_status=True, timeout=0):
|
command, check_status=True, timeout=0, stdout=StringIO()):
|
||||||
"""
|
"""
|
||||||
Remotely start up ceph specifying the admin socket
|
Remotely start up ceph specifying the admin socket
|
||||||
:param command: a list of words to use as the command
|
:param command: a list of words to use as the command
|
||||||
@ -1095,7 +1099,7 @@ class CephManager:
|
|||||||
args.extend(command)
|
args.extend(command)
|
||||||
return remote.run(
|
return remote.run(
|
||||||
args=args,
|
args=args,
|
||||||
stdout=StringIO(),
|
stdout=stdout,
|
||||||
wait=True,
|
wait=True,
|
||||||
check_status=check_status
|
check_status=check_status
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user