From: Zack Cerza Date: Tue, 25 Jan 2022 18:20:56 +0000 (-0700) Subject: task.clock: Skip containerized testnodes X-Git-Tag: 1.2.0~194^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d64af200c8ac727a5c8f02f7e1dc8c3d6f5aee6f;p=teuthology.git task.clock: Skip containerized testnodes Signed-off-by: Zack Cerza --- diff --git a/teuthology/task/clock.py b/teuthology/task/clock.py index a3f3ecde..a6ea1f91 100644 --- a/teuthology/task/clock.py +++ b/teuthology/task/clock.py @@ -8,6 +8,13 @@ from teuthology.orchestra import run log = logging.getLogger(__name__) +def filter_out_containers(cluster): + """ + Returns a cluster that excludes remotes which should skip this task. + Currently, only skips containerized remotes. + """ + return cluster.filter(lambda r: not r.is_container) + @contextlib.contextmanager def task(ctx, config): """ @@ -30,9 +37,9 @@ def task(ctx, config): """ log.info('Syncing clocks and checking initial clock skew...') - + cluster = filter_out_containers()(ctx.cluster) run.wait( - ctx.cluster.run( + cluster.run( args = [ 'sudo', 'systemctl', 'stop', 'ntp.service', run.Raw('||'), 'sudo', 'systemctl', 'stop', 'ntpd.service', run.Raw('||'), @@ -60,8 +67,9 @@ def task(ctx, config): finally: log.info('Checking final clock skew...') + cluster = filter_out_containers(ctx.cluster) run.wait( - ctx.cluster.run( + cluster.run( args=[ 'PATH=/usr/bin:/usr/sbin', 'ntpq', '-p', run.Raw('||'), 'PATH=/usr/bin:/usr/sbin', 'chronyc', 'sources', @@ -82,8 +90,9 @@ def check(ctx, config): :param config: Configuration """ log.info('Checking initial clock skew...') + cluster = filter_out_containers(ctx.cluster) run.wait( - ctx.cluster.run( + cluster.run( args=[ 'PATH=/usr/bin:/usr/sbin', 'ntpq', '-p', run.Raw('||'), 'PATH=/usr/bin:/usr/sbin', 'chronyc', 'sources', @@ -99,8 +108,9 @@ def check(ctx, config): finally: log.info('Checking final clock skew...') + cluster = filter_out_containers(ctx.cluster) run.wait( - ctx.cluster.run( + cluster.run( args=[ 'PATH=/usr/bin:/usr/sbin', 'ntpq', '-p', run.Raw('||'), 'PATH=/usr/bin:/usr/sbin', 'chronyc', 'sources',