From 9664b940defa2d29cc204fc432d0b10ecadd6b56 Mon Sep 17 00:00:00 2001 From: Eduardo Olivares Date: Thu, 25 Mar 2021 17:00:11 +0100 Subject: [PATCH] Skip ping tests when instance does not support ping command Recently an Ubuntu Minimal instance was added to tobiko and it does not support ping and ping6 commands. That makes some tests fail, but they should be skipped instead Change-Id: I9ff4312fc80503ebc9966347ab2a79a9d91ae321 --- tobiko/shell/ping/_interface.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tobiko/shell/ping/_interface.py b/tobiko/shell/ping/_interface.py index 5aa503079..f1e2751b7 100644 --- a/tobiko/shell/ping/_interface.py +++ b/tobiko/shell/ping/_interface.py @@ -86,6 +86,9 @@ def get_ping_usage(ssh_client): ssh_client=ssh_client) usage = ((result.stdout and str(result.stdout)) or (result.stderr and str(result.stderr)) or "").strip() + if result.exit_status != 0 and 'command not found' in usage.lower(): + raise tobiko.SkipException( + 'ping command not installed on this instance') if usage: LOG.debug('Got ping usage text') else: