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

Conversation

Miciah
Copy link
Contributor

@Miciah Miciah commented Mar 18, 2014

oo-diagnostics: Fix test_node_mco_log when no log

Make test_node_mco_log fail gracefully when the node mcollective log file is absent. Before this commit, the test would hang because it would run a sed command with no input file provided.

This commit fixes bug 1077664.

oo-diagnostics: Fix comments for test_node_mco_log

Place comments with relevant code, consistently use proper case and punctuation, and use whitespace for better logical grouping.

Make test_node_mco_log fail gracefully when the node mcollective log file
is absent.  Before this commit, the test would hang because it would run
a sed command with no input file provided.

This commit fixes bug 1077664.
@Miciah
Copy link
Contributor Author

Miciah commented Mar 18, 2014

[test]

@openshift-bot
Copy link

logfile = "#{@scl_prefix}mcollective.log"
logfile = [ "/var/log/openshift/node/#{logfile}", "/var/log/#{logfile}" ].find {|f| File.exist? f}
if logfile.nil? || logfile.empty?
do_fail <<-"FAIL"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FAIL seems a little strong if it's just that the log file isn't where expected. And with the logging changes coming, this will probably be a common occurrence.

Is the non-existence of the log file actually indicative of a problem? Otherwise this would be a WARN at best, maybe just a "verbose".

@openshift-bot
Copy link

Origin Test Results: FAILURE (https://originci-openshift.rhcloud.com/job/test_pull_requests/2280/)

Place comments with relevant code, consistently use proper case and
punctuation, and use whitespace for better logical grouping.
@Miciah
Copy link
Contributor Author

Miciah commented May 2, 2014

Updated to use verbose and skip_test instead of using do_fail and skip_test.

[test]

@Miciah
Copy link
Contributor Author

Miciah commented May 3, 2014

@sosiouxme, does it look good?

@sosiouxme
Copy link
Member

@Miciah yes, looks good. Just one thought. Would it make more sense to FAIL when this file is missing? I can't think of a case when a working node would be missing this file.

@Miciah
Copy link
Contributor Author

Miciah commented May 12, 2014

@sosiouxme, you mentioned before that the file might not exist if logs are going to syslog (and syslog is not configured to put them in that file).

@sosiouxme
Copy link
Member

You are right. I am scatterbrained. I see no reason not to [merge] then.

@openshift-bot
Copy link

Online Merge Results: SUCCESS (https://ci.dev.openshift.redhat.com/jenkins/job/merge_pull_requests/5423/) (Image: devenv_4787)

@openshift-bot
Copy link

Evaluated for online up to 6a917ca

@openshift-bot
Copy link

Evaluated for origin up to 6a917ca

openshift-bot pushed a commit that referenced this pull request May 14, 2014
…node_mco_log-fixes

Merged by openshift-bot
@openshift-bot openshift-bot merged commit 5082c67 into openshift:master May 14, 2014
@Miciah
Copy link
Contributor Author

Miciah commented May 14, 2014

Spiffin'. Thanks!

Looks like Origin tests failed because of ssh timeouts setting up the environment, unrelated to this PR, so I'm hoping merges are not gated by Origin tests at present.

@Miciah
Copy link
Contributor Author

Miciah commented May 14, 2014

And right as I say that, it gets merged. All right then.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants