Testcase for xbps_transaction_check_revdeps regression #245

This commit is contained in:
Piotr Wójcik 2020-03-05 21:44:33 +01:00 committed by Juan RP
parent b0904b32d2
commit 7b933a87a8
3 changed files with 49 additions and 1 deletions

View File

@ -28,3 +28,4 @@ atf_test_program{name="ignore_test"}
atf_test_program{name="preserve_test"}
atf_test_program{name="orphans_test"}
atf_test_program{name="noextract_files_test"}
atf_test_program{name="transaction_check_revdeps"}

View File

@ -9,7 +9,7 @@ TESTSHELL+= vpkg_test install_test preserve_files_test configure_test
TESTSHELL+= update_shlibs_test update_hold_test update_repolock_test
TESTSHELL+= cyclic_deps_test conflicts_test update_itself_test
TESTSHELL+= hold_test ignore_test preserve_test
TESTSHELL+= noextract_files_test orphans_test
TESTSHELL+= noextract_files_test orphans_test transaction_check_revdeps
EXTRA_FILES = Kyuafile
include $(TOPDIR)/mk/test.mk

View File

@ -0,0 +1,47 @@
#!/usr/bin/env atf-sh
atf_test_case issue_245
issue_245_head() {
atf_set "descr" "Tests update of package with removed and uptodate revdeps"
}
issue_245_body() {
mkdir some_repo
mkdir destdir
cd some_repo
xbps-create -A noarch -n libX-1_1 -s "libX pkg" ../destdir
atf_check_equal $? 0
xbps-create -A noarch -n cmdA-1_1 -s "cmdA pkg" --dependencies "libX>=1_1" ../destdir
atf_check_equal $? 0
xbps-create -A noarch -n cmdB-1_1 -s "cmdB pkg" --dependencies "libX>=1_1" ../destdir
atf_check_equal $? 0
xbps-rindex -d -a $PWD/*.xbps
atf_check_equal $? 0
cd ..
xbps-install -r root --repository=$PWD/some_repo -yd cmdA cmdB
atf_check_equal $? 0
cd some_repo
xbps-create -A noarch -n libX-1_2 -s "libX pkg" --replaces "cmdA>=1_1" ../destdir
atf_check_equal $? 0
xbps-rindex -d -a $PWD/*.xbps
atf_check_equal $? 0
cd ..
# was failing here with <libX-1_2 in transaction breaks installed pkg `cmdB-1_1'>
xbps-install -r root --repository=$PWD/some_repo -uyd
atf_check_equal $? 0
xbps-query -r root cmdA
atf_check_equal $? 2
xbps-query -r root libX-1_2
atf_check_equal $? 0
}
atf_init_test_cases() {
atf_add_test_case issue_245
}