Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add some regression tests about multiple version of the same package in a repo. Comment the part about what it should do and does not right now.
Baptiste Daroussin committed 10 years ago
commit 1c37f79e91fe86edfa6ac7454c9ab62006cec149
parent 8b217c1
1 file changed +58 -1
modified tests/frontend/repo.sh
@@ -3,7 +3,8 @@
. $(atf_get_srcdir)/test_environment.sh

tests_init \
-
	repo
+
	repo \
+
	repo_multiversion

repo_body() {
	touch plop
@@ -68,3 +69,59 @@ EOF
	atf_check_equal $nb 2

}
+

+
repo_multiversion_body() {
+
	cat > test.ucl << EOF
+
name: "test"
+
origin: "osef"
+
version: "1.0"
+
arch: "freebsd:*"
+
maintainer: "test"
+
www: "unknown"
+
prefix: "${TMPDIR}"
+
comment: "need one"
+
desc: "here as well"
+
EOF
+

+
	cat > test1.ucl << EOF
+
name: "test"
+
origin: "osef"
+
version: "1.1"
+
arch: "freebsd:*"
+
maintainer: "test"
+
www: "unknown"
+
prefix: "${TMPDIR}"
+
comment: "need one"
+
desc: "here as well"
+
EOF
+
	for i in test test1; do
+
		atf_check pkg create -M $i.ucl
+
	done
+

+
	atf_check \
+
		-o inline:"Creating repository in .:  done\nPacking files for repository:  done\n" \
+
		pkg repo .
+

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

+
	atf_check -o ignore \
+
		pkg -C ./pkg.conf update
+

+
	# Ensure we can pickup the old version
+
	#atf_check -o match:"Installing test-1\.\.\." \
+
	#	pkg -C ./pkg.conf install -y test-1.0
+

+
	#atf_check pkg -C ./pkg.conf upgrade -y
+

+
	#atf_check -o ignore pkg -C ./pkg.conf delete test
+

+
	# Ensure the latest version is installed
+
	atf_check -o match:"Installing test-1.1" \
+
		pkg -C ./pkg.conf install -y test
+
}