Instead of having this be a local test, have a format target for the
Makefile and use a github action for clang-format to avoid differences
between developer systems clang-format and runner clang-format
versions.
Signed-off-by: William Douglas <william.douglas@intel.com>
Create another github job to check if the API has been changed in this
PR, so it will be easier to notice that a broken test is just an API
broken test
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Converting from different int types are not always correct, so turning the
gcc warning that check for conversions that might change the value or sign of
the number.
This commit adds the statedir.c module and moves the function to get the
tracking directory to this module. It also adds a new function to get
the path to a tracking file into the module.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Ignore call was confusing and value was ignored for the main usages.
It should always run with the main heuristic functions.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
src/
src/3rd-party/ # Everything that is 3rd-party related
src/cmds/ # All sub-commands from swupd (except 3rd-party ones)
src/lib/ # Modules that implement functions not dependent on swupd
behavior (i.e. system interations, logging)
src/swupd_lib/ # Modules that implement functions dependent on swupd
behavior (i.e. hash calculation, signature verification,
manifest/bundle handlers)
Adding src to default list of includes to make it easier to organize swupd header
files in directories.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Make sure we are not accidently using the incorrect variable
by not allowing 2 variables with the same name.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
We have added more dependencies in verifytime, but this was harder to
keep as it looks like, so making it completely independent from swupd
libs.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
We are aiming to provide a stable --quiet output, so forcing "make
compliant" to fail if there are changes in the test/functional/api
tests, which cover these scenarios will prevent us from unadvertedly
changing those tests.
Closes#1501
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Instead of explicitly adding config.h in every file, forcing it to be included
by the build system. Forgetting to include config.h could cause ifdefs to include
incorrect code.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Staging.c file was grouping functions that perform installation of files into
the target root (globals.path_prefix).
The staging is one step of this process, that is copying the file with a
different name to be renamed later, so this module needed a better name.
By calling it 'target root' we can group here all functions related to the
current root directory that is used by swupd, internally called path_prefix.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Move to staging.c all functions related to installation or removal of files
in the system. Reorganize the staging_install_all_files() too.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
There are some functions we decided to avoid using, so add a test to make
sure we won't add them by accident.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
As there are more string functions that will be needed by log and
verifytime and it would be impractical to copy everything, prefering
to include more dependencies instead.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Instead of requiring an external script (.prereq) to generate the certificates
we can regenerate them before running each test.
Also removes completly the .prereq script
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Check-functional wasn't being run in parallel. Using $(MAKE) instead
of make to propagate make parameters
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Clear Linux isn't using the check-update service anymore for a long time
and there's no other known uses for those scripts. So there's no reason to
keep them.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Implementation of the 3rd-party info command to show the version of the
3rd-party repository along with the update URL.
Closes#1354
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
We have a list of header files that weren't documented yet. Add them explicitly
to the check to prevent us to lower the quality of the documentation of headers
that are well documented.
Also fixing some documentation that weren't included because of incorrect style.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
We used compare-like functions as arguments to other functions that
filter, sort, compare data. These functions are scattered accros the
code and they are sometimes difficult to identify so there is a lot of
code duplication.
This commit organizes all the compare like functions throughout the code
in the same place and with standard naming so it is easier to find them
and reuse them.
Closes#1167
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit implements the swupd clean command for the 3rd-party bundles
so users are able to clean the cache on their state directories.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit adds the ability to update the system based on the 3rd-party
repositories the user have.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit adds a new "3rd-party bundle-info" command which can be used
to show information about a bundle from a 3rd-party repository. If no
3rd-party repository is specified, the bundle is searched for in all
available repositories.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit adds the ability to remove 3rd-party bundles. If a repo is
not specified the bundle will be searched for in all repositories. All
options from the normal bundle-remove command are supported with
3rd-party bundles.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit introduces a new command to list bundles from all 3rd-party
repositories. At this point users cannot choose a specific repo to show
its bundles but rather all repos are shown.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit adds the 3rd-party bundle-add command to swupd. It does not
implement the functionality yet.
The actual functionality will be implemented in a different commit.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
sudo swupd 3rd-party add <repo_name> <upstream_url>
With some clean up from Otavio
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
Now make check is only running unit tests and a new target,
functional-check is used for bat tests. The major win on that
was that now we can use find to look for all bat tests in the
functional library and we don't need to keep the BATS list
updated.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
This PR starts the third-party repo-add, delete, list skeletal features
for swupd. This PR also add support for configure flag
to build third-party optionally for swupd, off by default.
Repo Add:
sudo swupd 3rd-party add <repo_name> <URL>
Repo Remove:
sudo swupd 3rd-party remove <repo_name>
Repos List:
sudo swupd 3rd-party list
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
Functional tests for the new "--recursive" flag in bundle-remove that
will be used to remove a bundle and its dependencies.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>