Files
swupd-client/test/functional/update/update-skip-scripts.bats
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

46 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bats
load "../testlib"
test_setup() {
create_test_environment "$TEST_NAME"
create_version "$TEST_NAME" 100 10
update_bundle "$TEST_NAME" os-core --update /core
update_bundle "$TEST_NAME" os-core --add /testfile
}
@test "UPD033: Updating a system without running the post-update scripts" {
run sudo sh -c "$SWUPD update --no-scripts $SWUPD_OPTS"
# Should still be successful
assert_status_is 0
expected_output=$(cat <<-EOM
Update started
Preparing to update from 10 to 100
Downloading packs for:
- os-core
Finishing packs extraction...
Statistics for going from version 10 to version 100:
changed bundles : 1
new bundles : 0
deleted bundles : 0
changed files : 1
new files : 1
deleted files : 0
Validate downloaded files
No extra files need to be downloaded
Installing files...
Update was applied
Warning: post-update helper scripts skipped due to --no-scripts argument
Update successful - System updated from version 10 to version 100
EOM
)
assert_is_output "$expected_output"
# The file should still be added
assert_file_exists "$TARGET_DIR"/testfile
}
#WEIGHT=3