Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add test case for pkg clean segfault
Baptiste Daroussin committed 6 years ago
commit 013ac903f8ef2320491cafb1467fd52621c75ca3
parent 640d50d
2 files changed +58 -1
modified tests/Makefile.autosetup
@@ -50,7 +50,8 @@ TESTS_SH= \
	frontend/issue1445.sh \
	frontend/fingerprint.sh \
	frontend/lua.sh \
-
	frontend/shellscript.sh
+
	frontend/shellscript.sh \
+
	frontend/clean.sh \

merge_OBJS=	lib/merge.o
plist_OBJS=	lib/plist.o
added tests/frontend/clean.sh
@@ -0,0 +1,56 @@
+
#! /usr/bin/env atf-sh
+

+
. $(atf_get_srcdir)/test_environment.sh
+

+
tests_init \
+
	basic
+

+
basic_body() {
+
	atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1"
+

+
	atf_check \
+
		-o empty \
+
		-e empty \
+
		-s exit:0 \
+
		pkg create -M test.ucl
+
	mkdir -p ${TMPDIR}/target
+
	atf_check \
+
		-e empty \
+
		-o ignore \
+
		-s exit:0 \
+
		pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.txz
+

+
	atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "2"
+

+
	atf_check \
+
		-o empty \
+
		-e empty \
+
		-s exit:0 \
+
		pkg create -M test.ucl
+
	atf_check \
+
		-o ignore \
+
		-e empty \
+
		-s exit:0 \
+
		pkg repo .
+
	mkdir reposconf
+
	cat <<EOF >> reposconf/repo.conf
+
local: {
+
	url: file:///${TMPDIR},
+
	enabled: true
+
}
+
EOF
+
	atf_check \
+
		-e empty \
+
		-o ignore \
+
		-s exit:0 \
+
		pkg -o REPOS_DIR="${TMPDIR}/reposconf" update
+

+
	mkdir cache
+
	mv test-* cache
+
	atf_check \
+
		-e empty \
+
		-o match:"test-.\.txz" \
+
		-s exit:0 \
+
		pkg -C /dev/null -o PKG_CACHEDIR=${TMPDIR}/cache -o REPOS_DIR="${TMPDIR}/reposconf" clean -n
+
}
+