Skip to content

Commit

Permalink
Merge pull request networkupstools#139 from jimklimov/FTY-remerge-202…
Browse files Browse the repository at this point in the history
…10922
  • Loading branch information
jimklimov committed Oct 8, 2021
2 parents e35a4ea + e17284e commit 41b3db1
Show file tree
Hide file tree
Showing 23 changed files with 599 additions and 450 deletions.
156 changes: 144 additions & 12 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,19 @@ pipeline {
stage ('compile') {
steps {
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; make -k -j4 all || make all'
sh 'echo "Are GitIgnores good after make? (should have no output below)"; git status -s || if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; git diff; exit 1; fi'
sh """ set +x
echo "Are GitIgnores good after make? (should have no output below)"
OUT="`git status -s`" && [ -z "\$OUT" ] \\
|| { echo "\$OUT" >&2
if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then
echo "WARNING GitIgnore tests found newly changed or untracked files:" >&2
exit 0
else
echo "FAILED GitIgnore tests" >&2
git diff >&2
exit 1
fi
}"""
script {
if ( (params.DO_TEST_CHECK && params.DO_TEST_MEMCHECK) || (params.DO_TEST_CHECK && params.DO_TEST_DISTCHECK) || (params.DO_TEST_MEMCHECK && params.DO_TEST_DISTCHECK) ||
(params.DO_TEST_INSTALL && params.DO_TEST_MEMCHECK) || (params.DO_TEST_INSTALL && params.DO_TEST_DISTCHECK) || (params.DO_TEST_INSTALL && params.DO_TEST_CHECK)
Expand Down Expand Up @@ -208,7 +220,19 @@ pipeline {
timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') {
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; make check'
}
sh 'echo "Are GitIgnores good after make check? (should have no output below)"; git status -s || if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; git diff; exit 1; fi'
sh """ set +x
echo "Are GitIgnores good after make check? (should have no output below)"
OUT="`git status -s`" && [ -z "\$OUT" ] \\
|| { echo "\$OUT" >&2
if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then
echo "WARNING GitIgnore tests found newly changed or untracked files:" >&2
exit 0
else
echo "FAILED GitIgnore tests" >&2
git diff >&2
exit 1
fi
}"""
script {
if ( params.DO_CLEANUP_AFTER_BUILD ) {
deleteDir()
Expand All @@ -219,7 +243,19 @@ pipeline {
timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') {
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; make check'
}
sh 'echo "Are GitIgnores good after make check? (should have no output below)"; git status -s || if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; git diff; exit 1; fi'
sh """ set +x
echo "Are GitIgnores good after make check? (should have no output below)"
OUT="`git status -s`" && [ -z "\$OUT" ] \\
|| { echo "\$OUT" >&2
if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then
echo "WARNING GitIgnore tests found newly changed or untracked files:" >&2
exit 0
else
echo "FAILED GitIgnore tests" >&2
git diff >&2
exit 1
fi
}"""
}
}
}
Expand All @@ -242,7 +278,19 @@ pipeline {
timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') {
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; make memcheck && exit 0 ; echo "Re-running failed ($?) memcheck with greater verbosity" >&2 ; make VERBOSE=1 memcheck-verbose'
}
sh 'echo "Are GitIgnores good after make memcheck? (should have no output below)"; git status -s || if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; git diff; exit 1; fi'
sh """ set +x
echo "Are GitIgnores good after make memcheck? (should have no output below)"
OUT="`git status -s`" && [ -z "\$OUT" ] \\
|| { echo "\$OUT" >&2
if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then
echo "WARNING GitIgnore tests found newly changed or untracked files:" >&2
exit 0
else
echo "FAILED GitIgnore tests" >&2
git diff >&2
exit 1
fi
}"""
script {
if ( params.DO_CLEANUP_AFTER_BUILD ) {
deleteDir()
Expand All @@ -253,7 +301,19 @@ pipeline {
timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') {
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; make memcheck && exit 0 ; echo "Re-running failed ($?) memcheck with greater verbosity" >&2 ; make VERBOSE=1 memcheck-verbose'
}
sh 'echo "Are GitIgnores good after make memcheck? (should have no output below)"; git status -s || if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; git diff; exit 1; fi'
sh """ set +x
echo "Are GitIgnores good after make memcheck? (should have no output below)"
OUT="`git status -s`" && [ -z "\$OUT" ] \\
|| { echo "\$OUT" >&2
if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then
echo "WARNING GitIgnore tests found newly changed or untracked files:" >&2
exit 0
else
echo "FAILED GitIgnore tests" >&2
git diff >&2
exit 1
fi
}"""
}
}
}
Expand All @@ -276,7 +336,19 @@ pipeline {
timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') {
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; make DISTCHECK_CONFIGURE_FLAGS="--with-neon=yes --with-lua=yes --with-snmp=yes --with-snmp_dmf_lua=yes --with-dev --with-doc=html-single=auto,man=yes --with-dmfnutscan-regenerate=yes --with-dmfsnmp-regenerate=auto --with-dmfsnmp-validate=yes --with-dmfnutscan-validate=yes" distcheck'
}
sh 'echo "Are GitIgnores good after make distcheck? (should have no output below)"; git status -s || if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; git diff; exit 1; fi'
sh """ set +x
echo "Are GitIgnores good after make distcheck? (should have no output below)"
OUT="`git status -s`" && [ -z "\$OUT" ] \\
|| { echo "\$OUT" >&2
if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then
echo "WARNING GitIgnore tests found newly changed or untracked files:" >&2
exit 0
else
echo "FAILED GitIgnore tests" >&2
git diff >&2
exit 1
fi
}"""
script {
if ( params.DO_CLEANUP_AFTER_BUILD ) {
deleteDir()
Expand All @@ -287,7 +359,19 @@ pipeline {
timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') {
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; make DISTCHECK_CONFIGURE_FLAGS="--with-neon=yes --with-lua=yes --with-snmp=yes --with-snmp_dmf_lua=yes --with-dev --with-doc=html-single=auto,man=yes --with-dmfnutscan-regenerate=yes --with-dmfsnmp-regenerate=auto --with-dmfsnmp-validate=yes --with-dmfnutscan-validate=yes" distcheck'
}
sh 'echo "Are GitIgnores good after make distcheck? (should have no output below)"; git status -s || if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; git diff; exit 1; fi'
sh """ set +x
echo "Are GitIgnores good after make distcheck? (should have no output below)"
OUT="`git status -s`" && [ -z "\$OUT" ] \\
|| { echo "\$OUT" >&2
if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then
echo "WARNING GitIgnore tests found newly changed or untracked files:" >&2
exit 0
else
echo "FAILED GitIgnore tests" >&2
git diff >&2
exit 1
fi
}"""
}
}
}
Expand All @@ -310,7 +394,19 @@ pipeline {
timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') {
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; make distcheck-dmf-all-yes'
}
sh 'echo "Are GitIgnores good after make distcheck-dmf-all-yes? (should have no output below)"; git status -s || if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; git diff; exit 1; fi'
sh """ set +x
echo "Are GitIgnores good after make distcheck-dmf-all-yes? (should have no output below)"
OUT="`git status -s`" && [ -z "\$OUT" ] \\
|| { echo "\$OUT" >&2
if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then
echo "WARNING GitIgnore tests found newly changed or untracked files:" >&2
exit 0
else
echo "FAILED GitIgnore tests" >&2
git diff >&2
exit 1
fi
}"""
script {
if ( params.DO_CLEANUP_AFTER_BUILD ) {
deleteDir()
Expand All @@ -321,7 +417,19 @@ pipeline {
timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') {
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; make distcheck-dmf-all-yes'
}
sh 'echo "Are GitIgnores good after make distcheck-dmf-all-yes? (should have no output below)"; git status -s || if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; git diff; exit 1; fi'
sh """ set +x
echo "Are GitIgnores good after make distcheck-dmf-all-yes? (should have no output below)"
OUT="`git status -s`" && [ -z "\$OUT" ] \\
|| { echo "\$OUT" >&2
if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then
echo "WARNING GitIgnore tests found newly changed or untracked files:" >&2
exit 0
else
echo "FAILED GitIgnore tests" >&2
git diff >&2
exit 1
fi
}"""
}
}
}
Expand All @@ -344,7 +452,19 @@ pipeline {
timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') {
sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; make DESTDIR="${params.USE_TEST_INSTALL_DESTDIR}" install"""
}
sh 'echo "Are GitIgnores good after make install? (should have no output below)"; git status -s || if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; git diff; exit 1; fi'
sh """ set +x
echo "Are GitIgnores good after make install? (should have no output below)"
OUT="`git status -s`" && [ -z "\$OUT" ] \\
|| { echo "\$OUT" >&2
if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then
echo "WARNING GitIgnore tests found newly changed or untracked files:" >&2
exit 0
else
echo "FAILED GitIgnore tests" >&2
git diff >&2
exit 1
fi
}"""
script {
if ( params.DO_CLEANUP_AFTER_BUILD ) {
deleteDir()
Expand All @@ -355,7 +475,19 @@ pipeline {
timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') {
sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; make DESTDIR="${params.USE_TEST_INSTALL_DESTDIR}" install"""
}
sh 'echo "Are GitIgnores good after make install? (should have no output below)"; git status -s || if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; git diff; exit 1; fi'
sh """ set +x
echo "Are GitIgnores good after make install? (should have no output below)"
OUT="`git status -s`" && [ -z "\$OUT" ] \\
|| { echo "\$OUT" >&2
if [ "${params.CI_REQUIRE_GOOD_GITIGNORE}" = false ]; then
echo "WARNING GitIgnore tests found newly changed or untracked files:" >&2
exit 0
else
echo "FAILED GitIgnore tests" >&2
git diff >&2
exit 1
fi
}"""
}
}
}
Expand All @@ -369,7 +501,7 @@ pipeline {
branch 'master'
branch "release/*"
changeRequest()
}
}
}
stages {
stage('Compile') {
Expand Down
12 changes: 11 additions & 1 deletion docs/config-prereqs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ both, at a disk space cost.

NOTE: Some NUT branches may need additional or different software versions
that are not yet included into `master` branch dependencies, e.g. the DMF
(Dynamic Mapping Files) sub-project needs LUA 5.1.
(Dynamic Mapping Files) sub-project needs LUA 5.1 for build and run-time,
and some Python modules for build.

More packages and/or system setup may be needed to actually run NUT with
all features enabled; chapters below concern just with building it.
Expand Down Expand Up @@ -107,6 +108,9 @@ complete environments):
NOTE: For Jenkins agents, also need to `apt-get install openjdk-11-jdk-headless`
(technically, needs at least JRE 8+).

For DMF, additionally install `python-pycparser` (or in newer distributions,
an explicitly versioned package, e.g. `python3-pycparser`).

FreeBSD 12.2
~~~~~~~~~~~~

Expand Down Expand Up @@ -172,6 +176,8 @@ scripts), better use this routine to test the config/build:
Note the lack of `pkg-config` also precludes libcppunit tests, although they
also tend to mis-compile/mis-link with GCC (while CLANG seems okay).

