From 88fe064e36c77ff4812822f998a99659ab80e9d4 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 2 Feb 2015 09:38:05 +0100 Subject: [PATCH] tests: remove: add a test case to verify revdeps with xbps-remove(8). --- tests/xbps/libxbps/shell/remove_test.sh | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/xbps/libxbps/shell/remove_test.sh b/tests/xbps/libxbps/shell/remove_test.sh index 028a241a..8785dc7e 100644 --- a/tests/xbps/libxbps/shell/remove_test.sh +++ b/tests/xbps/libxbps/shell/remove_test.sh @@ -221,6 +221,31 @@ remove_dups_body() { atf_check_equal $out 1 } +atf_test_case remove_with_revdeps + +remove_with_revdeps_head() { + atf_set "descr" "Tests for package removal: remove a pkg with revdeps" +} + +remove_with_revdeps_body() { + mkdir some_repo + mkdir -p pkg_A/usr/bin pkg_B/usr/bin + + cd some_repo + xbps-create -A noarch -n A-1.0_1 -s "A pkg" ../pkg_A + atf_check_equal $? 0 + xbps-create -A noarch -n B-1.0_1 -s "B pkg" --dependencies "A-1.0_1" ../pkg_B + atf_check_equal $? 0 + xbps-rindex -d -a $PWD/*.xbps + atf_check_equal $? 0 + cd .. + xbps-install -r root --repository=some_repo -yv B + atf_check_equal $? 0 + xbps-remove -r root -yv A + # ENODEV == unresolved dependencies + atf_check_equal $? 19 +} + atf_init_test_cases() { atf_add_test_case keep_base_symlinks atf_add_test_case keep_modified_symlinks @@ -229,4 +254,5 @@ atf_init_test_cases() { atf_add_test_case remove_symlinks_from_root atf_add_test_case remove_symlinks_modified atf_add_test_case remove_dups + atf_add_test_case remove_with_revdeps }