summaryrefslogtreecommitdiff
path: root/tests/smb.sh
diff options
context:
space:
mode:
authorSeonah Moon <seonah1.moon@samsung.com>2019-10-07 11:05:26 +0900
committerSeonah Moon <seonah1.moon@samsung.com>2019-10-07 11:06:12 +0900
commitb0706e54b48af6c11783f55455842a292c4d9b17 (patch)
treee18f8e347693bf9a1297f5553716e84c9109246f /tests/smb.sh
parentd722eee76c51a65c5449806c6fdacf2ac4f95055 (diff)
parent9ceaf0d786e9465506271e8450248a57719e4eb1 (diff)
downloadtcpdump-b0706e54b48af6c11783f55455842a292c4d9b17.tar.gz
tcpdump-b0706e54b48af6c11783f55455842a292c4d9b17.tar.bz2
tcpdump-b0706e54b48af6c11783f55455842a292c4d9b17.zip
Change-Id: Ib2ce6fe0c63523943f1fe7d772010824fe2c0d41
Diffstat (limited to 'tests/smb.sh')
-rw-r--r--tests/smb.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/smb.sh b/tests/smb.sh
new file mode 100644
index 0000000..4502354
--- /dev/null
+++ b/tests/smb.sh
@@ -0,0 +1,49 @@
+#!/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$' 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