Simplify test failure detection in %check
There is the same logic in the upstream script: https://hg.mozilla.org/projects/nss/file/tip/tests/common/cleanup.sh#l56
This commit is contained in:
parent
0e03f768ab
commit
455711f1df
33
nss.spec
33
nss.spec
@ -43,7 +43,7 @@ rpm.define(string.format("nss_release_tag NSS_%s_RTM",
|
|||||||
Summary: Network Security Services
|
Summary: Network Security Services
|
||||||
Name: nss
|
Name: nss
|
||||||
Version: %{nss_version}
|
Version: %{nss_version}
|
||||||
Release: 4%{?dist}
|
Release: 5%{?dist}
|
||||||
License: MPLv2.0
|
License: MPLv2.0
|
||||||
URL: http://www.mozilla.org/projects/security/pki/nss/
|
URL: http://www.mozilla.org/projects/security/pki/nss/
|
||||||
Requires: nspr >= %{nspr_version}
|
Requires: nspr >= %{nspr_version}
|
||||||
@ -478,35 +478,7 @@ pushd nss/tests
|
|||||||
HOST=localhost DOMSUF=localdomain PORT=$MYRAND NSS_CYCLES=%{?nss_cycles} NSS_TESTS=%{?nss_tests} NSS_SSL_TESTS=%{?nss_ssl_tests} NSS_SSL_RUN=%{?nss_ssl_run} ./all.sh
|
HOST=localhost DOMSUF=localdomain PORT=$MYRAND NSS_CYCLES=%{?nss_cycles} NSS_TESTS=%{?nss_tests} NSS_SSL_TESTS=%{?nss_ssl_tests} NSS_SSL_RUN=%{?nss_ssl_run} ./all.sh
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# Normally, the grep exit status is 0 if selected lines are found and 1 otherwise,
|
|
||||||
# Grep exits with status greater than 1 if an error ocurred.
|
|
||||||
# If there are test failures we expect TEST_FAILURES > 0 and GREP_EXIT_STATUS = 0,
|
|
||||||
# With no test failures we expect TEST_FAILURES = 0 and GREP_EXIT_STATUS = 1, whereas
|
|
||||||
# GREP_EXIT_STATUS > 1 would indicate an error in grep such as failure to find the log file.
|
|
||||||
killall $RANDSERV || :
|
killall $RANDSERV || :
|
||||||
|
|
||||||
TEST_FAILURES=$(grep -c -- '- FAILED$' ./tests_results/security/localhost.1/output.log) || GREP_EXIT_STATUS=$?
|
|
||||||
|
|
||||||
if [ ${GREP_EXIT_STATUS:-0} -eq 1 ]; then
|
|
||||||
echo "okay: test suite detected no failures"
|
|
||||||
else
|
|
||||||
if [ ${GREP_EXIT_STATUS:-0} -eq 0 ]; then
|
|
||||||
# while a situation in which grep return status is 0 and it doesn't output
|
|
||||||
# anything shouldn't happen, set the default to something that is
|
|
||||||
# obviously wrong (-1)
|
|
||||||
echo "error: test suite had ${TEST_FAILURES:--1} test failure(s)"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
if [ ${GREP_EXIT_STATUS:-0} -eq 2 ]; then
|
|
||||||
echo "error: grep has not found log file"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "error: grep failed with exit code: ${GREP_EXIT_STATUS}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
echo "test suite completed"
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%install
|
%install
|
||||||
@ -895,6 +867,9 @@ update-crypto-policies &> /dev/null || :
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Feb 8 2019 Daiki Ueno <dueno@redhat.com> - 3.41.0-5
|
||||||
|
- Simplify test failure detection in %%check
|
||||||
|
|
||||||
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.41.0-4
|
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.41.0-4
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user