diff --git a/tests/xbps/xbps-rindex/clean_test.sh b/tests/xbps/xbps-rindex/clean_test.sh index 487123d4..cc94e5aa 100644 --- a/tests/xbps/xbps-rindex/clean_test.sh +++ b/tests/xbps/xbps-rindex/clean_test.sh @@ -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 }