[3/3] generic: exclude selinux xattr form being considered
diff mbox series

Message ID 20181127214308.137410-4-gwendal@chromium.org
State New
Headers show
Series
  • Adapt some tests to ChromeOS
Related show

Commit Message

Gwendal Grignou Nov. 27, 2018, 9:43 p.m. UTC
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
---
 common/filter     | 1 +
 tests/generic/062 | 2 +-
 tests/generic/377 | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

Comments

Eryu Guan Nov. 28, 2018, 4:37 a.m. UTC | #1
On Tue, Nov 27, 2018 at 01:43:08PM -0800, Gwendal Grignou wrote:
> Signed-off-by: Gwendal Grignou <gwendal@chromium.org>

I didn't see such failures before, could you please provide more info in
the commit log about the problem? So I can try to reproduce the failure.

> ---
>  common/filter     | 1 +
>  tests/generic/062 | 2 +-
>  tests/generic/377 | 2 +-
>  3 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/common/filter b/common/filter
> index ed082d24..3ca40431 100644
> --- a/common/filter
> +++ b/common/filter
> @@ -290,6 +290,7 @@ _filter_scratch()
>  	# so substitute SCRATCH_MNT first
>  	sed -e "s,\B$SCRATCH_MNT,SCRATCH_MNT,g" \
>  	    -e "s,\B$SCRATCH_DEV,SCRATCH_DEV,g" \
> +	    -e "/security\.selinux/d" \
>  	    -e "/.use_space/d"

This doesn't belong to _filter_scratch but to filters that filter xattr.
I want to understand & reproduce the problem so I know where the failure
comes from and think about what the best fix would be.

Thanks,
Eryu

>  }
>  
> diff --git a/tests/generic/062 b/tests/generic/062
> index 9024af2e..7e79a2dd 100755
> --- a/tests/generic/062
> +++ b/tests/generic/062
> @@ -120,7 +120,7 @@ for nsp in $ATTR_MODES; do
>  		getfattr -m $nsp -e hex -n $nsp.name2 $SCRATCH_MNT/$inode 2>&1 | invalid_attribute_filter
>  
>  		echo "*** final list (strings, type=$inode, nsp=$nsp)"
> -		getfattr -m '.' -e hex $SCRATCH_MNT/$inode
> +		getfattr -m '.' -e hex $SCRATCH_MNT/$inode | grep -ve "security\.selinux"
>  	
>  	done
>  done
> diff --git a/tests/generic/377 b/tests/generic/377
> index f7835ee8..0ce2cb4b 100755
> --- a/tests/generic/377
> +++ b/tests/generic/377
> @@ -66,7 +66,7 @@ $listxattr $testfile 9
>  $listxattr $testfile 11
>  
>  # 6. Calling listxattr with buffersize bigger than needed should succeed.
> -$listxattr $testfile 500 | sort
> +$listxattr $testfile 500 | grep -ve "security\.selinux" | sort
>  
>  status=0
>  exit
> -- 
> 2.18.1
>

Patch
diff mbox series

diff --git a/common/filter b/common/filter
index ed082d24..3ca40431 100644
--- a/common/filter
+++ b/common/filter
@@ -290,6 +290,7 @@  _filter_scratch()
 	# so substitute SCRATCH_MNT first
 	sed -e "s,\B$SCRATCH_MNT,SCRATCH_MNT,g" \
 	    -e "s,\B$SCRATCH_DEV,SCRATCH_DEV,g" \
+	    -e "/security\.selinux/d" \
 	    -e "/.use_space/d"
 }
 
diff --git a/tests/generic/062 b/tests/generic/062
index 9024af2e..7e79a2dd 100755
--- a/tests/generic/062
+++ b/tests/generic/062
@@ -120,7 +120,7 @@  for nsp in $ATTR_MODES; do
 		getfattr -m $nsp -e hex -n $nsp.name2 $SCRATCH_MNT/$inode 2>&1 | invalid_attribute_filter
 
 		echo "*** final list (strings, type=$inode, nsp=$nsp)"
-		getfattr -m '.' -e hex $SCRATCH_MNT/$inode
+		getfattr -m '.' -e hex $SCRATCH_MNT/$inode | grep -ve "security\.selinux"
 	
 	done
 done
diff --git a/tests/generic/377 b/tests/generic/377
index f7835ee8..0ce2cb4b 100755
--- a/tests/generic/377
+++ b/tests/generic/377
@@ -66,7 +66,7 @@  $listxattr $testfile 9
 $listxattr $testfile 11
 
 # 6. Calling listxattr with buffersize bigger than needed should succeed.
-$listxattr $testfile 500 | sort
+$listxattr $testfile 500 | grep -ve "security\.selinux" | sort
 
 status=0
 exit