Skip to content

Commit 213c829

Browse files
committed
tests: cleanup clean_cache test
1 parent 4086c36 commit 213c829

File tree

1 file changed

+15
-21
lines changed

1 file changed

+15
-21
lines changed

tests/xbps/xbps-remove/basic_test.sh

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -55,31 +55,25 @@ clean_cache_head() {
5555
clean_cache_body() {
5656
mkdir -p repo pkg_A/B/C pkg_B
5757
touch pkg_A/
58+
5859
cd repo
59-
xbps-create -A noarch -n A-1.0_1 -s "A pkg" ../pkg_A
60-
atf_check_equal $? 0
61-
xbps-create -A noarch -n A-1.0_2 -s "A pkg" ../pkg_A
62-
atf_check_equal $? 0
63-
xbps-create -A noarch -n B-1.0_1 -s "B pkg" ../pkg_B
64-
atf_check_equal $? 0
65-
xbps-rindex -d -a $PWD/*.xbps
66-
atf_check_equal $? 0
60+
atf_check -o ignore -- xbps-create -A noarch -n A-1.0_1 -s "A pkg" ../pkg_A
61+
atf_check -o ignore -- xbps-create -A noarch -n A-1.0_2 -s "A pkg" ../pkg_A
62+
atf_check -o ignore -- xbps-create -A noarch -n B-1.0_1 -s "B pkg" ../pkg_B
63+
atf_check -o ignore -- xbps-rindex -a $PWD/*.xbps
6764
cd ..
65+
6866
mkdir -p root/etc/xbps.d root/var/db/xbps/https___localhost_ root/var/cache/xbps
69-
cp repo/*-repodata root/var/db/xbps/https___localhost_
70-
atf_check_equal $? 0
71-
cp repo/*.xbps root/var/cache/xbps
72-
atf_check_equal $? 0
67+
atf_check -- cp repo/*-repodata root/var/db/xbps/https___localhost_
68+
atf_check -- cp repo/*.xbps root/var/cache/xbps
7369
echo "repository=https://localhost/" >root/etc/xbps.d/localrepo.conf
74-
xbps-install -r root -C etc/xbps.d -R repo -dvy B
75-
xbps-remove -r root -C etc/xbps.d -dvO
76-
atf_check_equal $? 0
77-
test -f root/var/cache/xbps/A-1.0_2.noarch.xbps
78-
atf_check_equal $? 0
79-
test -f root/var/cache/xbps/A-1.0_1.noarch.xbps
80-
atf_check_equal $? 1
81-
test -f root/var/cache/xbps/B-1.0_1.noarch.xbps
82-
atf_check_equal $? 0
70+
71+
atf_check -o ignore -- xbps-install -r root -C etc/xbps.d -R repo -y B
72+
atf_check -o inline:"Removed A-1.0_1.noarch.xbps from cachedir (obsolete)\n" \
73+
-- xbps-remove -r root -C etc/xbps.d -O
74+
atf_check -- test -f root/var/cache/xbps/A-1.0_2.noarch.xbps
75+
atf_check -s exit:1 -- test -f root/var/cache/xbps/A-1.0_1.noarch.xbps
76+
atf_check -- test -f root/var/cache/xbps/B-1.0_1.noarch.xbps
8377
}
8478

8579
atf_test_case clean_cache_dry_run

0 commit comments

Comments
 (0)