From 2ef15e76c4c6fecd2178a84bf97edbe5952acbe3 Mon Sep 17 00:00:00 2001 From: Duncan Overbruck Date: Tue, 30 May 2023 21:24:36 +0200 Subject: [PATCH] tests: add another install mode test --- tests/xbps/libxbps/shell/installmode_test.sh | 49 ++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/tests/xbps/libxbps/shell/installmode_test.sh b/tests/xbps/libxbps/shell/installmode_test.sh index 7363609f..9d1e8cd9 100644 --- a/tests/xbps/libxbps/shell/installmode_test.sh +++ b/tests/xbps/libxbps/shell/installmode_test.sh @@ -62,6 +62,54 @@ instmode_auto_body() { 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 atf_test_case instmode_update @@ -344,6 +392,7 @@ instmode_auto_dependency_configure_body() { atf_init_test_cases() { atf_add_test_case instmode atf_add_test_case instmode_auto + atf_add_test_case instmode_auto_update atf_add_test_case instmode_update atf_add_test_case instmode_reinstall atf_add_test_case instmode_dependency_update