4 # This file and its contents are supplied under the terms of the
5 # Common Development and Distribution License ("CDDL"), version 1.0.
6 # You may only use this file in accordance with the terms of version
9 # A full copy of the text of the CDDL should have accompanied this
10 # source. A copy of the CDDL is also available via the Internet at
11 # http://www.illumos.org/license/CDDL.
15 # Copyright (c) 2017, Joyent, Inc.
19 # Run all of the various libsff tests.
23 sff_arg0
=$
(basename $0)
26 sff_tests
="8472 br compliance conn enc ident lengths opts strings wave"
27 sff_tests
="$sff_tests 8636_diag 8636_extspec 8636_tech 8636_temp einval efault"
28 sff_outfile
="/tmp/$sff_arg0.out.$$"
33 [[ -z "$msg" ]] && msg
="failed"
34 echo "TEST FAILED: $sff_arg0: $msg" >&2
40 cd $
(dirname $0) || fatal
"failed to cd to test root"
42 cd $dt_origwd || fatal
"failed to return to original dir"
44 for t
in $sff_tests; do
46 testfile
=$sff_root/libsff_
$t
48 if ! $testfile > $sff_outfile; then
49 fatal
"failed to run $testfile"
52 if [[ -f $testfile.out
]]; then
53 if ! diff $testfile.out
$sff_outfile >/dev
/null
; then
54 fatal
"$t results differ from expected values"
57 printf "TEST PASSED: libsff_%s\n" $t
60 rm -f $sff_outfile || fatal
"failed to remove output file"