From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC893C4338F for ; Wed, 28 Jul 2021 23:07:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 96BAA60524 for ; Wed, 28 Jul 2021 23:07:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232230AbhG1XHR (ORCPT ); Wed, 28 Jul 2021 19:07:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:42678 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232143AbhG1XHR (ORCPT ); Wed, 28 Jul 2021 19:07:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3691260524; Wed, 28 Jul 2021 23:07:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627513635; bh=OkygAFFi/GK9Glt34GCM3YsoR5yh6ZE4tf0BX8UKxfw=; h=Date:From:To:Cc:Subject:From; b=mDfmwWaflHnDc4FgS0MvtbRLe92mNpZu4r6CnsRmkJJJ3i0Ku63zjl2Bl2z7lR+Zz JfscH4/wRk+61Ha5b5lP5DjDo5G8TSNq55u9tDPfrQ+x2PoXCT6wa2Pq3y30C7Jgzt usY7zmwLPQdqCZ7fgKfREhESPqSnR8oJO+VHLayhi3NTlBO3FpUltp+p0nPZmLHf36 YUbao2vViEOzCE/Z+R11LNm3RbnuZ4PnwhLRCXmuvIO+U+I8dCAJiks4iLs7cnuV6+ 1oIG6a1lx5wnjfbN0z+Bf0ygOyXrHMUVBNq/Sl0E0o83xQ8XGCXR3xvf9MWAKGBdCJ H/vJcaTjMHgjQ== Date: Wed, 28 Jul 2021 16:07:14 -0700 From: "Darrick J. Wong" To: Theodore Ts'o Cc: linux-ext4@vger.kernel.org Subject: [PATCH] tests: skip u_direct_io if losetup fails Message-ID: <20210728230714.GA3601392@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Darrick J. Wong This new test requires a loop device to run testing. While it checks for some "obvious" parameters that might cause the test to fail such as not being root and no losetup executable, it doesn't actually check that the losetup -a call succeeds. This causes a test regression in my package building container (where there is only a minimal /dev with no loop devices available) so I can't build debian packages. Fix the test to skip out if we can't create a loop device. Signed-off-by: Darrick J. Wong --- tests/u_direct_io/script | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/u_direct_io/script b/tests/u_direct_io/script index 0b5d7083..b4f07752 100644 --- a/tests/u_direct_io/script +++ b/tests/u_direct_io/script @@ -9,6 +9,11 @@ elif test ! -x $DEBUGFS_EXE; then else dd if=/dev/zero of=$TMPFILE bs=1M count=128 > /dev/null 2>&1 LOOP=$(losetup --show --sector-size 4096 -f $TMPFILE) + if [ ! -b "$LOOP" ]; then + echo "$test_name: $DESCRIPTION: skipped (no loop devices)" + rm -f $TMPFILE + exit 0 + fi echo mke2fs -F -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D \$LOOP > $OUT $MKE2FS -F -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D $LOOP 2>&1 | \ sed -f $cmd_dir/filter.sed >> $OUT