Files
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

35 lines
894 B
Bash
Executable File

#!/usr/bin/env bats
load "../testlib"
test_setup() {
create_test_environment -r "$TEST_NAME"
create_bundle -L -n test-bundle -f /usr/lib/kernel/test-file "$TEST_NAME"
}
@test "REM008: Removing a bundle containing a boot file" {
run sudo sh -c "$SWUPD bundle-remove $SWUPD_OPTS test-bundle"
assert_status_is 0
assert_file_not_exists "$TARGET_DIR"/usr/share/clear/bundles/test-bundle
assert_file_not_exists "$TARGET_DIR"/usr/lib/kernel/testfile
assert_dir_not_exists "$TARGET_DIR"/usr/lib/kernel
# these files should not be deleted because they are also part of os-core
assert_dir_exists "$TARGET_DIR"/usr/lib
assert_dir_exists "$TARGET_DIR"/usr/
expected_output=$(cat <<-EOM
The following bundles are being removed:
- test-bundle
Deleting bundle files...
Total deleted files: 3
Successfully removed 1 bundle
EOM
)
assert_is_output "$expected_output"
}
#WEIGHT=3