riscv workarounds for timing related tests

------------- time ----------------------
real 1.07 user 0.84 sys 0.20
1 seconds
sdr.sh: #9: pwdecrypt no time regression  - FAILED

Allow it to be <2 seconds.

------------- time ----------------------
real 8.12 user 7.69 sys 0.33
8 seconds
dbtests.sh: #27: certutil dump keys with explicit default trust flags  - FAILED

Give it 20 seconds.

Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
This commit is contained in:
David Abdurachmanov 2024-11-14 13:06:58 +02:00
parent df41af19fa
commit 7ceed042c4
Signed by: davidlt
GPG Key ID: 7A5F42FAF91FACC3
2 changed files with 41 additions and 4 deletions

View File

@ -0,0 +1,38 @@
From 92025c4ca158dccf4a640ddcf52edda1e8ffd77e Mon Sep 17 00:00:00 2001
From: David Abdurachmanov <davidlt@rivosinc.com>
Date: Thu, 14 Nov 2024 11:04:11 +0000
Subject: [PATCH] riscv workarounds for timing
All current boards are too slow to deliver required timing.
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
diff --git a/nss/tests/dbtests/dbtests.sh b/nss/tests/dbtests/dbtests.sh
index c82ea85..067b40d 100755
--- a/nss/tests/dbtests/dbtests.sh
+++ b/nss/tests/dbtests/dbtests.sh
@@ -366,7 +366,7 @@ dbtest_main()
RARRAY=($dtime)
TIMEARRAY=(${RARRAY[1]//./ })
echo "${TIMEARRAY[0]} seconds"
- test ${TIMEARRAY[0]} -lt 5
+ test ${TIMEARRAY[0]} -lt 20
ret=$?
html_msg ${ret} 0 "certutil dump keys with explicit default trust flags"
fi
diff --git a/nss/tests/sdr/sdr.sh b/nss/tests/sdr/sdr.sh
index a934460..e7024d2 100755
--- a/nss/tests/sdr/sdr.sh
+++ b/nss/tests/sdr/sdr.sh
@@ -146,7 +146,7 @@ sdr_main()
RARRAY=($dtime)
TIMEARRAY=(${RARRAY[1]//./ })
echo "${TIMEARRAY[0]} seconds"
- html_msg ${TIMEARRAY[0]} 0 "pwdecrypt no time regression"
+ html_msg ${TIMEARRAY[0]} 1 "pwdecrypt no time regression"
export NSS_MAX_MP_PBE_ITERATION_COUNT=$OLD_MAX_PBE_ITERATIONS
}
--
2.47.0

View File

@ -17,11 +17,7 @@
%global dracut_modules_dir %{dracutlibdir}/modules.d/05nss-softokn/ %global dracut_modules_dir %{dracutlibdir}/modules.d/05nss-softokn/
%global dracut_conf_dir %{dracutlibdir}/dracut.conf.d %global dracut_conf_dir %{dracutlibdir}/dracut.conf.d
%ifnarch riscv64
%bcond_without tests %bcond_without tests
%else
%bcond_with tests
%endif
%bcond_with dbm %bcond_with dbm
# Produce .chk files for the final stripped binaries # Produce .chk files for the final stripped binaries
@ -140,6 +136,9 @@ Patch41: nss-3.101-enable-kyber-policy.patch
# fix unused variable warnings # fix unused variable warnings
Patch42: nss-3.103-unused-cipherwrap2.patch Patch42: nss-3.103-unused-cipherwrap2.patch
# riscv workarounds
Patch50: 0001-riscv-workarounds-for-timing.patch
Patch100: nspr-config-pc.patch Patch100: nspr-config-pc.patch
Patch101: nspr-gcc-atomics.patch Patch101: nspr-gcc-atomics.patch