Files
swupd-client/test/functional/update/update-verify-fix-path-missing-dir.bats
William Douglas acad8c47b0 Add format information to update output
The current format is very useful information to get from bug reports
so add it as default output to swupd update.

Signed-off-by: William Douglas <william.douglas@intel.com>
2025-04-24 14:20:58 -07:00

55 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bats
load "../testlib"
test_setup() {
create_test_environment "$TEST_NAME"
create_bundle -L -n test-bundle -f /foo/bar/baz/test-file "$TEST_NAME"
# remove the foo dir
sudo rm -rf "$TARGET_DIR"/foo
create_version "$TEST_NAME" 100 10
update_bundle "$TEST_NAME" test-bundle --update /foo/bar/baz/test-file
}
@test "UPD029: Update corrects a missing directory in the target system" {
assert_dir_not_exists "$TARGET_DIR"/foo
run sudo sh -c "$SWUPD update $SWUPD_OPTS"
assert_status_is 0
expected_output=$(cat <<-EOM
Update started
Preparing to update from 10 to 100 (in format staging)
Downloading packs for:
- test-bundle
Finishing packs extraction...
Warning: File "/foo/bar/baz/test-file" is missing or corrupted
Warning: Couldn't use delta file because original file is corrupted or missing
Consider running "swupd repair" to fix the issue
Statistics for going from version 10 to version 100:
changed bundles : 1
new bundles : 0
deleted bundles : 0
changed files : 1
new files : 0
deleted files : 0
Validate downloaded files
Starting download of remaining update content. This may take a while...
Installing files...
Update was applied
Calling post-update helper scripts
1 file was not in a pack
Update successful - System updated from version 10 to version 100
EOM
)
assert_is_output "$expected_output"
assert_dir_exists "$TARGET_DIR"/foo/bar/baz
assert_file_exists "$TARGET_DIR"/foo/bar/baz/test-file
}
#WEIGHT=3