imgimport looked up the litefile entries for all images with "image" =
'ALL'. MySQL takes a double-quoted name for a string, so the lookup
found nothing, and imgimport added entries that an ALL entry already
covered. The lookup now quotes the column the way the database needs.
Remove source-pattern and helper-call counts. Check key-file creation and
replacement through the real DDNS code, with file access redirected to a
temporary fixture. Keep the signing and named configuration checks.
Run the unchanged initrd builder with fixture binaries and inspect both generated archives. Replace source extraction with checks for selected libraries and their contents.
Read site settings from an isolated database and inspect the sources.list written into the image. Stop at an injected package-metadata failure without downloading packages.
Run genimage and inspect the arguments passed to debootstrap instead of evaluating an extracted assignment. Keep the existing ppc64le pass-through explicit.
Exclude node postscripts through the native RPM and dpkg options. Verify
that upgrade configuration, captured output and cleanup still complete.
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
Generate self-contained RPM and Debian upgrade scripts from the shared
source. Package transactions no longer load functions from the node-facing
postscript payload. Keep the existing command, logging and failure policies.
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
The man page said that packimage overwrites the root image and that nodes
cannot use it while packimage runs. Describe the replacement instead, and
the disk space that it needs.
The test packs cpio and tar archives with gzip, xz and pigz, and squashfs
images, on the Red Hat path. A wrapper around the compressor, mksquashfs,
cpio or find records the file under the final name while the pack runs,
and then runs the real tool or fails.
It checks that nodes get the previous archive during the pack, that a
pack whose compressor, cpio or file listing fails keeps the previous
archive, metainfo and other formats, that a successful pack replaces
them, and that no temporary file is left. The next pack removes a
temporary file or directory that an interrupted pack on the same host
left, and keeps one that another host is writing.
For a StateLite tree, it checks that a pack that fails while listing the
files, compressing them or creating the temporary directory restores the
files that packimage switched, and that a retry keeps them. When a file
cannot be moved back, the original and the previous archive must stay,
and the next pack must refuse to run.
A pack must wait while another host holds .packimage-publish. When a
pack that did not finish left the lock, the next pack must fail, name the
holder, and keep the previous archive and the lock. With --tracker,
ctorrent must build the metainfo from the new archive under its final
name before the archive is replaced. A ctorrent failure must keep the
previous archive and metainfo, and so must a previous metainfo that
cannot be removed.
packimage deleted every rootimg.* file before it packed, and wrote the new
cpio or tar archive under its final name with mode 0600. Until the pack
finished, a node that booted got HTTP 403 for its image. When the pack
failed, the image was gone or left truncated, and no node could boot until
a later pack succeeded.
Build every archive in a temporary directory inside the image directory,
and rename the archive over the final name only after the pack succeeds,
as the openEuler path already did with a temporary file. With --tracker,
ctorrent builds the metainfo in the same directory, from the new archive
under its final name. The previous metainfo is removed before the archive
is renamed, and the new metainfo is renamed after it, so no failure
leaves a metainfo that describes another archive. The other rootimg.*
files are removed after the rename. The next pack on the same host
removes a temporary directory that an interrupted pack left. Image locks
are per host, so temporary directories of other hosts that share the
directory stay.
A pack now also fails when find cannot list the image or cpio cannot read
a file, as on the openEuler path. Before, only the compressor status
counted, and such a pack published an incomplete archive.
Every failure after packimage switches a StateLite tree to stateless files
now switches it back. That includes a failure to create the temporary
directory or the squashfs staging directory, which File::Temp reports
with die. packimage records each file that it moves and checks each move. When
a file cannot be moved back, the original stays in .statebackup,
packimage reports it, and the next pack refuses to run until the files
are restored. The new archive replaces the previous one only after the
StateLite files are back. Before, a failed pack left the tree switched,
and a retry overwrote the saved StateLite files.
The image lock is per host, and service nodes mount a shared image
directory without NFS locks. So a pack also holds the directory
.packimage-publish while it replaces the archive and removes the other
formats. mkdir is atomic for every host, also on NFS without locks. When
the lock is older than 60 seconds, or stays held for 60 seconds, the pack
fails, names the holder, and keeps the previous archive. packimage does
not take the lock over, because its holder can still be running.
A ctorrent failure now fails the pack, and the previous archive and
metainfo stay. Before, a failed ctorrent left a partial metainfo, and
nodeset pointed nodes at it.
The packimage tests skip their squashfs and pigz cases unless mksquashfs,
unsquashfs and pigz are installed. Install them in the unit test job so
that CI runs those cases.