mirror of
https://github.com/clearlinux/swupd-client.git
synced 2026-09-05 13:11:41 +00:00
Instead of initializing curl library on start, initialize it only when needed. The advantage of this approach is that we can run some commands offline, if there's no file to download. Fixes #801 Fixes #895 Fixes #277 Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
31 lines
689 B
Bash
Executable File
31 lines
689 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"
|
|
# remove the formatstaging/latest
|
|
sudo rm -rf "$WEBDIR/version/formatstaging/latest"
|
|
|
|
}
|
|
|
|
@test "INS012: Try doing an OS install based on the latest version and a version file can't be found on server" {
|
|
|
|
# if swupd cannot determine what the "latest" version is, it should fail
|
|
|
|
run sudo sh -c "$SWUPD os-install $SWUPD_OPTS --version latest"
|
|
|
|
assert_status_is_not "$SWUPD_OK"
|
|
expected_output=$(cat <<-EOM
|
|
Error: Unable to get latest version for install
|
|
Installation failed
|
|
EOM
|
|
)
|
|
assert_in_output "$expected_output"
|
|
|
|
}
|