tests: new test for xbps-query(8) -Rf when binpkg is not available.
This commit is contained in:
		@@ -1,5 +1,5 @@
 | 
			
		||||
-include ../../config.mk
 | 
			
		||||
 | 
			
		||||
SUBDIRS = common libxbps xbps-rindex
 | 
			
		||||
SUBDIRS = common libxbps xbps-query xbps-rindex
 | 
			
		||||
 | 
			
		||||
include ../../mk/subdir.mk
 | 
			
		||||
 
 | 
			
		||||
@@ -3,4 +3,5 @@ syntax("kyuafile", 1)
 | 
			
		||||
test_suite("xbps")
 | 
			
		||||
 | 
			
		||||
include('libxbps/Kyuafile')
 | 
			
		||||
include('xbps-query/Kyuafile')
 | 
			
		||||
include('xbps-rindex/Kyuafile')
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								tests/xbps/xbps-query/Kyuafile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								tests/xbps/xbps-query/Kyuafile
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
syntax("kyuafile", 1)
 | 
			
		||||
 | 
			
		||||
test_suite("xbps-query")
 | 
			
		||||
atf_test_program{name="remote_test"}
 | 
			
		||||
							
								
								
									
										8
									
								
								tests/xbps/xbps-query/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								tests/xbps/xbps-query/Makefile
									
									
									
									
									
										Normal 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
 | 
			
		||||
							
								
								
									
										28
									
								
								tests/xbps/xbps-query/remote_test.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								tests/xbps/xbps-query/remote_test.sh
									
									
									
									
									
										Normal 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
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user