diff mbox series

[12/24] overlay/020: make sure the system supports the required namespaces

Message ID 160013425217.2923511.11863740582450765597.stgit@magnolia
State Accepted
Headers show
Series fstests: tons of random fixes | expand

Commit Message

Darrick J. Wong Sept. 15, 2020, 1:44 a.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

Don't run this test if the kernel doesn't support namespaces.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/overlay/020 |    6 ++++++
 1 file changed, 6 insertions(+)

Comments

Amir Goldstein Sept. 15, 2020, 8:46 a.m. UTC | #1
On Tue, Sep 15, 2020 at 4:44 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Don't run this test if the kernel doesn't support namespaces.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Amir Goldstein <amir73il@gmail.com>

>  tests/overlay/020 |    6 ++++++
>  1 file changed, 6 insertions(+)
>
>
> diff --git a/tests/overlay/020 b/tests/overlay/020
> index 85488b83..9029f042 100755
> --- a/tests/overlay/020
> +++ b/tests/overlay/020
> @@ -32,10 +32,16 @@ rm -f $seqres.full
>
>  # real QA test starts here
>
> +require_unshare() {
> +       unshare -f -r "$@" true &>/dev/null || \
> +               _notrun "unshare $@: not supported"
> +}
> +

I guess we can defer making this common until xfstests catches up on
testing FS_USERNS_MOUNT...

Thanks,
Amir.
diff mbox series

Patch

diff --git a/tests/overlay/020 b/tests/overlay/020
index 85488b83..9029f042 100755
--- a/tests/overlay/020
+++ b/tests/overlay/020
@@ -32,10 +32,16 @@  rm -f $seqres.full
 
 # real QA test starts here
 
+require_unshare() {
+	unshare -f -r "$@" true &>/dev/null || \
+		_notrun "unshare $@: not supported"
+}
+
 # Modify as appropriate.
 _supported_fs overlay
 _supported_os Linux
 _require_scratch
+require_unshare -m -p -U
 
 # Remove all files from previous tests
 _scratch_mkfs