[mej/nhc] b69631: lbnl_cmd.nhc: Remove line numbers from dmesg check

0 views
Skip to first unread message

Michael Jennings

unread,
Sep 18, 2023, 8:28:40 PM9/18/23
to nhc-...@lbl.gov
Branch: refs/heads/mej/fix/143-nuke-dmesg-line-numbers
Home: https://github.com/mej/nhc
Commit: b6963181cc2bfc3c9372807ccea363ead83bbf5a
https://github.com/mej/nhc/commit/b6963181cc2bfc3c9372807ccea363ead83bbf5a
Author: Michael Jennings <m...@lanl.gov>
Date: 2023-09-18 (Mon, 18 Sep 2023)

Changed paths:
M scripts/common.nhc
M scripts/lbnl_cmd.nhc
M test/nhc-test
M test/test_common.nhc
M test/test_lbnl_cmd.nhc

Log Message:
-----------
lbnl_cmd.nhc: Remove line numbers from dmesg check

When using `check_cmd_dmesg()` directly (as written in `scripts/lbnl_cmd.nhc`)
with a negated match string, the default behavior of
`check_cmd_output()` (which `check_cmd_dmesg()` wraps) used for error
reporting causes the "Reason" field to contain not only the match
string that was found (and shouldn't have been) but also the **_line
number_** where the match was found. In the case of `dmesg` output,
the line number is almost completely useless; moreover, it prevents
Slurm and other schedulers/RMs from being able to group all the
affected nodes together -- because the line numbers almost always
differ!

Granted that users/admins can override the default failure message
generation behavior (via `-M` entries, all of which are passed
directly to `check_cmd_output()`), but in the specific case of
`check_cmd_dmesg()`, I think the default behavior should suppress the
line numbers and use a simpler, more concise message instead.

This changeset does exactly that by adding a bit of pre-processing to
the command-line arguments passed to `check_cmd_dmesg()` before
passing them on to `check_cmd_output()`. Each match string (`-m`
argument) that doesn't already have a corresponding message (`-M`
argument) to override the default will have a new default provided to
it that omits the extraneous information. In other words, any
`-m`_`mstr`_ that already has a matching `-M`_`message`_ will be
passed on to `check_cmd_output()` exactly as it is; any `-m`_`mstr`_
that _**lacks**_ a corresponding `-M`_`message`_ &mdash; or that has an
**empty** _`message`_ as a placeholder &mdash; will be assigned a new
`-M`_`message`_ that gets passed to `check_cmd_output()` without any
line number or other dynamic information.

Fixes #143.


Michael Jennings

unread,
Sep 20, 2023, 1:39:48 PM9/20/23
to nhc-...@lbl.gov
Branch: refs/heads/dev
Commit: 7d9cec9d2cded054e9db59f778d7d44f3c60c484
https://github.com/mej/nhc/commit/7d9cec9d2cded054e9db59f778d7d44f3c60c484
Author: Michael Jennings <m...@lanl.gov>
Date: 2023-09-20 (Wed, 20 Sep 2023)

Changed paths:
M scripts/common.nhc
M scripts/lbnl_cmd.nhc
M test/nhc-test
M test/test_common.nhc
M test/test_lbnl_cmd.nhc

Log Message:
-----------
Merge pull request #144 from mej/mej/fix/143-nuke-dmesg-line-numbers

lbnl_cmd.nhc: Remove line numbers from dmesg check


Compare: https://github.com/mej/nhc/compare/8b4b5355211e...7d9cec9d2cde
Reply all
Reply to author
Forward
0 new messages