summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/gnutls/gnutls/run-ptest
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-support/gnutls/gnutls/run-ptest')
-rw-r--r--meta/recipes-support/gnutls/gnutls/run-ptest100
1 files changed, 100 insertions, 0 deletions
diff --git a/meta/recipes-support/gnutls/gnutls/run-ptest b/meta/recipes-support/gnutls/gnutls/run-ptest
new file mode 100644
index 0000000000..17e26eae70
--- /dev/null
+++ b/meta/recipes-support/gnutls/gnutls/run-ptest
@@ -0,0 +1,100 @@
1#!/bin/sh
2
3rjob() {
4 local job=$1
5 local log=$2
6
7 # TODO: Output will be garbled
8 ./${job} >> ${log} 2>&1
9
10 ret=$?
11 case $ret in
12 0)
13 echo "PASS: $t" >> ${log}
14 echo "PASS: $t"
15 ;;
16 77)
17 echo "SKIP: $t" >> ${log}
18 echo "SKIP: $t"
19 ;;
20 *)
21 echo "FAIL: $t" >> ${log}
22 echo "FAIL: $t"
23 ;;
24 esac
25}
26
27is_disallowed() {
28 local key=$1
29 $(echo ${test_disallowlist} | grep -w -q ${key})
30 return $?
31}
32
33# TODO
34# This list should probably be in a external file
35# Testcases defined here either take very long time (dtls-stress)
36# or are dependent on local files (certs, etc) in local file system
37# currently not exported to target.
38
39test_disallowlist=""
40test_disallowlist="${test_disallowlist} dtls-stress"
41test_disallowlist="${test_disallowlist} handshake-large-cert"
42test_disallowlist="${test_disallowlist} id-on-xmppAddr"
43test_disallowlist="${test_disallowlist} mini-x509-cas"
44test_disallowlist="${test_disallowlist} pkcs12_simple"
45test_disallowlist="${test_disallowlist} protocol-set-allowlist"
46test_disallowlist="${test_disallowlist} psk-file"
47test_disallowlist="${test_disallowlist} rawpk-api"
48test_disallowlist="${test_disallowlist} set_pkcs12_cred"
49test_disallowlist="${test_disallowlist} system-override-curves-allowlist"
50test_disallowlist="${test_disallowlist} system-override-hash"
51test_disallowlist="${test_disallowlist} system-override-sig"
52test_disallowlist="${test_disallowlist} system-override-sig-tls"
53test_disallowlist="${test_disallowlist} system-prio-file"
54test_disallowlist="${test_disallowlist} x509cert-tl"
55
56LOG=${PWD}/tests.log
57cd tests
58max_njobs=$(grep -c ^processor /proc/cpuinfo)
59njobs=0
60
61set +e
62
63for t in *; do
64 [ -x $t ] || continue
65 [ -f $t ] || continue
66
67 is_disallowed ${t}
68 [ $? -eq 0 ] && continue
69
70 rjob ${t} ${LOG} &
71 one=1
72 njobs=$(expr ${njobs} + ${one})
73 if [ ${njobs} -eq ${max_njobs} ]; then
74 wait
75 njobs=0
76 fi
77done
78wait
79
80skipped=$(grep -c SKIP ${LOG})
81passed=$(grep -c PASS ${LOG})
82failed=$(grep -c FAIL ${LOG})
83total=$(expr ${passed} + ${failed} + ${skipped})
84
85if [ ${failed} -ne 0 ]; then
86 echo
87 echo "Tests failed for gnutls, log is:"
88 echo "--------------------"
89 cat ${LOG}
90 echo
91fi
92
93echo
94echo "gnutls test summary:"
95echo "--------------------"
96echo "total: ${total}"
97echo "pass : ${passed}"
98echo "fail : ${failed}"
99echo "skip : ${skipped}"
100echo