From 121d0fbb6422253a01650f552d3743241bea15c6 Mon Sep 17 00:00:00 2001 From: Duncaen Date: Sun, 2 Jun 2019 18:24:03 +0200 Subject: [PATCH] tests: add test for removing package with ignored dependency --- tests/xbps/libxbps/shell/ignore.sh | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/xbps/libxbps/shell/ignore.sh b/tests/xbps/libxbps/shell/ignore.sh index acf50f74..2c960ca4 100644 --- a/tests/xbps/libxbps/shell/ignore.sh +++ b/tests/xbps/libxbps/shell/ignore.sh @@ -68,7 +68,41 @@ update_with_ignored_dep_body() { atf_check_equal $? 2 } +atf_test_case remove_with_ignored_dep + +remove_with_ignored_dep_head() { + atf_set "descr" "Tests for pkg remove: with ignored dependency" +} + +remove_with_ignored_dep_body() { + mkdir -p repo root/xbps.d pkg_A pkg_B + cd repo + xbps-create -A noarch -n A-1.0_1 -s "A pkg" -D "B-1.0_1" ../pkg_A + atf_check_equal $? 0 + xbps-create -A noarch -n B-1.0_1 -s "B pkg" ../pkg_B + atf_check_equal $? 0 + xbps-rindex -d -a $PWD/*.xbps + atf_check_equal $? 0 + cd .. + echo "ignorepkg=B" > root/xbps.d/ignore.conf + xbps-install -r root -C xbps.d --repository=$PWD/repo -yd A + atf_check_equal $? 0 + xbps-query -r root B + atf_check_equal $? 2 + out=$(xbps-remove -r root -C xbps.d -Rn A) + set -- $out + exp="$1 $2 $3 $4" + atf_check_equal "$exp" "A-1.0_1 remove noarch $PWD/repo" + xbps-remove -r root -C xbps.d -Ryvd A + atf_check_equal $? 0 + xbps-query -r root A + atf_check_equal $? 2 + xbps-query -r root B + atf_check_equal $? 2 +} + atf_init_test_cases() { atf_add_test_case install_with_ignored_dep atf_add_test_case update_with_ignored_dep + atf_add_test_case remove_with_ignored_dep }