aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2019-11-30 17:25:18 +0100
committerFabian Groffen <grobian@gentoo.org>2019-11-30 17:26:43 +0100
commitd1442dee24b0760665a103c5c1b3ad838eef02f9 (patch)
tree72152914aa8a7a4e11ebd6ddac2897fd8c80f10f /tests
parenttests: allow running all tests using valgrind (diff)
downloadportage-utils-d1442dee24b0760665a103c5c1b3ad838eef02f9.tar.gz
portage-utils-d1442dee24b0760665a103c5c1b3ad838eef02f9.tar.bz2
portage-utils-d1442dee24b0760665a103c5c1b3ad838eef02f9.zip
misc fixes for valgrind
mainly memory and socket leaks, sometimes using invalid data, this is related to bug #701402 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/qmerge/dotest25
-rwxr-xr-xtests/quse/dotest4
2 files changed, 18 insertions, 11 deletions
diff --git a/tests/qmerge/dotest b/tests/qmerge/dotest
index 86c61472..15635953 100755
--- a/tests/qmerge/dotest
+++ b/tests/qmerge/dotest
@@ -20,17 +20,20 @@ mkdir -p "${ROOT}/var/db/pkg"
set +e
+# sanity check on environment
+q -Cev
+
# Do a merge into an empty tree.
out=$(yes | qmerge -F qmerge-test)
-tend $? "qmerge-test: [N] basic merge" || echo "${out}"
+tend $? "qmerge-test: [N] basic merge" || die "${out}"
[[ ${out} != *"FAIL"* ]]
-tend $? "qmerge-test: [N] FAIL messages" || echo "${out}"
+tend $? "qmerge-test: [N] FAIL messages" || die "${out}"
order=$(echo "${out}" | awk '$1 == ">>>" && $2 ~ /^pkg_/ { printf "%s ", $NF }')
[[ ${order} == "pkg_pretend pkg_setup pkg_preinst pkg_postinst " ]]
-tend $? "qmerge-test: [N] pkg_* order of execution" || printf '%s\n' "${order}" "${out}"
+tend $? "qmerge-test: [N] pkg_* order of execution" || die "$(printf '%s\n' "${order}" "${out}")"
ls -d "${ROOT}"/var/db/pkg/sys-devel/qmerge-test-* >/dev/null
tend $? "qmerge-test: [N] vdb installed"
@@ -38,25 +41,25 @@ tend $? "qmerge-test: [N] vdb installed"
[[ -x ${ROOT}/usr/bin/qmerge-test && \
-f ${ROOT}/etc/some.conf && \
-f ${ROOT}/etc/another.conf ]]
-tend $? "qmerge-test: [N] installed expected files" || treedir "${ROOT}"
+tend $? "qmerge-test: [N] installed expected files" || die "$(treedir "${ROOT}")"
# Now do a re-emerge.
out=$(yes | qmerge -F qmerge-test)
-tend $? "qmerge-test: [R] re-emerge" || echo "${out}"
+tend $? "qmerge-test: [R] re-emerge" || die "${out}"
[[ -x ${ROOT}/usr/bin/qmerge-test ]]
-tend $? "qmerge-test: [R] installed expected files" || treedir "${ROOT}"
+tend $? "qmerge-test: [R] installed expected files" || die "$(treedir "${ROOT}")"
order=$(echo "${out}" | awk '$1 == ">>>" && $2 ~ /^pkg_/ { printf "%s ", $NF }')
[[ ${order} == "pkg_pretend pkg_setup pkg_preinst pkg_postinst " ]]
-tend $? "qmerge-test: [R] pkg_* order of execution" || printf '%s\n' "${order}" "${out}"
+tend $? "qmerge-test: [R] pkg_* order of execution" || die "$(printf '%s\n' "${order}" "${out}")"
[[ -x ${ROOT}/usr/bin/qmerge-test && \
-f ${ROOT}/etc/some.conf && \
-f ${ROOT}/etc/another.conf && \
-f ${ROOT}/etc/._cfg0000_some.conf ]]
-tend $? "qmerge-test: [R] re-installed expected files" || treedir "${ROOT}"
+tend $? "qmerge-test: [R] re-installed expected files" || die "$(treedir "${ROOT}")"
# Finally do an unmerge.
@@ -64,17 +67,17 @@ echo alkdsjfalksdf > "${ROOT}/etc/some.conf"
rm -f "${ROOT}/etc/._cfg0000_some.conf"
out=$(yes | qmerge -FU qmerge-test)
-tend $? "qmerge-test: [C] uninstall" || echo "${out}"
+tend $? "qmerge-test: [C] uninstall" || die "${out}"
order=$(echo "${out}" | awk '$1 == ">>>" { printf "%s ", $NF }')
[[ ${order} == "pkg_prerm pkg_postrm " ]]
-tend $? "qmerge-test: [C] pkg_* order of execution" || printf '%s\n' "${order}" "${out}"
+tend $? "qmerge-test: [C] pkg_* order of execution" || die "$(printf '%s\n' "${order}" "${out}")"
[[ ! -x ${ROOT}/usr/bin/qmerge-test && \
-f ${ROOT}/etc/some.conf && \
! -f ${ROOT}/etc/another.conf && \
! -d ${ROOT}/var/db/pkg/sys-devel ]]
-tend $? "qmerge-test: [C] uninstalled expected files" || treedir "${ROOT}"
+tend $? "qmerge-test: [C] uninstalled expected files" || die "$(treedir "${ROOT}")"
set -e
diff --git a/tests/quse/dotest b/tests/quse/dotest
index ada7bd98..93bef567 100755
--- a/tests/quse/dotest
+++ b/tests/quse/dotest
@@ -8,6 +8,10 @@ mktmpdir
mkportdir "${as}/portdir"
+# check inference of PORTDIR with repos.conf
+q -evC PORTDIR
+q -ovC
+
d=${PORTDIR}/profiles
entries() {
sed -e 's:#.*::' -e '/^$/d' "$1"