From 7b933a87a89bbf111b6b88cfd858fc0068cc2149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= Date: Thu, 5 Mar 2020 21:44:33 +0100 Subject: [PATCH] Testcase for xbps_transaction_check_revdeps regression #245 --- tests/xbps/libxbps/shell/Kyuafile | 1 + tests/xbps/libxbps/shell/Makefile | 2 +- .../shell/transaction_check_revdeps.sh | 47 +++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 tests/xbps/libxbps/shell/transaction_check_revdeps.sh diff --git a/tests/xbps/libxbps/shell/Kyuafile b/tests/xbps/libxbps/shell/Kyuafile index b9c74ed5..cdc1d8d8 100644 --- a/tests/xbps/libxbps/shell/Kyuafile +++ b/tests/xbps/libxbps/shell/Kyuafile @@ -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"} diff --git a/tests/xbps/libxbps/shell/Makefile b/tests/xbps/libxbps/shell/Makefile index 2ee0a8ae..cfdaaf8c 100644 --- a/tests/xbps/libxbps/shell/Makefile +++ b/tests/xbps/libxbps/shell/Makefile @@ -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 diff --git a/tests/xbps/libxbps/shell/transaction_check_revdeps.sh b/tests/xbps/libxbps/shell/transaction_check_revdeps.sh new file mode 100644 index 00000000..cdd11068 --- /dev/null +++ b/tests/xbps/libxbps/shell/transaction_check_revdeps.sh @@ -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 + 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 +}