fstype=fstype))
# it shouldn't have exited yet; exposes some trivial problems
- assert not fuse.exitstatus.ready()
+ assert not fuse.poll()
time.sleep(5)
log.info('ceph-fuse is mounted on %s', mountpoint)
for name, proc in nodes.iteritems():
log.info('Waiting for %s to finish shutdowns...', name)
- proc.exitstatus.get()
+ proc.wait()
def find_kernel_mounts(ctx):
kernel_mounts = list()
for remote, proc in nodes.iteritems():
try:
- proc.exitstatus.get()
+ proc.wait()
log.debug('kernel mount exists on %s', remote.name)
kernel_mounts.append(remote)
except run.CommandFailedError: # no mounts!
nodes[remote] = proc
for remote, proc in nodes:
- proc.exitstatus.get()
+ proc.wait()
def remove_osd_mounts(ctx):
# we just ignore these procs because reboot -f doesn't actually
# send anything back to the ssh client!
# for remote, proc in nodes.iteritems():
- # proc.exitstatus.get()
+ # proc.wait()
if remotes:
log.info('waiting for nodes to reboot')
time.sleep(8) # if we try and reconnect too quickly, it succeeds!
for name, proc in nodes.iteritems():
log.info('Waiting for %s to restart syslog...', name)
- proc.exitstatus.get()
+ proc.wait()
def dpkg_configure(ctx):
log.info(
'Waiting for %s to dpkg --configure -a and apt-get -f install...',
name)
- proc.exitstatus.get()
+ proc.wait()
def remove_installed_packages(ctx):
for name, proc in nodes.iteritems():
log.info('Waiting for %s to clear filesystem...', name)
- proc.exitstatus.get()
+ proc.wait()
def synch_clocks(remotes):
nodes[remote.name] = proc
for name, proc in nodes.iteritems():
log.info('Waiting for clock to synchronize on %s...', name)
- proc.exitstatus.get()
+ proc.wait()
def main(ctx):
valgrind_exception = None
for (proc, remote) in lookup_procs:
- proc.exitstatus.get()
+ proc.wait()
out = proc.stdout.getvalue()
for line in out.split('\n'):
if line == '':
],
wait=False,
check_status=False)
- result = proc.exitstatus.get();
-
+ result = proc.wait()
+
if result != 0:
remote.run(
args=[
remote.run(args=[
'rm', '-rf', '--', dir
])
-
+
"""
from cStringIO import StringIO
import contextlib
-import gevent
import logging
import os
import time
)
failed = False
for proc in processes:
- assert isinstance(proc.exitstatus, gevent.event.AsyncResult)
try:
- proc.exitstatus.get()
+ proc.wait()
except run.CommandFailedError:
log.error('Host %s has stale /var/lib/ceph, check lock and nuke/cleanup.', proc.remote.shortname)
failed = True
)
failed = False
for proc in processes:
- assert isinstance(proc.exitstatus, gevent.event.AsyncResult)
try:
- proc.exitstatus.get()
+ proc.wait()
except run.CommandFailedError:
log.error('Host %s has stale test directory %s, check lock and cleanup.', proc.remote.shortname, testdir)
failed = True
r = remote.run(args=['test', '-e', '/ceph-qa-ready',],
stdout=StringIO(),
check_status=False,)
- if r.exitstatus != 0:
+ if r.returncode != 0:
p1 = subprocess.Popen(['cat', editinfo], stdout=subprocess.PIPE)
p2 = subprocess.Popen(['ssh', '-t', '-t', str(remote), 'sudo', 'sh'], stdin=p1.stdout, stdout=subprocess.PIPE)
_, err = p2.communicate()
Currently this only returns armv7l on the quantal distro or x86_64
on the precise distro
-
+
:param ctx: Context
:returns: arch,distro
"""
for name, proc in procs.iteritems():
log.debug('Waiting for download/copy to %s to complete...', name)
- proc.exitstatus.get()
+ proc.wait()
def _no_grub_link(in_file, remote, kernel_ver):
(as is the case in Arm kernels)
:param infile: kernel file or image file to be copied.
- :param remote: remote machine
+ :param remote: remote machine
:param kernel_ver: kernel version
"""
boot1 = '/boot/%s' % in_file
for name, proc in procs.iteritems():
log.debug('Waiting for install on %s to complete...', name)
- proc.exitstatus.get()
+ proc.wait()
def enable_disable_kdb(ctx, config):
"""
{client: client.1, lockfile: testfile, holdtime: 5},
{client: client.2, lockfile: testfile, holdtime: 5, maxwait: 1, expectfail: True}]
-
+
In the past this test would have failed; there was a bug where waitlocks weren't
cleaned up if the process failed. More involved scenarios are also possible.
try:
assert isinstance(config, list), \
"task lockfile got invalid config"
-
+
log.info("building executable on each host")
buildprocs = list()
# build the locker executable on each client
badconfig = True
if badconfig:
raise KeyError("bad config {op_}".format(op_=op))
-
+
testdir = teuthology.get_testdir(ctx)
clients = set(clients)
files = set(files)
log.info("got a client remote")
(_, _, client_id) = client.partition('.')
filepath = os.path.join(testdir, 'mnt.{id}'.format(id=client_id), op["lockfile"])
-
+
proc = client_remote.run(
args=[
'mkdir', '-p', '{tdir}/archive/lockfile'.format(tdir=testdir),
],
logger=log.getChild('lockfile_client.{id}'.format(id=client_id)),
wait=False
- )
+ )
log.info('building sclockandhold on client{id}'.format(id=client_id))
buildprocs.append(proc)
-
+
# wait for builds to finish
run.wait(buildprocs)
log.info('finished building sclockandhold on all clients')
-
+
# create the files to run these locks on
client = clients.pop()
clients.add(client)
lock_procs.append((greenlet, op))
time.sleep(0.1) # to provide proper ordering
#for op in config
-
+
for (greenlet, op) in lock_procs:
log.debug('checking lock for op {op_}'.format(op_=op))
result = greenlet.get()
stdin=run.PIPE,
check_status=False
)
- result = proc.exitstatus.get()
+ result = proc.wait()
except gevent.Timeout as tout:
if tout is not timeout:
raise
)
log.info('built locktest on each client')
-
+
host.run(args=['sudo', 'touch',
'{mnt}/locktestfile'.format(mnt=hostmnt),
run.Raw('&&'),
logger=log.getChild('locktest.client'),
wait=False
)
-
- hostresult = hostproc.exitstatus.get()
- clientresult = clientproc.exitstatus.get()
+
+ hostresult = hostproc.wait()
+ clientresult = clientproc.wait()
if (hostresult != 0) or (clientresult != 0):
raise Exception("Did not pass locking test!")
log.info('finished locktest executable with results {r} and {s}'. \
'thrashosds task only accepts a dict for configuration'
first_mon = teuthology.get_first_mon(ctx, config)
(mon,) = ctx.cluster.only(first_mon).remotes.iterkeys()
-
+
num_osds = teuthology.num_instances_of_type(ctx.cluster, 'osd')
log.info('num_osds is %s' % num_osds)
- assert num_osds == 3
+ assert num_osds == 3
manager = ceph_manager.CephManager(
mon,
# write some data
p = rados_start(ctx, mon, ['-p', 'rbd', 'bench', '15', 'write', '-b', '4096',
'--no-cleanup'])
- err = p.exitstatus.get();
+ err = p.wait()
log.info('err is %d' % err)
# mark osd.0 out to trigger a rebalance/backfill
manager.revive_osd(1)
# wait for our writes to complete + succeed
- err = p.exitstatus.get()
+ err = p.wait()
log.info('err is %d' % err)
# cluster must recover
time.sleep(sleep_time)
proc.stdin.close() # causes daemon-helper send SIGKILL to ceph -w
- proc.exitstatus.get()
+ proc.wait()
lines = proc.stdout.getvalue().split('\n')
time.sleep(sleep_time)
proc.stdin.close() # causes daemon-helper send SIGKILL to ceph -w
- proc.exitstatus.get()
+ proc.wait()
lines = proc.stdout.getvalue().split('\n')
time.sleep(sleep_time)
proc.stdin.close() # causes daemon-helper send SIGKILL to ceph -w
- proc.exitstatus.get()
+ proc.wait()
lines = proc.stdout.getvalue().split('\n')
time.sleep(sleep_time)
proc.stdin.close() # causes daemon-helper send SIGKILL to ceph -w
- proc.exitstatus.get()
+ proc.wait()
lines = proc.stdout.getvalue().split('\n')
time.sleep(sleep_time)
proc.stdin.close() # causes daemon-helper send SIGKILL to ceph -w
- proc.exitstatus.get()
+ proc.wait()
lines = proc.stdout.getvalue().split('\n')
testdir = teuthology.get_testdir(ctx)
first_mon = teuthology.get_first_mon(ctx, config)
(mon,) = ctx.cluster.only(first_mon).remotes.iterkeys()
-
+
num_osds = teuthology.num_instances_of_type(ctx.cluster, 'osd')
log.info('num_osds is %s' % num_osds)
- assert num_osds == 3
+ assert num_osds == 3
manager = ceph_manager.CephManager(
mon,
manager.revive_osd(1)
# wait for our writes to complete + succeed
- err = p.exitstatus.get()
+ err = p.wait()
log.info('err is %d' % err)
# cluster must repeer
# write some more (make sure osd.2 really is divergent)
p = rados_start(testdir, mon, ['-p', 'rbd', 'bench', '15', 'write', '-b', '4096'])
- p.exitstatus.get();
+ p.wait()
# revive divergent osd
manager.revive_osd(2)
p = rados_start(testdir, mon,
['-p', 'rbd', 'bench', '60', 'write', '-b', '1',
'--no-cleanup'])
- p.exitstatus.get()
+ p.wait()
# few objects in metadata pool (with pg log, normal recovery)
for f in range(1, 20):
p = rados_start(testdir, mon, ['-p', 'metadata', 'put',
'foo.%d' % f, '/etc/passwd'])
- p.exitstatus.get()
+ p.wait()
# move it back
manager.raw_cluster_cmd('osd', 'in', '0', '1')
nodes[remote.name] = proc
for name, proc in nodes.iteritems():
"""Wait for each process to finish before yielding and allowing other contextmanagers to run."""
- proc.exitstatus.get()
+ proc.wait()
yield
@contextlib.contextmanager
assert(False), "task parallel_example only supports a list or dictionary for configuration"
if config is None:
config = ['client.{id}'.format(id=id_)
- for id_ in teuthology.all_roles_of_type(ctx.cluster, 'client')]
+ for id_ in teuthology.all_roles_of_type(ctx.cluster, 'client')]
if isinstance(config, list):
config = dict.fromkeys(config)
clients = config.keys()
for client, proc in procs:
log.info("shutting down sync agent on %s", client)
proc.stdin.close()
- proc.exitstatus.get()
+ proc.wait()
finally:
for client, proc in procs:
ctx.cluster.only(client).run(
proc.stdin.writelines(['restarted\n'])
proc.stdin.flush()
try:
- proc.exitstatus.get()
+ proc.wait()
except tor.CommandFailedError:
raise Exception('restart task got non-zero exit status from script: {s}'.format(s=c))
finally: