tests: add tests to ensure that packages in stage are not removed
This commit is contained in:
parent
3431715d67
commit
b9ce711848
@ -3,3 +3,4 @@ syntax("kyuafile", 1)
|
||||
test_suite("xbps-rindex")
|
||||
atf_test_program{name="add_test"}
|
||||
atf_test_program{name="clean_test"}
|
||||
atf_test_program{name="remove_test"}
|
||||
|
@ -1,7 +1,7 @@
|
||||
TOPDIR = ../../..
|
||||
-include $(TOPDIR)/config.mk
|
||||
|
||||
TESTSHELL = add_test clean_test
|
||||
TESTSHELL = add_test clean_test remove_test
|
||||
TESTSSUBDIR = xbps/xbps-rindex
|
||||
EXTRA_FILES = Kyuafile
|
||||
|
||||
|
39
tests/xbps/xbps-rindex/remove_test.sh
Normal file
39
tests/xbps/xbps-rindex/remove_test.sh
Normal file
@ -0,0 +1,39 @@
|
||||
#! /usr/bin/env atf-sh
|
||||
# Test that xbps-rindex(8) -c (clean mode) works as expected.
|
||||
|
||||
# 1st test: make sure that nothing is removed if there are no changes.
|
||||
atf_test_case noremove_stage
|
||||
|
||||
noremove_stage_head() {
|
||||
atf_set "descr" "xbps-rindex(8) -r: don't removing if there's staging test"
|
||||
}
|
||||
|
||||
noremove_stage_body() {
|
||||
mkdir -p some_repo pkg_A pkg_B
|
||||
cd some_repo
|
||||
xbps-create -A noarch -n foo-1.0_1 -s "foo pkg" --shlib-provides "foo.so.1" ../pkg_A
|
||||
atf_check_equal $? 0
|
||||
xbps-create -A noarch -n bar-1.0_1 -s "foo pkg" --shlib-requires "foo.so.1" ../pkg_B
|
||||
atf_check_equal $? 0
|
||||
xbps-rindex -d -a $PWD/*.xbps
|
||||
atf_check_equal $? 0
|
||||
xbps-create -A noarch -n foo-1.1_1 -s "foo pkg" --shlib-provides "foo.so.2" ../pkg_A
|
||||
atf_check_equal $? 0
|
||||
xbps-rindex -d -a $PWD/*.xbps
|
||||
atf_check_equal $? 0
|
||||
[ -f *-stagedata ]
|
||||
atf_check_equal $? 0
|
||||
xbps-rindex -r some_repo
|
||||
atf_check_equal $? 0
|
||||
cd some_repo
|
||||
[ -f foo-1.0_1* ]
|
||||
atf_check_equal $? 0
|
||||
[ -f foo-1.1_1* ]
|
||||
atf_check_equal $? 0
|
||||
[ -f bar-1.0_1* ]
|
||||
atf_check_equal $? 0
|
||||
}
|
||||
|
||||
atf_init_test_cases() {
|
||||
atf_add_test_case noremove_stage
|
||||
}
|
Loading…
Reference in New Issue
Block a user