From 397918435be3fdeaf3318f4bcede196cd15bead2 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Fri, 15 Sep 2017 16:08:25 -0700 Subject: [PATCH] Fix docker error handling for cs/vcenter tests. --- test/runner/lib/cloud/cs.py | 10 ++++++++-- test/runner/lib/cloud/vcenter.py | 13 ++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/test/runner/lib/cloud/cs.py b/test/runner/lib/cloud/cs.py index 5f6950b42c..14b7b484a7 100644 --- a/test/runner/lib/cloud/cs.py +++ b/test/runner/lib/cloud/cs.py @@ -66,12 +66,18 @@ class CsCloudProvider(CloudProvider): if os.path.isfile(self.config_static_path): return - docker = find_executable('docker') + docker = find_executable('docker', required=False) if docker: return - super(CsCloudProvider, self).filter(targets, exclude) + skip = 'cloud/%s/' % self.platform + skipped = [target.name for target in targets if skip in target.aliases] + + if skipped: + exclude.append(skip) + display.warning('Excluding tests marked "%s" which require the "docker" command or config (see "%s"): %s' + % (skip.rstrip('/'), self.config_template_path, ', '.join(skipped))) def setup(self): """Setup the cloud resource before delegation and register a cleanup callback.""" diff --git a/test/runner/lib/cloud/vcenter.py b/test/runner/lib/cloud/vcenter.py index cd312b9859..43fb4f2bf0 100644 --- a/test/runner/lib/cloud/vcenter.py +++ b/test/runner/lib/cloud/vcenter.py @@ -47,15 +47,18 @@ class VcenterProvider(CloudProvider): :type targets: tuple[TestTarget] :type exclude: list[str] """ - if os.path.isfile(self.config_static_path): - return - - docker = find_executable('docker') + docker = find_executable('docker', required=False) if docker: return - super(VcenterProvider, self).filter(targets, exclude) + skip = 'cloud/%s/' % self.platform + skipped = [target.name for target in targets if skip in target.aliases] + + if skipped: + exclude.append(skip) + display.warning('Excluding tests marked "%s" which require the "docker" command: %s' + % (skip.rstrip('/'), ', '.join(skipped))) def setup(self): """Setup the cloud resource before delegation and register a cleanup callback."""