This commit makes possible the creation of bundles with exported files
in test environments. These bundles will have the 'x' in the appropriate
place in the manifest plus those bundles that are to be installed in the
environment will have the "exporting script" created in the 3rd-party
bin directory.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When diagnosing/repairing a system, sometimes is useful to only
diagnose/repair a specific file or path.
This commit implements the --file option for diagnose/repair so a file
or path can be diagnosed only instead of doing it to the whole OS or a
whole bundle.
Closes#1150
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
bundle-info currently shows the installation status of a bundle, but
this one is restricted to "installed" or "not installed", it doesn't
show if a bundle was explicitly or implicitly installed.
This commit adds this information to the installation status during a
bundle-info.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
The "bundle-list" command can be used to show all installed bundles in
the system, however, currently there is no way to know which of those
installed bundles were implicitly or explicitly installed.
This commit implements the "--status" flag for bundle-list which can be
used to show which bundles were explicitly or implicitly installed.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Swupd should not run post-update scripts after updating content from a
3rd-party repo since it may threaten the security of the system.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This PR re-enables the failing auto-update
tests while moving from travis to github actions
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
Sometimes is useful to see the list of dependencies in a tree view form,
for example when trying to remove bundles from a system.
This commit adds the ability of listing the dependencies of a bundle in
a tree view when --verbose is used.
Closes#929
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit moves the path where the content from 3rd-party bundles is
going to be installed from opt/3rd-party/<bundle_name> to
/opt/3rd-party/bundles/<bundle_name> so bundle directories are separated
from other top level directories like bin.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When using "bundle-info BUNDLE --dependencies", information regarding
BUNDLE is presented to the user, this information includes the list of
direct and indirect dependencies BUNDLE has. All direct includes that
are optional (also-add) are marked as such, while there is no way to
distiguish what indirect dependencies are optional with the provided
information.
This commit expands the information shown by the command so indirect
dependencies that are optional are shown as such along with info about
the status of that dependency.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
The 3rd-party repository directory is currently 3rd_party, this name is
incorrect and needs to be changed to 3rd-party.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
The search-file command is restricted to looking for files in the
current version. This commit adds the --version option to the command
that can be used to seach for files in specific versions of Clear.
Closes#1155
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Sometimes when a test finds a problem in the source code it is difficult
to determine what is the problem in the code, so the code needs to be
debugged. In order to do this, the test environment of the particular
test has to be created but without running the test, so we can run the
command executed by the test with the debugger.
This commit adds a function (create_test_environment_only) to create a
specific test environment based on a bats file, but without running the
test.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
For some options of bundle-list, like --deps and --has-dep, we sometimes
need to download a considerable amount of manifests, if that happens
swupd just seems to hang for some time, this time could be considerably
in slow networks.
This commit enables the spinner while the manifests are baing downloaded
during a bundle-list operation so users know swupd is not hung and it is
doing some downloading.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
In order to report progress accuratelly, currently swupd requires a
hardcoded number of steps per operation so we can report how far in the
operation we are. Most of these step totals are wrong.
This commit fixes the number of steps in many swupd functions.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
A spinner was added to swupd to show some kind of progress while
downloading content which its amount is unknown. Once the content is
downloaded the stopped spinner should be removed from the screen. This
commit does that.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit makes a few small changes to the output of the commands to
make it look cleaner and to be consistent with the output of other swupd
commands.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When we remove a 3rd-party repo from the system, we remove the directory
where all its contents got installed, but we don't remove its state
directory.
This commit removes it since we no longer need that state directory.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When performing signature verification to the MoM or to the version
file, if there is any error during the process, a series of errors are
printed to stderr. Many of these error messages are duplicated and most
of them are too detailed.
This commit filters those detailed messages so they are only seen if the
user is using the --debug flag, showing only a few more general
error messages about the signature failure.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit enhance the consistency and readability, of the messages
shown when the signature verification is skipped or fails.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When running an operation, swupd uses a certificate to validate things
ilke the MoM and the version file. The certificate that needs to be used
for 3rd-party repos is different than the one that has to be used for
upstream.
This commit enables the use of the 3rd-party repo certificate that will
be installed in the repo's directory with all swupd operations, except
when adding the repository, in those cases, since the os-core bundle
hasn't been installed yet, we need to provide the cert path through
other means, like using the -C flag..
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When adding a 3rd-party repository we need to make sure that the URL
provided by the user is not already assigned to another 3rd-arty
repository, otherwise we can end up having the same repository multiple
times, just with different names.
This commit checks the URL doesn't already exists.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When listing bundles using the --deps or --has-dep flags which
take a BUNDLE as argument, one or more repositories may not have
the specified BUNDLE, but we should not return a
SWUPD_INVALID_BUNDLE error unless the bundle is not found in any
repository.
This commit enforces that behavior and also modify the output of the
different list options to make them more consistent with one another.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit does some housekeeping in the 3rd-party commands:
- Initialize the function "progress" only after swupd has initialized
successfully.
- Make functions that are not used outside of a file static.
- Avoid using regex or partial verifications on tests when possible.
- Add 3rd-party command flags to the default config file.
- Don't use "repo" in help menus, use the whole "repository" word.
- Add 3rd-party sub-commands to the flag_validator script.
- Add missing values from the autocompletion scripts.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit adds a function that can run an operation in one or all
3rd-party repositories. If a repository is specified then the operation
is run in only that 3rd-party repo, otherwise it is run in all 3rd-party
repos.
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 modifies some of the functions of the test library so it is
possible to update bundles that belong to 3rd-party repositories.
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>
Variables defined with "enum swupd_code" should only receive values that
are consistent with swupd_code.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit reorganizes the location where we read the system version
for some operations like bundle-add and bundle-list to make the code
more reusable.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
The os-core file includes the os-release file, which has the
version of a content server. When adding a new 3rd-party repository we
need to install the os-core bundle from that repo so we can track the
current version of the repo.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
The version of a repository won't be read from the repo.ini file anymore
but from the os-release file at the repo's path_prefix, so this commit
removes all the code related to handling the version key/value in the
repo.ini file.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Instead of getting the current version of a 3rd-party repo during a
bundle-list from the repo.ini file, this commit changes the code so it
is gotten from the os-release file in the appropriate path_prefix for
the repo.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit adds the --repo flag for the 3rd-party bundle-list command
which can be used to specify the repository from which the bundles are
going to be listed.
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 does two things:
- makes the output of all options of bundle-list consistent with each
other.
- makes the ouptut of all bundle-list work properly with the --quiet
flag so it prints the output in a format that is friendly for piping the
output.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When a user is adding bundles from a 3rd-party repository, if the user
doesn't specify the repository, swupd will search for the bundle in all
3rd-party repositories. If the bundle is in more than one 3rd-party
repository, he/she needs to specify the repo to use.
This commit adds the means to specify this repo by providing the
--repo/-R flag for 3rd-party bundle-add.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit adds the section that handles the "3rd-party bundle-add"
options into the default config file. It also enables the use of
the 3rd-party command and its subcommands in the config file.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Heuristics and post-update scripts that apply to upstream bundles don't
apply to bundles installed from 3rd-party repositories. This commit
enables/disables these actions on demand so 3rd-party bundles are
installed correctly.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
The version is usually expected to be a integer throughout the swupd
code, so storing the value as an integer instead of as a string reduces
the number of times we have to convert this value.
Also this commit initializes the version to 10 instead of 0 when first
adding a repo, this is the initial value for any mix, so it makes more
sense.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit separates the 3rd-party tests in their own job since we will
be adding several tests related to 3rd-party in the upcoming days.
This commit also rebalances the tests in the update groups so they are
better balanced.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>