From patchwork Tue Mar 30 22:00:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12173941 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=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT 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 2C638C433E0 for ; Tue, 30 Mar 2021 22:01:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 03FBF619D2 for ; Tue, 30 Mar 2021 22:01:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232686AbhC3WAa (ORCPT ); Tue, 30 Mar 2021 18:00:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:27710 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232879AbhC3WAM (ORCPT ); Tue, 30 Mar 2021 18:00:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617141611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pDb6zJ9aYLRbPMfVaRhrhqS5rNBUtGGaCCaXGmtw1a0=; b=MBDycxKoWmCS3/uRtVSP448HpVcuAfcnXDoN3cvuSF1UrWloeWrMTyt7KfeidCTslAzb9M Tzg1tuo/0nn/wp7LrzDNyiHFdW/Tj6J9UFhtjvcu5S1D0KdBHwQNf8lhtVVmNCkSIlscY7 +d3WFYQ0po6AtYoFAxEAY9lTS+ItLdE= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-439-oeZIMj3RPP2Qm3gxx6yOTg-1; Tue, 30 Mar 2021 18:00:09 -0400 X-MC-Unique: oeZIMj3RPP2Qm3gxx6yOTg-1 Received: by mail-wr1-f71.google.com with SMTP id n16so10988048wro.1 for ; Tue, 30 Mar 2021 15:00:09 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=pDb6zJ9aYLRbPMfVaRhrhqS5rNBUtGGaCCaXGmtw1a0=; b=hdVRFNyxqfPY2x7YXOWnjKrHWt/EwE47EOr7R0apecXSAa8c2QKfPUQ5myZ++hbnEJ vcTsY9bcmfFZ99e4Ei7fvTWRIJIoD+eSo7Tsp86xIv/DXCMn1crlsSkobPCbRCgHPOEP 1dWyiIdxdXiZM70NMYc5IhZ3rc4AcDa4bL5nS3tz1BnvUs/+D79W3CzSnQnbiadAf+b+ xA/kFH5NH8gfQUWzXkTNMuHl5v82sJlaw7pMq3891JdO/YwNoptDNQJ9UpTKleKo5LiZ 1X6ChNqLKvWUN8DbV1gAa4hZ/2c7MiS0c7IQlDGKkvMP7y8FGwWSWboHN5EtoiAIxeEH UcUw== X-Gm-Message-State: AOAM533gLZhUqlgRYRs4kNUfcNJsmIkxwMRPnhm8K2XVuCTCUWr5BfmL TbLYugb8ANVkDGIWjms56FiXlZKJ3uMIgGHSMPgY+GJnsGPwYSV1uigolBmhLyw8upFeb/EUK1M cbz9aYg490nCAi8BanzVJiJr8XDeOAHJ6/IWCajxNbc1k1MWrqTGtn+nIvLZEKB30W/NL X-Received: by 2002:a5d:698d:: with SMTP id g13mr153528wru.2.1617141608103; Tue, 30 Mar 2021 15:00:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyh1oSvFuK//P4+A6xxb864vMfViEezogf2V5c6s/FD78ukfmw0YSUogjn/3ApqeotcSnz0Hg== X-Received: by 2002:a5d:698d:: with SMTP id g13mr153517wru.2.1617141607938; Tue, 30 Mar 2021 15:00:07 -0700 (PDT) Received: from localhost.localdomain.com ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id z2sm522894wrm.0.2021.03.30.15.00.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 15:00:07 -0700 (PDT) From: Pavel Reichl To: fstests@vger.kernel.org Cc: zlang@redhat.com, guan@eryu.me Subject: [PATCH v2 1/4] common/rc: Add _require_{chown,chmod,symlink}() Date: Wed, 31 Mar 2021 00:00:02 +0200 Message-Id: <20210330220005.56019-2-preichl@redhat.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210330220005.56019-1-preichl@redhat.com> References: <20210330220005.56019-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org Add helper functions that ensure that test is only executed on file systems that implement chown, chmod and symbolic links. Fixed test are: generic/{87,88,125,126,128,193,314,317,355,597,598} Signed-off-by: Pavel Reichl --- common/rc | 27 +++++++++++++++++++++++++++ tests/generic/087 | 1 + tests/generic/088 | 1 + tests/generic/125 | 1 + tests/generic/126 | 1 + tests/generic/128 | 1 + tests/generic/193 | 1 + tests/generic/314 | 1 + tests/generic/317 | 1 + tests/generic/355 | 1 + tests/generic/597 | 1 + tests/generic/598 | 1 + 12 files changed, 38 insertions(+) diff --git a/common/rc b/common/rc index 0ce3cb0d..9cdfe21c 100644 --- a/common/rc +++ b/common/rc @@ -2129,6 +2129,33 @@ _require_user() [ "$?" == "0" ] || _notrun "$qa_user cannot execute commands." } +# check for a chown support +# +_require_chown() +{ + if [ "$FSTYP" = "exfat" ]; then + _notrun "chown is not supported on $FSTYP" + fi +} + +# check for a chmod support +# +_require_chmod() +{ + if [ "$FSTYP" = "exfat" ]; then + _notrun "chmod is not supported on $FSTYP" + fi +} + +# check for a symbolic links support +# +_require_symlink() +{ + if [ "$FSTYP" = "exfat" ]; then + _notrun "symbolic links are not supported on $FSTYP" + fi +} + # check for a group on the machine, fsgqa as default # _require_group() diff --git a/tests/generic/087 b/tests/generic/087 index 1f30dbf4..c3576117 100755 --- a/tests/generic/087 +++ b/tests/generic/087 @@ -37,6 +37,7 @@ _cleanup() # real QA test starts here _supported_fs generic _require_test +_require_chown QA_FS_PERMS=$here/src/fs_perms diff --git a/tests/generic/088 b/tests/generic/088 index 9388a083..ad99bd7e 100755 --- a/tests/generic/088 +++ b/tests/generic/088 @@ -29,6 +29,7 @@ _filter() # real QA test starts here _supported_fs generic _require_test +_require_chown path=$TEST_DIR/t_access $here/src/t_access_root $path | tee $seqres.full | _filter diff --git a/tests/generic/125 b/tests/generic/125 index e84248d3..8c8f5cd7 100755 --- a/tests/generic/125 +++ b/tests/generic/125 @@ -25,6 +25,7 @@ _supported_fs generic _require_test _require_user _require_odirect +_require_chmod TESTDIR=$TEST_DIR/ftrunc TESTFILE=$TESTDIR/ftrunc.tmp diff --git a/tests/generic/126 b/tests/generic/126 index ac25d294..636ca00d 100755 --- a/tests/generic/126 +++ b/tests/generic/126 @@ -27,6 +27,7 @@ _cleanup() # real QA test starts here _supported_fs generic _require_test +_require_chown QA_FS_PERMS=$here/src/fs_perms diff --git a/tests/generic/128 b/tests/generic/128 index b3e49eff..c1eae77a 100755 --- a/tests/generic/128 +++ b/tests/generic/128 @@ -24,6 +24,7 @@ _supported_fs generic _require_scratch _require_user +_require_chmod _scratch_mkfs >/dev/null 2>&1 _scratch_mount "-o nosuid" diff --git a/tests/generic/193 b/tests/generic/193 index 3125efdd..fd0ebbf6 100755 --- a/tests/generic/193 +++ b/tests/generic/193 @@ -56,6 +56,7 @@ _supported_fs generic _require_test _require_user +_require_chown test_root=$TEST_DIR/$seq.$$.root test_user=$TEST_DIR/$seq.$$.user diff --git a/tests/generic/314 b/tests/generic/314 index 03df81ce..540f0feb 100755 --- a/tests/generic/314 +++ b/tests/generic/314 @@ -29,6 +29,7 @@ _cleanup() _supported_fs generic _require_test _require_user +_require_chown rm -rf $TEST_DIR/$seq-dir diff --git a/tests/generic/317 b/tests/generic/317 index 29c37a57..289dfabe 100755 --- a/tests/generic/317 +++ b/tests/generic/317 @@ -45,6 +45,7 @@ _require_scratch _require_user _require_ugid_map _require_userns +_require_chown qa_user_id=`id -u $qa_user` _filter_output() diff --git a/tests/generic/355 b/tests/generic/355 index 161dd042..74fba0f9 100755 --- a/tests/generic/355 +++ b/tests/generic/355 @@ -32,6 +32,7 @@ _supported_fs generic _require_test _require_user _require_odirect +_require_chown testfile=$TEST_DIR/$seq.test rm -f $testfile diff --git a/tests/generic/597 b/tests/generic/597 index ba769d73..f596406c 100755 --- a/tests/generic/597 +++ b/tests/generic/597 @@ -43,6 +43,7 @@ _require_sysctl_variable fs.protected_hardlinks _require_user fsgqa2 # Do this SECOND so that qa_user is fsgqa, and _user_do uses that account _require_user fsgqa +_require_symlink OWNER=fsgqa2 OTHER=fsgqa diff --git a/tests/generic/598 b/tests/generic/598 index 6b765275..230c3ac7 100755 --- a/tests/generic/598 +++ b/tests/generic/598 @@ -43,6 +43,7 @@ _require_sysctl_variable fs.protected_fifos _require_user fsgqa2 # Do this SECOND so that qa_user is fsgqa, and _user_do uses that account _require_user fsgqa +_require_chmod USER1=fsgqa2 USER2=fsgqa From patchwork Tue Mar 30 22:00:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12173945 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=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT 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 4EBE6C433E1 for ; Tue, 30 Mar 2021 22:01:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 25546619CF for ; Tue, 30 Mar 2021 22:01:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232821AbhC3WAb (ORCPT ); Tue, 30 Mar 2021 18:00:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:24618 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232882AbhC3WAO (ORCPT ); Tue, 30 Mar 2021 18:00:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617141613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hp8hQWqoEZuTj5KIJ3Tua6tWI5QWBpoTdPdpekFNQRA=; b=L7EmYGKhDGTTDlyiql3ztjhskX5L6KNwmXxF8jNXhhxm6YvBhbXLYv7y0WiH3wOklCP9Aq CuT3wRwSKJEBWqY01Joc45Au1RrSSuKEdUl8WLpxadHFcAY7kgDm6cB/nLhO9R6xOJlQ6S YrFaDe3gArcMH/TjuZNxccSUSK1jQ1o= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-334-oAa7vDmdOcGB_43iKNgv7g-1; Tue, 30 Mar 2021 18:00:10 -0400 X-MC-Unique: oAa7vDmdOcGB_43iKNgv7g-1 Received: by mail-wr1-f69.google.com with SMTP id h5so10914843wrr.17 for ; Tue, 30 Mar 2021 15:00:10 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=hp8hQWqoEZuTj5KIJ3Tua6tWI5QWBpoTdPdpekFNQRA=; b=tu10ec1Ti0wjCRTzqDwI87ktAxn0tAwIKv7i4/Uvkdy6THxBAcWSXgShlJbGmnQ5u/ YDIuJQp24vHVIZ3qZ7FD9WRpTLXI40YjRp/be72PSIMYucZl3Hn9/9m2hpkGNy8AcuhQ 6nwnq3wAIqR5WfTu47P3EpRw0o2JRCeSg0b2vnx0BkWlSEh0LkG+SMDHalRQZX7H4My1 c5MSWS3kNf0q4Z/7EIu0K/UdIse7BtOMBFdQ3XwfcsNqlj+etUEE7Bh5YCOa2MOpqQTa 8/AV7NRoqQmfVjGC4rBqOxmRWXn2UvO+0yvLXVRlW5kKH1Qsjl/nprjkU5Sev9gJ55uL BoBg== X-Gm-Message-State: AOAM533cD0LKN/j88sgy7g3LD+2rdnHEcKYFk4S8wXMxuih82v06ke+m zonoeU8k0OKgLA4yVkme1nprOjQdLfxGy4ixKzpM+BN1AeIhRvrdCQfh6Yi8buPwAXKm58Z5mps 6eQCjBHBICjtuxOF3tETZWvcSWtUHbOpOutbU/05oUkgBApsGYvS+X7hebOH74q1pUcXL X-Received: by 2002:a1c:23c2:: with SMTP id j185mr134704wmj.54.1617141609260; Tue, 30 Mar 2021 15:00:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsdVO2VASFynOPLAEK8APaJN0ePKE19hLQ3dalQCSyvDySVLqQE3+Je0IJ2p6uWBsBAOay2A== X-Received: by 2002:a1c:23c2:: with SMTP id j185mr134692wmj.54.1617141609030; Tue, 30 Mar 2021 15:00:09 -0700 (PDT) Received: from localhost.localdomain.com ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id z2sm522894wrm.0.2021.03.30.15.00.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 15:00:08 -0700 (PDT) From: Pavel Reichl To: fstests@vger.kernel.org Cc: zlang@redhat.com, guan@eryu.me Subject: [PATCH v2 2/4] common: hide permision warning from mkswap for exfat Date: Wed, 31 Mar 2021 00:00:03 +0200 Message-Id: <20210330220005.56019-3-preichl@redhat.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210330220005.56019-1-preichl@redhat.com> References: <20210330220005.56019-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org exfat does not support posix file permisions, so warning from mkswap is inavitable. This patch hides the warning message so the test won't fail. Signed-off-by: Pavel Reichl --- common/rc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/rc b/common/rc index 9cdfe21c..2d658711 100644 --- a/common/rc +++ b/common/rc @@ -2392,7 +2392,13 @@ _format_swapfile() { # Swap files must be nocow on Btrfs. $CHATTR_PROG +C "$fname" > /dev/null 2>&1 _pwrite_byte 0x61 0 "$sz" "$fname" >> $seqres.full - $MKSWAP_PROG "$fname" >> $seqres.full + if [ "$FSTYP" = "exfat" ]; then + # exfat does not support posix file permisions, so warning is + # to be expected + $MKSWAP_PROG "$fname" 2>&1 | grep -v 'insecure permission' >> $seqres.full + else + $MKSWAP_PROG "$fname" >> $seqres.full + fi } # Check that the filesystem supports swapfiles From patchwork Tue Mar 30 22:00:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12173943 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=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT 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 63DD4C433E3 for ; Tue, 30 Mar 2021 22:01:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 563F1619DE for ; Tue, 30 Mar 2021 22:01:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232882AbhC3WAc (ORCPT ); Tue, 30 Mar 2021 18:00:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:39420 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232880AbhC3WAO (ORCPT ); Tue, 30 Mar 2021 18:00:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617141613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nw5o5wizmXgcbuighDLLe6l7zhsYKiO7skt1BP/rbus=; b=OAtMxlKEdsRmeZCDmrQubtkv9JbIOB7hlzSh12aHfTqmZEroaXlaJ+EtvnQ9clG+bt5fIH ILgUSV6O7fI8dXlatLXoM5Y2zNsA344Tq4xJRFXSMsgIiT4HrmARUIGPzN9zd5oW8VvERB lv5s9P4y2kkqRQieYMG3sBHHFzFx12U= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-138-de4VHfa1Pf--_qJj4raC9g-1; Tue, 30 Mar 2021 18:00:11 -0400 X-MC-Unique: de4VHfa1Pf--_qJj4raC9g-1 Received: by mail-wr1-f72.google.com with SMTP id a15so9173751wrf.19 for ; Tue, 30 Mar 2021 15:00:11 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=nw5o5wizmXgcbuighDLLe6l7zhsYKiO7skt1BP/rbus=; b=siX2QmkFfoiyxJqFbL4dWoQ+YM9iBrhVbL+FlMR1efoBOm9FZZtAOcB00kcIfW1491 a7yUMWTdAjBjeCScDFuBdFMFOczrXeB3YdvBtRf4Ft4GJLbKpZ7iBNHaq4h78P9+BSQb Ng0zxdW440A2t3Or8oA9uOOkUr0QC2aOk4eiyH9Yr3i89vcQP81fFwfmxxfVL/Jd+4AN 7+5HOQJks/71WhK00CDv4N+IZHkb/OMsR1AaNgjLuNFFRhssqL2lws/ih0mReoO0469n kTmX1r/MzSXuZpGrl2AxX4V1XfXENTen0zWsYIvTOOqSMN8Ng3u9qAqaU+4sIRteqYXk mqAQ== X-Gm-Message-State: AOAM533FgzfUW9/vI9y6/PE9An6Z6n2C1qkLCcU/Dp0FxMAvV+E15trm ZnQUE1oDHUXxi1yb+XoW/eUYuuMt21ywfsCezkYWuFM06vr2O7M2jCpOzexyx5oVNNPdMEo7W8H Dx/a2eEOlbgtf3+scYrXg+0tnsvuAQjtlzusIiXK4QFlrfbS/9EktKjvQjgGp+O2wg5+v X-Received: by 2002:a5d:68cd:: with SMTP id p13mr103136wrw.247.1617141610349; Tue, 30 Mar 2021 15:00:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3p4NooMCPuNTzCJZB5ItmfPhb1T3PhcG/kWaeg0BA0qZ/YaMIMZcKSPNVsGtk8RW0H90nDg== X-Received: by 2002:a5d:68cd:: with SMTP id p13mr103115wrw.247.1617141610100; Tue, 30 Mar 2021 15:00:10 -0700 (PDT) Received: from localhost.localdomain.com ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id z2sm522894wrm.0.2021.03.30.15.00.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 15:00:09 -0700 (PDT) From: Pavel Reichl To: fstests@vger.kernel.org Cc: zlang@redhat.com, guan@eryu.me Subject: [PATCH v2 3/4] generic/554: hide permision warning on exfat Date: Wed, 31 Mar 2021 00:00:04 +0200 Message-Id: <20210330220005.56019-4-preichl@redhat.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210330220005.56019-1-preichl@redhat.com> References: <20210330220005.56019-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org Signed-off-by: Pavel Reichl --- common/rc | 13 +++++++++++++ tests/generic/554 | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/common/rc b/common/rc index 2d658711..379140ea 100644 --- a/common/rc +++ b/common/rc @@ -2401,6 +2401,19 @@ _format_swapfile() { fi } +_format_swapon_file() { + local fname="$1" + + if [ "$FSTYP" = "exfat" ]; then + # exfat does not support posix file permisions, so warning is + # to be expected + swapon "$fname" |& grep -v "insecure permissions" + else + swapon "$fname" + fi + +} + # Check that the filesystem supports swapfiles _require_scratch_swapfile() { diff --git a/tests/generic/554 b/tests/generic/554 index fa4f97d2..c2f9eee8 100755 --- a/tests/generic/554 +++ b/tests/generic/554 @@ -46,7 +46,8 @@ $XFS_IO_PROG -f -c "pwrite -S 0x61 0 128k" $SCRATCH_MNT/file >> $seqres.full 2>& echo swap files return ETXTBUSY _format_swapfile $SCRATCH_MNT/swapfile 16m -swapon $SCRATCH_MNT/swapfile +_format_swapon_file $SCRATCH_MNT/swapfile + $XFS_IO_PROG -f -c "copy_range -l 32k $SCRATCH_MNT/file" $SCRATCH_MNT/swapfile swapoff $SCRATCH_MNT/swapfile From patchwork Tue Mar 30 22:00:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12173947 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=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT 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 60FCAC433E2 for ; Tue, 30 Mar 2021 22:01:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 350BA619AB for ; Tue, 30 Mar 2021 22:01:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232836AbhC3WAe (ORCPT ); Tue, 30 Mar 2021 18:00:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:32480 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232883AbhC3WAP (ORCPT ); Tue, 30 Mar 2021 18:00:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617141614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LkJ6qWHxSfuxNqvg132bNGuMpPuVn9GLJ8yG6ihh9YQ=; b=BDVcHwjKE8YZWD4kTQtCmsJ5YiB46afGoH9yTDfLieaMGCNDTkNKBjITqjFwJZlmDyF9CL Q8bQqvAye4c44sm8vZLNRfYWjBlMcmABv6yHmxxwaA135BMlhxd8xk3rKwzczTmMvjLlJm 6l5ohG6YUoATHtYwBS3y2As5hKp5E2U= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-590-cESApNTHPdKLH65NczLo7Q-1; Tue, 30 Mar 2021 18:00:12 -0400 X-MC-Unique: cESApNTHPdKLH65NczLo7Q-1 Received: by mail-wr1-f69.google.com with SMTP id b6so10913456wrq.22 for ; Tue, 30 Mar 2021 15:00:12 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=LkJ6qWHxSfuxNqvg132bNGuMpPuVn9GLJ8yG6ihh9YQ=; b=H04UpGytwtMW/s4jFHJ4IQaWNkXupWcUGj4Lu7IsFfBRua489Ij/yVwAXd0lW3jM72 9zdIhwE6DMmytc0vatUktRlrX0Iw0spCDGxczbYqGzxE4iY/JkS0ZPyQjwxXLJpayQgA 92zTGNE8NvnCb6OFxcN6J4UBAvIapbBzcH5dJ9MHUoFm0s54/MejYXlGoZSeqN8JzUO3 2SxbYoVBI+QfHVBE6h8gch56Kv6FiwbX3VqN+twQiVsZCNF1PzavOY9R2DZSn5E+qT25 m9BJKy1pFteoXxAwhwwmrKX/t2NWSj2EPZl9jA8SXtBHipfLLRtUnxgdXMS82f75L7LR Z3oQ== X-Gm-Message-State: AOAM531+IGhhTlNHhLuBzlC/GBN5pJ1325CDivFtJBAS2GXz9iCisg5w Vd+B7OQUIRW4HVSfVLWDPY255UYS07yepMQA8SWy3rmgqijoRoqmesI5nMGwytyJFoIEA6Azuzm DwlFxYUq1eTcCJQFJYfmblTGnOXoTAPnoyrtauYtXo2AoNUsnsrawol75+c3IcGJnrGkU X-Received: by 2002:adf:dc4e:: with SMTP id m14mr135830wrj.248.1617141611454; Tue, 30 Mar 2021 15:00:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8Li+6AtOE/660aNu6IWRryi7KZQbsh7hZyHtnJ2jCz5sQlsZHgSEqXaW4FCTM1PXWlBFMAA== X-Received: by 2002:adf:dc4e:: with SMTP id m14mr135806wrj.248.1617141611181; Tue, 30 Mar 2021 15:00:11 -0700 (PDT) Received: from localhost.localdomain.com ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id z2sm522894wrm.0.2021.03.30.15.00.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 15:00:10 -0700 (PDT) From: Pavel Reichl To: fstests@vger.kernel.org Cc: zlang@redhat.com, guan@eryu.me Subject: [PATCH v2 4/4] generic/003: Amend the test for exfat Date: Wed, 31 Mar 2021 00:00:05 +0200 Message-Id: <20210330220005.56019-5-preichl@redhat.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210330220005.56019-1-preichl@redhat.com> References: <20210330220005.56019-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org Update the test so it can be run even for exfat which has 2 seconds granularity for access_time and does not have a timestamp for metadata change. Signed-off-by: Pavel Reichl --- tests/generic/003 | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/tests/generic/003 b/tests/generic/003 index ec4fdfc1..39596665 100755 --- a/tests/generic/003 +++ b/tests/generic/003 @@ -37,6 +37,13 @@ _require_relatime rm -f $seqres.full +if [ "$FSTYP" = "exfat" ]; then + # exfat's timestamp for access_time has double seconds granularity + access_delay=2 +else + access_delay=1 +fi + _stat() { stat -c "%x;%y;%z" $1 } @@ -79,14 +86,14 @@ echo "aaa" > $TPATH/dir1/file1 file1_stat_before_first_access=`_stat $TPATH/dir1/file1` # Accessing file1 the first time -sleep 1 +sleep $access_delay cat $TPATH/dir1/file1 > /dev/null file1_stat_after_first_access=`_stat $TPATH/dir1/file1` _compare_stat_times YNN "$file1_stat_before_first_access" \ "$file1_stat_after_first_access" "after accessing file1 first time" # Accessing file1 a second time -sleep 1 +sleep $access_delay cat $TPATH/dir1/file1 > /dev/null file1_stat_after_second_access=`_stat $TPATH/dir1/file1` _compare_stat_times NNN "$file1_stat_after_first_access" \ @@ -109,7 +116,7 @@ _compare_stat_times NYY "$dir2_stat_before_file_creation" \ # Accessing file2 file2_stat_before_first_access=`_stat $TPATH/dir2/file2` -sleep 1 +sleep $access_delay cat $TPATH/dir2/file2 > /dev/null file2_stat_after_first_access=`_stat $TPATH/dir2/file2` _compare_stat_times YNN "$file2_stat_before_first_access" \ @@ -135,11 +142,15 @@ echo "xyz" > $TPATH/dir1/file1 file1_stat_after_modify=`_stat $TPATH/dir1/file1` _compare_stat_times NYY "$file1_stat_before_modify" \ "$file1_stat_after_modify" "after modifying file1" -sleep 1 -mv $TPATH/dir1/file1 $TPATH/dir1/file1_renamed -file1_stat_after_change=`_stat $TPATH/dir1/file1_renamed` -_compare_stat_times NNY "$file1_stat_after_modify" \ - "$file1_stat_after_change" "after changing file1" + +# exfat does not support last metadata change timestamp +if [ "$FSTYP" != "exfat" ]; then + sleep 1 + mv $TPATH/dir1/file1 $TPATH/dir1/file1_renamed + file1_stat_after_change=`_stat $TPATH/dir1/file1_renamed` + _compare_stat_times NNY "$file1_stat_after_modify" \ + "$file1_stat_after_change" "after changing file1" +fi # Mounting with strictatime option and # accessing a previously created file twice @@ -148,7 +159,7 @@ cat $TPATH/dir2/file3 > /dev/null file3_stat_after_second_access=`_stat $TPATH/dir2/file3` _compare_stat_times YNN "$file3_stat_after_first_access" \ "$file3_stat_after_second_access" "after accessing file3 second time" -sleep 1 +sleep $access_delay cat $TPATH/dir2/file3 > /dev/null file3_stat_after_third_access=`_stat $TPATH/dir2/file3` _compare_stat_times YNN "$file3_stat_after_second_access" \