--- /dev/null
+smb_print_trans-oobr1 smb_print_trans-oobr1.pcapng smb_print_trans-oobr1.out -vv -c4
+# bad packets from Philippe Antoine
+smb_print_trans-oobr2 smb_print_trans-oobr2.pcap smb_print_trans-oobr2.out -vv -c1
+
+# CVE-2018-10105 bad packets from Luis Rocha
+cve-2018-10105_smbprint-readofsize1 cve-2018-10105_smbprint-readofsize1.pcap cve-2018-10105_smbprint-readofsize1.out -vvv
+cve-2018-10105_smbutil_withoutasan cve-2018-10105_smbutil_withoutasan.pcap cve-2018-10105_smbutil_withoutasan.out -vvv
+
+
ospf6_print_lshdr-oobr ospf6_print_lshdr-oobr.pcapng ospf6_print_lshdr-oobr.out -vv -c15
rpl-dao-oobr rpl-dao-oobr.pcapng rpl-dao-oobr.out -vv -c1
hncp_prefix-oobr hncp_prefix-oobr.pcapng hncp_prefix-oobr.out -vvv
-smb_print_trans-oobr1 smb_print_trans-oobr1.pcapng smb_print_trans-oobr1.out -vv -c4
# bad packets from Ryan Ackroyd
ieee802.11_meshhdr-oobr ieee802.11_meshhdr-oobr.pcap ieee802.11_meshhdr-oobr.out -H -c1
dccp_options-oobr dccp_options-oobr.pcap dccp_options-oobr.out -vv -c8
-# bad packets from Philippe Antoine
-smb_print_trans-oobr2 smb_print_trans-oobr2.pcap smb_print_trans-oobr2.out -vv -c1
-
# RTP tests
# fuzzed pcap
rtp-seg-fault-1 rtp-seg-fault-1.pcap rtp-seg-fault-1.out -v -T rtp
# CVE-2018-10105 bad packets from Luis Rocha
cve-2018-10105-segv-sflowprint cve-2018-10105-segv-sflowprint.pcapng cve-2018-10105-segv-sflowprint.out -v
-cve-2018-10105_smbprint-readofsize1 cve-2018-10105_smbprint-readofsize1.pcap cve-2018-10105_smbprint-readofsize1.out -vvv
-cve-2018-10105_smbutil_withoutasan cve-2018-10105_smbutil_withoutasan.pcap cve-2018-10105_smbutil_withoutasan.out -vvv
--- /dev/null
+#!/bin/sh
+
+srcdir=${1-..}
+echo smb.sh using ${srcdir} from $(pwd)
+
+testdir=${srcdir}/tests
+
+exitcode=0
+passedfile=tests/.passed
+failedfile=tests/.failed
+passed=`cat ${passedfile}`
+failed=`cat ${failedfile}`
+
+# Only attempt OpenSSL-specific tests when compiled with the library.
+
+if grep '^#define ENABLE_SMB 1$' ${srcdir}/config.h >/dev/null
+then
+ cat ${srcdir}/tests/SMBLIST | while read name input output options
+ do
+ case $name in
+ \#*) continue;;
+ '') continue;;
+ esac
+ rm -f core
+ [ "$only" != "" -a "$name" != "$only" ] && continue
+ SRCDIR=${srcdir}
+ export SRCDIR
+ # I hate shells with their stupid, useless subshells.
+ passed=`cat ${passedfile}`
+ failed=`cat ${failedfile}`
+ (cd tests # run TESTonce in tests directory
+ if ${srcdir}/tests/TESTonce $name ${srcdir}/tests/$input ${srcdir}/tests/$output "$options"
+ then
+ passed=`expr $passed + 1`
+ echo $passed >${passedfile}
+ else
+ failed=`expr $failed + 1`
+ echo $failed >${failedfile}
+ fi
+ if [ -d COREFILES ]; then
+ if [ -f core ]; then mv core COREFILES/$name.core; fi
+ fi)
+ done
+ # I hate shells with their stupid, useless subshells.
+ passed=`cat ${passedfile}`
+ failed=`cat ${failedfile}`
+fi
+
+exit $exitcode