From patchwork Tue May 12 18:36:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Andreas_Gr=C3=BCnbacher?= X-Patchwork-Id: 6390361 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 2BC60BEEE1 for ; Tue, 12 May 2015 18:37:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 505312041C for ; Tue, 12 May 2015 18:37:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 601A0203FB for ; Tue, 12 May 2015 18:37:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932916AbbELShG (ORCPT ); Tue, 12 May 2015 14:37:06 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:33689 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933069AbbELShG (ORCPT ); Tue, 12 May 2015 14:37:06 -0400 Received: by wief7 with SMTP id f7so118962857wie.0 for ; Tue, 12 May 2015 11:37:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=1cw2IdiC5oZuhDGNJdSHjSIBoHIvyJQ4AfjsAa3LaMY=; b=BvctZiTYGl6auiNDZO+bSTYihZplw9P/wt/V0L/MiPm0UKTVw5RX0gRi9f6q64FvL/ +EveR0+awvyqnJQThr52FGDbk20/8SmeO8VfBUenT5c7C1ED4L0EMZycxRuk6GbnlKn8 LOBotdHWrcoX1hC/EHv8kCZWBmDMGqmhrS/aeP4nGntUmuFhtXxZzGhKTdO2sq+T4VHf 308jvZ7ck+EhlYsJbnOfx3gDSLNekjXh81u7gtYl/a0BDUZbycCNpaRO73hEzbr0G8SG POpCrVlj82ZBNwRFyhOrKepBg3Qo86we1tWWkk+ZqOlIYwlwPJ+dcwEg0CNnkD3gDPWw 8wDA== X-Received: by 10.194.209.130 with SMTP id mm2mr8671808wjc.64.1431455825078; Tue, 12 May 2015 11:37:05 -0700 (PDT) Received: from nuc.local (80-110-112-232.cgn.dynamic.surfer.at. [80.110.112.232]) by mx.google.com with ESMTPSA id cf9sm3380042wjc.27.2015.05.12.11.37.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 May 2015 11:37:04 -0700 (PDT) From: Andreas Gruenbacher To: fstests@vger.kernel.org Cc: Christoph Hellwig Subject: [PATCH] generic: Fix _is_block_dev quoting Date: Tue, 12 May 2015 20:36:39 +0200 Message-Id: <1431455799-13289-1-git-send-email-andreas.gruenbacher@gmail.com> X-Mailer: git-send-email 2.4.0 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, 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 Add more quoting so that test cases that don't require a SCRATCH_DEV won't fail. Signed-off-by: Andreas Gruenbacher --- common/rc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/common/rc b/common/rc index 6ea107e..bec7417 100644 --- a/common/rc +++ b/common/rc @@ -967,11 +967,11 @@ _is_block_dev() _dev=$1 if [ -L "${_dev}" ]; then - _dev=`readlink -f ${_dev}` + _dev=`readlink -f "${_dev}"` fi if [ -b "${_dev}" ]; then - src/lstat64 ${_dev} | $AWK_PROG '/Device type:/ { print $9 }' + src/lstat64 "${_dev}" | $AWK_PROG '/Device type:/ { print $9 }' fi } @@ -1105,11 +1105,11 @@ _require_scratch_nocheck() fi ;; *) - if [ -z "$SCRATCH_DEV" -o "`_is_block_dev $SCRATCH_DEV`" = "" ] + if [ -z "$SCRATCH_DEV" -o "`_is_block_dev "$SCRATCH_DEV"`" = "" ] then _notrun "this test requires a valid \$SCRATCH_DEV" fi - if [ "`_is_block_dev $SCRATCH_DEV`" = "`_is_block_dev $TEST_DEV`" ] + if [ "`_is_block_dev "$SCRATCH_DEV"`" = "`_is_block_dev "$TEST_DEV"`" ] then _notrun "this test requires a valid \$SCRATCH_DEV" fi @@ -1179,11 +1179,11 @@ _require_test() fi ;; *) - if [ -z "$TEST_DEV" -o "`_is_block_dev $TEST_DEV`" = "" ] + if [ -z "$TEST_DEV" ] || [ "`_is_block_dev "$TEST_DEV"`" = "" ] then _notrun "this test requires a valid \$TEST_DEV" fi - if [ "`_is_block_dev $SCRATCH_DEV`" = "`_is_block_dev $TEST_DEV`" ] + if [ "`_is_block_dev "$SCRATCH_DEV"`" = "`_is_block_dev "$TEST_DEV"`" ] then _notrun "this test requires a valid \$TEST_DEV" fi @@ -2282,10 +2282,10 @@ _require_scratch_dev_pool() esac for i in $SCRATCH_DEV_POOL; do - if [ "`_is_block_dev $i`" = "" ]; then + if [ "`_is_block_dev "$i"`" = "" ]; then _notrun "this test requires valid block disk $i" fi - if [ "`_is_block_dev $i`" = "`_is_block_dev $TEST_DEV`" ]; then + if [ "`_is_block_dev "$i"`" = "`_is_block_dev "$TEST_DEV"`" ]; then _notrun "$i is part of TEST_DEV, this test requires unique disks" fi if _mount | grep -q $i; then