2153 Commits
Author SHA1 Message Date
William Douglas ad4ee1fe77 Release 5.0.3
- Fix issues with print format strings
- Update handling of optimized binary files

Signed-off-by: William Douglas <william.douglas@intel.com>
v5.0.3
2023-04-11 12:39:28 -07:00
William Douglas a9aac28ae7 Update opt_mask handling to match mixer-tools
mixer-tools populates the optimized mask based on a matrix of values
where the mask includes both the optimization of the file on the line
but also the combined masks of all matching files.

This means a file mask needs to be translaed from the mask to what its
actual optimization level is and what other optimizations levels are
available to be useful. This change adds 2 new elements to the file
struct. The opt_level stores a files optimization level and
available_levels stores a bitwise or of the different optimization
levels that can be found in the file list for the same file.

For instance an AVX2_3 mask indicates the file is AVX2 with both SSE
and AVX512 files also available (SSE | AVX2 | AVX512 == 3).

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-04-11 12:20:25 -07:00
William Douglas 6eb95df3e2 Fixup format string specifiers
Correct format strings to be the right type.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-04-11 12:20:12 -07:00
William Douglas 8b71dac239 Release v5.0.2
- Bug fix for handling errors for default state dirs

Signed-off-by: William Douglas <william.douglas@intel.com>
v5.0.2
2023-03-07 15:18:08 -08:00
William Douglas ba9649e223 Handle errors from statedir_set_*_path
In the case of the system default paths being set, potential errors
from state_set_*_path functions were being ignored. Handle errors and
exit accordingly.

Previously the directories were not attempted to be created in this
code path so there was no error handling needed but with the mkdir
addition, no longer handling this erro will cause segfaults later on
as the mkdir failure prevents the path setting further causing
uninitalized variables to be used.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-03-07 15:10:16 -08:00
William Douglas 65d8d02f6d Release v5.0.1
- Bug fix for modifier flag handling.

Signed-off-by: William Douglas <william.douglas@intel.com>
v5.0.1
2023-03-03 10:14:49 -08:00
William Douglas 5ecf766ba8 Fix typo in OPTIMIZED_BITMASKS
Remove duplicate '9' in string for generating OPTIMIZED_BITMASKS array
and regenerate. This also requires an additional element is added to
the array to get to the 64 characters usable in the map.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-03-03 10:11:00 -08:00
William Douglas d68bc6fb83 Release v5.0.0
- Major change in how manifests are parsed.

The manifest's modifier flag has been reworked, previous flag settings
are now ignored and they get the default behavior of the new
settings. Only default modifiers are currently supported, all other
types are skipped at this time.

Signed-off-by: William Douglas <william.douglas@intel.com>
v5.0.0
2023-03-02 12:39:32 -08:00
William Douglas 77f16b0120 Add new handling for modifier field
The modifier field will be a character that translates roughly into a
base64 encoded bitmask. The first 3 bytes are the optimization level
and the last three are the max optimization level any files with that
same filename can have.

For now though skip all lines that don't match SSE_OPT (the previous
values the modifier field would have: 'b', 's' and 'C' all map to
the SSE_OPT bitmask).

Also rework the manifest unit tests a bit more. Noticed the exported
flag was wrong in the data and the X flag for the 3rd field was
completely unchecked for in swupd code. Added testing for the ignored
'b', 's' and 'C' values of the modifier field and checked the non-sse
is in fact skipped as a file for now.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-03-02 12:35:32 -08:00
William Douglas bf3b0201c3 Fetch entire git tree for master comparison
The api test needs to compare the current commit on the remote branch
to the master branch. Based on the documentation, 'fetch-depth: 0' is
intended to fetch all branches and tags.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-02-28 13:25:05 -08:00
William Douglas ca3b07cf5e Update to use latest checkout action
Update all workflow's checkout action to the latest version.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-02-28 13:25:05 -08:00
William Douglas a011f9429a Remove logic for flag not in use
The logic is testing a flag that mixer does not set and would like
to change the purpose of in a new version. Remove the test (needs a
format bump before mixer can use the flag) for the flag.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-02-28 13:25:05 -08:00
William Douglas 6896d8f155 Rework output checking in test
The disk space check was trying to match exact number of download
attempt messages which was not working consistently.

