Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
autoremove: add test for --no-scripts
Tobias Kortkamp committed 5 years ago
commit 6f9d784372ef93cb51542e55b18223309dd6ffc8
parent 034ea68
1 file changed +24 -2
modified tests/frontend/autoremove.sh
@@ -17,6 +17,9 @@ files: {
	${TMPDIR}/file1: "",
	${TMPDIR}/file2: "",
}
+
scripts: {
+
	post-deinstall: "exit 1"
+
}
EOF

	atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg dep1 master 1
@@ -53,7 +56,7 @@ autoremove_body() {

	atf_check \
	    -o match:"Deinstalling test-1\.\.\." \
-
	    -e empty \
+
	    -e inline:"${PROGNAME}: POST-DEINSTALL script failed\n" \
	    -s exit:0 \
	    pkg autoremove -y

@@ -66,13 +69,32 @@ autoremove_body() {
	test ! -f ${TMPDIR}/file1 -o ! -f ${TMPDIR}/file2 || atf_fail "Files are still present"
}

-
autoremove_quiet_body() {
+
autoremove_no_scripts_body() {
	autoremove_prep

	atf_check \
+
	    -o match:"Deinstalling test-1\.\.\." \
+
	    -e empty \
+
	    -s exit:0 \
+
	    pkg autoremove -yDq
+

+
	atf_check \
	    -o empty \
	    -e empty \
	    -s exit:0 \
+
	    pkg info
+

+
	test ! -f ${TMPDIR}/file1 -o ! -f ${TMPDIR}/file2 || atf_fail "Files are still present"
+
}
+

+

+
autoremove_quiet_body() {
+
	autoremove_prep
+

+
	atf_check \
+
	    -o empty \
+
	    -e inline:"${PROGNAME}: POST-DEINSTALL script failed\n" \
+
	    -s exit:0 \
	    pkg autoremove -yq

	atf_check \