Print this page
7290 ZFS test suite needs to control what utilities it can run
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>

*** 24,34 **** # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ! # Copyright (c) 2013 by Delphix. All rights reserved. # . $STF_SUITE/include/libtest.shlib # --- 24,34 ---- # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ! # Copyright (c) 2013, 2016 by Delphix. All rights reserved. # . $STF_SUITE/include/libtest.shlib #
*** 41,51 **** # 3) Verify the output by checking for "mdb:" in the output string # function cleanup { ! $RM -f $OUTFILE } verify_runnable "global" log_onexit cleanup --- 41,51 ---- # 3) Verify the output by checking for "mdb:" in the output string # function cleanup { ! rm -f $OUTFILE } verify_runnable "global" log_onexit cleanup
*** 79,103 **** typeset -i RET=0 i=0 while (( $i < ${#dcmds[*]} )); do log_note "Verifying: '${dcmds[i]}'" ! $ECHO "${dcmds[i]}" | $MDB -k > $OUTFILE 2>&1 RET=$? if (( $RET != 0 )); then log_fail "mdb '${dcmds[i]}' returned error $RET" fi # # mdb prefixes all errors with "mdb: " so we check the output. # ! $GREP "mdb:" $OUTFILE > /dev/null 2>&1 RET=$? if (( $RET == 0 )); then ! $ECHO "mdb '${dcmds[i]}' contained 'mdb:'" ! # Using $TAIL limits the number of lines in the log ! $TAIL -100 $OUTFILE log_fail "mdb walker or dcmd failed" fi ((i = i + 1)) done --- 79,103 ---- typeset -i RET=0 i=0 while (( $i < ${#dcmds[*]} )); do log_note "Verifying: '${dcmds[i]}'" ! echo "${dcmds[i]}" | mdb -k > $OUTFILE 2>&1 RET=$? if (( $RET != 0 )); then log_fail "mdb '${dcmds[i]}' returned error $RET" fi # # mdb prefixes all errors with "mdb: " so we check the output. # ! grep "mdb:" $OUTFILE > /dev/null 2>&1 RET=$? if (( $RET == 0 )); then ! echo "mdb '${dcmds[i]}' contained 'mdb:'" ! # Using tail limits the number of lines in the log ! tail -100 $OUTFILE log_fail "mdb walker or dcmd failed" fi ((i = i + 1)) done