mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
generic/317,318: fail gracefully if userns not supported
generic/317 and generic/318 fail un-gracefully on older kernels which don't support userns; fix that by running a simple test as a prerequisite and fail gracefully if needed. Roll that in with the test for executable presence, and make a new _require_userns() Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
committed by
Dave Chinner
parent
bbe5d55a0b
commit
c728752cfa
@@ -2132,6 +2132,12 @@ _require_relatime()
|
|||||||
_scratch_unmount
|
_scratch_unmount
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_require_userns()
|
||||||
|
{
|
||||||
|
[ -x src/nsexec ] || _notrun "src/nsexec executable not found"
|
||||||
|
src/nsexec -U true 2>/dev/null || _notrun "userns not supported by this kernel"
|
||||||
|
}
|
||||||
|
|
||||||
_create_loop_device()
|
_create_loop_device()
|
||||||
{
|
{
|
||||||
file=$1
|
file=$1
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,6 @@ _supported_fs generic
|
|||||||
# only Linux supports user namespace
|
# only Linux supports user namespace
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
[ -x $nsexec ] || _notrun "$nsexec executable not found"
|
|
||||||
[ -x $lstat64 ] || _notrun "$lstat64 executable not found"
|
[ -x $lstat64 ] || _notrun "$lstat64 executable not found"
|
||||||
|
|
||||||
rm -f $seqres.full
|
rm -f $seqres.full
|
||||||
@@ -62,6 +61,7 @@ _require_scratch
|
|||||||
_need_to_be_root
|
_need_to_be_root
|
||||||
_require_user
|
_require_user
|
||||||
_require_ugid_map
|
_require_ugid_map
|
||||||
|
_require_userns
|
||||||
qa_user_id=`grep $qa_user /etc/passwd |awk -F: '{print $3}'`
|
qa_user_id=`grep $qa_user /etc/passwd |awk -F: '{print $3}'`
|
||||||
|
|
||||||
_filter_output()
|
_filter_output()
|
||||||
|
|||||||
+1
-2
@@ -55,8 +55,6 @@ _supported_fs generic
|
|||||||
# only Linux supports user namespace
|
# only Linux supports user namespace
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
[ -x $nsexec ] || _notrun "$nsexec executable not found"
|
|
||||||
|
|
||||||
rm -f $seqres.full
|
rm -f $seqres.full
|
||||||
|
|
||||||
_require_scratch
|
_require_scratch
|
||||||
@@ -64,6 +62,7 @@ _need_to_be_root
|
|||||||
_acl_setup_ids
|
_acl_setup_ids
|
||||||
_require_acls
|
_require_acls
|
||||||
_require_ugid_map
|
_require_ugid_map
|
||||||
|
_require_userns
|
||||||
ns_acl1=0
|
ns_acl1=0
|
||||||
ns_acl2=`expr $acl2 - $acl1`
|
ns_acl2=`expr $acl2 - $acl1`
|
||||||
ns_acl3=`expr $acl3 - $acl1`
|
ns_acl3=`expr $acl3 - $acl1`
|
||||||
|
|||||||
Reference in New Issue
Block a user