2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-19 17:02:15 +00:00
Commit Graph

74 Commits

Author SHA1 Message Date
Daniel Hilst 37de3e634e fix(xcat-probe): a terminal tput cannot measure erases every checkpoint message
xcatprobe asks 'tput cols' for the screen width whenever TERM is set. The
GitHub Actions container sets TERM=unknown, terminfo carries no such
terminal, and tput writes nothing. The width became 0 and the layout cut
every checkpoint message to the empty string, so the probe printed a
column of bare [ OK ], [WARN] and [FAIL] marks with no text beside them.

xcatprobe_xcatmn_selinux failed on that output. It asserts that the
SELinux checkpoint reports [ OK ], and no checkpoint text reached the log.
The rest of the probe diagnostics were unreadable for the same reason, so
the one [FAIL] in the run named no checkpoint.

probe_format::screen_width keeps the 80 column default when 'tput cols'
gives no usable number. probe_xcatmn_selinux_case.t renders the checkpoint
at that width and three of its assertions fail without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-22 08:49:45 -03:00
Daniel Hilst f38418bd75 test(xcat-probe): the probe case measures a checkpoint line the test wrote itself
xcatprobe_xcatmn_selinux asserts the text of the SELinux checkpoint, and
probe_xcatmn_selinux_case.t built that line by hand. The line xcatprobe
prints in the GitHub Actions container carries no text, so the test passed
while the case failed.

xcatprobe held the layout in format_cmd_output, which no test can call.
This moves the layout to probe_format and leaves xcatprobe the printing.
The rendering is unchanged at every width: an identical column of output
for widths 7, 40, 79, 80, 120, 121 and 200, truncated and wrapped, with
and without colour.

The test now renders the checkpoint through probe_format at the width the
container gives, and it fails here. screen_width returns 0 for a terminal
'tput cols' cannot measure, the message is cut to the empty string, and
three assertions read '[ OK ]' where they expect the checkpoint text.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-22 08:49:37 -03:00
Daniel Hilst fabfaedc89 feat(xcat-core): provision compute and service nodes with SELinux enabled
Every compute and service node was provisioned with SELinux disabled.
mknetboot added selinux=0, the kickstart templates said selinux
--disable, and the genimage postinstall and the dracut hooks wrote
SELINUX=disabled into the image. noderes.selinux and site.selinux had no
consumer on the node side.

The mode that xCAT::SELinux->node_modes resolves now reaches the node:

- Kernel command line: mknetboot appends kcmdline_selinux(): selinux=0
  for disabled, enforcing=0 for permissive, nothing for enforcing. An
  image built without the relabel hook (EL7 and older), and a squashfs
  image without labels, boot with selinux=0 and nodeset says why.
  Test: selinux_netboot_kcmdline.t.
- Kickstart: #SELINUXMODE# and #SELINUXRELABEL# in xCAT::Template. The
  rh el8/9/10, riscv64 and openEuler templates use them; the %post ends
  with restorecon -RF over the paths the xCAT scripts write. mkinstall
  warns when a template cannot express the mode of the node.
  Test: selinux_kickstart_template.t.
- genimage: the el8-10 postinstalls no longer write SELINUX=disabled, and
  the stateless xcatroot no longer writes /etc/sysconfig/selinux. genimage
  sets SELINUX=enforcing in the image, adds dracut 98selinux, and installs
  a pre-pivot hook that runs setfiles with the image file_contexts unless
  selinux=0 is set. Tests: selinux_image_config.t, selinux_relabel_hook.bats.
- packimage -m squashfs stores the labels of the image policy through
  mksquashfs pseudo xattr definitions (squashfs-tools 4.6 or later), and
  writes rootimg.sfs.selinux beside the image. Test:
  selinux_squashfs_labels.t.
- Service nodes mount /install and /tftpboot from the management node with
  context=public_content_t and tftpdir_t when SELinux is on.
  Test: selinux_sn_mount_options.t.
