Accepting request 1127170 from home:mslacken:branches:network:cluster

- updated to 1.4.3 with following new features:
  * toggle BASH tracing or NHC debugging via SIGUSR1/SIGUSR2, respectively
  * check_nvsmi_healthmon(): New check from CSC for GPU health monitoring via
    nvidia-smi
  * Provide added detail to tracing info (-x mode)
  * Based on feedback from Moe Jette of SchedMD, pull node job data directly
    from Slurm via squeue instead of the previous method that only worked for
    single-node jobs.
  * Support for recent additions to the Slurm node states (e.g., "planned")
  * Pathname expansion has been disabled on startup, and re-enabled only when
    being actively used, to avoid "unintended" expansions of wildcards at
    random points throughout the code.
  * Correct clobbering of BASH built-in variables and add tests to prevent future recurrence
  * Switch "system UID" boundary handling to a more accurate source of truth,
    and ensure that the code matches the math, naming, and intent.
  * Reorder resource manager detection to improve accurate detection,
    especially with respect to Slurm vs. PBS (all variants)

OBS-URL: https://build.opensuse.org/request/show/1127170
OBS-URL: https://build.opensuse.org/package/show/network:cluster/warewulf-nhc?expand=0&rev=8
This commit is contained in:
2023-11-16 19:29:07 +00:00
committed by Git OBS Bridge
parent 14f0c55bf5
commit c2caec2cac
5 changed files with 29 additions and 234 deletions
+21
View File
@@ -1,3 +1,24 @@
-------------------------------------------------------------------
Thu Nov 16 19:22:58 UTC 2023 - Christian Goll <cgoll@suse.com>
- updated to 1.4.3 with following new features:
* toggle BASH tracing or NHC debugging via SIGUSR1/SIGUSR2, respectively
* check_nvsmi_healthmon(): New check from CSC for GPU health monitoring via
nvidia-smi
* Provide added detail to tracing info (-x mode)
* Based on feedback from Moe Jette of SchedMD, pull node job data directly
from Slurm via squeue instead of the previous method that only worked for
single-node jobs.
* Support for recent additions to the Slurm node states (e.g., "planned")
* Pathname expansion has been disabled on startup, and re-enabled only when
being actively used, to avoid "unintended" expansions of wildcards at
random points throughout the code.
* Correct clobbering of BASH built-in variables and add tests to prevent future recurrence
* Switch "system UID" boundary handling to a more accurate source of truth,
and ensure that the code matches the math, naming, and intent.
* Reorder resource manager detection to improve accurate detection,
especially with respect to Slurm vs. PBS (all variants)
-------------------------------------------------------------------
Fri Mar 20 14:30:43 UTC 2020 - Christian Goll <cgoll@suse.com>
+5 -7
View File
@@ -1,7 +1,7 @@
#
# spec file for package warewulf-nhc
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -21,14 +21,13 @@
%{!?nhc_helper_dir:%global nhc_helper_dir %{_libexecdir}/%{sname}}
Name: warewulf-nhc
Version: 1.4.2
Version: 1.4.3
Release: 0
Summary: Warewulf Node Health Check (NHC)
License: BSD-3-Clause
Group: Productivity/Clustering/Computing
URL: http://warewulf.lbl.gov/trac
Source0: https://github.com/mej/nhc/archive/%{version}.tar.gz#./warewulf-nhc-%{version}.tar.gz
Patch0: test-test_lbnl_file.nhc-Put-all-process-substitution.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
BuildRequires: autoconf
@@ -51,7 +50,6 @@ to misconfiguration, hardware failures, etc.
%prep
%setup -q -n %{sname}-%{version}
%autopatch -p1
%build
./autogen.sh
@@ -72,17 +70,17 @@ rm -vr %{buildroot}/%{_localstatedir}/run/nhc
mv %{buildroot}/etc/logrotate.d/%{sname} %{buildroot}/etc/logrotate.d/%{name}
# test fails for factory, will be fixed in next release
%if !0%{?suse_version} > 1500
%if !0%{?suse_version} > 1500
%check
%{__make} test
%endif
%post
%post
%tmpfiles_create %{_tmpfilesdir}/%{name}.conf
%files
%defattr(-, root, root)
%license LICENSE COPYING
%license LICENSE COPYING
%doc nhc.conf contrib/nhc.cron
%dir %{_sysconfdir}/%{sname}/
%dir %{_localstatedir}/lib/%{sname}/
@@ -1,224 +0,0 @@
From 5c678ecf4cc0fe13a8209bea0116ffc300409550 Mon Sep 17 00:00:00 2001
From: Michael Jennings <mej@lanl.gov>
Date: Sat, 27 May 2017 22:13:28 -0600
Subject: [PATCH] test/test_lbnl_file.nhc: Put all process substitutions on
the same lines where they're used.
Some (newer?) versions of BASH don't like creating a process
substitution file on one line and using it on the next while other
(older?) versions seem to handle it just fine. Keeping everything all
on the same line should work everywhere, so let's do that. This
should (hopefully?) fix #31 which appears on both Fedora and Cygwin64
but which I had previously misunderstood.
---
test/test_lbnl_file.nhc | 138 ++++++++++++++--------------------------
1 file changed, 46 insertions(+), 92 deletions(-)
diff --git a/test/test_lbnl_file.nhc b/test/test_lbnl_file.nhc
index 7b90731..33d4be7 100644
--- a/test/test_lbnl_file.nhc
+++ b/test/test_lbnl_file.nhc
@@ -12,154 +12,108 @@ plan $((3+5+5+3+9+6+8+10+22)) "lbnl_file.nhc" && {
# correctly (i.e., <(...) constructs) when debugging (set -x). Skip.
skip $((5+5+3+9+6+8+10))
else
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '/line3/'
+ check_file_contents <(echo "$FILEDATA") '/line3/'
is $? 0 'Single regexp match success'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE 'line1'
+ check_file_contents <(echo "$FILEDATA") 'line1'
is $? 0 'Single glob match success'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '/line1/' '/^line2$/' '/line3/' '/^line4$/' '/line5/' '/^line6$/'
+ check_file_contents <(echo "$FILEDATA") '/line1/' '/^line2$/' '/line3/' '/^line4$/' '/line5/' '/^line6$/'
is $? 0 'Multiple regexp match success'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '*line1*' 'line2' '*line3*' 'line4' '*line5*' 'line6'
+ check_file_contents <(echo "$FILEDATA") '*line1*' 'line2' '*line3*' 'line4' '*line5*' 'line6'
is $? 0 'Multiple glob match success'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '/line1/' '/^line2$/' '*line3*' 'line4' '/line5$/' '/^line6/'
+ check_file_contents <(echo "$FILEDATA") '/line1/' '/^line2$/' '*line3*' 'line4' '/line5$/' '/^line6/'
is $? 0 'Multiple mixed glob/regexp matches success'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '/line7/'
+ check_file_contents <(echo "$FILEDATA") '/line7/'
is $? 1 'Single regexp match failure'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE 'line7'
+ check_file_contents <(echo "$FILEDATA") 'line7'
is $? 1 'Single glob match failure'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '/line7/' '/^line8$/' '/line9/' '/^line10$/' '/line11/' '/^line12$/'
+ check_file_contents <(echo "$FILEDATA") '/line7/' '/^line8$/' '/line9/' '/^line10$/' '/line11/' '/^line12$/'
is $? 1 'Multiple regexp match failure'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '*line7*' 'line8' '*line9*' 'line10' '*line11*' 'line12'
+ check_file_contents <(echo "$FILEDATA") '*line7*' 'line8' '*line9*' 'line10' '*line11*' 'line12'
is $? 1 'Multiple glob match failure'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '/line7/' '/^line8$/' '*line9*' 'line10' '/line11$/' '/^line12/'
+ check_file_contents <(echo "$FILEDATA") '/line7/' '/^line8$/' '*line9*' 'line10' '/line11$/' '/^line12/'
is $? 1 'Multiple mixed glob/regexp matches failure'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '/line1/' '/^line7$/' '*line9*' 'line11'
+ check_file_contents <(echo "$FILEDATA") '/line1/' '/^line7$/' '*line9*' 'line11'
is $? 1 'Multiple matches, 1 success, 3 failures'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '/line7/' '/^line2$/' '*line3*' 'line11'
+ check_file_contents <(echo "$FILEDATA") '/line7/' '/^line2$/' '*line3*' 'line11'
is $? 1 'Multiple matches, 2 successes, 2 failures'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '/line1/' '/^line7$/' '*line3*' 'line4'
+ check_file_contents <(echo "$FILEDATA") '/line1/' '/^line7$/' '*line3*' 'line4'
is $? 1 'Multiple matches, 3 successes, 1 failure'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '!line7'
+ check_file_contents <(echo "$FILEDATA") '!line7'
is $? 0 'Single negated glob match success'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '!line1'
+ check_file_contents <(echo "$FILEDATA") '!line1'
is $? 1 'Single negated glob match failure'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '!/line7/'
+ check_file_contents <(echo "$FILEDATA") '!/line7/'
is $? 0 'Single negated regexp match success'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '!/^line1/'
+ check_file_contents <(echo "$FILEDATA") '!/^line1/'
is $? 1 'Single negated regexp match failure'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '!/line7/' '!/line8/' '!/line9/' '!/line0/'
+ check_file_contents <(echo "$FILEDATA") '!/line7/' '!/line8/' '!/line9/' '!/line0/'
is $? 0 'Multiple negated matches, 4 successes, 0 failures'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '!/line1/' '!/line8/' '!/line9/' '!/line0/'
+ check_file_contents <(echo "$FILEDATA") '!/line1/' '!/line8/' '!/line9/' '!/line0/'
is $? 1 'Multiple negated matches, 3 successes, 1 failures'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '!/line1/' '!/line2/' '!/line9/' '!/line0/'
+ check_file_contents <(echo "$FILEDATA") '!/line1/' '!/line2/' '!/line9/' '!/line0/'
is $? 1 'Multiple negated matches, 2 successes, 2 failures'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '!/line1/' '!/line2/' '!/line3/' '!/line0/'
+ check_file_contents <(echo "$FILEDATA") '!/line1/' '!/line2/' '!/line3/' '!/line0/'
is $? 1 'Multiple negated matches, 1 successes, 3 failures'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '!/line1/' '!/line2/' '!/line3/' '!/line4/'
+ check_file_contents <(echo "$FILEDATA") '!/line1/' '!/line2/' '!/line3/' '!/line4/'
is $? 1 'Multiple negated matches, 0 successes, 4 failures'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '/line1/' '/line2/' '!/line7/' '!/line8/'
+ check_file_contents <(echo "$FILEDATA") '/line1/' '/line2/' '!/line7/' '!/line8/'
is $? 0 '4 matches: 2 positive successes, 0 positive failures, 2 negative successes, 0 negative failures'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '/line1/' '/line7/' '!/line8/' '!/line2/'
+ check_file_contents <(echo "$FILEDATA") '/line1/' '/line7/' '!/line8/' '!/line2/'
is $? 1 '4 matches: 1 positive success, 1 positive failure, 1 negative success, 1 negative failure'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '/line7/' '/line8/' '!/line1/' '!/line2/'
+ check_file_contents <(echo "$FILEDATA") '/line7/' '/line8/' '!/line1/' '!/line2/'
is $? 1 '4 matches: 0 positive successes, 2 positive failures, 0 negative successes, 2 negative failures'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '/line1/' '/line2/' '/line7/' '!/line8/'
+ check_file_contents <(echo "$FILEDATA") '/line1/' '/line2/' '/line7/' '!/line8/'
is $? 1 '4 matches: 2 positive successes, 1 positive failures, 1 negative successes, 0 negative failures'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '/line1/' '/line7/' '!/line8/' '!/line9/'
+ check_file_contents <(echo "$FILEDATA") '/line1/' '/line7/' '!/line8/' '!/line9/'
is $? 1 '4 matches: 1 positive successes, 1 positive failures, 2 negative successes, 0 negative failures'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '/line7/' '/line8/' '!/line9/' '!/line0/'
+ check_file_contents <(echo "$FILEDATA") '/line7/' '/line8/' '!/line9/' '!/line0/'
is $? 1 '4 matches: 0 positive successes, 2 positive failures, 2 negative successes, 0 negative failures'
FILEDATA=$'$pbsserver master.node\n$pbsclient master.node\n$restricted master.node\n\n$usecp *:/global /global\n$usecp *:/clusterfs /clusterfs\n$usecp *:/var/spool/torque /var/spool/torque\n\n$nospool_dir_list *\n$spool_as_final_name true\n\n$node_check_script /usr/sbin/nhc\n$node_check_interval 5,jobstart,jobend\n$down_on_error 1\n$check_poll_time 60\n\n$logevent 255\n$loglevel 3\n'
# Some real-world example checks against an actual TORQUE pbs_mom config
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '/^\$pbsserver master.node$/'
+ check_file_contents <(echo "$FILEDATA") '/^\$pbsserver master.node$/'
is $? 0 'Real world example: Match TORQUE server name against MOM config'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '!/^\$pbsserver[[:space:]]*local/'
+ check_file_contents <(echo "$FILEDATA") '!/^\$pbsserver[[:space:]]*local/'
is $? 0 'Real world example: Forbid localhost in MOM config'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '/^\$spool_as_final_name (true|True|TRUE|1|yes|Yes|YES)$/'
+ check_file_contents <(echo "$FILEDATA") '/^\$spool_as_final_name (true|True|TRUE|1|yes|Yes|YES)$/'
is $? 0 'Real world example: Assert TORQUE configuration setting in MOM config (present)'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '/^\$source_login_batch (true|True|TRUE|1|yes|Yes|YES)$/'
+ check_file_contents <(echo "$FILEDATA") '/^\$source_login_batch (true|True|TRUE|1|yes|Yes|YES)$/'
is $? 1 'Real world example: Assert TORQUE configuration setting in MOM config (missing)'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '$logevent *' '$loglevel *' '$check_poll_time *'
+ check_file_contents <(echo "$FILEDATA") '$logevent *' '$loglevel *' '$check_poll_time *'
is $? 0 'Real world example: Match TORQUE variable names against MOM config (present)'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '$status_update_time *' '$timeout *' '$usecp *'
+ check_file_contents <(echo "$FILEDATA") '$status_update_time *' '$timeout *' '$usecp *'
is $? 1 'Real world example: Match TORQUE variable names against MOM config (missing)'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '!source_login_batch *' '$check_poll_time *' '$usecp *'
+ check_file_contents <(echo "$FILEDATA") '!source_login_batch *' '$check_poll_time *' '$usecp *'
is $? 0 'Real world example: Match TORQUE variable names against MOM config (mixed positive/negative)'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_contents $FILEDATA_FILE '!$pbs*'
+ check_file_contents <(echo "$FILEDATA") '!$pbs*'
is $? 1 'Real world example: Match TORQUE configuration (negated, failed)'
# Check some file attributes of a dynamically-created file
FILEDATA='stuff'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_test -a $FILEDATA_FILE -e $FILEDATA_FILE -r $FILEDATA_FILE
+ FILEDATA_FILE=<(echo "$FILEDATA") check_file_test -a "$FILEDATA_FILE" -e "$FILEDATA_FILE" -r "$FILEDATA_FILE"
is $? 0 'Bash process substitution file exists and is readable.'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_test -a -e -r $FILEDATA_FILE
+ check_file_test -a -e -r <(echo "$FILEDATA")
is $? 0 'Bash process substitution file exists and is readable (single file, multiple operators).'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_test -d $FILEDATA_FILE
+ check_file_test -d <(echo "$FILEDATA")
is $? 1 'Bash process substitution file is not a directory.'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_test -f $FILEDATA_FILE
+ check_file_test -f <(echo "$FILEDATA")
is $? 1 'Bash process substitution file is not a regular file.'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_test -g $FILEDATA_FILE
+ check_file_test -g <(echo "$FILEDATA")
is $? 1 'Bash process substitution file is not setgid.'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_test -k $FILEDATA_FILE
+ check_file_test -k <(echo "$FILEDATA")
is $? 1 'Bash process substitution file is not sticky.'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_test -u $FILEDATA_FILE
+ check_file_test -u <(echo "$FILEDATA")
is $? 1 'Bash process substitution file is not setuid.'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_test -x $FILEDATA_FILE
+ check_file_test -x <(echo "$FILEDATA")
is $? 1 'Bash process substitution file is not executable.'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_test -O $FILEDATA_FILE
+ check_file_test -O <(echo "$FILEDATA")
is $? 0 'Bash process substitution file is owned by uid $EUID.'
- FILEDATA_FILE=<(echo "$FILEDATA")
- check_file_test -G $FILEDATA_FILE
+ check_file_test -G <(echo "$FILEDATA")
is $? 0 'Bash process substitution file is owned by gid of $$.'
fi
--
2.25.0
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3c794cdb540997d033da967e943646b5d5672bbe765728c574e93f32ceac69e1
size 120924
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:97507057d183bd52ee01920892791eb3befb7bd065feb0b38a279c51cd502543
size 128253