Move to simply detecting the failure messages once.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-02-22 00:04:12 -08:00
William Douglas 98a3362ae9 Rework clear linux docker container for test runs
Also skips a few tests that do not run well with docker (changing date
and disk filling have a hard time). Adding comment for how to run
docker (needs the --cap-add LINUX_IMMUTABLE option passed).

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-02-22 00:04:12 -08:00
William Douglas a9608851ee Move packs to download synchronously
There are some problems with how we are using multiplexed curl causing
huge slowdowns (2-5 times slower).

For now rather than rework the multiplexed curl code, switch to using
the synchronous code path.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-02-21 23:26:19 -08:00
William Douglas 3338cb2c66 Rework clean-old-statedir test output checking
The order of files in this test aren't very completely stable so make
do with looking at output chunks that seem to be reasonably consistent
across different environments.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-02-17 12:58:05 -08:00
William Douglas 7f59817a43 Improve tests for container
Detect docker container usage when running test to handle cases where
systemd is unlikely to be running.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-02-17 12:58:05 -08:00
William Douglas 776f8c92b0 Update use bats setup and teardown features
Instead of relying on a custom global_setup and global_teardown
functions, migrate to the use of bats' setup_file and teardown_file
functions.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-02-17 12:58:05 -08:00
William Douglas eddf0dc2a4 Fix shellcheck SC2048 error
Correctly quote arrays.