- makedns no longer warns about SELinux. xcatprobe xcatmn checks the xcat
  module and the labels of installdir and tftpdir instead of failing on
  enforcing. Test: probe_utils_selinux_policy.t.

The selinux/cases1 xcattest cases provision a diskful, a stateless and a
squashfs node enforcing, and a stateless node with site.selinux=disabled.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-21 10:33:16 -03:00
Vinícius Ferrão c3c2351fd9 fix(probe): check the discovery scripts of the upstream loader
An unknown x86 client now fetches its Genesis script from
xcat/ipxe/nets. xcatprobe discovery checked the scripts of each network
under xcat/xnba/nets, and marked the boot loader stage only for a
download from there. It now checks xcat/ipxe/nets, and marks the stage
for a download from either directory.
2026-10-02 23:58:13 -03:00
Vinícius Ferrão fae705d969 fix(probe): recognize the upstream loader download
osdeploy marked a node as loading its boot loader only when it fetched a
file under xcat/xnba, the POWER grub2 image, or yaboot. A node on the
upstream loader fetches xcat/ipxe/..., so osdeploy missed that stage.

Move the match into probe_utils and add xcat/ipxe/.
2026-10-02 23:58:13 -03:00
Vinícius Ferrão 77c1694b03 refactor(utils): centralize executable lookup 2026-09-02 22:57:05 -03:00
Vinícius Ferrão 33d9ac6eeb refactor(networkutils): rename isIpaddr to isIpv4addr 2026-09-01 11:18:05 -03:00
Vinícius Ferrão b22a19876a refactor(probe): reuse command capture for netplan 2026-07-22 23:30:45 -03:00
Vinícius Ferrão 73b9368ff3 fix(xcatprobe): report listener inspection errors 2026-07-17 14:31:01 -03:00
Vinícius Ferrão 888f5360b8 fix(xcatprobe): prefer ss for listener checks 2026-07-16 21:31:08 -03:00
Vinícius Ferrão 701e9e00c0 Fix xcatprobe TFTP check failure with restrictive umask
The is_tftp_ready() function creates test files that inherit the
shell's umask. With umask 027, files get 640 permissions and the
TFTP daemon (running as nobody/tftp) cannot read them, causing a
false negative even when TFTP service is healthy.

Temporarily set umask to 022 during test file creation so files
are world-readable (644), then restore the original umask.

Fixes: https://github.com/xcat2/xcat-core/issues/7487
2026-05-11 13:13:05 -03:00
Vinícius Ferrão 219b0f1f5d Add networkd fallback for netplan static IP probe
Detect static netplan addresses on older Ubuntu netplan releases by falling back to generated systemd-networkd configuration when netplan get is unavailable. Keep netplan get authoritative when supported.

