From patchwork Fri Apr 10 13:02:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Tulak X-Patchwork-Id: 6195341 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8F886BF4A6 for ; Fri, 10 Apr 2015 13:02:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B09A6203FB for ; Fri, 10 Apr 2015 13:02:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CA12B203F4 for ; Fri, 10 Apr 2015 13:02:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933055AbbDJNCf (ORCPT ); Fri, 10 Apr 2015 09:02:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44419 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932672AbbDJNCf (ORCPT ); Fri, 10 Apr 2015 09:02:35 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3AD2YWN029485 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 10 Apr 2015 09:02:34 -0400 Received: from jtulak.brq.redhat.com ([10.34.27.15]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3AD2Tgj016509; Fri, 10 Apr 2015 09:02:33 -0400 From: =?UTF-8?q?Jan=20=C5=A4ul=C3=A1k?= To: fstests@vger.kernel.org Cc: david@fromorbit.com Subject: [PATCH 3/7] fstests: environments - add option for skipping output diff from a test Date: Fri, 10 Apr 2015 15:02:25 +0200 Message-Id: <1428670949-17524-4-git-send-email-jtulak@redhat.com> In-Reply-To: <1428670949-17524-1-git-send-email-jtulak@redhat.com> References: <1428670949-17524-1-git-send-email-jtulak@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The performance tests has no "right" output for diff. Thus, this patch allows tests to opt-out of output diffs and to have their full output always saved into the results directory. Changes are both in check script and common/rc. Signed-off-by: Jan ?ulák --- check | 20 ++++++++++++++++++-- common/rc | 16 ++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/check b/check index 1a691e9..c746d71 100755 --- a/check +++ b/check @@ -713,12 +713,21 @@ for section in $HOST_OPTIONS_SECTIONS; do cat $seqres.notrun notrun="$notrun $seqnum" else + # Check for diff skip. + # Some tests, like performance ones, has no "right" output, + # so there is no reason to diff it. It is saved instead. + skip_diff=false + if [ -f $seqres.no_output_check ];then + skip_diff=true + rm $seqres.no_output_check + fi + if [ $sts -ne 0 ] then echo -n " [failed, exit status $sts]" err=true fi - if [ ! -f $seq.out ] + if [ ! -f $seq.out -a $skip_diff = false ] then echo " - no qualified output" err=true @@ -727,7 +736,8 @@ for section in $HOST_OPTIONS_SECTIONS; do # coreutils 8.16+ changed quote formats in error messages from # `foo' to 'foo'. Filter old versions to match the new version. sed -i "s/\`/\'/g" $tmp.out - if diff $seq.out $tmp.out >/dev/null 2>&1 + if (test $skip_diff = true) \ + || diff $seq.out $tmp.out >/dev/null 2>&1 then if $err then @@ -736,6 +746,12 @@ for section in $HOST_OPTIONS_SECTIONS; do echo "$seqnum `expr $stop - $start`" >>$tmp.time echo -n " `expr $stop - $start`s" fi + # if diff was skipped, we want to have the output saved + if test $skip_diff = true + then + mv $tmp.out $seqres.out + echo -n " Output saved per request of the test." + fi echo "" else echo " - output mismatch (see $seqres.out.bad)" diff --git a/common/rc b/common/rc index e090ecd..4498810 100644 --- a/common/rc +++ b/common/rc @@ -85,6 +85,22 @@ _get_lists_intersect() echo $intersect } +# Tell the check script that it should not check output +# of a test, but should always save it. +# +_disable_output_check() +{ + touch $seqres.no_output_check +} + +# Tell the check script that it should check output +# of a test. Revert the effect of "_disable_output_check()" call. +# +_enable_output_check() +{ + rm $seqres.no_output_check +} + dd() { if [ "$HOSTOS" == "Linux" ]