xbps-query: list unavailable repositories in -L mode

This commit is contained in:
Piotr Wójcik
2021-12-04 23:27:02 +01:00
committed by Duncan Overbruck
parent 49bd3d62b5
commit ce4fd6a63c
4 changed files with 50 additions and 10 deletions

View File

@@ -2,5 +2,6 @@ syntax("kyuafile", 1)
test_suite("xbps-query")
atf_test_program{name="ignore_repos_test"}
atf_test_program{name="list_test"}
atf_test_program{name="remote_test"}
atf_test_program{name="query_test"}

View File

@@ -1,7 +1,7 @@
TOPDIR = ../../..
-include $(TOPDIR)/config.mk
TESTSHELL = ignore_repos_test remote_test query_test
TESTSHELL = ignore_repos_test list_test remote_test query_test
TESTSSUBDIR = xbps/xbps-query
EXTRA_FILES = Kyuafile

View File

@@ -0,0 +1,28 @@
#! /usr/bin/env atf-sh
# Test that xbps-query(1) list modes work as expected
atf_test_case list_repos
list_repos_head() {
atf_set "descr" "xbps-query(1) -L"
}
list_repos_body() {
mkdir -p some_repo pkg_A/bin
touch pkg_A/bin/file
cd some_repo
xbps-create -A noarch -n foo-1.0_1 -s "foo pkg" ../pkg_A
atf_check_equal $? 0
xbps-create -A noarch -n baz-1.0_1 -s "baz pkg" ../pkg_A
atf_check_equal $? 0
xbps-rindex -d -a $PWD/*.xbps
atf_check_equal $? 0
rm -f *.xbps
cd ..
output="$(xbps-query -C empty.conf -i --repository=some_repo --repository=vanished_repo -L | tr -d '\n')"
atf_check_equal "$output" " 2 ${PWD}/some_repo (RSA unsigned) -1 vanished_repo (RSA maybe-signed)"
}
atf_init_test_cases() {
atf_add_test_case list_repos
}