From patchwork Thu Apr 9 19:10:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 11482245 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 83C0F14B4 for ; Thu, 9 Apr 2020 19:10:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B0BF2082D for ; Thu, 9 Apr 2020 19:10:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TFhdmCmX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726659AbgDITKm (ORCPT ); Thu, 9 Apr 2020 15:10:42 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:21806 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726598AbgDITKm (ORCPT ); Thu, 9 Apr 2020 15:10:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586459440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=DyzCdNAtDKSxz0DXZ0dtgYVm1n1tsPFLyzzaswOBYN4=; b=TFhdmCmXLerFIFnRzON3zVbr0rZbUgwNnGPCCZkpayf4ls+v5Q+I4x1+v8D/O0OV1fKAHZ Vyv28RFFfRUpUTLJRljED/BF9zUoqJqslmsVES4I0ZST6UdAjvor7F6GjOjcVevUSSqPo3 at5/7p/CyCjBIebF7IhFygqhPYB5wKE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-172-fWoj-h4rM9mfhie1FG-1sQ-1; Thu, 09 Apr 2020 15:10:38 -0400 X-MC-Unique: fWoj-h4rM9mfhie1FG-1sQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AAE4C8017FD; Thu, 9 Apr 2020 19:10:37 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6DBBC60BFB; Thu, 9 Apr 2020 19:10:37 +0000 (UTC) Subject: [PATCH 2/2] fstests: add _require_hardlinks for all necessary tests From: Eric Sandeen To: fstests Cc: Namjae Jeon References: <83a816c2-fa40-c63f-7709-35863d412ded@redhat.com> Autocrypt: addr=sandeen@redhat.com; prefer-encrypt=mutual; keydata= mQINBE6x99QBEADMR+yNFBc1Y5avoUhzI/sdR9ANwznsNpiCtZlaO4pIWvqQJCjBzp96cpCs nQZV32nqJBYnDpBDITBqTa/EF+IrHx8gKq8TaSBLHUq2ju2gJJLfBoL7V3807PQcI18YzkF+ WL05ODFQ2cemDhx5uLghHEeOxuGj+1AI+kh/FCzMedHc6k87Yu2ZuaWF+Gh1W2ix6hikRJmQ vj5BEeAx7xKkyBhzdbNIbbjV/iGi9b26B/dNcyd5w2My2gxMtxaiP7q5b6GM2rsQklHP8FtW ZiYO7jsg/qIppR1C6Zr5jK1GQlMUIclYFeBbKggJ9mSwXJH7MIftilGQ8KDvNuV5AbkronGC sEEHj2khs7GfVv4pmUUHf1MRIvV0x3WJkpmhuZaYg8AdJlyGKgp+TQ7B+wCjNTdVqMI1vDk2 BS6Rg851ay7AypbCPx2w4d8jIkQEgNjACHVDU89PNKAjScK1aTnW+HNUqg9BliCvuX5g4z2j gJBs57loTWAGe2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JIMb4kR7Eb FzNbA3ias5BaExPknJv7XwI74JbEl8dpheIsRbt0jUDKcviOOfhbQxKJelYNTD5+wE4+TpqH XQLj5HUlzt3JSwqSwx+++FFfWFMheG2HzkfXrvTpud5NrJkGGVn+ErXy6pNf6zSicb+bUXe9 i92UTina2zWaaLEwXspqM338TlFC2JICu8pNt+wHpPCjgy2Ei4u5/4zSYjiA+X1I+V99YJhU +FpT2jzfLUoVsP/6WHWmM/tsS79i50G/PsXYzKOHj/0ZQCKOsJM14NMMCC8gkONe4tek Message-ID: <39716adc-c4db-65b3-b3c1-866bf3517d7f@redhat.com> Date: Thu, 9 Apr 2020 14:10:36 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <83a816c2-fa40-c63f-7709-35863d412ded@redhat.com> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org Add a new _require function for hardlinks, to test hardlink support in all tests which need it. Signed-off-by: Eric Sandeen diff --git a/common/rc b/common/rc index 476d3d07..8bb9aa1f 100644 --- a/common/rc +++ b/common/rc @@ -3493,6 +3493,18 @@ _require_symlinks() rm -f $target $link } +_require_hardlinks() +{ + local target=`mktemp -p $TEST_DIR` + local link=`mktemp -p $TEST_DIR -u` + ln `basename $target` $link + if [ "$?" -ne 0 ]; then + rm -f $target + _notrun "No hardlink support" + fi + rm -f $target $link +} + _require_test_fcntl_advisory_locks() { [ "$FSTYP" != "cifs" ] && return 0 diff --git a/tests/generic/002 b/tests/generic/002 index 575ac42b..480b77bc 100755 --- a/tests/generic/002 +++ b/tests/generic/002 @@ -28,6 +28,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_test +_require_hardlinks rm -f $seqres.full diff --git a/tests/generic/039 b/tests/generic/039 index daa2e353..27cd6bf5 100755 --- a/tests/generic/039 +++ b/tests/generic/039 @@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full diff --git a/tests/generic/040 b/tests/generic/040 index 712ae595..b69d8127 100755 --- a/tests/generic/040 +++ b/tests/generic/040 @@ -44,6 +44,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full diff --git a/tests/generic/041 b/tests/generic/041 index 8001e8ce..1674d544 100755 --- a/tests/generic/041 +++ b/tests/generic/041 @@ -48,6 +48,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full diff --git a/tests/generic/056 b/tests/generic/056 index 9caf1166..28920d36 100755 --- a/tests/generic/056 +++ b/tests/generic/056 @@ -37,6 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full diff --git a/tests/generic/057 b/tests/generic/057 index ba51dbb9..91e1d98e 100755 --- a/tests/generic/057 +++ b/tests/generic/057 @@ -37,6 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full diff --git a/tests/generic/065 b/tests/generic/065 index d6a1670b..30f3c32e 100755 --- a/tests/generic/065 +++ b/tests/generic/065 @@ -38,6 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full diff --git a/tests/generic/089 b/tests/generic/089 index 3d608269..52649596 100755 --- a/tests/generic/089 +++ b/tests/generic/089 @@ -36,6 +36,7 @@ addentries() _supported_fs generic _supported_os Linux _require_test +_require_hardlinks rm -f $seqres.full [ "X$TEST_DIR" = "X" ] && exit 1 diff --git a/tests/generic/090 b/tests/generic/090 index bf38d1c8..db1aeef3 100755 --- a/tests/generic/090 +++ b/tests/generic/090 @@ -36,6 +36,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full diff --git a/tests/generic/104 b/tests/generic/104 index d78689f4..4b6256db 100755 --- a/tests/generic/104 +++ b/tests/generic/104 @@ -31,6 +31,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full diff --git a/tests/generic/106 b/tests/generic/106 index 74d5dc30..e1c859e5 100755 --- a/tests/generic/106 +++ b/tests/generic/106 @@ -30,6 +30,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full diff --git a/tests/generic/107 b/tests/generic/107 index 5c6bbfca..214f3389 100755 --- a/tests/generic/107 +++ b/tests/generic/107 @@ -33,6 +33,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full diff --git a/tests/generic/236 b/tests/generic/236 index f207165f..2110b053 100755 --- a/tests/generic/236 +++ b/tests/generic/236 @@ -25,8 +25,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # real QA test starts here _supported_fs generic -# only Linux supports fallocate _supported_os Linux +_require_hardlinks _require_test rm -f $TEST_DIR/ouch* diff --git a/tests/generic/336 b/tests/generic/336 index e007552c..6832ccde 100755 --- a/tests/generic/336 +++ b/tests/generic/336 @@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full diff --git a/tests/generic/343 b/tests/generic/343 index e35488dd..2034197e 100755 --- a/tests/generic/343 +++ b/tests/generic/343 @@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full diff --git a/tests/generic/378 b/tests/generic/378 index 393d1ce7..ea776949 100755 --- a/tests/generic/378 +++ b/tests/generic/378 @@ -39,6 +39,7 @@ _supported_fs generic _supported_os Linux _require_test _require_user +_require_hardlinks # Setup testfile and its hardlink testfile=$TEST_DIR/testfile.$seq diff --git a/tests/generic/480 b/tests/generic/480 index ba2c34ad..63a87519 100755 --- a/tests/generic/480 +++ b/tests/generic/480 @@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full diff --git a/tests/generic/498 b/tests/generic/498 index 71f5091c..7adf0b32 100755 --- a/tests/generic/498 +++ b/tests/generic/498 @@ -31,6 +31,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full diff --git a/tests/generic/502 b/tests/generic/502 index a60ac9a7..a49ee0b3 100755 --- a/tests/generic/502 +++ b/tests/generic/502 @@ -34,6 +34,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full diff --git a/tests/generic/526 b/tests/generic/526 index d0b51f87..934d263f 100755 --- a/tests/generic/526 +++ b/tests/generic/526 @@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full diff --git a/tests/generic/527 b/tests/generic/527 index 61dd4f0b..4b664da9 100755 --- a/tests/generic/527 +++ b/tests/generic/527 @@ -32,6 +32,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_hardlinks _require_dm_target flakey rm -f $seqres.full