test: fix typo in remove_directoy and move to right place

This commit is contained in:
Johannes Brechtmann 2019-05-22 15:05:54 +02:00 committed by Duncan Overbruck
parent dc65f62ad7
commit 77b90951ea
6 changed files with 25 additions and 42 deletions

View File

@ -8,7 +8,6 @@ include('xbps-checkvers/Kyuafile')
include('xbps-create/Kyuafile')
include('xbps-install/Kyuafile')
include('xbps-query/Kyuafile')
include('xbps-remove/Kyuafile')
include('xbps-rindex/Kyuafile')
include('xbps-uhelper/Kyuafile')

View File

@ -1,5 +1,5 @@
-include ../../config.mk
SUBDIRS = common libxbps xbps-alternatives xbps-checkvers xbps-create xbps-install xbps-query xbps-remove xbps-rindex xbps-uhelper
SUBDIRS = common libxbps xbps-alternatives xbps-checkvers xbps-create xbps-install xbps-query xbps-rindex xbps-uhelper
include ../../mk/subdir.mk

View File

@ -466,6 +466,29 @@ remove_with_revdeps_in_trans_recursive_body() {
atf_check_equal $out 0
}
atf_test_case remove_directory
remove_directory_head() {
atf_set "descr" "xbps-remove(8): remove nested directories"
}
remove_directory_body() {
mkdir -p some_repo pkg_A/B/C
touch pkg_A/B/C/file00
cd some_repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" ../pkg_A
atf_check_equal $? 0
xbps-rindex -d -a $PWD/*.xbps
atf_check_equal $? 0
cd ..
xbps-install -r root -C empty.conf --repository=$PWD/some_repo -y A
atf_check_equal $? 0
xbps-remove -r root -C empty.conf -y A
atf_check_equal $? 0
test -d root/B
atf_check_equal $? 1
}
atf_init_test_cases() {
atf_add_test_case keep_base_symlinks
atf_add_test_case keep_modified_symlinks
@ -483,4 +506,5 @@ atf_init_test_cases() {
atf_add_test_case remove_with_revdeps_in_trans
atf_add_test_case remove_with_revdeps_in_trans_inverted
atf_add_test_case remove_with_revdeps_in_trans_recursive
atf_add_test_case remove_directory
}

View File

@ -1,4 +0,0 @@
syntax("kyuafile", 1)
test_suite("xbps-remove")
atf_test_program{name="basic_test"}

View File

@ -1,8 +0,0 @@
TOPDIR = ../../..
-include $(TOPDIR)/config.mk
TESTSHELL = basic_test
TESTSSUBDIR = xbps/xbps-remove
EXTRA_FILES = Kyuafile
include $(TOPDIR)/mk/test.mk

View File

@ -1,28 +0,0 @@
#! /usr/bin/env atf-sh
atf_test_case remove_directory
remoe_directory_head() {
atf_set "descr" "xbps-remove(8): remove nested directories"
}
remove_directory_body() {
mkdir -p some_repo pkg_A/B/C
touch pkg_A/B/C/file00
cd some_repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" ../pkg_A
atf_check_equal $? 0
xbps-rindex -d -a $PWD/*.xbps
atf_check_equal $? 0
cd ..
xbps-install -r root -C empty.conf --repository=$PWD/some_repo -y A
atf_check_equal $? 0
xbps-remove -r root -C empty.conf -y A
atf_check_equal $? 0
test -d root/B
atf_check_equal $? 1
}
atf_init_test_cases() {
atf_add_test_case remove_directory
}