From effee7ffc6a67e9bfa5ef4cb4560511c8eb91a8a Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Thu, 30 Jun 2011 15:53:42 -0700 Subject: [PATCH] Make kernel a separate entity outside of tasks. It is run before anything other than checking for conflicts. This way it can't step on the connections used by other tasks, or clobber test files in /tmp when rebooting. --- teuthology/run.py | 22 ++++++++++++------ teuthology/task/kernel.py | 47 +++++++++++++++++++-------------------- 2 files changed, 38 insertions(+), 31 deletions(-) diff --git a/teuthology/run.py b/teuthology/run.py index 0d90c67d48539..ee9e6fd1d8479 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -110,13 +110,21 @@ def main(): if ctx.description is not None: ctx.summary['description'] = ctx.description - ctx.config['tasks'][:0] = [ - {'internal.check_conflict': None}, - {'internal.base': None}, - {'internal.archive': None}, - {'internal.coredump': None}, - {'internal.syslog': None}, - ] + for task in ctx.config['tasks']: + assert 'kernel' not in task, \ + 'kernel installation shouldn be a base-level item, not part of the tasks list' + + init_tasks = [{'internal.check_conflict': None}] + if 'kernel' in ctx.config: + init_tasks.append({'kernel': ctx.config['kernel']}) + init_tasks.extend([ + {'internal.base': None}, + {'internal.archive': None}, + {'internal.coredump': None}, + {'internal.syslog': None}, + ]) + + ctx.config['tasks'][:0] = init_tasks from teuthology.run_tasks import run_tasks try: diff --git a/teuthology/task/kernel.py b/teuthology/task/kernel.py index a6018404b9735..27ac2696632ac 100644 --- a/teuthology/task/kernel.py +++ b/teuthology/task/kernel.py @@ -109,17 +109,17 @@ def install(ctx, config): 'wget', '-nv', '-O', - '/tmp/cephtest/linux-image.deb', - '--base={url}'.format(url=str(deb_url)), + '/tmp/linux-image.deb', + '--base={url}'.format(url=deb_url), '--input-file=-', run.Raw('&&'), 'sudo', 'dpkg', '-i', - '/tmp/cephtest/linux-image.deb', + '/tmp/linux-image.deb', run.Raw('&&'), 'rm', - '/tmp/cephtest/linux-image.deb', + '/tmp/linux-image.deb', ], ) @@ -165,42 +165,41 @@ def task(ctx, config): To install the kernel from the master branch on all hosts:: + kernel: tasks: - - kernel: - ceph: To wait 5 minutes for hosts to reboot:: + kernel: + timeout: 300 tasks: - - kernel: - timeout: 300 - ceph: To specify different kernels for each client:: + kernel: + client.0: + branch: foo + client.1: + tag: v3.0rc1 + client.2: + sha1: db3540522e955c1ebb391f4f5324dff4f20ecd09 tasks: - - kernel: - client.0: - branch: foo - client.1: - tag: v3.0rc1 - client.2: - sha1: db3540522e955c1ebb391f4f5324dff4f20ecd09 - ceph: You can specify a branch, tag, or sha1 for all roles of a certain type (more specific roles override this):: - tasks: - - kernel: - client: - tag: v3.0 - osd: - branch: btrfs_fixes - client.1: - branch: more_specific_branch - osd.3: - branch: master + kernel: + client: + tag: v3.0 + osd: + branch: btrfs_fixes + client.1: + branch: more_specific_branch + osd.3: + branch: master """ assert config is None or isinstance(config, dict), \ "task kernel only supports a dictionary for configuration" -- 2.39.5