16 Commits
Author SHA1 Message Date
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
Otavio Pontes 64d8222e4e test: Rebalance weights
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-17 18:44:18 -07:00
Otavio Pontes d61288464d tests: Auto rebalance tests based on how long they take to long
This patch adds 2 scripts used to balance test execution. The weight_tests.bash
runs all tests and sets a weight to them based on how long they take to run. The
other, filter_bats_list.bash, use this information to split the tests in groups to
be executed by github actions.
When a new test is added the script will consider it with an average weight, so this
shouldn't unbalance the system right away. After some time, if we notice that the
system is not balanced anymore we can just run the weight_tests.bash again to rebalance.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-02-20 13:22:31 -08:00
Castulo Martinez 43c7bf074a Validate tracking directory during swupd init
Insteaf of validating the tracking directory exists and is not empty
every time we want to track a bundle, we can validate it during swupd
initialization.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-10-30 13:38:41 -06:00
Otavio Pontes d2590a1b9e fullfile: Improve output of fullfile downloads
Print a "Validate downloaded files" message to separate 2 different progress bars
and improve the output when downloading extra fullfiles

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2019-10-18 09:27:25 -07:00
Otavio Pontes 08650efcc6 bundle_add: Rework on bundle-add main function
Reorganize bundle add main function to reuse more code and improve performance.
Stopped using subscription code from bundles and now using a new function to
recurse manifests, gaining around 30% cpu time on manifest processing.

Started using staging code from update and preventing checking hashes more than
once for some files on bundle-add operations gaining around of 30% CPU time too.

Overall executions of this new bundle-add uses 30% less CPU time but because this
operation is very IO intensitive this reflects to a gain in around 10% of total
time in systems I tested.
2019-10-04 17:43:18 -05:00
Castulo Martinez 5f407dd525 Showing indirect bundles installed by bundle-add
When installing a bundle using bundle-add, swupd also installs any
dependency not already installed in the system (if any). When the
bundle-add operation is complete, swupd reports how many of the
requested bundles were successfully installed and how many failed, but
if there are bundles that got installed as a side effect because they
are dependencies of the requested bundle(s), they are not included in
the summary of bundle-add.

This commit adds the number of dependencies installed in the summary of
bundle-add so it provides a more accurate view of the changes in the
system.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-09-16 17:34:18 -07:00
Castulo Martinez c521417205 Including a few more cosmetic changes for "verify"
This commit adds a few more cosmetic changes to the commands that run
verify in the back for consistency.
- Different steps in the update process are separated by a blank line.
- Messages from swupd should not finish with a '.'

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-06-14 14:50:09 -07:00
Castulo Martinez a7cf50d360 Improving output messages in bundle-add
Adding messages where swupd could take some time to finish a step so
users know better where the process is at.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-05-13 14:38:20 -07:00
Castulo Martinez 755e7e1527 Use swupd_progress_callback for fullfile download
This commit makes use of the swupd_progress_callback() function to
report progress downloading fullfiles based on how much data we have
downloaded vs the number of files downloaded. This callback will only be
used when the number of files to be downloaded are less than MAX_FILES,
calculating the total download size can be very costly if the files are
too many. If the files to be downloaded are more than MAX_FILES we will
fallback to reporting download progress based on file count as before.

When installing bundles or doing updates, swupd creates a list of files
that need to be downloaded. This list may contain files that were
already downloaded via packages and it often does. These files are then
skipped at the moment of downloading them since they are already in the
system. This causes a misleading output that shows the user that
fullfiles will be downloaded when they are actually not.

This commit filters the list of fullfiles to be downloaded to only
contain those ones that actually need to be downloaded.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-04-18 10:29:49 -07:00
Castulo Martinez d7210882e6 Use the swupd_progress_callback for packs download
This commit makes use of the swupd_progress_callback() function to
report progress downloading packs based on how much data we have
downloaded vs the number of files downloaded.

This commit also fixes a bug in the download_subscribed_packs function.
Swupd was not downloading the correct pack for bundles not installed in
the system that had been recently added as dependency of another
installed bundle.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-04-18 10:29:49 -07:00
William Douglas 6da50ee5d7 Fix manually installed bundle tracking and add tests
Update bundle tracking to correctly initialize tracked bundle state
and add testing to validate tracking works as expected.
2019-02-13 12:23:28 -08:00
Castulo Martinez 39e2d40127 Define size of test environment
Sometimes is useful to be able to limit the size of a test environment
to validate some scenarios that are bound to disk size.

This commit adds a -s (size) option that can be used when creating test
environments so the user can control how much space is available in that
environment. If not used, the test environment works the same as before.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-01-10 14:05:01 -08:00
Castulo Martinez 1438148bbd Adding functions to get test IDs in testlib
Every test should include a unique ID, so it is necessary to have
a way of knowing what is the next available ID for the group of
tests.

This commit helps with that issue by implementing the following
features in the test library:
 - Adds the function get_test_list which can be used to print a
list of tests in a specific group directory.
 - Adds the function get_next_available_id which return the next
test ID that can be used in a new test.
 - When using the generate_test function to generate an empty test
the next available ID will be used for the template.

This commit also adds the ID to a bundle-add test that was missing it.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2018-11-02 15:25:09 -07:00
Castulo Martinez 9eed3cd4d1 Adding IDs to bundle-add tests
As part of the effort of having the functional tests better
organized and have traceability we are adding unique IDs to
every test.

This commit adds the IDs to the bundle-add tests. It also
changes the description of some of them to make them clearer,
and removes duplicates.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2018-10-30 09:59:56 -07:00
Castulo Martinez c857216c01 Replacing old bundleadd tests
The old bundleadd tests used the swupdlib.bash library that was
replaced by testlib.bash.

This commit replaces those old bundleadd tests with new versions
of the same tests that now use testlib.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2018-09-27 12:48:14 -07:00