PyNUT: use command identifiers in description requests - #3628
PyNUT: use command identifiers in description requests#3628user01010111 wants to merge 5 commits into
Conversation
Decode LIST CMD identifiers as ASCII for GET CMDDESC requests and response offsets, preserving the public bytes dictionary and description fallback. Add request-sensitive regression coverage to make check and note the fix in NEWS.adoc. Validated with Python 2.6, 2.7 and 3.4 through 3.14, localhost upsd with dummy-ups, generated/installed/packaged modules, make check, spellcheck and distcheck-light. AI assistance: OpenAI Codex with gpt-6-astra (x-high reasoning). The human contributor remains responsible for reviewing and submitting the change. Closes: networkupstools#3621 Signed-off-by: user01010111 <12504630+user01010111@users.noreply.github.com>
|
You are on a roll again, now that the previous PR merge train has left the station, and NUT CI farm is more available to queries :) |
|
A ZIP file with standard source tarball and another tarball with pre-built docs for commit ceab8e0 is temporarily available: NUT-tarballs-PR-3628.zip. |
|
✅ Build nut 2.8.5.5250-master completed (commit fe492a87e2 by @user01010111)
|
|
Curious: this failed on just one build combo, for a fairly valid reason: On the CI side, I can add the module so we would test the feature everywhere, but on the project source side - the module should be listed in build dependencies I think ( And perhaps the presence of the module should be checked in
So maybe until this is handled, I would NOT update that build agent, so we would know builds/checks no longer crash because of this. UPDATE: I'm on it now... |
…etworkupstools#3627, networkupstools#3628] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…nd `unittest` module [networkupstools#3628] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ailability of `unittest` module [networkupstools#3628] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…networkupstools#3628] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
✅ Build nut 2.8.5.5265-master completed (commit b8eb25d79f by @jimklimov)
|
Closes: #3621
On Python 3,
GetUPSCommands()formats command names parsed fromLIST CMDas bytes representations, sending requests such as
GET CMDDESC dummy b'load.off'. Currentupsdconsequently returns "Description unavailable"even though
load.offhas a description.Decode the command identifier as ASCII for both the description request and
the response-prefix length. The returned dictionary retains its bytes keys
and values, and description errors retain the existing identifier fallback.
Add a request-sensitive regression test under
tests, run it throughmake check, and record the fix inNEWS.adoc.Validation:
fix; the complete fix passes on Python 2.6.9, 2.7.18, and 3.4 through 3.14.
upsdwithdummy-upsadvertisesload.off. Against thesame server, baseline returns "Description unavailable" and the patched
client returns "Turn off the load immediately". Exact request bytes and
separate unavailable/error controls were checked; no UPS commands ran.
source-distribution-install checks passed. The existing suite passed
12/12, plus all six new regression tests.
make spellcheck, changed-line ASCII/whitespace checks, and normalmake distcheck-lightpassed. The latter exercised the extracted archive'sbuild, tests, installation, uninstallation and redistribution, using its
standard placeholder handling for unselected manual pages.
No physical UPS hardware was available for testing. Validation covered
request-sensitive transport tests, Python runtime compatibility checks,
generated and packaged modules, build and distribution checks, and simulated
localhost integration with upsd and dummy-ups. Physical UPS models, firmware
versions, and hardware combinations were not tested.
AI assistance: OpenAI Codex with gpt-6-astra (x-high reasoning).
The human contributor remains responsible for reviewing and submitting
the change.
Relevant contribution checklist: