re-introduce old nss im too tired for this

This commit is contained in:
wuggy 2026-06-30 06:37:32 +01:00
commit 3a838106b9
2871 changed files with 1374431 additions and 1762417 deletions

75
security/nss/tests/common/init.sh Executable file → Normal file
View file

@ -83,7 +83,6 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
GTESTDIR=${HOSTDIR}/gtests
PWFILE=${HOSTDIR}/tests.pw
LONGPWFILE=${HOSTDIR}/tests.longpw
EMPTY_FILE=${HOSTDIR}/tests_empty
NOISE_FILE=${HOSTDIR}/tests_noise
CORELIST_FILE=${HOSTDIR}/clist
@ -92,9 +91,6 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
FIPSBADPWFILE=${HOSTDIR}/tests.fipsbadpw
FIPSP12PWFILE=${HOSTDIR}/tests.fipsp12pw
echo nss > ${PWFILE}
echo "nss123456789012345678901234567890123456789012345678901234567890_" > ${LONGPWFILE}
echo > ${EMPTY_FILE}
echo "fIps140" > ${FIPSPWFILE}
echo "fips104" > ${FIPSBADPWFILE}
echo "pKcs12fips140" > ${FIPSP12PWFILE}
@ -257,72 +253,6 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
HTML_UNKNOWN='</TD><TD>Unknown</TD><TR>'
TABLE_ARGS=
gtest_parse_report_helper()
{
# Check XML reports for normal test runs and failures.
local successes=$(gtest_parse_report_xpath "//testcase[@status='run'][count(*)=0]" "$@" )
local failures=$(gtest_parse_report_xpath "//failure/.." "$@" )
# Print all tests that succeeded.
while read result name; do
html_passed_ignore_core "$name"
done <<< "$successes"
# Print failing tests.
if [ -n "$failures" ]; then
printf "\nFAILURES:\n=========\n"
while read result name; do
html_failed_ignore_core "$name"
done <<< "$failures"
printf "\n"
fi
}
# This legacy report parser can't actually detect failures. It always relied
# on the binary's exit code. Print the tests we ran to keep the old behavior.
gtest_parse_report_legacy()
{
while read result name && [ -n "$name" ]; do
if [ "$result" = "notrun" ]; then
echo "$name" SKIPPED
elif [ "$result" = "run" ]; then
html_passed_ignore_core "$name"
else
html_failed_ignore_core "$name"
fi
done <<< "$(sed -f "${COMMON}/parsegtestreport.sed" "$@" )"
# here's how we would use bash if it wasn't so slow
# done <<< "$(sh "${COMMON}/parsegtestreport.sh" "$@" )"
}
gtest_parse_report_xpath()
{
# Query the XML report with the given XPath pattern.
xpath="$1"
shift
xmllint --xpath "${xpath}" "$@" 2>/dev/null | \
# Insert newlines to help sed.
sed $'s/<testcase/\\\n<testcase/g' | \
# Use sed to parse the report.
sed -f "${COMMON}/parsegtestreport.sed"
# here's how we would use bash if it wasn't so slow
#sh "${COMMON}/parsegtestreport.sh"
}
gtest_parse_report()
{
if type xmllint &>/dev/null; then
echo "DEBUG: Using xmllint to parse GTest XML report(s)"
gtest_parse_report_helper "$@"
else
echo "DEBUG: Falling back to legacy XML report parsing using only sed"
gtest_parse_report_legacy "$@"
fi
}
#directory name init
SCRIPTNAME=init.sh
@ -663,7 +593,6 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
fi
R_PWFILE=../tests.pw
R_LONGPWFILE=../tests.longpw
R_EMPTY_FILE=../tests_empty
R_NOISE_FILE=../tests_noise
@ -722,9 +651,9 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
RELOAD_CRL=1
# if test mode isn't set, test scripts default to expecting sql
# if test mode isn't set, test scripts default to expecting dbm
if [ "${TEST_MODE}" = "" ]; then
NSS_DEFAULT_DB_TYPE=${NSS_DEFAULT_DB_TYPE:-"sql"}
NSS_DEFAULT_DB_TYPE="dbm"
export NSS_DEFAULT_DB_TYPE
fi