Files
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

46 lines
933 B
Bash
Executable File

#!/usr/bin/env bats
# Author: Karthik Prabhu Vinod
# Email: karthik.prabhu.vinod@intel.com
load "../testlib"
test_setup() {
create_test_environment "$TEST_NAME" 10 1
}
@test "INF001: Basic test, Check info verbose" {
run sudo sh -c "$SWUPD info $SWUPD_OPTS --verbose"
assert_status_is "$SWUPD_OK"
expected_output=$(cat <<-EOM
Distribution: Swupd Test Distro
Installed version: 10 (format 1)
Version URL: file://$ABS_TEST_DIR/web-dir
Content URL: file://$ABS_TEST_DIR/web-dir
EOM
)
assert_is_output "$expected_output"
}
@test "INF002: Basic test, Check info basic" {
run sudo sh -c "$SWUPD info $SWUPD_OPTS"
assert_status_is "$SWUPD_OK"
expected_output=$(cat <<-EOM
Distribution: Swupd Test Distro
Installed version: 10
Version URL: file://$ABS_TEST_DIR/web-dir
Content URL: file://$ABS_TEST_DIR/web-dir
EOM
)
assert_is_output "$expected_output"
}
#WEIGHT=2