mirror of
https://github.com/clearlinux/swupd-client.git
synced 2026-09-03 04:01:34 +00:00
The "bundle-list" command can be used to show all installed bundles in the system, however, currently there is no way to know which of those installed bundles were implicitly or explicitly installed. This commit implements the "--status" flag for bundle-list which can be used to show which bundles were explicitly or implicitly installed. Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
54 lines
1.1 KiB
Bash
Executable File
54 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bats
|
|
|
|
load "../testlib"
|
|
|
|
test_setup() {
|
|
|
|
create_test_environment "$TEST_NAME"
|
|
create_bundle -n test-bundle1 -f /foo "$TEST_NAME"
|
|
create_bundle -n test-bundle2 -f /bar "$TEST_NAME"
|
|
create_bundle -L -n test-bundle3 -f /baz "$TEST_NAME"
|
|
create_bundle -L -t -n test-bundle4 -f /bat "$TEST_NAME"
|
|
|
|
}
|
|
|
|
@test "LST002: List all available bundles" {
|
|
|
|
run sudo sh -c "$SWUPD bundle-list $SWUPD_OPTS --all"
|
|
|
|
assert_status_is 0
|
|
expected_output=$(cat <<-EOM
|
|
All available bundles:
|
|
- os-core
|
|
- test-bundle1
|
|
- test-bundle2
|
|
- test-bundle3
|
|
- test-bundle4
|
|
|
|
Total: 5
|
|
EOM
|
|
)
|
|
assert_is_output --identical "$expected_output"
|
|
|
|
}
|
|
|
|
@test "LST026: List all available bundles and their installation status" {
|
|
|
|
run sudo sh -c "$SWUPD bundle-list $SWUPD_OPTS --all --status"
|
|
|
|
assert_status_is 0
|
|
expected_output=$(cat <<-EOM
|
|
All available bundles:
|
|
- os-core (installed)
|
|
- test-bundle1
|
|
- test-bundle2
|
|
- test-bundle3 (installed)
|
|
- test-bundle4 (explicitly installed)
|
|
|
|
Total: 5
|
|
EOM
|
|
)
|
|
assert_is_output --identical "$expected_output"
|
|
|
|
}
|