tests: new test for xbps-query(8) -Rf when binpkg is not available.

This commit is contained in:
Juan RP 2014-05-06 11:16:00 +02:00
parent 1e273bf575
commit 6c8a073fb2
5 changed files with 42 additions and 1 deletions

View File

@ -1,5 +1,5 @@
-include ../../config.mk -include ../../config.mk
SUBDIRS = common libxbps xbps-rindex SUBDIRS = common libxbps xbps-query xbps-rindex
include ../../mk/subdir.mk include ../../mk/subdir.mk

View File

@ -3,4 +3,5 @@ syntax("kyuafile", 1)
test_suite("xbps") test_suite("xbps")
include('libxbps/Kyuafile') include('libxbps/Kyuafile')
include('xbps-query/Kyuafile')
include('xbps-rindex/Kyuafile') include('xbps-rindex/Kyuafile')

View File

@ -0,0 +1,4 @@
syntax("kyuafile", 1)
test_suite("xbps-query")
atf_test_program{name="remote_test"}

View File

@ -0,0 +1,8 @@
TOPDIR = ../../..
-include $(TOPDIR)/config.mk
TESTSHELL = remote_test
TESTSSUBDIR = xbps/xbps-query
EXTRA_FILES = Kyuafile
include $(TOPDIR)/mk/test.mk

View File

@ -0,0 +1,28 @@
#! /usr/bin/env atf-sh
# Test that xbps-query(8) remote modes work as expected
# 1st test: test that -Rf does not segfault when binpkg is not available
atf_test_case remote_files
remote_files_head() {
atf_set "descr" "xbps-query(8) -Rf: binpkg files test"
}
remote_files_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-rindex -a *.xbps
atf_check_equal $? 0
rm -f *.xbps
cd ..
xbps-query -C empty.conf --repository=some_repo -f foo-1.0_1
# ENOENT is ok because binpkg does not exist
atf_check_equal $? 2
}
atf_init_test_cases() {
atf_add_test_case remote_files
}