Skip to content

Commit aad6e7e

Browse files
committed
tests: check if xbps-rindex --remove-obsoletes actually removes files
1 parent 1654a50 commit aad6e7e

1 file changed

Lines changed: 17 additions & 20 deletions

File tree

tests/xbps/xbps-rindex/remove_test.sh

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,23 @@ noremove_stage_head() {
1111
noremove_stage_body() {
1212
mkdir -p some_repo pkg_A pkg_B
1313
cd some_repo
14-
xbps-create -A noarch -n foo-1.0_1 -s "foo pkg" --shlib-provides "foo.so.1" ../pkg_A
15-
atf_check_equal $? 0
16-
xbps-create -A noarch -n bar-1.0_1 -s "foo pkg" --shlib-requires "foo.so.1" ../pkg_B
17-
atf_check_equal $? 0
18-
xbps-rindex -d -a $PWD/*.xbps
19-
atf_check_equal $? 0
20-
xbps-create -A noarch -n foo-1.1_1 -s "foo pkg" --shlib-provides "foo.so.2" ../pkg_A
21-
atf_check_equal $? 0
22-
xbps-rindex -d -a $PWD/*.xbps
23-
atf_check_equal $? 0
24-
atf_check -o inline:" 2 $PWD (Staged) (RSA unsigned)\n" -- \
25-
xbps-query -r ../root -i --repository=$PWD -L
26-
xbps-rindex -r some_repo
27-
atf_check_equal $? 0
28-
[ -f foo-1.0_1* ]
29-
atf_check_equal $? 0
30-
[ -f foo-1.1_1* ]
31-
atf_check_equal $? 0
32-
[ -f bar-1.0_1* ]
33-
atf_check_equal $? 0
14+
atf_check -o ignore -- xbps-create -A noarch -n foo-1.0_1 -s "foo pkg" --shlib-provides "foo.so.1" ../pkg_A
15+
atf_check -o ignore -- xbps-create -A noarch -n bar-1.0_1 -s "foo pkg" --shlib-requires "foo.so.1" ../pkg_B
16+
atf_check -o ignore -- xbps-create -A noarch -n deleteme-1.0_1 -s "deleteme pkg" ../pkg_B
17+
atf_check -o ignore -e ignore -- xbps-rindex -a $PWD/*.xbps
18+
atf_check -o ignore -- xbps-create -A noarch -n deleteme-1.1_1 -s "deleteme pkg" ../pkg_B
19+
atf_check -o ignore -e ignore -- xbps-rindex -a $PWD/*.xbps
20+
atf_check -o ignore -- xbps-create -A noarch -n foo-1.1_1 -s "foo pkg" --shlib-provides "foo.so.2" ../pkg_A
21+
atf_check -o ignore -e ignore -- xbps-rindex -a $PWD/*.xbps
22+
cd ..
23+
atf_check -o inline:" 3 $PWD/some_repo (Staged) (RSA unsigned)\n" -- \
24+
xbps-query -r ../root -i --repository=some_repo -L
25+
atf_check -o inline:"Removed obsolete package \`deleteme-1.0_1.noarch.xbps'.\n" -- xbps-rindex -r some_repo
26+
[ -f some_repo/foo-1.0_1* ] || atf_fail "foo-1.0_1 doesn't exist"
27+
[ -f some_repo/foo-1.1_1* ] || atf_fail "foo-1.1_1 doesn't exist"
28+
[ -f some_repo/bar-1.0_1* ] || atf_fail "bar-1.0_1 doesn't exist"
29+
[ -f some_repo/deleteme-1.0_1* ] && atf_fail "deleteme-1.0_1 still exists"
30+
[ -f some_repo/deleteme-1.1_1* ] || atf_fail "deleteme-1.1_1 doesn't exist"
3431
}
3532

3633
atf_init_test_cases() {

0 commit comments

Comments
 (0)