With mandatory signature verification being enabled, the tests will have
to generate a certificate and sign their Manifest.MoMs to properly run the
swupd operations.
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
The bundle-remove subcommand returns a unique error code for invalid
usage, so check that instead. This also avoids the need to track
bundle-remove --help output, or ignore it.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This commit adds "lines-checked" files for every test that checks
swupd-client output and removes the old bash-array-style checks from
the test scripts.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Because signature verification is a feature that we need separate
testing for, and swupd's output may print a verification error (or not)
depending on how swupd was built, add a helper function to remove the
verification error message when swupd is built with verification
enabled. If verification is not enabled, swupd will not print any
message, and the function is a no-op.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This commit expands the swupd BATS library to encapsulate more of the
boilerplate steps in the test cases.
Additionally, bundle manifest hashes needed updating now that swupd is
emitting warnings (and later on, errors). Better to be prepared for the
switch to errors on mismatches.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Instead of only checking if bundle-remove has at least one bundle
argument and ignoring additional ones, check that there is exactly one
argument passed to bundle-remove instead.
The Manifest.os-core was present, but the compressed version was not.
Fix the issue by providing the compressed version.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Since a numeric format now requires a config file, and aligning the
client format with the test format is a maintenance problem, use the
"staging" format for all tests.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
The following tests are added here:
- Add a boot file via 'bundle-add' (failed before the previous commit).
- Remove a boot file via 'bundle-remove'.
- Add a boot file via 'update'.
- Detect a boot file hash mismatch via 'verify' (failed before the
previous commit).
- Fix a boot file with incorrect hash via 'verify --fix' (failed before
the previous commit).
- Ignore a boot file during 'verify --fix' if marked deleted (failed
before the previous commit).
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>