From patchwork Mon May 14 05:49:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 912689 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ext4-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rG53YRaP"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40kqW94l50z9s16 for ; Mon, 14 May 2018 15:48:37 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751978AbeENFsg (ORCPT ); Mon, 14 May 2018 01:48:36 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:36689 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751780AbeENFsd (ORCPT ); Mon, 14 May 2018 01:48:33 -0400 Received: by mail-wr0-f194.google.com with SMTP id p4-v6so10871597wrh.3; Sun, 13 May 2018 22:48:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JSCNYVKJn9rSe1OHcjIBEAFq6munwqh+2cBs1sQBLcI=; b=rG53YRaPk87B8m21UFx+YOQoBuprqor96lRK/Psx3WswKoBIzGRNcMc5mIDzhzvads jMYek2u+BQgLVTFFSrCaA5q9HFCJzc4135S2i7UPqBH+9XoAtVF5wuden7yrCoHgMgHy CWCRRGhqgoUUZbl1b0LCo4S6rpRvUealu27hdEWXE+qL5tUOGFpsqi4lOxsV5wOwnhtj cbJoHvJXetJujU2nc6yvrPNCx7cGOhCH2vhH1NCYUNkUNap2ivnh+NCeB4j1EeRdJncN NMASaKAxkljDd9ud9x1UfDOov//rzg0DMd29rXuL6YcM33SAPOO8yIH9G4zMzckVxJz3 awPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JSCNYVKJn9rSe1OHcjIBEAFq6munwqh+2cBs1sQBLcI=; b=q1JiVR8uCvrdD/vKXHtxM5CM6cKD0e6ypK9g/9nR0+qYBoGmTmw+3LZ9NS+I8RODH5 Boqg2UR2m7F147o4U0j44s9YeOrRoYHVZJqIzyhHgWkTkdCeQENNtuSzq5ks0yq0HM6/ P755dGw+MDj2Zjyp/MH/+mCsR9evf+mgn1SeSZ2LwVmxKfUeOHDji13m1fxppbovSauB sbnQ/B7MtYuw1hSIq3K1cEr5PWxn18aVN1s343RonuV+BO8hfu/Z/XHDOM9n1fw9zvAG +UJ/m5KuSWqeZ5h+4pCG7l4mOZcsfLacxdQrT4K1hSLpd511gjOtMtSRLSj+fV8yXDxm 1CZg== X-Gm-Message-State: ALKqPwffZH4ViQa1PHiN+ve7OM4+Mzsw2lbwaGEr47wsdTfNRKW6pgg0 wJpo6mbUAI6/WGOKY8Kcf+yq2A== X-Google-Smtp-Source: AB8JxZpprmOr1OWFWFVyJFaX9G18ukbFcqtHrgU0n39QgZhquEVpxqV9IkijcIT8OzgP7aZ+EtdRfw== X-Received: by 2002:adf:9789:: with SMTP id s9-v6mr6262712wrb.28.1526276912180; Sun, 13 May 2018 22:48:32 -0700 (PDT) Received: from localhost.localdomain ([94.230.83.122]) by smtp.gmail.com with ESMTPSA id o12-v6sm12109404wrf.31.2018.05.13.22.48.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 13 May 2018 22:48:31 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Theodore Ts'o , fstests@vger.kernel.org, linux-ext4@vger.kernel.org Subject: [PATCH 2/3] fstests: define and use TIMEOUT_PROG Date: Mon, 14 May 2018 08:49:50 +0300 Message-Id: <1526276991-23897-3-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526276991-23897-1-git-send-email-amir73il@gmail.com> References: <1526276991-23897-1-git-send-email-amir73il@gmail.com> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Signed-off-by: Amir Goldstein --- common/config | 1 + tests/generic/297 | 4 ++-- tests/generic/298 | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/common/config b/common/config index cc31806..af360ce 100644 --- a/common/config +++ b/common/config @@ -204,6 +204,7 @@ export UBIUPDATEVOL_PROG="`set_prog_path ubiupdatevol`" export THIN_CHECK_PROG="$(set_prog_path thin_check)" export PYTHON2_PROG="`set_prog_path python2`" export SQLITE3_PROG="`set_prog_path sqlite3`" +export TIMEOUT_PROG="`set_prog_path timeout`" # use 'udevadm settle' or 'udevsettle' to wait for lv to be settled. # newer systems have udevadm command but older systems like RHEL5 don't. diff --git a/tests/generic/297 b/tests/generic/297 index f7eb37b..a3ba5c4 100755 --- a/tests/generic/297 +++ b/tests/generic/297 @@ -45,7 +45,7 @@ _cleanup() _supported_os Linux _require_scratch_reflink _require_cp_reflink -_require_command "$(which timeout)" "timeout" +_require_command "$TIMEOUT_PROG" "timeout" test $FSTYP == "nfs" && _notrun "NFS can't interrupt clone operations" @@ -83,7 +83,7 @@ kill_after=2 # give us a shorter time to die n=$(stat -c '%s' $testdir/file1) echo "performing kill test on $n bytes..." >> $seqres.full touch $TEST_DIR/before -timeout -s INT ${kill_after}s $XFS_IO_PROG -f -c "reflink $testdir/file1 0 $n $n" $testdir/file1 >> $seqres.full 2>&1 +$TIMEOUT_PROG -s INT ${kill_after}s $XFS_IO_PROG -f -c "reflink $testdir/file1 0 $n $n" $testdir/file1 >> $seqres.full 2>&1 touch $TEST_DIR/after before=$(stat -c '%Y' $TEST_DIR/before) after=$(stat -c '%Y' $TEST_DIR/after) diff --git a/tests/generic/298 b/tests/generic/298 index b518da1..a4d458c 100755 --- a/tests/generic/298 +++ b/tests/generic/298 @@ -45,7 +45,7 @@ _cleanup() _supported_os Linux _require_scratch_reflink _require_cp_reflink -_require_command "$(which timeout)" "timeout" +_require_command "$TIMEOUT_PROG" "timeout" test $FSTYP == "nfs" && _notrun "NFS can't interrupt clone operations" @@ -83,7 +83,7 @@ kill_after=2 # give us a shorter time to die n=$(stat -c '%s' $testdir/file1) echo "performing kill test on $n bytes..." >> $seqres.full touch $TEST_DIR/before -urk=$(timeout -s KILL ${kill_after}s $XFS_IO_PROG -f -c "reflink $testdir/file1 0 $n $n" $testdir/file1 >> $seqres.full 2>&1) +urk=$($TIMEOUT_PROG -s KILL ${kill_after}s $XFS_IO_PROG -f -c "reflink $testdir/file1 0 $n $n" $testdir/file1 >> $seqres.full 2>&1) touch $TEST_DIR/after before=$(stat -c '%Y' $TEST_DIR/before) after=$(stat -c '%Y' $TEST_DIR/after)