Files
swupd-client/test/functional/os-install/install-latest-missing.bats
Otavio Pontes 0696de4435 curl: Initialize curl as needed
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>
2019-08-20 10:48:20 -07:00

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"
}