tests/xbps-alternatives: extend register_one_relative test case.

This commit is contained in:
Juan RP 2015-10-31 13:08:13 +01:00
parent 2d9630581e
commit e3a0164355

View File

@ -3,7 +3,7 @@
atf_test_case register_one
register_one_head() {
atf_set "descr" "xbps-alternatives: register one pkg wth an alternatives group"
atf_set "descr" "xbps-alternatives: register one pkg with an alternatives group"
}
register_one_body() {
mkdir -p repo pkg_A/usr/bin
@ -31,13 +31,13 @@ register_one_body() {
atf_test_case register_one_relative
register_one_relative_head() {
atf_set "descr" "xbps-alternatives: register one pkg wth an alternatives group that has a relative path"
atf_set "descr" "xbps-alternatives: register one pkg with an alternatives group that has a relative path"
}
register_one_relative_body() {
mkdir -p repo pkg_A/usr/bin
touch pkg_A/usr/bin/fileA
touch pkg_A/usr/bin/fileA pkg_A/usr/bin/fileB
cd repo
xbps-create -A noarch -n A-1.1_1 -s "A pkg" --alternatives "file:../file:/usr/bin/fileA" ../pkg_A
xbps-create -A noarch -n A-1.1_1 -s "A pkg" --alternatives "file:../file:/usr/bin/fileA file2:file2:/usr/bin/fileB" ../pkg_A
atf_check_equal $? 0
xbps-rindex -d -a $PWD/*.xbps
atf_check_equal $? 0
@ -54,6 +54,15 @@ register_one_relative_body() {
echo "A lnk: $lnk"
fi
atf_check_equal $rv 0
rv=1
if [ -e root/usr/bin/fileB ]; then
lnk=$(readlink root/usr/bin/file2)
if [ "$lnk" = "/usr/bin/fileB" ]; then
rv=0
fi
echo "A lnk: $lnk"
fi
atf_check_equal $rv 0
}
atf_test_case register_dups