]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
task.clock: Skip containerized testnodes
authorZack Cerza <zack@redhat.com>
Tue, 25 Jan 2022 18:20:56 +0000 (11:20 -0700)
committerZack Cerza <zack@redhat.com>
Thu, 17 Mar 2022 23:07:38 +0000 (17:07 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/task/clock.py

index a3f3ecde5412c4527b19348121674785849d7061..a6ea1f91c3dbbe620efcbc78190e57a92058972e 100644 (file)
@@ -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',