Skip to content

Commit 31e183e

Browse files
authored
Merge 4b990e4 into 14dd0a7
2 parents 14dd0a7 + 4b990e4 commit 31e183e

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

NEWS.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ https://github.com/networkupstools/nut/milestone/12
274274
to bumping the debug verbosity of `upsdrvctl` tool. [#3276]
275275
* If we fail to stop a driver by signal (e.g. PID file was not saved),
276276
retry to `INSTCMD driver.exit` it by socket protocol. [#3277]
277+
* The NUT Integration Testing suite now also involves `upsdrvctl` to
278+
run one driver instance indirectly, helping make check-NIT` catch
279+
portability issues with different builds of the tool. [#2800]
277280

278281
- `upslog` tool updates:
279282
* Updated `help()` and failure messages to suggest `-m '*,-'` for logging

drivers/upsdrvctl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,6 +1622,10 @@ int main(int argc, char **argv)
16221622

16231623
prog = argv[0];
16241624

1625+
#if (defined ENABLE_SHARED_PRIVATE_LIBS) && ENABLE_SHARED_PRIVATE_LIBS
1626+
callback_upsconf_args = do_upsconf_args;
1627+
#endif
1628+
16251629
/* Historically special banner*/
16261630
snprintf(progdesc, sizeof(progdesc), "%s - UPS driver controller", xbasename(prog));
16271631
print_banner_once(progdesc, 0);

tests/NIT/nit.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
# different value like "nobody" or "nogroup" would be defaulted for test.
5454
#
5555
# Copyright
56-
# 2022-2025 Jim Klimov <jimklimov+nut@gmail.com>
56+
# 2022-2026 Jim Klimov <jimklimov+nut@gmail.com>
5757
#
5858
# License: GPLv2+
5959

@@ -427,7 +427,7 @@ else
427427
fi
428428

429429
log_info "Locating NUT programs to test:"
430-
for PROG in upsd upsc dummy-ups upsmon upslog upssched ; do
430+
for PROG in upsd upsc dummy-ups upsdrvctl upsmon upslog upssched ; do
431431
(command -v ${PROG}) || (command -v ${PROG}${EXEEXT-}) || die "Useless setup: ${PROG} not found in PATH: ${PATH}"
432432
done
433433

@@ -1359,8 +1359,9 @@ sandbox_start_drivers() {
13591359
if [ -n "${NUT_DEBUG_LEVEL_DRIVERS-}" ]; then
13601360
NUT_DEBUG_LEVEL="${NUT_DEBUG_LEVEL_DRIVERS}"
13611361
fi
1362-
#execcmd upsdrvctl ${ARG_FG} ${ARG_USER} start dummy &
1363-
execcmd dummy-ups -a dummy ${ARG_USER} ${ARG_FG} &
1362+
# Run one driver instance indirectly, to test the upsdrvctl tool too:
1363+
execcmd upsdrvctl ${ARG_FG} ${ARG_USER} start dummy &
1364+
#execcmd dummy-ups -a dummy ${ARG_USER} ${ARG_FG} &
13641365
PID_DUMMYUPS="$!"
13651366
log_debug "Tried to start dummy-ups driver for 'dummy' as PID $PID_DUMMYUPS"
13661367

tools/nut-scanner/nutscan-init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ size_t max_threads_ipmi = 0; /* limits not yet known */
138138
#endif /* HAVE_PTHREAD */
139139

140140
#ifdef WIN32
141-
/* Stub for libupsclient */
141+
/* Stub for libupsclient, no need to register a callback for ENABLE_SHARED_PRIVATE_LIBS builds */
142142
void do_upsconf_args(char *confupsname, char *var, char *val) {
143143
NUT_UNUSED_VARIABLE(confupsname);
144144
NUT_UNUSED_VARIABLE(var);

0 commit comments

Comments
 (0)