Co-authored-by: karcaw <663031+karcaw@users.noreply.github.com>
2026-05-07 13:46:33 -03:00
Vinícius Ferrão 1babd7b0e4 fix: improve Ubuntu LTS provisioning support 2026-04-29 18:19:12 -03:00
Vinícius Ferrão 6f3d9bb9d1 Add Kea DHCP backend 2026-04-23 02:01:33 -03:00
Mark Gurevich 28fe1dfaad Improve xcatprobe check for firewall 2021-04-23 14:49:56 -04:00
cxhong 42915fefe0 Use option type=A for nslookup 2019-11-13 09:24:57 -05:00
Kurt H Maier e8aa0c8599 probe_utils: simplify selinux enforcing check 2019-05-07 14:05:25 -07:00
Kurt H Maier 59f8845d37 probe_utils: remove extraneous else block 2019-05-07 13:52:34 -07:00
Kurt H Maier f89f611ca9 probe-utils.pm: refactor switch statement
switch() is only available if explicitly declared.  switch to
a for block using elsif to return a value.
2019-05-07 13:01:17 -07:00
Kurt H Maier 330ada0a34 probe_utils: add check to see if selinux is enforcing (not just enabled) 2019-05-01 13:23:10 -07:00
xuweibj 4e1663a960 enhance pr 5715 of httpport check 2018-12-02 20:22:53 -05:00
xuweibj 6d9a912cf7 Use postscript file efibootmgr to check http service instead of syslog (#5758) 2018-11-16 17:33:37 +08:00
xuweibj 344c05f658 fix issue 5701, support site.httpport setting for xcatmn check 2018-10-17 22:41:25 -04:00
Weihua Hu 3d6aab2924 Merge pull request #5697 from xuweibj/I5694
fix issue 5694, not try to install tree for xCAT-probe
2018-10-12 15:33:35 +08:00
xuweibj 823a1530ee fix issue 5694, not try to install tree for xCAT-probe 2018-10-12 02:52:40 -04:00
huweihua f3f7890225 Enhance osdeploy for issue 5488 2018-10-12 01:20:18 -04:00
Weihua Hu 300cc96b6a Merge pull request #5686 from xuweibj/I5677
fix xcatprobe xcatmn issues 5677&5678
2018-10-11 16:32:58 +08:00
xuweibj e18b8a0615 fix issue 5633, use noempty file to check tftp service (#5691) 2018-10-11 14:50:44 +08:00
xuweibj 31cb4aa2b8 modified dependiing on comments 2018-10-11 02:19:03 -04:00
xuweibj 852222796d fix xcatprobe xcatmn issues 5677&5678 2018-10-09 21:32:26 -04:00
xuweibj 4bfa23e1bb fix issue 5633, enhance check tftp service (#5639)
* fix issue 5633, enhance check tftp service
2018-09-26 10:30:41 +08:00
GONG Jie 65f01f7d1e Remove trailing spaces in file xCAT-probe/lib/perl/probe_utils.pm 2017-12-31 23:59:59 +00:00
GONG Jie e124bc5a9b Remove trailing spaces in file xCAT-probe/lib/perl/LogParse.pm 2017-12-31 23:59:59 +00:00
Thilo Maurer e0097dcf21 fix probing for static IP: proper escaping of backslash 2018-08-08 10:23:35 +02:00
xuweibj a1596fa3e3 check ip whether static for networkmanager config (#5261)
* check ip whether static by networkmanager
2018-06-07 16:58:49 +08:00
xuweibj 270434e884 Add log service and log record in xcatprobe xcatmn (#5157)
* Add log service and log record in xcatprobe xcatmn
2018-05-09 16:52:13 +08:00
XuWei e96a68d00a Fix issue 3825, if BOOTPROTO is none consider it as static IP in xcatprobe 2017-09-01 00:35:25 -04:00
XuWei a162ca8420 change RPM to INSTALL 2017-02-14 04:47:45 -05:00
XuWei 64b926ce63 modified table format 2017-02-10 02:22:54 -05:00
XuWei 6fdf3bef66 modified depending on comments 2017-01-24 20:36:19 -05:00
XuWei 97ca01394d xcatprobe osdeploy performance 2017-01-23 00:46:26 -05:00
hu-weihua 9bfc34395b modify depending on Victor's comments 2017-01-09 01:07:01 -05:00
hu-weihua 1512f118dc Fix bug#2320 Request changing xcatprobe xcatmn output messages for checking services 2017-01-05 03:03:23 -05:00
neo954 4383a4ff03 Merge pull request #2323 from hu-weihua/addhttp
Enhance xcatmn http service checking offer more error message and add ntp check
2016-12-21 02:42:34 -06:00
hu-weihua 0d3beb67c9 modify depending on gongjie'comment 2016-12-21 03:07:46 -05:00
hu-weihua e3cfd47466 add ntp check and modify http part depending on gongjie's comment 2016-12-21 02:09:02 -05:00
hu-weihua 4a0c497697 enhance http service checking, offer more error message 2016-12-19 00:47:52 -05:00
XuWei 34ab88985c modified depending on comments 2016-12-16 03:06:49 -05:00
XuWei 09a661c800 enhance xcatprobe osdeploy functions 2016-12-13 21:58:27 -05:00
XuWei 66bc88169f delete extra functions in probe_utils 2016-11-04 03:51:48 -04:00