When creating the fullfile and installing the bundle in targetfs we
need to preserve the owner and mode of file
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
XDG_CONFIG_DIRS variable was added with an incorrect name. XDG_CONF_DIRS was used instead.
Fixing that.
Fix#1443
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
When dealing with extra files during a "verify" action, we cannot really
tell how far in the process we are, so we should be defining that step
as PROGRESS_UNDEFINED. Since we are using a PROGRESS_BAR, it is causing
to show an extra "[100%]" at the end of the diagnose process.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:
- swupd diagnose
- swupd 3rd-party diagnose
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:
- swupd search-file
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:
- swupd bundle-info
- swupd 3rd-party bundle-info
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:
- swupd bundle-list
- swupd 3rd-party bundle-list
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When a MoM contains an experimental bundle and the hashes in the MoM are
regenerated, the experimental bundles are being skipped. This commit
fixes that issue.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When listing bundles using "swupd bundle-list --status" we were
distinguishing bundles that were explicitly installed, by marking them
as such and since bundle-list shows only bundles tha are installed, bundles
that were not marked as explicitelly installed were assumed to be
just installed.
When we use "bundle-list --all --status" (which shows installed and
uninstalled bundles), we were marking files as "installed", "explicitly
installed" and bundles without any of these distinctions were assumed to
be not installed. This could cause confusion.
This PR changes the "bundle-list --status" so we always label bundles
as either "implicitly installed" or "installed" (even though it couls
sound a little redundant) so it is consistent with the way they are
labeled during "bundle-list --all --status".
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When creating test bundles, we are not including os-core in them by
default. This is how it works in production so we should do it so it
resembles the real production environment more accurately.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:
- swupd bundle-add
- swupd 3rd-party bundle-add
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:
- swupd bundle-remove
- swupd 3rd-party bundle-remove
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When the template used for creating the wrapper scripts changes, all
exported binaries should have the scripts regenerated during updates
regardless of if the binary changed.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
The update_bundle() function of testlib has many different options to
create updates for test bundles, all of those supported the creation of
the update in a 3rd-party repository except for the --header-only
option. This commit adds that support do --header-nly flag can also be
used for 3rd-party repos.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:
- swupd update
- swupd 3rd-party update
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:
- swupd check-update
- swupd 3rd-party check-update
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit provides a minimal output to be displayed when the --quiet
flag is used for this command:
- swupd autoupdate
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:
- swupd info
- swupd 3rd-party info
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Current implementation was only removing test enviroment for envs created
on test setup. And test_teardown function needed to be overriden in case
global_setup() was used.
Now always cleaning the enviroment for both use cases, test_setup() and
global_setup(). The user doesn't have the control anymore on that and
if the user wants to keep the env KEEP_ENV variable should be used.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Test environment can be created on global_setup() or test_setup() and that
change the behavior of several operations on testlib.
Because of that, let the user create the test environment as desired instead
of forcing it on test_setup()
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
When generating the certificate for tests, openssl is printing messages
to the terminal, we are already selecting what to print by using the
debug_msg() function, so these unwanted messages shouldnot be printed.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
We need to install/uninstall on test_setup, not global_setup because env
variables are not preserved between tests
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>
When updating a bundle using testlib, if the file is updated, and the
update includes a file type change, testlib was updating the manifest
with the correct type but was overwriting the other status flags, so if
a file was marked as 'x' (exported) before, that flag was being removed.
This commit fixes the issue by only updating the flag that relates to
the file type.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
During a 3rd-party repair, the wrapper scripts of all binaries verified
should be regenerated regardless of if the binary was repaired or not.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When updating a 3rd-party bundle, if any of its binaries is modified,
or the binary is new swupd needs to recreate the wrapper script.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When running tests sometimes is useful to see how the filesystem of the
test target system looks like before and after a test. This commit adds
a function to show that chroot fs in a tree view, and it calls that
function in the setup and teardown of tests if DEBUG_TESTS is set.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit provides a function that can be used to generate update
content based on the content from a directory specified by the user.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit adds a function that retrieve the matching entry from a
manifest or all entries if no key is provided.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit adds a function to create a bundle based on the content form
a directory specified by the user.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit has a few small corrections in testlib:
- it removes some code that was used for iterative manifests
- it correct some help menus
- favors the use of debug_msg over an if statement for filtering
messages
- do not follow links in the function that creates tars from
fullfiles
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When a test is adding a symlink to a manifest, the file the link is
pointing to is also added to the manifest. This commit prevents the file
pointed by the link to be added, if the user wants to add this file they
can do it explicitely.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit adds support for file type changes when using bundle_update,
so the correct type is added to the manifest.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
It is considered safe to accept expired signatures to validate the latest
file because we are always checking again the signature of the MoM file.
Adding tests to validate that:
- Expired signatures for latest file works
- Expired signatures for MoM fails even when latest signature is correct
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
- Check if custom certificate is working when valid
- Check if we are having errors on expired certificate
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2 groups were created:
- slow: Tests that are very slow because of sleeps, so we can run them all
in parallel
- system: Tests that make change to the system, so they can cause problems
when running in parallel, so we run them in series.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
When creating a wrapper for 3rd-party binaries, append relative
/usr/share and /usr/local/share to XDG_DATA_DIRS variable and /etc
to XDG_CONF_DIRS.
Fix#1411
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
This commit removes the extra slash '/' from the path from:
- the update_boot function
- the verifytime script
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When a manifest delta was incorrect, the full manifest was used. But in the
case of a correct delta that produces an invalid manifest, swupd was never
trying to download the full manifest.
Changing code to try to use deltas only once. On first error, always retry
downloading the full manifest.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
When swupd is adding a 3rd-party repo and it finds a non empty directory
that matches the repo's name in the content path it warns the user and
aborts. This may have been caused by a corrupt repo.
This commit adds a --force flag to allow users to instruct swupd to
remove the existing directory and its conent and continue adding the
3rd-party repo.
Closes#1388
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>