tests: fix ingorepkg tests

This commit is contained in:
Duncaen 2019-04-20 11:53:06 +02:00
parent 0c657582f2
commit a65630df03

View File

@ -7,21 +7,21 @@ install_with_ignored_dep_head() {
} }
install_with_ignored_dep_body() { install_with_ignored_dep_body() {
mkdir -p repo pkg_A pkg_B mkdir -p repo root/xbps.d pkg_A pkg_B
cd repo cd repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" ../pkg_A xbps-create -A noarch -n A-1.0_1 -s "A pkg" -D "B-1.0_1" ../pkg_A
atf_check_equal $? 0 atf_check_equal $? 0
xbps-create -A noarch -n B-1.0_1 -s "B pkg" ../pkg_B xbps-create -A noarch -n B-1.0_1 -s "B pkg" ../pkg_B
atf_check_equal $? 0 atf_check_equal $? 0
xbps-rindex -d -a $PWD/*.xbps xbps-rindex -d -a $PWD/*.xbps
atf_check_equal $? 0 atf_check_equal $? 0
cd .. cd ..
echo "ignorepkg=B" > ignore.conf echo "ignorepkg=B" > root/xbps.d/ignore.conf
out=$(xbps-install -r root -C ignore.conf --repository=$PWD/repo -n A) out=$(xbps-install -r root -C xbps.d --repository=$PWD/repo -n A)
set -- $out set -- $out
exp="$1 $2 $3 $4" exp="$1 $2 $3 $4"
atf_check_equal "$exp" "A-1.0_1 install noarch $PWD/repo" atf_check_equal "$exp" "A-1.0_1 install noarch $PWD/repo"
xbps-install -r root -C ignore.conf --repository=$PWD/repo -yd A xbps-install -r root -C xbps.d --repository=$PWD/repo -yd A
atf_check_equal $? 0 atf_check_equal $? 0
xbps-query -r root A xbps-query -r root A
atf_check_equal $? 0 atf_check_equal $? 0
@ -36,32 +36,36 @@ update_with_ignored_dep_head() {
} }
update_with_ignored_dep_body() { update_with_ignored_dep_body() {
mkdir -p repo pkg_A pkg_B mkdir -p repo root/xbps.d pkg_A pkg_B
cd repo cd repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" ../pkg_A xbps-create -A noarch -n A-1.0_1 -s "A pkg" -D "B-1.0_1" ../pkg_A
atf_check_equal $? 0 atf_check_equal $? 0
xbps-create -A noarch -n B-1.0_1 -s "B pkg" ../pkg_B xbps-create -A noarch -n B-1.0_1 -s "B pkg" ../pkg_B
atf_check_equal $? 0 atf_check_equal $? 0
xbps-rindex -d -a $PWD/*.xbps xbps-rindex -d -a $PWD/*.xbps
atf_check_equal $? 0 atf_check_equal $? 0
cd .. cd ..
echo "ignorepkg=B" > ignore.conf echo "ignorepkg=B" > root/xbps.d/ignore.conf
xbps-install -r root -C ignore.conf --repository=$PWD/repo -yd A xbps-install -r root -C xbps.d --repository=$PWD/repo -yd A
atf_check_equal $? 0 atf_check_equal $? 0
xbps-query -r root B
atf_check_equal $? 2
cd repo cd repo
xbps-create -A noarch -n A-1.1_1 -s "A pkg" ../pkg_A xbps-create -A noarch -n A-1.1_1 -s "A pkg" -D "B-1.0_1" ../pkg_A
atf_check_equal $? 0 atf_check_equal $? 0
xbps-rindex -d -a $PWD/*.xbps xbps-rindex -d -a $PWD/*.xbps
atf_check_equal $? 0 atf_check_equal $? 0
cd .. cd ..
out=$(xbps-install -r root -C ignore.conf --repository=$PWD/repo -un) out=$(xbps-install -r root -C xbps.d --repository=$PWD/repo -un)
set -- $out set -- $out
exp="$1 $2 $3 $4" exp="$1 $2 $3 $4"
atf_check_equal "$exp" "A-1.1_1 update noarch $PWD/repo" atf_check_equal "$exp" "A-1.1_1 update noarch $PWD/repo"
xbps-install -r root --repository=$PWD/repo -yuvd xbps-install -r root -C xbps.d --repository=$PWD/repo -yuvd
atf_check_equal $? 0 atf_check_equal $? 0
out=$(xbps-query -r root -p pkgver A) out=$(xbps-query -r root -p pkgver A)
atf_check_equal $out A-1.1_1 atf_check_equal $out A-1.1_1
xbps-query -r root B
atf_check_equal $? 2
} }
atf_init_test_cases() { atf_init_test_cases() {