2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-05 20:47:55 +00:00
Files
xcat-core/xCAT-server/lib/xcat/plugins
Daniel Hilst 124e2782db fix(makentp): make the backend call site testable
The NTP backend selector was well covered and nothing connected it to makentp:
copying the base makentp.pm over the head one left the whole unit suite
byte-identical, so the branches that consume choose()'s answer -- abort on a
selector error, warn on a downgrade, abort when neither daemon is installed --
and the --backend argument handed to setupntp were covered by nothing.

They were unreachable from a test because they sat inside process_request,
which needs a management node. Move the decisions into ntp_backend_action() and
setupntp_command(), which take their inputs and return an answer; the caller
keeps send_msg and runcmd. No behaviour changes -- the same messages are sent
on the same conditions, and the same command is built.

Verified by mutation rather than by reading: dropping the install abort reds 3
of 15, the downgrade note 1, the --backend argument 2, the server-list split 1,
and the selector-error abort 2.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-01 18:57:21 -03:00
..
2017-09-07 15:50:11 -04:00
2026-07-15 00:29:26 -03:00
2024-05-07 16:19:25 +02:00
2024-05-07 16:19:25 +02:00
2019-10-28 14:33:54 -04:00
2024-05-07 16:19:25 +02:00
2026-09-01 10:50:24 -03:00
2023-01-18 11:00:59 -05:00
2024-04-13 12:36:08 +05:30
2022-08-15 10:16:22 -04:00
2018-08-21 15:18:12 -04:00
2018-08-21 15:18:12 -04:00