Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Bug 1077664: oo-diagnostics: Fix test_node_mco_log when no log #4983

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 12 additions & 6 deletions common/bin/oo-diagnostics
Original file line number Diff line number Diff line change
Expand Up @@ -768,16 +768,22 @@ class OODiag

def test_node_mco_log
skip_test unless @is_node
#
# create a tmp file with all of the unique log statements after most recent mcollective start

logfile = "#{@scl_prefix}mcollective.log"
logfile = [ "/var/log/openshift/node/#{logfile}", "/var/log/#{logfile}" ].find {|f| File.exist? f}
if logfile.nil? || logfile.empty?
verbose 'No node mcollective log file found.'
skip_test
end

# Create a tmp file with all of the unique log statements after most recent mcollective start.
tmpfile = Tempfile.new("oodiag-mco-#{$$}").path
system %Q! sed -n 'H; /INFO.*The Marionette Collective.*started logging/h; ${g;p;}' #{logfile} | sed 's|^\w, \[[^]]*\]||' | sort -u > #{tmpfile} !
# if no restart seen, just use the whole thing

# If no restart seen, just use the whole thing.
system %Q! sort -u /var/log/#{@scl_prefix}mcollective.log > #{tmpfile} ! unless File.exists? tmpfile
return unless File.exists? tmpfile
#

# Look for the mco timeout warning
out = `grep 'WARN.*created at [0-9]* is [0-9]* seconds old, TTL is' #{tmpfile}`
unless out.empty?
Expand All @@ -796,8 +802,8 @@ class OODiag
TIMEOUT
do_fail errors
end
#
# clean up temp file

# Clean up temp file.
system "rm #{tmpfile}"
end

Expand Down