Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit 6896d8f

Browse files
William Douglasbryteise
authored andcommitted
Rework output checking in test
The disk space check was trying to match exact number of download attempt messages which was not working consistently. Move to simply detecting the failure messages once. Signed-off-by: William Douglas <[email protected]>
1 parent 98a3362 commit 6896d8f

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

test/functional/only_in_ci_system/add-no-disk-space.bats

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ test_setup() {
113113
run sudo sh -c "timeout 30 $SWUPD bundle-add --skip-diskspace-check --allow-insecure-http $SWUPD_OPTS test-bundle"
114114

115115
assert_status_is "$SWUPD_COULDNT_DOWNLOAD_FILE"
116-
expected_output=$(cat <<-EOM
116+
expected_output1=$(cat <<-EOM
117117
Warning: This is an insecure connection
118118
The --allow-insecure-http flag was used, be aware that this poses a threat to the system
119119
Loading required manifests...
@@ -126,19 +126,15 @@ test_setup() {
126126
Starting download of remaining update content. This may take a while...
127127
Error: Curl - Error downloading to local file - 'http://localhost:$(get_web_server_port "$TEST_NAME")/$TEST_NAME/web-dir/10/.*.tar'
128128
Error: Curl - Check free space for $ABS_TEST_DIR/testfs/state\\?
129-
Error: Curl - Error downloading to local file - 'http://localhost:$(get_web_server_port "$TEST_NAME")/$TEST_NAME/web-dir/10/.*.tar'
130-
Error: Curl - Check free space for $ABS_TEST_DIR/testfs/state\\?
131-
Error: Curl - Error downloading to local file - 'http://localhost:$(get_web_server_port "$TEST_NAME")/$TEST_NAME/web-dir/10/.*.tar'
132-
Error: Curl - Check free space for $ABS_TEST_DIR/testfs/state\\?
133-
Error: Curl - Error downloading to local file - 'http://localhost:$(get_web_server_port "$TEST_NAME")/$TEST_NAME/web-dir/10/.*.tar'
134-
Error: Curl - Check free space for $ABS_TEST_DIR/testfs/state\\?
135-
Error: Curl - Error downloading to local file - 'http://localhost:$(get_web_server_port "$TEST_NAME")/$TEST_NAME/web-dir/10/.*.tar'
136-
Error: Curl - Check free space for $ABS_TEST_DIR/testfs/state\\?
129+
EOM
130+
)
131+
expected_output2=$(cat <<-EOM
137132
Error: Could not download some files from bundles, aborting bundle installation
138133
Failed to install 1 of 1 bundles
139134
EOM
140135
)
141-
assert_regex_is_output "$expected_output"
136+
assert_regex_in_output "$expected_output1"
137+
assert_in_output "$expected_output2"
142138

143139
}
144140
#WEIGHT=16

0 commit comments

Comments
 (0)