diff mbox

[3/4] fstests: add helper _require_exportfs

Message ID 1492539444-25938-4-git-send-email-amir73il@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Amir Goldstein April 18, 2017, 6:17 p.m. UTC
Use open_by_handle -c to determine if filesystem supports NFS export
---
 common/rc | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Eryu Guan April 19, 2017, 9:44 a.m. UTC | #1
On Tue, Apr 18, 2017 at 09:17:23PM +0300, Amir Goldstein wrote:
> Use open_by_handle -c to determine if filesystem supports NFS export
> ---
>  common/rc | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/common/rc b/common/rc
> index 685b859..f24a21f 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -2857,6 +2857,15 @@ _require_freeze()
>  	[ $result -eq 0 ] || _notrun "$FSTYP does not support freezing"
>  }
>  
> +# Does NFS export work on this fs?
> +_require_exportfs()
> +{
> +	mkdir -p "$TEST_DIR"/export_test
> +	$here/src/open_by_handle -c "$TEST_DIR"/export_test 2>&1 \
> +		|| _notrun "$FSTYP does not support NFS export"

_require_test_program "open_by_handle" first?

Thanks,
Eryu

> +}
> +
> +
>  # Does shutdown work on this fs?
>  _require_scratch_shutdown()
>  {
> -- 
> 2.7.4
> 
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Howells April 19, 2017, 9:50 a.m. UTC | #2
Amir Goldstein <amir73il@gmail.com> wrote:

> +# Does NFS export work on this fs?
> +_require_exportfs()

Don't forget to add it to doc/requirement-checking.txt!

David
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/common/rc b/common/rc
index 685b859..f24a21f 100644
--- a/common/rc
+++ b/common/rc
@@ -2857,6 +2857,15 @@  _require_freeze()
 	[ $result -eq 0 ] || _notrun "$FSTYP does not support freezing"
 }
 
+# Does NFS export work on this fs?
+_require_exportfs()
+{
+	mkdir -p "$TEST_DIR"/export_test
+	$here/src/open_by_handle -c "$TEST_DIR"/export_test 2>&1 \
+		|| _notrun "$FSTYP does not support NFS export"
+}
+
+
 # Does shutdown work on this fs?
 _require_scratch_shutdown()
 {