Log output from ping command
Today we don't log this information which could be useful to see that
this is actually occurring successfully or failure.
To avoid the ping verbose output, logging is put around the call to
call_until_true. A log message before indicates the attemption of caller
and one after indicates the ping result whether it's as expected.
Change-Id: Ib39ce3d4c9077d04e13cd86973fcb95d878ead3c
Closes-bug: #1373055
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index fd84570..fb80a48 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -494,9 +494,23 @@
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
proc.communicate()
+
return (proc.returncode == 0) == should_succeed
- return tempest.test.call_until_true(ping, timeout, 1)
+ caller = misc_utils.find_test_caller()
+ LOG.debug('%(caller)s begins to ping %(ip)s in %(timeout)s sec and the'
+ ' expected result is %(should_succeed)s' % {
+ 'caller': caller, 'ip': ip_address, 'timeout': timeout,
+ 'should_succeed':
+ 'reachable' if should_succeed else 'unreachable'
+ })
+ result = tempest.test.call_until_true(ping, timeout, 1)
+ LOG.debug('%(caller)s finishes ping %(ip)s in %(timeout)s sec and the '
+ 'ping result is %(result)s' % {
+ 'caller': caller, 'ip': ip_address, 'timeout': timeout,
+ 'result': 'expected' if result else 'unexpected'
+ })
+ return result
def check_vm_connectivity(self, ip_address,
username=None,