tests: check if empty stage correctly gets removed

This commit is contained in:
Enno Boland 2016-03-22 09:39:38 +01:00
parent 2e6b2a6c94
commit 3a067f2e20

View File

@ -51,7 +51,36 @@ issue19_body() {
atf_check_equal $? 0
}
atf_test_case remove_from_stage
remove_from_stage_head() {
atf_set "descr" "xbps-rindex(8) -r: don't removing if there's staging test"
}
remove_from_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
rm foo-1.1_1*
cd ..
xbps-rindex -c some_repo
[ -f *-stagedata ]
atf_check_equal $? 1
}
atf_init_test_cases() {
atf_add_test_case noremove
atf_add_test_case issue19
atf_add_test_case remove_from_stage
}