diff mbox series

[1/5] common: Add _require_{chown,chmod}()

Message ID 20210326154134.309159-2-preichl@redhat.com (mailing list archive)
State New
Headers show
Series Fix some tests that fail for exfat FS | expand

Commit Message

Pavel Reichl March 26, 2021, 3:41 p.m. UTC
Add helper function that ensures that test is only executed on file
systems that implement chown and chmod.

Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
 common/rc | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Eryu Guan March 28, 2021, 3:38 p.m. UTC | #1
On Fri, Mar 26, 2021 at 04:41:30PM +0100, Pavel Reichl wrote:
> Add helper function that ensures that test is only executed on file
> systems that implement chown and chmod.
> 
> Signed-off-by: Pavel Reichl <preichl@redhat.com>

I think patch 1 and patch 2 could be folded into one patch, introduce
new helpers and use them in the same patch.

Thanks,
Eryu

> ---
>  common/rc | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/common/rc b/common/rc
> index 0ce3cb0d..b18d37fd 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -2129,6 +2129,24 @@ _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 group on the machine, fsgqa as default
>  #
>  _require_group()
> -- 
> 2.30.2
diff mbox series

Patch

diff --git a/common/rc b/common/rc
index 0ce3cb0d..b18d37fd 100644
--- a/common/rc
+++ b/common/rc
@@ -2129,6 +2129,24 @@  _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 group on the machine, fsgqa as default
 #
 _require_group()