DMF builds were not tested on BSD as of yet.

OpenIndiana 2021.04
~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -248,6 +254,10 @@ from third-party repositories (e.g. SFE) and/or build from sources.
NOTE: For Jenkins agents, also need to `pkg install developer/java/openjdk8`
(or 11+).

For DMF, additionally install `library/python/pycparser` (or a versioned one
matching your installed Python distribution, e.g. `library/python/pycparser-39`
or `library/python/pycparser-27`).

OmniOS CE (as of release 151036)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
7 changes: 4 additions & 3 deletions docs/nut.dict
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
personal_ws-1.1 en 2808 utf-8
personal_ws-1.1 en 2809 utf-8
AAS
ACFAIL
ACFREQ
Expand Down Expand Up @@ -1457,10 +1457,12 @@ byv
cablepower
calloc
cb
cbe
cbl
cblimit
ccache
cd
cef
cerr
certfile
certname
Expand Down Expand Up @@ -1999,10 +2001,9 @@ lowvoltsout
lposix
lr
lsusb
lua
luaOutlet
lu
lua
luaOutlet
lv
lvo
lxc
Expand Down
1 change: 1 addition & 0 deletions scripts/DMF/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ if WITH_REGENERATE_DMF_SNMP
test -d "$(@D)" -a -w "$(@D)" || $(MKDIR_P) "$(@D)" || exit ; \
if test -f "$(DMFGEN_SANITY_VALIDATED)" ; then \
( cd "$(@D)" && \
LANG=C LC_ALL=C TZ=UTC \
CFLAGS="$(DMFTOOLS_CFLAGS) $(AM_CFLAGS)" \
LDFLAGSx="$(abs_top_builddir)/common/libcommon.la $(abs_top_builddir)/drivers/dstate.o" \
CPPFLAGS="$(DMFTOOLS_CPPFLAGS) $(CPPFLAGS) $(AM_CPPFLAGS)" \
Expand Down
8 changes: 4 additions & 4 deletions scripts/DMF/dmfify-mib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fi
|| { echo "ERROR: Can not find Python 2.7+: '$PYTHON'" >&2; exit 2; }

# The pycparser uses GCC-compatible flags
[ -n "${CC-}" ] || CC="`which gcc`"
[ -n "${CC-}" ] || CC="`command -v gcc`"
CC_ENV=""
if [ -n "${CC-}" ] ; then
case "$CC" in
Expand All @@ -72,13 +72,13 @@ if [ -n "${CC-}" ] ; then
esac
case "$CC" in
/*) ;;
*) CC="`which "$CC"`" ;;
*) CC="`command -v "$CC"`" ;;
esac
fi
[ -n "${CC}" ] && [ -x "$CC" ] || { echo "ERROR: Can not find (G)CC: '$CC'" >&2; exit 2; }
export CC CFLAGS CC_ENV

[ -n "${CPP-}" ] || CPP="`which cpp`"
[ -n "${CPP-}" ] || CPP="`command -v cpp`"
CPP_ENV=""
if [ -n "${CPP-}" ] ; then
case "$CPP" in
Expand All @@ -103,7 +103,7 @@ if [ -n "${CPP-}" ] ; then
esac
case "$CPP" in
/*) ;;
*) CPP="`which "$CPP"`" ;;
*) CPP="`command -v "$CPP"`" ;;
esac
fi
[ -n "${CPP}" ] && [ -x "$CPP" ] || { echo "ERROR: Can not find a C preprocessor: '$CPP'" >&2; exit 2; }
Expand Down
8 changes: 4 additions & 4 deletions scripts/DMF/dmfsnmp/apc-ats-mib.dmf
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<?xml version="1.0" ?>
<nut version="1.0.0" xmlns="http://www.networkupstools.org/dmf/snmp/snmp-ups">
<lookup name="apc_ats_sensitivity_info">
<lookup_info oid="1" value="high"/>
<lookup_info oid="2" value="low"/>
</lookup>
<lookup name="apc_ats_outletgroups_name_info">
<lookup_info oid="1" value="total"/>
<lookup_info oid="2" value="bank1"/>
Expand All @@ -19,6 +15,10 @@
<lookup_info oid="1" value="OFF"/>
<lookup_info oid="2" value="OL"/>
</lookup>
<lookup name="apc_ats_sensitivity_info">
<lookup_info oid="1" value="high"/>
<lookup_info oid="2" value="low"/>
</lookup>
<snmp name="apc_ats_mib">
<snmp_info absent="yes" default="ats" flag_ok="yes" multiplier="128.0" name="device.type" static="yes" string="yes"/>
<snmp_info absent="yes" default="APC" flag_ok="yes" multiplier="128.0" name="device.mfr" static="yes" string="yes"/>
Expand Down
Loading

0 comments on commit 41b3db1

Please sign in to comment.