Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
tests: Add a basic check for the pkg-check frontend
Mark Johnston committed 7 months ago
commit 9bb9034d61e17901df8b668a0ac106b46af62f8c
parent 52913da
2 files changed +26 -0
modified tests/Makefile.autosetup
@@ -29,6 +29,7 @@ TESTS_SH= \
	frontend/annotate.sh \
	frontend/autoremove.sh \
	frontend/autoupgrade.sh \
+
	frontend/check.sh \
	frontend/config.sh \
	frontend/configmerge.sh \
	frontend/conflicts.sh \
added tests/frontend/check.sh
@@ -0,0 +1,25 @@
+
#! /usr/bin/env atf-sh
+

+
. $(atf_get_srcdir)/test_environment.sh
+

+
tests_init \
+
	basic
+

+
basic_body() {
+
	atf_check sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1"
+

+
	cat <<__EOF__ >> test.ucl
+
files: {
+
    ${TMPDIR}/a: "",
+
}
+
__EOF__
+

+
	echo a > a
+
	atf_check pkg create -M test.ucl
+
	atf_check mkdir -p target
+
	atf_check pkg -o REPOS_DIR=/dev/null -r target install -qfy ${TMPDIR}/test-1.pkg
+
	atf_check pkg -r target check -q
+
	echo b > ${TMPDIR}/target/${TMPDIR}/a
+
	atf_check -s not-exit:0 -e inline:"test-1: checksum mismatch for ${TMPDIR}/a\n" \
+
	    pkg -r target check -q
+
}