Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
add a test case for ignored post-install failures
Baptiste Daroussin committed 9 years ago
commit a84f0fc8b04c3e8240a2343306dbdf3194c5d061
parent 8301e2b
1 file changed +24 -2
modified tests/frontend/install.sh
@@ -4,7 +4,8 @@

tests_init \
	reinstall \
-
	script_fail
+
	pre_script_fail \
+
	post_script_ignored

reinstall_body()
{
@@ -42,7 +43,7 @@ EOF
		pkg -o REPOS_DIR="${TMPDIR}" install -y test
}

-
script_fail_body()
+
pre_script_fail_body()
{
	new_pkg test test 1
	cat << EOF >> test.ucl
@@ -62,3 +63,24 @@ EOF
		-s exit:3 \
		pkg -o REPOS_DIR="/dev/null" install -y ${TMPDIR}/test-1.txz
}
+

+
post_script_ignored_body()
+
{
+
	new_pkg test test 1
+
	cat << EOF >> test.ucl
+
scripts: {
+
   post-install: "exit 1"
+
}
+
EOF
+

+
	atf_check \
+
		-o ignore \
+
		-e empty \
+
		-s exit:0 \
+
		pkg create -M test.ucl
+

+
	atf_check -o ignore \
+
		-e inline:"pkg: POST-INSTALL script failed\n" \
+
		-s exit:0 \
+
		pkg -o REPOS_DIR="/dev/null" install -y ${TMPDIR}/test-1.txz
+
}