mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-11-21 01:42:15 +00:00
91e6672110
The diskless cases snapshot the mount table before genimage and after it and require the two to be identical, ignoring only fusectl. The comparison is there to catch a bind mount genimage leaves inside the root image, which is worth catching. It also fails for mounts the kernel makes on its own. binfmt_misc is an autofs stub that becomes a real mount the first time a process reads /proc/sys/fs/binfmt_misc, and tracefs appears under /sys/kernel/debug the first time anything opens debugfs tracing. On openeuler22.03sp4 both appeared during genimage and failed reg_linux_diskless_installation_flat four minutes into a 1168 second case, while the provisioning that followed succeeded and the node reached booted. The single fusectl exclusion shows the same class was met once before and patched by name. mount_snapshot.sh drops the mounts whose mount POINT is under /proc or /sys, which is where the kernel keeps its on-demand mounts, and the three cases take their snapshots through it. Dropping them by filesystem TYPE would hide the leak the comparison exists for, because a leaked genimage bind is itself a proc or sysfs mount. fusectl needs no exclusion of its own any more. mount_snapshot.bats covers both directions. Taking the filter out fails the two ignore-the-kernel assertions and keeps both leak assertions; filtering by type instead of by mount point fails only the leaked-bind assertion. A test-only commit would skip rather than fail, because require_repo_file skips when the script is absent, so the proof is those two mutations. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>