task.clock: Skip containerized testnodes
@@ -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',
