Skip to content

Commit 602288f

Browse files
committed
tests: clean up self_replace test
1 parent d3e6807 commit 602288f

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

tests/xbps/libxbps/shell/replace_test.sh

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,23 +88,18 @@ self_replace_body() {
8888
echo "A-1.0_1" > pkg_A/usr/bin/foo
8989
echo "B-1.0_1" > pkg_B/usr/bin/foo
9090
cd some_repo
91-
xbps-create -A noarch -n A-1.0_1 -s "A pkg" ../pkg_A
92-
atf_check_equal $? 0
93-
xbps-create -A noarch -n B-1.0_1 -s "B pkg" --replaces "A>=0" --provides="A-1.0_1" ../pkg_B
94-
atf_check_equal $? 0
95-
xbps-rindex -d -a $PWD/*.xbps
96-
atf_check_equal $? 0
91+
atf_check -o ignore -- xbps-create -A noarch -n A-1.0_1 -s "A pkg" ../pkg_A
92+
atf_check -o ignore -- xbps-create -A noarch -n B-1.0_1 -s "B pkg" --replaces "A>=0" --provides="A-1.0_1" ../pkg_B
93+
atf_check -o ignore -- xbps-rindex -a $PWD/*.xbps
9794
cd ..
98-
xbps-install -C xbps.d -r root --repository=$PWD/some_repo -yd A
99-
atf_check_equal $? 0
100-
xbps-install -C xbps.d -r root --repository=$PWD/some_repo -yd B
101-
atf_check_equal $? 0
102-
xbps-install -C xbps.d -r root --repository=$PWD/some_repo -yd A
103-
atf_check_equal $? 0
104-
out=$(xbps-query -C xbps.d -r root -l|awk '{print $2}')
105-
exp="A-1.0_1"
106-
atf_check_equal $out $exp
107-
atf_check_equal $(xbps-query -C xbps.d -r root -p state A) installed
95+
atf_check -o ignore -e ignore -- xbps-install -C xbps.d -r root --repository=$PWD/some_repo -yd A
96+
atf_check -o ignore -e ignore -- xbps-install -C xbps.d -r root --repository=$PWD/some_repo -yd B
97+
atf_check -e ignore \
98+
-o match:'A-1\.0_1: installed successfully.' \
99+
-o match:'B-1\.0_1: removed successfully.' \
100+
-- xbps-install -C xbps.d -r root --repository=$PWD/some_repo -yd A
101+
atf_check -o inline:"A-1.0_1\n" -- xbps-query -C xbps.d -r root -p pkgver A
102+
atf_check -o inline:"installed\n" -- xbps-query -C xbps.d -r root -p state A
108103
}
109104

110105
atf_test_case replace_vpkg

0 commit comments

Comments
 (0)