33 Commits
Author SHA1 Message Date
William Douglas 9fdf88c74b Test fixups and update for newer systemd
systemctl reports that the timer file is missing now as a return code
4 so update the unknown start number.

Also with this change SWUPD_NO is no longer always returned so add a
new helper to check if a status is one of multiple options.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-07-29 11:46:45 -07: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
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 40472f5a21 Updating "clean" to remove new and old cache dirs
"Swupd clean" removes cache from certain pre-defined directories. This
commit udpdates the locations where clean looks for cache so it includes
the new locations where the cache is stored.

Swupd will continue looking at old cache locations until the bump to
format 31.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-06-08 12:10:39 -07:00
Castulo Martinez 8e4c017365 Moving downloaded manifests to their own directory
When swupd downloads manifests to the statedir they are downloaded in
directories that represent the version of clear that the manifests
belong to. However those version directories are stored in the statedir,
root directory. This commit moves them into their own "manifest"
directory so there is more consistency with the downloaded files.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-15 11:47:33 -07:00
Otavio Pontes d5d3c599d2 Revert "Moving downloaded manifests to their own directory"
This reverts commit 336fee7a9d.
2020-05-15 08:18:37 -07:00
Castulo Martinez 336fee7a9d Moving downloaded manifests to their own directory
When swupd downloads manifests to the statedir they are downloaded in
directories that represent the version of clear that the manifests
belong to. However those version directories are stored in the statedir,
root directory. This commit moves them into their own "manifest"
directory so there is more consistency with the downloaded files.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-14 11:03:51 -07:00
Castulo Martinez bca38243d8 3rd-party: add bundle-remove --orphans flag
Implementing the --orphans option to remove bundles no longer required
by tracked bundles from 3rd-party repositories.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-08 09:30:50 -07:00
Castulo Martinez 4d0a6d29a1 Implement bundle-remove --orphans flag
This commit implements the --orphan flag for bundle-remove which can be
used to remove bundles that are no longer required by tracked bundles.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-08 09:30:50 -07:00
Castulo Martinez 0b47050848 3rd-party: add --orphans flag for bundle-list
Implementing the --orphans flag for 3rd-party bundle-list.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-05 10:37:44 -07:00
Castulo Martinez 4cd51ca5d8 Add --orphans flag to bundle-list
Adding the --orphans flag to bundle-list which shows those bundles that
are installed ut no longer required by any tracked bundle.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-05-05 10:37:44 -07:00
Castulo Martinez 201950445a Reporting if a file was fixed or not with --quiet
When using --quiet, there was no way of knowing if a file had been
successfully repaired or not. This commit fixes that.

Closes #1504

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-28 09:13:45 -07:00
Castulo Martinez 8b9a2e8510 API: Do not validate error messages in API tests
The tests in test/functional/api are going to validate the --quiet
output is rarely changed, therefore only expected output should be
validated and not warnings or error messages.

Closes #1502

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-27 16:04:05 -07:00
Otavio Pontes 9a8d5a09e3 target_root: Reorganize function verify_fix_path()
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-27 14:50:22 -07:00
Castulo Martinez 5e3164523d Testlib: function to add os-core-update to an env
For some tests is useful to have a minimal version of the os-core-update
bundle since some system files are tracked there.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-24 09:32:28 -07:00
Castulo Martinez 1e3cb68979 API: output for mirror
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:

- swupd mirror

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-20 10:52:14 -07:00
Castulo Martinez dbe702ca03 API: output for 3rd-party add, remove, list
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:

- swupd 3rd-party add
- swupd 3rd-party remove
- swupd 3rd-party list

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-20 09:51:22 -07:00
Otavio Pontes 64d8222e4e test: Rebalance weights
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-17 18:44:18 -07:00
Castulo Martinez 5b2773455f API: output for hashdump
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:

- swupd hashdump

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-17 12:21:40 -07:00
Castulo Martinez 5b69e4585c API: output for [3rd-party] clean
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:

- swupd clean
- swupd 3rd-party clean

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-17 11:43:32 -07:00
Castulo Martinez 194d54544e API: output for os-install
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:

- swupd os-install

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-17 10:39:26 -07:00
Castulo Martinez 4f852953d0 API: output for [3rd-party] repair
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:

- swupd repair
- swupd 3rd-party repair

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-04-17 10:37:26 -07:00
Castulo Martinez 53878d8317 API: output for [3rd-party] diagnose
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>
2020-04-15 16:15:28 -07:00
Castulo Martinez bc58b8bb48 API: output for search-file
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>
2020-04-15 15:35:00 -07:00
Castulo Martinez 532d5743ca API: output for [3rd-party] bundle-info
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>
2020-04-15 08:47:57 -07:00
Castulo Martinez b686c07719 API: output for [3rd-party] bundle-list
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>
2020-04-14 08:55:59 -07:00
Castulo Martinez faf2d994fb API: output for [3rd-party] bundle-add
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>
2020-04-10 16:44:34 -07:00
Castulo Martinez 2fb27c3b5f API: output for [3rd-party] bundle-remove
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>
2020-04-10 15:21:59 -07:00
Castulo Martinez d94920a7d0 API: output for [3rd-party] update
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>
2020-04-10 10:15:27 -07:00
Castulo Martinez d22bdeb5c4 API: output for [3rd-party] check-update
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>
2020-04-09 09:56:17 -07:00
Castulo Martinez f3bb9765da API: output for autoupdate
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>
2020-04-08 15:47:31 -07:00
Castulo Martinez b62aae3c8c API: output for [3rd-party] info
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>
2020-04-08 15:02:40 -07:00