tests: add another install mode test

This commit is contained in:
Duncan Overbruck 2023-05-30 21:24:36 +02:00
parent 825f1f30f9
commit 2ef15e76c4
No known key found for this signature in database
GPG Key ID: 335C1D17EC3D6E35

View File

@ -62,6 +62,54 @@ instmode_auto_body() {
atf_check_equal $out yes atf_check_equal $out yes
} }
atf_test_case instmode_auto_update
instmode_auto_update_head() {
atf_set "descr" "installation mode: basic test for automatic mode during updates"
}
instmode_auto_update_body() {
mkdir some_repo
mkdir -p pkg_a/usr/bin pkg_b/usr/bin
touch -f pkg_a/usr/bin/foo pkg_b/usr/bin/blah
cd some_repo
xbps-create -A noarch -n a-1.0_1 -s "foo pkg" ../pkg_a
atf_check_equal $? 0
xbps-create -A noarch -n b-1.0_1 -s "foo pkg" ../pkg_b
atf_check_equal $? 0
xbps-rindex -d -a $PWD/*.xbps
atf_check_equal $? 0
cd ..
xbps-install -r root -c null.conf --repository=$PWD/some_repo -Ayd a
atf_check_equal $? 0
xbps-install -r root -c null.conf --repository=$PWD/some_repo -yd b
atf_check_equal $? 0
out=$(xbps-query -r root --property=automatic-install a)
atf_check_equal $out yes
out=$(xbps-query -r root --property=automatic-install b)
atf_check_equal $out ""
cd some_repo
xbps-create -A noarch -n a-1.1_1 -s "foo pkg" ../pkg_a
atf_check_equal $? 0
xbps-create -A noarch -n b-1.1_1 -s "foo pkg" ../pkg_b
atf_check_equal $? 0
xbps-rindex -d -a $PWD/*.xbps
atf_check_equal $? 0
cd ..
xbps-install -r root -c null.conf --repository=$PWD/some_repo -Aydu
atf_check_equal $? 0
out=$(xbps-query -r root --property=automatic-install a)
atf_check_equal $out yes
out=$(xbps-query -r root --property=automatic-install b)
atf_check_equal $out ""
}
# 1- preserve installation mode on updates # 1- preserve installation mode on updates
atf_test_case instmode_update atf_test_case instmode_update
@ -344,6 +392,7 @@ instmode_auto_dependency_configure_body() {
atf_init_test_cases() { atf_init_test_cases() {
atf_add_test_case instmode atf_add_test_case instmode
atf_add_test_case instmode_auto atf_add_test_case instmode_auto
atf_add_test_case instmode_auto_update
atf_add_test_case instmode_update atf_add_test_case instmode_update
atf_add_test_case instmode_reinstall atf_add_test_case instmode_reinstall
atf_add_test_case instmode_dependency_update atf_add_test_case instmode_dependency_update