Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add a test to try and tease out a failure I saw with conflicts.
Brad Davis committed 8 years ago
commit 8c79a14b8448eda41d7449131a37063b4fd8aec6
parent 078aab7
1 file changed +127 -0
modified tests/frontend/conflicts.sh
@@ -3,8 +3,135 @@
. $(atf_get_srcdir)/test_environment.sh

tests_init \
+
	complex_conflicts \
	find_conflicts

+
# install foo
+
# foo depends on bar-1.0
+
# foo is upgraded to new dep on bar1-1.0 & bar is updated to 2.0
+
# bar1 and bar conflict with each other
+
complex_conflicts_body() {
+
	echo "bar-1.0" > file1
+
	atf_check -s exit:0 ${RESOURCEDIR}/test_subr.sh new_pkg bar bar 1.0 "${TMPDIR}"
+
	cat << EOF >> bar.ucl
+
files: {
+
	${TMPDIR}/file1: "",
+
}
+
EOF
+

+
	atf_check \
+
		-o empty \
+
		-e empty \
+
		-s exit:0 \
+
		pkg create -M ./bar.ucl -o ./repo/
+

+
	atf_check -s exit:0 ${RESOURCEDIR}/test_subr.sh new_pkg foo foo 1.0 "${TMPDIR}"
+
	cat << EOF >> foo.ucl
+
deps: {
+
	bar: {
+
		origin: "bar",
+
		version: "1.0"
+
	}
+
}
+
EOF
+

+
	atf_check \
+
		-o empty \
+
		-e empty \
+
		-s exit:0 \
+
		pkg create -M ./foo.ucl -o ./repo/
+

+
	cat << EOF > pkg.conf
+
PKG_DBDIR=${TMPDIR}
+
REPOS_DIR=[]
+
repositories: {
+
	local: { url : file://${TMPDIR}/repo }
+
}
+
EOF
+

+
	atf_check \
+
		-o inline:"Creating repository in ./repo:  done\nPacking files for repository:  done\n" \
+
		-e empty \
+
		-s exit:0 \
+
		pkg -C ./pkg.conf repo ./repo
+

+
	atf_check \
+
		-o ignore \
+
		-e match:".*load error: access repo file.*" \
+
		-s exit:0 \
+
		pkg -C ./pkg.conf update -f
+

+
	atf_check \
+
		-o match:"Installing foo-1\.0" \
+
		-s exit:0 \
+
		pkg -C ./pkg.conf install -y foo
+

+
	# Upgrade bar
+
	rm -fr repo
+
	echo "bar-2.0" > file1
+
	atf_check -s exit:0 ${RESOURCEDIR}/test_subr.sh new_pkg bar bar 2.0 "${TMPDIR}"
+
	cat << EOF >> bar.ucl
+
files: {
+
	${TMPDIR}/file1: "",
+
}
+
EOF
+

+
	atf_check \
+
		-o empty \
+
		-e empty \
+
		-s exit:0 \
+
		pkg create -M ./bar.ucl -o ./repo/
+

+
	# Create bar1-1.1
+
	echo "bar-1.1" > file1
+
	atf_check -s exit:0 ${RESOURCEDIR}/test_subr.sh new_pkg bar1 bar1 1.1 "${TMPDIR}"
+
	cat << EOF >> bar.ucl
+
files: {
+
	${TMPDIR}/file1: "",
+
}
+
EOF
+

+
	atf_check \
+
		-o empty \
+
		-e empty \
+
		-s exit:0 \
+
		pkg create -M ./bar.ucl -o ./repo/
+

+
	atf_check -s exit:0 ${RESOURCEDIR}/test_subr.sh new_pkg foo foo 1.1 "${TMPDIR}"
+
	cat << EOF >> foo.ucl
+
deps: {
+
	bar1: {
+
		origin: "bar1",
+
		version: "1.1"
+
	}
+
}
+
EOF
+

+
	atf_check \
+
		-o empty \
+
		-e empty \
+
		-s exit:0 \
+
		pkg create -M ./foo.ucl -o ./repo/
+

+
	atf_check \
+
		-o inline:"Creating repository in ./repo:  done\nPacking files for repository:  done\n" \
+
		-e empty \
+
		-s exit:0 \
+
		pkg -C ./pkg.conf repo ./repo
+

+
	atf_check \
+
		-o ignore \
+
		-e empty \
+
		-s exit:0 \
+
		pkg -C ./pkg.conf update -f
+

+
	atf_check \
+
		-o match:"Upgrading bar from 1\.0 to 2\.0" \
+
		-e empty \
+
		-s exit:0 \
+
		pkg -C ./pkg.conf upgrade -y
+
}
+

find_conflicts_body() {
	touch a
	atf_check -s exit:0 ${RESOURCEDIR}/test_subr.sh new_manifest test 1 /