Skip to content

Commit

Permalink
Bug 1531236 - Fixup gtests.sh paths, a=bustage
Browse files Browse the repository at this point in the history
  • Loading branch information
martinthomson committed Mar 21, 2019
1 parent 7ac4b63 commit fac595e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
5 changes: 3 additions & 2 deletions tests/common/certsetup.sh
Expand Up @@ -47,11 +47,12 @@ make_cert() {
rsa_ca_rsapss_chain) type_args=(-g 1024 --pss-sign);sign=(-c rsa_ca);type=rsa;;
ecdh_rsa) type_args=(-q nistp256);sign=(-c rsa_ca);type=ec ;;
esac
msg="create certificate: $@"
shift 2
counter=$(($counter + 1))
certscript $@ | ${BINDIR}/certutil -S \
-z ${R_NOISE_FILE} -d "${PROFILEDIR}" \
-z "$R_NOISE_FILE" -d "$PROFILEDIR" \
-n $name -s "CN=$name" -t "$trust" "${sign[@]}" -m "$counter" \
-w -2 -v 120 -k "$type" "${type_args[@]}" "${sighash[@]}" -1 -2
html_msg $? 0 "create certificate: $@"
html_msg $? 0 "$msg"
}
29 changes: 17 additions & 12 deletions tests/gtests/gtests.sh
Expand Up @@ -23,18 +23,22 @@
gtest_init()
{
cd "$(dirname "$1")"
pwd
SOURCE_DIR="$PWD"/../..
if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
cd ../common
. ./init.sh
fi

SCRIPTNAME=gtests.sh
. "${QADIR}"/common/certsetup.sh

if [ -z "${CLEANUP}" ] ; then # if nobody else is responsible for
CLEANUP="${SCRIPTNAME}" # cleaning this script will do it
fi

mkdir -p "${GTESTDIR}"
cd "${GTESTDIR}"
}

########################## gtest_start #############################
Expand All @@ -48,20 +52,22 @@ gtest_start()
html_unknown "Skipping $i (not built)"
continue
fi
GTESTDIR="${HOSTDIR}/$i"
DIR="${GTESTDIR}/$i"
html_head "$i"
if [ ! -d "$GTESTDIR" ]; then
mkdir -p "$GTESTDIR"
echo "${BINDIR}/certutil" -N -d "$GTESTDIR" --empty-password 2>&1
"${BINDIR}/certutil" -N -d "$GTESTDIR" --empty-password 2>&1
if [ ! -d "$DIR" ]; then
mkdir -p "$DIR"
echo "${BINDIR}/certutil" -N -d "$DIR" --empty-password 2>&1
"${BINDIR}/certutil" -N -d "$DIR" --empty-password 2>&1

PROFILEDIR="$DIR" make_cert dummy p256 sign
fi
cd "$GTESTDIR"
GTESTREPORT="$GTESTDIR/report.xml"
PARSED_REPORT="$GTESTDIR/report.parsed"
cd "$DIR"
GTESTREPORT="$DIR/report.xml"
PARSED_REPORT="$DIR/report.parsed"
echo "executing $i"
"${BINDIR}/$i" "${SOURCE_DIR}/gtests/freebl_gtest/kat/Hash_DRBG.rsp" \
-d "$GTESTDIR" -w --gtest_output=xml:"${GTESTREPORT}" \
--gtest_filter="${GTESTFILTER:-*}"
-d "$DIR" -w --gtest_output=xml:"${GTESTREPORT}" \
--gtest_filter="${GTESTFILTER:-*}"
html_msg $? 0 "$i run successfully"
echo "test output dir: ${GTESTREPORT}"
echo "executing sed to parse the xml report"
Expand All @@ -82,8 +88,7 @@ gtest_start()
gtest_cleanup()
{
html "</TABLE><BR>"
cd "${QADIR}"
. common/cleanup.sh
. "${QADIR}"/common/cleanup.sh
}

################## main #################################################
Expand Down

0 comments on commit fac595e

Please sign in to comment.