Files
swupd-client/test/functional/os-install/install-latest-missing.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

32 lines
700 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 "$WEB_DIR/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"
}
#WEIGHT=1