Files
Otavio Pontes eeb3d61fea testlib: Always remove test enviroment implicitly at the end of tests
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>
2020-04-07 13:52:49 -07:00

37 lines
833 B
Bash
Executable File

#!/usr/bin/env bats
# Author: Castulo Martinez
# Email: castulo.martinez@intel.com
load "../testlib"
test_setup() {
create_test_environment "$TEST_NAME"
create_bundle -e -n test-bundle1 -f /file_1,/foo/file_2 "$TEST_NAME"
}
@test "ADD032: Add an experimental bundle" {
# Experimental bundles are added normally but the user gets warned about it
run sudo sh -c "$SWUPD bundle-add $SWUPD_OPTS test-bundle1"
assert_status_is 0
expected_output=$(cat <<-EOM
Loading required manifests...
Warning: Bundle test-bundle1 is experimental
No packs need to be downloaded
Validate downloaded files
Starting download of remaining update content. This may take a while...
Installing files...
Calling post-update helper scripts
Successfully installed 1 bundle
EOM
)
assert_is_output "$expected_output"
}
#WEIGHT=2