Also improve some commands getting the array content (fixes space
issues with quoting).

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-02-17 12:58:05 -08:00
William Douglas 6a6a907b06 Move no space tests to CI only
These tests fill up the disk and can be quite annoying to run on a dev
system normally.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-02-17 12:58:05 -08:00
William Douglas e55e33afef Fix shellcheck SC2269 error
Remove useless assignment.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-02-17 12:58:05 -08:00
William Douglas ffb1590909 Update shellcheck exceptions
Shellcheck changed its detection for a few file sourcing errors from
1090 to 1091. Update the disables accordingly.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-02-17 12:58:05 -08:00
William Douglas bf5e1f1297 Fix missing header
Header file ordering hid a missing list structure definition.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-02-17 12:58:05 -08:00
William Douglas 436fb503c6 Don't version clang-format
clang-format changing output between versions is painful so might need
to be reconsidered at some point.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-02-17 12:58:05 -08:00
William Douglas dbeb3662a4 Apply changes from clang-format
Running:
clang-format -i -style=file src/*.[ch] src/lib/*.[ch] \
src/3rd_party/*.[ch] src/cmds/*.[ch] src/swupd_lib/*.[ch] \
src/verifytime/*.[ch]

with clang v15

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-02-17 12:58:05 -08:00
William Douglas a425393c87 Update cache action
Old action was using deprecated API.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-02-17 12:58:05 -08:00
William Douglas 52ae6dadc1 Update rst2man path from Ubuntu
Correct the path where the rst2man script lives for CI to find it.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-02-17 12:58:05 -08:00
carlwiede 2341efda7e Fix broken links 2023-02-07 14:07:18 -08:00
William Douglas 7e00e0a20b Switch off of string n functions
These functions lead to spurious errors and warnings for our use
cases.

Signed-off-by: William Douglas <william.douglas@intel.com>
2022-10-07 12:51:05 -07:00
William Douglas b6a4aff5b7 Remove deprecated function use
Since OpenSSL 1.1.0 this function is no longer needed.

Signed-off-by: William Douglas <william.douglas@intel.com>
2022-10-07 12:51:05 -07:00
Arjan van de Ven 4774daf00d allow for non-versioned delta files 2022-10-07 12:51:05 -07:00
William Douglas 49adbbd18f Add additional shellcheck directives
Signed-off-by: William Douglas <william.r.douglas@gmail.com>
2022-10-06 14:34:40 -07:00
Brett T. Warden 0e0cc9b969 Update offline installation tests with URL override
Offline installation tests also override the installation URL, so we
must update the expected output to contain the new message about URL
override.
2022-10-05 11:08:47 -07:00
Brett T. Warden db4ceb85b8 Update tests for swupd mirror commands
Mirror tests specifically invoke the URL override options that trigger
the new text output I've added, so the tests' expected output needs to
be updated to match.
2022-10-05 11:08:47 -07:00
Brett T. Warden 39515d2fc0 Announce overrides of content and version URLs
When using -v, -c, or -u to set alternate version or content URLs, print
out a message so it's more obvious.
2022-10-05 11:08:47 -07:00
William Douglas 3d611782ab Move to a static pemfile
There is something going wrong with installing the generated pemfile.
The file is created but not yet valid, this is not a problem for
local testing for some reason. To work around this issue, use a static
pemfile that is already valid and force install it.

Signed-off-by: William Douglas <william.r.douglas@gmail.com>
2022-10-04 17:25:31 -07:00
William Douglas dbfce4b218 Skip the timesyncd stop and start
As these are CI only tests, the container image currently appears to
have the service masked so stop trying to modify it.

Signed-off-by: William Douglas <william.douglas@intel.com>
2022-10-04 17:25:31 -07:00
William Douglas 685ed470c4 Use regex match for size comparison
The exact size difference changed for some reason but shouldn't cause
the tests to fail as it isn't the point of this test.

Signed-off-by: William Douglas <william.douglas@intel.com>
2022-10-04 17:25:31 -07:00
William Douglas e778dc2ede Update test based on size
The test requires an exact size reporting, fix the size but consider
using a regex match instead.

Signed-off-by: William Douglas <william.douglas@intel.com>
2022-10-04 17:25:31 -07:00
William Douglas ca49f63feb Update CI scripts
Update CI scripts in attempt to get CI working with the current Ubuntu
container.

Signed-off-by: William Douglas <william.douglas@intel.com>
2022-10-04 17:25:31 -07:00
Mark D Horn 8b7525ec87 Fixed typo in man page.
Fixes: https://github.com/clearlinux/distribution/issues/2189

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-11-10 12:06:16 -08:00
Castulo Martinez 935053fdbe Testlib: refactoring setup to load correctly
The setup() function is run at the beginning of each test by the BATS
system, we leverage this function to implement a global_setup() and a
test_setup().

This commit refactors the function to make it easier to understand, also
makes sure it loads the environment variables correctly for tests.
2020-06-16 11:42:13 -07:00
Castulo Martinez 838022f36b Testlib: making variables available to all tests
Variables are available just after being exported, however variables are
not kept between tests since the process that orchestrate the tests of a
test file is a parent process and child processes cannot set variables
of a parent process. This is problematic because we were loosing some
variables (like all third party variables) when running multiple tests
using a global_setup().

This commit fixes the issue by making all the environment variables
available to all tests in a test file regardless of if they use
test_setup() o global_setup().

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-06-16 11:42:13 -07:00
Castulo Martinez 239376c425 Testlib: adding new setters for env variables
Unfortunatelly not all environment variables can be set in the same
place, since some values may depend on a specific function being run
before. However it is important to have easy to lacte places where env
variables are being set.

This commit adds a few more setter functions for envrionment variables
so they are easily identified.

Closes #1489

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-06-16 11:42:13 -07:00
Castulo Martinez da83141022 Testlib: set variables from a common place
Some env variables in testlib can be exported when the file is sourced,
but some other have to be exported only after the test environment has
been created because they depend on it and in values gotten from it.
However testlib should try to set env variables in as little places as
possible.

This commit moves the definition of variables that can be defined in
set_env_variables() to consolidate them there if possible.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-06-16 11:42:13 -07:00
Castulo Martinez 7dd6fc221a Testlib: renaming variables for consistency
Environment variables are used everywhere in testilb. This environment
variables are global variables that define the way testlib behaves.
However is was confusing to use the variables because they were
inconsistent between each other, for example some variables that define
paths would have absolute paths while other would have relative paths,
making it error prone while using them.

This commit makes the environment variables more consistent by following
a name convention for each type of variable, as an example, variables
that define absolute paths follow this convention ABS_<path_name>_DIR,
while variables that define relative paths are defined like this
<path_name>_DIR.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-06-16 11:42:13 -07:00
Castulo Martinez a48ff926f3 Testlib: adding one more env variable to the help
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-06-16 11:42:13 -07:00
Castulo Martinez ac837cb9fe Testlib: Replace zero_hash constant with ZERO_HASH
Global constants in testlib are just exported variables, so they should
be in all upper case so we know they were defined globally.

Closes #1484

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-06-16 11:42:13 -07:00
Castulo Martinez 47a2fc08d5 Testlib: adding info about BATS variables
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-06-16 11:42:13 -07:00
Castulo Martinez 04dfaa1db7 Allow paths that contain symlinks for cachedir
When the path provided by a user for the --statedir (or --cachedir)
contains a symlink swupd will fail to extrar tar files since
libarchive does not support extracting files through symlinks.

This commit fixes the issue allowing users to use symlinks in the
--statediri/--cachedir path.

Closes #1581

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-06-15 15:24:34 -07:00