All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH testsuite] tests/capable_sys: skip test_rawio on BTRFS
@ 2021-08-04 13:08 Ondrej Mosnacek
  2021-08-19  9:09 ` Ondrej Mosnacek
  0 siblings, 1 reply; 2+ messages in thread
From: Ondrej Mosnacek @ 2021-08-04 13:08 UTC (permalink / raw)
  To: selinux

BTRFS doesn't support the FIBMAP ioctl, which is used to test
CAP_SYS_RAWIO. It is already disabled for NFS, so disable that test also
on BTRFS.

Fedora 35 cloud images already have BTRFS volumes instead of ext4 and
this patch is needed to make the testsuite pass there.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
---
 tests/capable_sys/test | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/capable_sys/test b/tests/capable_sys/test
index cd50ebc..a72616d 100755
--- a/tests/capable_sys/test
+++ b/tests/capable_sys/test
@@ -9,10 +9,11 @@ BEGIN {
     $basedir = $0;
     $basedir =~ s|(.*)/[^/]*|$1|;
 
-    $isnfs = `stat -f --print %T $basedir`;
+    $fs          = `stat -f --print %T $basedir`;
+    $test_fibmap = $fs ne "btrfs" and $fs ne "nfs";
 
     $test_count = 7;
-    if ( $isnfs ne "nfs" ) {
+    if ($test_fibmap) {
         $test_count += 1;
     }
 
@@ -26,7 +27,7 @@ system "rm -f $basedir/temp_file 2>&1";
 # Tests for the good domain.
 #
 
-if ( $isnfs ne "nfs" ) {
+if ($test_fibmap) {
 
     # CAP_SYS_RAWIO
     system "touch $basedir/temp_file 2>&1";
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH testsuite] tests/capable_sys: skip test_rawio on BTRFS
  2021-08-04 13:08 [PATCH testsuite] tests/capable_sys: skip test_rawio on BTRFS Ondrej Mosnacek
@ 2021-08-19  9:09 ` Ondrej Mosnacek
  0 siblings, 0 replies; 2+ messages in thread
From: Ondrej Mosnacek @ 2021-08-19  9:09 UTC (permalink / raw)
  To: SElinux list

On Wed, Aug 4, 2021 at 3:08 PM Ondrej Mosnacek <omosnace@redhat.com> wrote:
> BTRFS doesn't support the FIBMAP ioctl, which is used to test
> CAP_SYS_RAWIO. It is already disabled for NFS, so disable that test also
> on BTRFS.
>
> Fedora 35 cloud images already have BTRFS volumes instead of ext4 and
> this patch is needed to make the testsuite pass there.
>
> Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
> ---
>  tests/capable_sys/test | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/tests/capable_sys/test b/tests/capable_sys/test
> index cd50ebc..a72616d 100755
> --- a/tests/capable_sys/test
> +++ b/tests/capable_sys/test
> @@ -9,10 +9,11 @@ BEGIN {
>      $basedir = $0;
>      $basedir =~ s|(.*)/[^/]*|$1|;
>
> -    $isnfs = `stat -f --print %T $basedir`;
> +    $fs          = `stat -f --print %T $basedir`;
> +    $test_fibmap = $fs ne "btrfs" and $fs ne "nfs";
>
>      $test_count = 7;
> -    if ( $isnfs ne "nfs" ) {
> +    if ($test_fibmap) {
>          $test_count += 1;
>      }
>
> @@ -26,7 +27,7 @@ system "rm -f $basedir/temp_file 2>&1";
>  # Tests for the good domain.
>  #
>
> -if ( $isnfs ne "nfs" ) {
> +if ($test_fibmap) {
>
>      # CAP_SYS_RAWIO
>      system "touch $basedir/temp_file 2>&1";
> --
> 2.31.1
>

This patch is now merged with minor modification - the logical
expression in tests/capable_sys had to be parenthesized because of
Perl bogosity (https://www.perlmonks.org/?node_id=734436).

https://github.com/SELinuxProject/selinux-testsuite/commit/4ed5d11312d673203d93dafbcdad441c3afc36f9

-- 
Ondrej Mosnacek
Software Engineer, Linux Security - SELinux kernel
Red Hat, Inc.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-19  9:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-04 13:08 [PATCH testsuite] tests/capable_sys: skip test_rawio on BTRFS Ondrej Mosnacek
2021-08-19  9:09 ` Ondrej Mosnacek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.