From patchwork Thu Apr 15 09:49: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: 12204887 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 B91B6C433ED for ; Thu, 15 Apr 2021 09:49:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E4BC6139A for ; Thu, 15 Apr 2021 09:49:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229457AbhDOJtg (ORCPT ); Thu, 15 Apr 2021 05:49:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35110 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231531AbhDOJte (ORCPT ); Thu, 15 Apr 2021 05:49:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618480151; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ucBprjId/JLGXlyCzWhwLvigBtrShDrHK+vmZYBr/lU=; b=bfGogAlFKWvrxGCon2AcSH1KuYKZi1bgGPYiZrHnLpNIMTvZW21TeKe1NtmTlvb3NrRqW1 hERNBWrapG54T0CxGKA6VPx8ZDPwT+/vhD0h368QOoXKoE1DnZYudoz/+jfIUPCB7FsysV JM4B8fIh1UQpsU/LIaItTL/sF4l55+Q= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-197-zOonpWQ9PiOgfL3NDliCkA-1; Thu, 15 Apr 2021 05:49:08 -0400 X-MC-Unique: zOonpWQ9PiOgfL3NDliCkA-1 Received: by mail-wm1-f70.google.com with SMTP id l6-20020a1c25060000b029010ee60ad0fcso2702174wml.9 for ; Thu, 15 Apr 2021 02:49:08 -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:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ucBprjId/JLGXlyCzWhwLvigBtrShDrHK+vmZYBr/lU=; b=bAHaBObUekF59c1T6qcj3RuRlv400jok+/X0h4+tUo6gd6+6FZTerW+qHUJDaK8Jzv nGTeVWf/7WHFYHakeBaZ/zjdbyD64ncbXYI/db7dJNZMHhLlPrxjyAMPzpAgr67FcWQF PUvB6EFiO449IbjdTycIos0y09fKEUjOutDtGWRsoDQy6+CTsKe7MFO2SaUZZiPle7mz n9QcbxpBZiA7GkprAnBcAcgPFunjuH6k/VZ456aPQSo+qrXqBLShgI2aeHSkr5Yg2ycc wQJkzn/9L7BtS5v2UjLBXHwBxuObvKvxhQ+RQy7F+M6gaZeWuPjzm7mLXkppTZY4pbGV UMOA== X-Gm-Message-State: AOAM5317NAi4nrD9oCC+TLsJQElVZsQAxoGYmJ0kMb9/498OMGOaZ1VY h4TjVKeeZNMnSpStP9pBmSIYWiwX0/fwsFWjVdxCcA4ficmZSdVXXdiPvoS8GLVvBZjsULKH+sV 0W25+NaRNqgHUD7f+s2gthhSHoGnmcjW6r862/5Mfawu7aD75t61fkLqYBFcZm4TYBKPu X-Received: by 2002:a5d:4251:: with SMTP id s17mr2513084wrr.174.1618480146971; Thu, 15 Apr 2021 02:49:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxodVvOx/IgEokByXBMnsiyAWpfbYERUX3JlsAVary27UgVNjUQqwYJpJX8zPPv+N1Lb9seZQ== X-Received: by 2002:a5d:4251:: with SMTP id s17mr2513071wrr.174.1618480146822; Thu, 15 Apr 2021 02:49:06 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id v4sm2427278wrf.36.2021.04.15.02.49.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 02:49:06 -0700 (PDT) From: Pavel Reichl To: fstests@vger.kernel.org Subject: [PATCH v3 1/4] common/rc: Add _require_{chown,chmod}() Date: Thu, 15 Apr 2021 11:49:02 +0200 Message-Id: <20210415094905.61853-2-preichl@redhat.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210415094905.61853-1-preichl@redhat.com> References: <20210415094905.61853-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 | 23 +++++++++++++++++++++++ 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, 34 insertions(+) diff --git a/common/rc b/common/rc index 23f86ce6..be292aaf 100644 --- a/common/rc +++ b/common/rc @@ -2115,6 +2115,29 @@ _require_user() [ "$?" == "0" ] || _notrun "$qa_user cannot execute commands." } +# check for a chown support +# +_require_chown() +{ + rnd_uid=4242 + + _require_test + + local file="$TEST_DIR/chown_testfile" + touch $file + chown ${rnd_uid}:${rnd_uid} $file >/dev/null 2>&1 \ + || _notrun "chown is not supported ${FSTYP}" + rm -f $file +} + + +# check for a chmod support +# +_require_chmod() +{ + _require_chown +} + # 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..6602dc70 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_symlinks 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 Thu Apr 15 09:49: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: 12204889 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 16C1FC433B4 for ; Thu, 15 Apr 2021 09:49:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E47BA61166 for ; Thu, 15 Apr 2021 09:49:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231531AbhDOJtg (ORCPT ); Thu, 15 Apr 2021 05:49:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:43391 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231766AbhDOJte (ORCPT ); Thu, 15 Apr 2021 05:49:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618480151; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=G7ohePm8V3EbpXOSXLfjDWDt4deCIcUZRMbI6KyN1lU=; b=F5Foiaw11iEyYWXNXNGymHiXHxGqOmnbDdMHkhSoMEa9Gr896/iS5M7TBxVWhOv/qenl8n 8ARwX0/Z/u4JwkhEq1fhpMmbwG6qWVwqkbhu4U+9+rIooXvbWvrW5/AxSZOu+n5Uu1tAjb SFnLPKy+HKLb6EcNfF/SfWSWgMrqI/w= 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-70-nmiA2BEfMqaxC_vRFY8g2g-1; Thu, 15 Apr 2021 05:49:09 -0400 X-MC-Unique: nmiA2BEfMqaxC_vRFY8g2g-1 Received: by mail-wr1-f72.google.com with SMTP id y13-20020adfdf0d0000b02901029a3bf796so2490479wrl.15 for ; Thu, 15 Apr 2021 02:49:08 -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:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=G7ohePm8V3EbpXOSXLfjDWDt4deCIcUZRMbI6KyN1lU=; b=K3m+vQNHqAXLHdSUQwpB1d4L/2gTRT8DydhiSLKadSZ9DQ6/Dac90JTLfgeYauemev tGibIPDHXZ96j+B3XupiK0ODtje09hG0MfTUKDc6F/ldzVMr6FUKBq4vXDA51sCw02Lh oElu3jCHvcfCTaOyhqC3r7lbi06HDlroM8kb8rnORyZGedrVFQUqbtQtsn1TZ4ssoeHz FWT590NlDTDovgonGdR9clvmdT+3XPxykpIYJytxY5LY5+a6DRJFq84qt1Aj8FRnOOi3 gBibGwSUkSNgx4poeJig2bqXui9WlX01is7myzTyoCIjaDnJCN8ch0syBqZ5CWhoJC0b T9Sg== X-Gm-Message-State: AOAM531m/uPiE/NSjx7Qy5yr1Ni/vpZvHkcd8nn+VDwi5SZkTPXZOk/H UCEmlFe874AT5Id8Z0FfVsO6apm0YNKbqL5qf1+nksia4zbapz1ZPx/lFBmRv3JRsSw9MsIs+xo 3XhRNyLIt4PwJU1Zqpz1O5xu8BPi/vJKfVJphmhLAbd+HNGdqkg+GZRU9fzVnzxmFgz2C X-Received: by 2002:a1c:c246:: with SMTP id s67mr2217708wmf.86.1618480147860; Thu, 15 Apr 2021 02:49:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvf8IrGxqqKnZv6SyhscjxcPSq3llsUd8hPufL9Myl9IdjZQaj8D2JM6ZXYFm5A/ckUG9NPg== X-Received: by 2002:a1c:c246:: with SMTP id s67mr2217696wmf.86.1618480147732; Thu, 15 Apr 2021 02:49:07 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id v4sm2427278wrf.36.2021.04.15.02.49.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 02:49:07 -0700 (PDT) From: Pavel Reichl To: fstests@vger.kernel.org Subject: [PATCH v3 2/4] common: hide permision warning from mkswap for exfat Date: Thu, 15 Apr 2021 11:49:03 +0200 Message-Id: <20210415094905.61853-3-preichl@redhat.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210415094905.61853-1-preichl@redhat.com> References: <20210415094905.61853-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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/rc b/common/rc index be292aaf..47098b55 100644 --- a/common/rc +++ b/common/rc @@ -2374,7 +2374,8 @@ _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 + # Ignore permission complaints on filesystems that don't support perms + $MKSWAP_PROG "$fname" 2> >(grep -v 'insecure permission' >&2) >> $seqres.full } # Check that the filesystem supports swapfiles From patchwork Thu Apr 15 09:49: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: 12204893 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 66D34C43461 for ; Thu, 15 Apr 2021 09:49:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 49B0C611AB for ; Thu, 15 Apr 2021 09:49:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232030AbhDOJth (ORCPT ); Thu, 15 Apr 2021 05:49:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:49333 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231809AbhDOJte (ORCPT ); Thu, 15 Apr 2021 05:49:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618480151; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sdWhtJvl7MC1oD/gW6XMgG8McJ9WGJMyj2oi9yBarHU=; b=JgEsbCbEn1vigWKIq9hZV4hS6dS7kanmP/il/tELPLC6JgdyjlSY0+ELTX6a2l2Zhw9GQV 03T7QoM/w3q81iwRtb9FDeWMDjfswb+vfs2YoCuSHWwo17+Z9eSfXiNlKRzjtjsvY8HD9O tEbQ6Nsyr8KEK6sRmDMiglxYRHQFWNY= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-238-KpKI6LfQNySwwA_OBD-yFw-1; Thu, 15 Apr 2021 05:49:10 -0400 X-MC-Unique: KpKI6LfQNySwwA_OBD-yFw-1 Received: by mail-wr1-f70.google.com with SMTP id j4-20020adfe5040000b0290102bb319b87so2490017wrm.23 for ; Thu, 15 Apr 2021 02:49: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:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sdWhtJvl7MC1oD/gW6XMgG8McJ9WGJMyj2oi9yBarHU=; b=NBdaA1RtfMp/mmFrKtdrN3L8q68KhneqHYRfGuduyBwhFKKiIWQWqEvGDVK+P6/6KT O1zK8D0K/GOGbziv/nIUsqZHerHTSL9xJdHlbPxBfMrPI0Rwa9WUN45nTujjCGkYi5UN NKt4imJEYa0p7PkeeAVmjNwVT2HXjl7rAWS+Uy1NB0Df4GsaAMhd246Pk5M9jcT/WgWR SpnUJCmv8/MMWHLv4QUrbNecyPe67nSASNWGBN6aKB+XYQkJsr4887LA+AkuoUfCi4JA I2np2FNg6hsLWxnw6R8jW3OLRyccK0d6IFfUghlChKNMl8NZmaf+BG0Wau44Ul730R8L +liw== X-Gm-Message-State: AOAM5327mU+cwjr5ZCk8CPMbyNfJnrQ3O8AQ85lN3XHkdDSzsPb2IqZ6 ub9DRi/B5XJhQa2Y/2lVwMffwdxK+5It2r2Dmk7JY/ZGruzqP0MQl0qEqRDkVA1hXT3sBiA2sNO UWv3Cs5dShGG7s3q2LR040LJ93+Fd/dvJBFPJG2zVW2AhzhKTFsvt8ip1+AAHYshivN8g X-Received: by 2002:a05:6000:184c:: with SMTP id c12mr2526699wri.125.1618480148667; Thu, 15 Apr 2021 02:49:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUfC1I0psH1pmH7LzmAk7edBqzYXyt+VYxcps2SVsqhB2+UwobP1bLOBkp5+lFb6og1z4DQw== X-Received: by 2002:a05:6000:184c:: with SMTP id c12mr2526682wri.125.1618480148544; Thu, 15 Apr 2021 02:49:08 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id v4sm2427278wrf.36.2021.04.15.02.49.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 02:49:08 -0700 (PDT) From: Pavel Reichl To: fstests@vger.kernel.org Subject: [PATCH v3 3/4] generic/554: hide permision warning on exfat Date: Thu, 15 Apr 2021 11:49:04 +0200 Message-Id: <20210415094905.61853-4-preichl@redhat.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210415094905.61853-1-preichl@redhat.com> References: <20210415094905.61853-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 | 7 +++++++ tests/generic/554 | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/common/rc b/common/rc index 47098b55..fb1f7598 100644 --- a/common/rc +++ b/common/rc @@ -2378,6 +2378,13 @@ _format_swapfile() { $MKSWAP_PROG "$fname" 2> >(grep -v 'insecure permission' >&2) >> $seqres.full } +_swapon_file() { + local fname="$1" + + # Ignore permission complaints on filesystems that don't support perms + swapon "$fname" 2> >(grep -v "insecure permissions" >&2) +} + # Check that the filesystem supports swapfiles _require_scratch_swapfile() { diff --git a/tests/generic/554 b/tests/generic/554 index fa4f97d2..da9bfce5 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 +_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 Thu Apr 15 09:49: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: 12204891 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 E8E77C43462 for ; Thu, 15 Apr 2021 09:49:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CD64F613B0 for ; Thu, 15 Apr 2021 09:49:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232129AbhDOJth (ORCPT ); Thu, 15 Apr 2021 05:49:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54651 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231815AbhDOJtf (ORCPT ); Thu, 15 Apr 2021 05:49:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618480152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zyDkbOJF+LAXZhVyXOvOwWICcwEeTsYdSwwQvMcPKv0=; b=IB1gPkFPDAQvFhLL4no2DRvhThL1gQPf/poGr6DcOnQYhOBopvzioPHtwT9qIho0wOPBE8 eONBN/X459apco45aQT0S5lmNgLOq7zL/sEoV+VW7PSjP/UFRay4ncp3k9nL90khzAb1K7 lnB4igMALzA2FWZGV+aBWHulfhtKf0Q= 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-91-zjKKZ4giPUiivq1xKHLXqg-1; Thu, 15 Apr 2021 05:49:11 -0400 X-MC-Unique: zjKKZ4giPUiivq1xKHLXqg-1 Received: by mail-wr1-f69.google.com with SMTP id 33-20020adf80240000b02900f9e2646f9aso2483988wrk.0 for ; Thu, 15 Apr 2021 02:49: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:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zyDkbOJF+LAXZhVyXOvOwWICcwEeTsYdSwwQvMcPKv0=; b=tHmMmUNmG6zKv3eZ9gdf8G5slMQTOf783qDRKBYVSb1KEgNFx7yLhtPvo5835MNKcM Kszpf/cCEHO7dn4//xsZD0BIk9kOkQG/QCdU+QRB5kdD25A+VRkOWM5VpRoeQu+UpfNl TNmm8v6zH4GTGnh6U+sEKDA3ncEH1QqH2dXNzVjw9oFaqAmPJQ1JCOvAidfyPXueVbW3 qWVjCR591HLWWYc+7XMuR4dIZBgAryqHOAH98oMabE+32kB6rHybK4HfYve3YdcOWe+L bOhvg/7ZoOIuKyFRUrdhSHkh/3JdT4dwEobGdRYQCHnxd6DjYwKHxUEcktCc7StGb5PQ /pmA== X-Gm-Message-State: AOAM532UMXknAl+uftjTb/7tJlnHF16BmCct51znskK4zHjB+P8nwQKx gGW3j3A5Z4//7gcbNhqwtVWkuAGxRAYGpCIBhL1LSimj7kmBvEiWPxXGmww6Mc7Q7Jj6TCs44Lt H18uOs29xKwl683dKnzUdLP2f4WnUxsAWoCzpf0hFi2u4DPSxdiFusE7eUyo+sfZj1quA X-Received: by 2002:a1c:94:: with SMTP id 142mr2344748wma.31.1618480149595; Thu, 15 Apr 2021 02:49:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhDChxWY49dUVS2tU0A0bxWSlMCmf44Nsrc+xImHUmwjnFlW4Ud2Z6rJTyyDJFRFiH2Dk4gg== X-Received: by 2002:a1c:94:: with SMTP id 142mr2344722wma.31.1618480149285; Thu, 15 Apr 2021 02:49:09 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id v4sm2427278wrf.36.2021.04.15.02.49.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 02:49:08 -0700 (PDT) From: Pavel Reichl To: fstests@vger.kernel.org Subject: [PATCH v3 4/4] generic/003: Amend the test for exfat Date: Thu, 15 Apr 2021 11:49:05 +0200 Message-Id: <20210415094905.61853-5-preichl@redhat.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210415094905.61853-1-preichl@redhat.com> References: <20210415094905.61853-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..b2a3db39 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.1 +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" \