tests/update_itself: improve test case on_any_op even more.

This commit is contained in:
Juan RP 2019-06-25 23:13:17 +02:00
parent 83aa486f6b
commit f9477e08a7
No known key found for this signature in database
GPG Key ID: AF19F6CB482F9368

View File

@ -159,14 +159,16 @@ update_xbps_on_any_op_head() {
} }
update_xbps_on_any_op_body() { update_xbps_on_any_op_body() {
mkdir -p repo xbps foo mkdir -p repo xbps foo bar
touch xbps/foo foo/blah touch xbps/foo foo/blah bar/baz
cd repo cd repo
xbps-create -A noarch -n xbps-1.0_1 -s "xbps pkg" ../xbps xbps-create -A noarch -n xbps-1.0_1 -s "xbps pkg" ../xbps
atf_check_equal $? 0 atf_check_equal $? 0
xbps-create -A noarch -n foo-1.0_1 -s "foo pkg" ../foo xbps-create -A noarch -n foo-1.0_1 -s "foo pkg" ../foo
atf_check_equal $? 0 atf_check_equal $? 0
xbps-create -A noarch -n bar-1.0_1 -s "bar pkg" ../bar
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 ..
@ -189,7 +191,8 @@ update_xbps_on_any_op_body() {
atf_check_equal $? 0 atf_check_equal $? 0
cd .. cd ..
xbps-install -r root --repository=$PWD/repo -yud foo # install an unrelated pkg, xbps autoupdates
xbps-install -r root --repository=$PWD/repo -yd bar
atf_check_equal $? 0 atf_check_equal $? 0
out=$(xbps-query -r root -p pkgver xbps) out=$(xbps-query -r root -p pkgver xbps)
@ -198,6 +201,18 @@ update_xbps_on_any_op_body() {
out=$(xbps-query -r root -p pkgver foo) out=$(xbps-query -r root -p pkgver foo)
atf_check_equal $out foo-1.0_1 atf_check_equal $out foo-1.0_1
# ENOENT
xbps-query -r root -p pkgver bar
atf_check_equal $? 2
# xbps has been updated, 2nd time
xbps-install -r root --repository=$PWD/repo -yd bar
atf_check_equal $? 0
out=$(xbps-query -r root -p pkgver bar)
atf_check_equal $out bar-1.0_1
# perform a globl update
xbps-install -r root --repository=$PWD/repo -yud xbps-install -r root --repository=$PWD/repo -yud
atf_check_equal $? 0 atf_check_equal $? 0