Received: from eggs.gnu.org ([2001:4830:134:3::10]:37669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apzk3-0007Gy-T8 for qemu-devel@nongnu.org; Tue, 12 Apr 2016 10:56:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1apzjz-0002UC-Qq for qemu-devel@nongnu.org; Tue, 12 Apr 2016 10:56:35 -0400 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:60032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apzjz-0002Sx-Ig for qemu-devel@nongnu.org; Tue, 12 Apr 2016 10:56:31 -0400 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 12 Apr 2016 15:56:27 +0100 From: Sascha Silbe Date: Tue, 12 Apr 2016 16:56:18 +0200 Message-Id: <1460472980-26319-3-git-send-email-silbe@linux.vnet.ibm.com> In-Reply-To: <1460472980-26319-1-git-send-email-silbe@linux.vnet.ibm.com> References: <1460472980-26319-1-git-send-email-silbe@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 2/4] qemu-iotests: common.rc: drop unused _do() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-block@nongnu.org, Kevin Wolf , Max Reitz Cc: Tu Bo _do() was never used and possibly creates temporary files at predictable, world-writable locations. Get rid of it. Signed-off-by: Sascha Silbe Reviewed-by: Bo Tu --- tests/qemu-iotests/common.rc | 46 -------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index d9913f8..5249ec5 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -287,52 +287,6 @@ _need_to_be_root() fi } - -# Do a command, log it to $seq.full, optionally test return status -# and die if command fails. If called with one argument _do executes the -# command, logs it, and returns its exit status. With two arguments _do -# first prints the message passed in the first argument, and then "done" -# or "fail" depending on the return status of the command passed in the -# second argument. If the command fails and the variable _do_die_on_error -# is set to "always" or the two argument form is used and _do_die_on_error -# is set to "message_only" _do will print an error message to -# $seq.out and exit. - -_do() -{ - if [ $# -eq 1 ]; then - _cmd=$1 - elif [ $# -eq 2 ]; then - _note=$1 - _cmd=$2 - echo -n "$_note... " - else - echo "Usage: _do [note] cmd" 1>&2 - status=1; exit - fi - - (eval "echo '---' \"$_cmd\"") >>"$OUTPUT_DIR/$seq.full" - (eval "$_cmd") >$tmp._out 2>&1; ret=$? - cat $tmp._out >>"$OUTPUT_DIR/$seq.full" - if [ $# -eq 2 ]; then - if [ $ret -eq 0 ]; then - echo "done" - else - echo "fail" - fi - fi - if [ $ret -ne 0 ] \ - && [ "$_do_die_on_error" = "always" \ - -o \( $# -eq 2 -a "$_do_die_on_error" = "message_only" \) ] - then - [ $# -ne 2 ] && echo - eval "echo \"$_cmd\" failed \(returned $ret\): see $seq.full" - status=1; exit - fi - - return $ret -} - # bail out, setting up .notrun file # _notrun() -- 1.9.1