Skip to content

Commit 8a22823

Browse files
committed
AZP: Skip RPM install dry-run when rpm db is unreadable
On euleros2sp12 and kylin10sp3 the system rpm db at /var/lib/rpm is locked down for non-root, so 'rpm -Uvh --test' fails when opening the db before it can validate the package. Probe with 'rpm -q rpm' and skip the install test when the db is unreadable, so the check still runs everywhere it can without hard-failing the build on those two distros. Also mark the task as SucceededWithIssues so the skip surfaces as a yellow row in the build summary instead of hiding behind a green pass. Signed-off-by: Alexey Rivkin <arivkin@nvidia.com>
1 parent 9412dd6 commit 8a22823

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

buildlib/tools/builds.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ build_release_pkg() {
9494
exit 1
9595
fi
9696
echo "==== Test install RPM (dry-run) ===="
97-
rpm -Uvh --test ${PWD}/rpm-dist/*/*.rpm
97+
if rpm -q rpm >/dev/null 2>&1; then
98+
rpm -Uvh --test ${PWD}/rpm-dist/*/*.rpm
99+
else
100+
azure_log_warning "Skip RPM install test: rpm db not readable as non-root"
101+
azure_complete_with_issues "Skip RPM install test: rpm db not readable as non-root"
102+
fi
98103
echo "==== Build debug RPM ===="
99104
${WORKSPACE}/contrib/buildrpm.sh -s -b -d --nodeps --define "_topdir $PWD/debug"
100105
fi

0 commit comments

Comments
 (0)