From patchwork Wed Jul 1 17:52:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 11636997 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 230A560D for ; Wed, 1 Jul 2020 17:52:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EFB3D20771 for ; Wed, 1 Jul 2020 17:52:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593625928; bh=DEBT7iYZXwwI2EGHfESXZ59bQ2dhEM04u7hoUagj3eM=; h=From:To:Subject:Date:List-ID:From; b=YgqTvLjL9SzsovLIrNK+1tpq+bDLZgdo1atPljsyO0rEB32pnBhhYVT1yMbPKWlm9 V8D42fqFGHIXdPka4eh0KZ8yU3FACFef+kXw0u2VwCHTz2+7ehgnbQ7I7r6o4TXODR xuZ79yIdG3PBC6jNbW+RFs5HA1Qxl9YD7mZBjiDU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731171AbgGARwH (ORCPT ); Wed, 1 Jul 2020 13:52:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:43544 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726675AbgGARwH (ORCPT ); Wed, 1 Jul 2020 13:52:07 -0400 Received: from tleilax.com (68-20-15-154.lightspeed.rlghnc.sbcglobal.net [68.20.15.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C297D20771 for ; Wed, 1 Jul 2020 17:52:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593625927; bh=DEBT7iYZXwwI2EGHfESXZ59bQ2dhEM04u7hoUagj3eM=; h=From:To:Subject:Date:From; b=W429ZfdbyYlhl6FagOa4XRGZF6PnJN0zrjYWKyxpotfgQlLwiFyRFSemFAWCiA4KC +zUYVSINALSFOW4HFKcuq+nsLhp7QhyXsIW3B4He51Oy7uFDsJe7r/gW1ZfbbB7dV1 RbupMop96HWFHRdr/a6kECcOF5c9XkZ5DxWWWs/0= From: Jeff Layton To: fstests@vger.kernel.org Subject: [PATCH] generic/377: filter out xattrs that don't start with 'user.' Date: Wed, 1 Jul 2020 13:52:05 -0400 Message-Id: <20200701175205.342650-1-jlayton@kernel.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org Most hosts that I've been testing on seem to display security.selinux in listxattr. 377.out doesn't account for that so it routinely fails for me in testing. When testing the output of listxattr in generic/377, filter out any xattr names that don't start with 'user.'. That should help ensure consistent output on SELinux-enabled hosts. Signed-off-by: Jeff Layton --- tests/generic/377 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) I'm not sure why this doesn't fail for most people, unless most are turning off SELinux. Is this the right approach? diff --git a/tests/generic/377 b/tests/generic/377 index f7835ee8ff9e..f08abdca60a6 100755 --- a/tests/generic/377 +++ b/tests/generic/377 @@ -48,7 +48,7 @@ $SETFATTR_PROG -n user.ping -v pong $testfile $SETFATTR_PROG -n user.hello -v there $testfile # 1. Call listxattr without buffer length argument. This should succeed. -$listxattr $testfile | sort +$listxattr $testfile | grep '^xattr: user\.' | sort # 2. Calling listxattr on nonexistant file should fail with -ENOENT. $listxattr "" @@ -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 '^xattr: user\.' | sort status=0 exit