Files
swupd-client/test/functional/api/api-3rd-party-list.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

31 lines
571 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"
create_third_party_repo -a "$TEST_NAME" 10 1 repo1
export repo1="$ABS_TP_URL"
create_third_party_repo -a "$TEST_NAME" 10 1 repo2
export repo2="$ABS_TP_URL"
}
@test "API073: 3rd-party list" {
run sudo sh -c "$SWUPD 3rd-party list $SWUPD_OPTS --quiet"
assert_status_is "$SWUPD_OK"
expected_output=$(cat <<-EOM
repo1: file://$repo1
repo2: file://$repo2
EOM
)
assert_is_output "$expected_output"
}