Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Test: add a testsuite about the solver and the vital flags
Baptiste Daroussin committed 2 years ago
commit 3681bf1185409f57f7bff39002092d79cfee55c7
parent ccfbf0c
1 file changed +43 -1
modified tests/frontend/upgrade.sh
@@ -8,7 +8,8 @@ tests_init \
	three_digit_revision \
	dual_conflict \
	file_become_dir \
-
	dir_become_file
+
	dir_become_file \
+
	vital

issue1881_body() {
	atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg pkg1 pkg_a 1
@@ -262,3 +263,44 @@ dir_become_file_body() {
	atf_check pkg create -M pkg.ucl -p plist-2
	atf_check -o ignore pkg -o REPOS_DIR="${TMPDIR}" -r ${TMPDIR}/target install -Uy ${TMPDIR}/pkg-2.pkg
}
+

+
vital_body() {
+
	atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "meta" "mymeta" "1"
+
	mkdir file-pkg-1
+
	cat << EOF >> meta.ucl
+
vital = true;
+
EOF
+
	echo entry > file-pkg-1/file
+
	echo "${TMPDIR}/file-pkg-1/file" > plist-1
+
	atf_check pkg create -M meta.ucl -p plist-1
+
	mkdir target
+
	atf_check -o ignore pkg -o REPOS_DIR="${TMPDIR}" -r ${TMPDIR}/target install -Uy ${TMPDIR}/mymeta-1.pkg
+
	atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "plop" "myplop" "1"
+
	atf_check pkg create -M plop.ucl
+
	atf_check -o ignore pkg -o REPOS_DIR="${TMPDIR}" -r ${TMPDIR}/target install -Uy ${TMPDIR}/myplop-1.pkg
+
	atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "plop" "myplop" "2"
+
	echo "${TMPDIR}/file-pkg-1/file" > plist-2
+
	atf_check pkg create -M plop.ucl -p plist-2
+
	mkdir repoconf
+
	cat << EOF > repoconf/repo.conf
+
local: {
+
	url: file:///$TMPDIR,
+
	enabled: true
+
}
+
EOF
+

+
	atf_check -o ignore pkg repo .
+
	atf_check -o ignore pkg -o REPOS_DIR="$TMPDIR/repoconf" -r ${TMPDIR}/target -o PKG_CACHEDIR="$TMPDIR" update
+
	OUTPUT="Updating local repository catalogue...
+
local repository is up to date.
+
All repositories are up to date.
+
Checking for upgrades (2 candidates):  done
+
Processing candidates (2 candidates):  done
+
Checking integrity... done (1 conflicting)
+
  - myplop-2 conflicts with mymeta-1 on ${TMPDIR}/file-pkg-1/file
+
Cannot solve problem using SAT solver, trying another plan
+
Checking integrity... done (0 conflicting)
+
Your packages are up to date.
+
"
+
	atf_check -o inline:"${OUTPUT}" pkg -o REPOS_DIR="$TMPDIR/repoconf" -r ${TMPDIR}/target -o PKG_CACHEDIR="$TMPDIR" upgrade -y
+
}