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
This commit is contained in:
Eduardo Olivares 2021-03-25 17:00:11 +01:00
parent 29c53bf31c
commit 9664b940de
1 changed files with 3 additions and 0 deletions

View File

@ -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: