These tests verify the basic install & update functionality for the
bootloaders, not the kernels. It should be noted that in the case of
syslinux, we have a restricted feature-set. As such we *always* report
that syslinux needs an update when the source file changes, because
it's far cheaper than actually reading the block device itself.
This change also addresses the gptmbr bin file being 1 byte too long,
which was revealed during the development of this test.
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
This test adds very basic coverage for doing a basic image installation,
using the syslinux legacy path.
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
To make it easier to manipulate the cmdline that is emitted into the
per-kernel boot entries, we add a new parser to clr-boot-manager. This
parser will be responsible in future for loading a *per kernel* cmdline,
as well as loading a global system cmdline.
The first file to be read will always be /etc/kernel/cmdline, and after
this the files in /etc/kernel/cmdline.d/*.conf will be read in, which is
then merged into a single cmdline line.
The file format permits new lines and comments, which are stripped from
the emitted text. It also takes care to skip unnecessary whitespace,
allowing the cmdline to be built in layers from various locations.
Two immediate consequences arise: The ability for the user to append to
the default kernel cmdline, and the ability for vendors to provide
quirks and such by default, without modifying kernel packages or CBM
itself.
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
Instead of hard-coding the OS ID into clr-boot-manager at build time,
we'll be able to use the standardised {/etc/,/usr/lib/}os-release file
to provide updated OS identity information.
This change adds the os-release parser, which takes steps to ensure that
only predefined sane keys are used, and that value keys never have NULL
values.
In the absence of all configuration, an empty map is returned to allow
the library to make use of default values and not rely on extensive
error handling in multiple locations, making the change far less
invasive.
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
Much of our low coverage rate can be attributed to using an imported version
of libnica, without the test suites. This change incorporate much of the nica
test suite for the core types that we utilize.
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
This is just part of improving coverage within clr-boot-manager, and is
a critical requirement given that we have changed how we determine that
two files differ.
With that said, we still do have the test harness that makes heavy use of
cbm_files_match, and one can clearly see that by deliberately inverting
logic in paths within cbm_files_match, the harness tests then completely
fail.
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
As the cbm_files_match function now uses a mmap'd stream-byte comparison,
the requirement for get_sha1sum has disappeared within clr-boot-manager.
Thus, we remove the no longer necessary code, and remove the requirement
for OpenSSL from the codebase permanently.
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>