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>
The testlib had two functions to create 3rd-party repositories that were
very similar but with only one difference, one function only created the
3rd-party repo, the other one created the repo and also added it as if
the user had already done a "swupd 3rd-party add" on it.
This commit merges both functions into one to avoid code duplication,
make the test library easier to maintain, and make it less confusing.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
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>
When removing a 3rd-party bundle, all scripts that export the binaries of
the bundle should be removed from the target system unless they are still
required by another installed 3rd-party bundle.
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>
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>
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>