From patchwork Wed Jan 29 15:19:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13953855 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36BD715B102; Wed, 29 Jan 2025 15:20:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738164027; cv=fail; b=JvlaVnoXaJ34dA0Cp1EUTZA4c3nTTlmjN0ulKR/4GRwDgmRBjjUAOUJmvYwZ51j4MTSJsKwsdjKwRP1f7xSryuwyMqjKSOOZTr3WR2Pt5ePNg1rNfVwAUGCSTIS2YCqNEmOOhrWpqYiWAa+1l8p9pyVoFehaFI0IO3nEy4q/fGU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738164027; c=relaxed/simple; bh=sgJiu9ugshyaxE1tYy/oMpUqOdkIVhfWQ8Mxt2dWwYM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=FbNQue+elX8aFEE/cS3TyfaZHkqQ+P45CYOFDg6Zk9T5o2BSQbulwE3RK84tZeyzkD4VScf2+F0kRVt+dh9wQtsHKgT3mVPHXoYRLZ8WBK1xnkWiOavLY+LZMDWHqURETkqgbYRWqpHJF6wcVKB0oZfbkBgMsxksI/BbGuH4wh4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=Fcsrddzo; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=F4vqnvAS; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="Fcsrddzo"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="F4vqnvAS" Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50TFHRnM000945; Wed, 29 Jan 2025 15:20:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=foZg87m0YStHqg0or9PvBHL8O8Bzf9n5ZOJOCwSX3vo=; b= Fcsrddzo1RAUjp6UEgmEYa0e8zcgP9PpKtuqQWWUF3s1SReqmB9X9TS/+I7oV/Dy Pmwl1bZE6FDyZgp5pshZHXEBfmlWvOAAgMXNBLo/SJkqhKqq+UBJJNq80P8QUIUc 22+Rr3/1Eb1zYrmFHZ3yqbgUT35T/UwXnqhvOfxmbl0DhQRNFJhy/rIno6zzqDFN yedKG73DKDHjmcXBp4FrPBhyd+/KCwAWu0gLVPB/fkcDS6K6bBIF+Ux7q59pRMCt GZHUb/YxEpIpqhPugLkiYbefaCExaqV/vHuZMMSfmrGrKhb3UlhgPv/kyBg9GaFD qiL7BCb6K68F2fCzG8x2WA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 44fn2ug8qu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Jan 2025 15:20:24 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 50TETeuU036366; Wed, 29 Jan 2025 15:20:23 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2042.outbound.protection.outlook.com [104.47.55.42]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 44cpd9tpks-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Jan 2025 15:20:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=biRVnOOTa811d6jCpilBjffkNgmTMf0M+NQIYwdqTZEafeAI4RfO8KFz8jw9thXS5wuJZG3pcvfxRP1fk8qJYyuVDY9VeMt1puSJ2PIE8mUFJVOS7nEQshT9Tr6kGTawxveccHezYHTs0Ylgtbw/AyXB3CRMHb/91dGLXici2UE5oMlp44ZeFGqnpLOmRsoI8ZP+etRSm2q2vmiEmwUxQWEUF63/UnbZw+C3l0VwB0IB3jNlTTfgoD5KQjUdOhtUnzPZaD3I+XmHImzfDgj5y2PzVUc5yjmJjQnXT6kNQoJdkIqC1JKzlYD+14lcV0Z0zYGhSanhlTH+mE0zzhn+mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=foZg87m0YStHqg0or9PvBHL8O8Bzf9n5ZOJOCwSX3vo=; b=axlj8qiJcldzwUEIMNTfXhAPnJ+25WDx/5kvaaPzc7yvGBLI3ZdtwAmKVDQ1ZGNYOLbxJg203UlWeYwOnm6XkxVERxG2aXXZa7sj+x3Uabjb4V0/gJ8UfzZWh5k79djTjzKsCzuuI5DPXjytBWUDahohbcAFF0gr+y+nh8ZCN2Pq2rTAAAKI8AuJy9ZCt4EGKmWT0CV9y20o4alxSaGAuZz30aNr5gumYVpEdSFh4W+StUofkvQAKMgPIZy8uO91d1JNYd47EFPysipn1X1lYf4Sp5k3vPEcQEiJJZLVUmWDRa6aoVAm6Gy0itCY4sd8WyrDAJxifTetAKxqIh+FMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=foZg87m0YStHqg0or9PvBHL8O8Bzf9n5ZOJOCwSX3vo=; b=F4vqnvAS0/fO+ocgj+Fj0KB9dbb7YhLylaktGLDLrqw7Yazl/Dwl9+u0HGLBIhyDiHTaBgffP3NWuAn+E9iDrSEug5r7E21DLFB3dY/xUKwOxgkLku3Oswwxci3sCXm3moGfLtAS852QAnxhJvUwxDKsvsgZXlT64em3toOoGyw= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by DS7PR10MB4959.namprd10.prod.outlook.com (2603:10b6:5:3a0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8398.20; Wed, 29 Jan 2025 15:20:19 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65%3]) with mapi id 15.20.8377.021; Wed, 29 Jan 2025 15:20:19 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org Subject: [PATCH 1/3] fstests: common/rc: set_fs_sysfs_attr: redirect errors to stdout Date: Wed, 29 Jan 2025 23:19:52 +0800 Message-ID: <1eb59407c06a9c6a51a854bbce458208e3e53fea.1738161075.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: References: X-ClientProxiedBy: SI2PR04CA0011.apcprd04.prod.outlook.com (2603:1096:4:197::10) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|DS7PR10MB4959:EE_ X-MS-Office365-Filtering-Correlation-Id: e5f1a11b-fce6-4382-8316-08dd40787134 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: ewyhgidAf2DP7Z4lLvSXauKFqyw4xHfGLmdmWDzXawFzFFCJa4qyPPXMS7xNS9vVcZ1OR36doKXBC9m14EPKb+h6/AHE4M2d7qAxCT694d/87liEkuay663aJFmMQFYLyad5vFNv5g7rkeS/0NDCc4pm07yHX/qBDs11CsfLGu/S2BAo56el0dkX3LsVLKsP6dBgSiyNcMf0oDpiNiRms66DULICxZVhbFRLS8UeX4rlUQ2WsjkTDAHkFqQYnsoauGxVPHbGmbSL4X6D/61+YLIw6AKGGg3/WUb87yPzJrXKxk47FxtOXDBOzUiiWyMYagrH8rEUdPkJ5Dkzvnc752VqiOEjhNTBsjdjpTS6hZPip7OdBvehy34EkaEKo1LagAdr1F9R4huEUN+AVKOBAR+nKNE/lcEQygKMPHw5estVhlnNeNHxy0AsalQ8WsJr3s1pg9FKFb8P1u471J14JbMw+bgDpAc0M4TBzUvcWnEJ80XjXc4Ypy6r0M26eDJOd5pm5dzARnSiqO3eU6I69lW1tBQ5vJSOEzoB5cUEcpnuA+OyEHL+6VbzNZowwFvRNZaVmUgVVZDLXuMPn1oCp+vc502bfQm3ldm1xgT0kpJSN/u67vhiPbOgl2XkeuNnnO2TQI0MYB8YbmIuGRwmBwVo7SLu/sVaC3dRbMD0ATrSk3LbyXRwhDB50LIg3VNlm2M7R3+ZLFWUIypTUmEEZprUiLulxHWxadmEYzKRL382KLYcjrUpd18n/L7l0Myf6rMdCfA4Rglj5IgHFjy3DH2J3FrJP0L5JYj87Qfq7RpOBiInADqBb/bAgH1BYBYLX6oRjnUlcGrr7/l42tADd/aRBg5594DZR/Et/QAbsq6FEJVQNhQ/RUaL/cvOgzd0907w9DtaCYiLt9Mwp/8LR2CJPYMmsCk3J6z+JbwywTodb1o7aE/8e8cXb3JM70X4SwtbZZoUb3/6bkHqwnAuhF3DlI0FB5Q0eYtoZbQi1T9F1o5Jps1LzRTUN8u1VNE1FJF9+Y0N8YLSOijrpQbtkRm7ojT+I/cVLi2dvrKJf2NaZ2QwnMzdRoKdJnTtKkcbOWSWxpBh53Y6jrp+XughSyaTFn5Lgi2TVPtNsz3EeG430PVG9Z1zP6dSo9UXZoWc81eTHTWTcaeYpCZfz+2GumxSzu2cXsWtngZLsvW18WFstjYQNj8V9SJB67rmLQehXiUZcGU+HCjYOe3DCjZN+0cpoq/NW8rbc32AcuAtxG+/GWkYIlYn1alhH97+HUfYBOxvvFmGMOfo6gH2FywulNqUMQ0gQUzon97mbmQgAzQCyRmOrZ6+z7tNZKm5NO6XYR04zCnLwrbUaK2ypaXu+WHp4mKGCJ2mYh/U/UTuDx8d1JEPGdST8bgTMRlGUsoe X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-Message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CLXATHMICbGJOHIDc6gxpNa45qr63quR0pe3QocACC0yDUybdk4ZhbrAgfZfdy6W9V1oI+Dem1RatB3JGwKVDh7HIGY8EFU+Tc2pJSqfYSrFDwbVIw2m9xNe+R9NyHCAAMu1TwTFbKC7tUly5ARGg1434mUTBiSuV3P0VK4AKy2ru2jcEr7MEOm7RfJ/qHpKLIZE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e5f1a11b-fce6-4382-8316-08dd40787134 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2025 15:20:19.7789 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KX8LAHR6Ksl8vet+sb0j0PvNywnMhFw6OUmu7i/agvZ2CS4KVk1JTGzegItJEobus3xFIaeXgdo7IO/kLtIQKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB4959 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-29_02,2025-01-29_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 spamscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2501290123 X-Proofpoint-ORIG-GUID: aJlmuW-vmQ6TbSjF152CkaC9U5f3U1Q- X-Proofpoint-GUID: aJlmuW-vmQ6TbSjF152CkaC9U5f3U1Q- Redirect sysfs write errors to stdout as a preparatory patch to enable testing of expected sysfs write failures. Also, log the executed sysfs write command and its failure if any to seqres.full for better debugging and traceability. Signed-off-by: Anand Jain --- common/rc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/rc b/common/rc index a3ee09d54cf0..2c4621bad5d0 100644 --- a/common/rc +++ b/common/rc @@ -5082,7 +5082,8 @@ _set_fs_sysfs_attr() local dname=$(_fs_sysfs_dname $dev) - echo "$content" > /sys/fs/${FSTYP}/${dname}/${attr} + echo "echo "$content" 2>&1 > /sys/fs/${FSTYP}/${dname}/${attr}" >> $seqres.full + echo "$content" 2>&1 > /sys/fs/${FSTYP}/${dname}/${attr} | tee -a $seqres.full } # Print the content of /sys/fs/$FSTYP/$DEV/$ATTR From patchwork Wed Jan 29 15:19:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13953856 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1B5D1DDC29; Wed, 29 Jan 2025 15:20:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738164030; cv=fail; b=G8aBpwkxHhf5OEVd8tP6wiFA/JUvdyIlc6pOba+nRxvyz/5+eAabCTBG37gHfvGBN5US1Rd0SSllABy2a8CkYU0zuEdTfukDDutInpZKHXRwD933Ax3feYwbNeD2xfiHRSFJUAGu1hFeH57kQMVwxoreLXOzpK/wgV64Bo0sKWU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738164030; c=relaxed/simple; bh=wNgnh1TlVlfK8YTAThtyuwABLpVhzodaP1+aGxKdrH8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=fBGEs0J691S65WEMBLbYYQbqlN8AnLoCOf23cXJ1xIVVJ5s4VEmMRWDpL+ASJuRvqPjA8LitIjSqFdlwxXuMKrCBaan0M/QZfiLCpeBu2hqD6ha/tGZt8GafDJHkUX14nnvYFuOnvU3g8JtUwYTAFWNqi+P9qj38pUIpgmNA/Qo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=DkWYnevP; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=ATBW1ayE; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="DkWYnevP"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="ATBW1ayE" Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50TFGwja016386; Wed, 29 Jan 2025 15:20:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=Zp/feMNjLPWmsSRM7r0W2CGtz48S0m33rjG+bqIW/kA=; b= DkWYnevPrd6LFWouo3yvlJBERmuBML/BgOh5gHm4RjgY+VlGFHDJO4iOWJ++6fv4 AZNxpJnkhrxDvPLUOn6+mhm8BNC8s6Yyx8d98ZflKMwwTOAhLc6WUHRb4sIVrZ8O K2eiNmNt1aH51L63P5P2bvv6rVNM90/HUijoZIgN1sfN1zzwoIVG/BAle/3JygLj 2S/9IxlJrk1J9lpLJGdgB/yAegbchURirA2h8VmAfVeiCaMgknoJq2aTA5P59Sbf haAR83Tkhsp0gn13QOSA/b3v+Wc15qg2D1yJLwXwFkkYkxEBFnjzsGK9nY8byhql d238KPgHjzXGTnZVAbymQg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 44fmf80c4g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Jan 2025 15:20:27 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 50TE5xCq021979; Wed, 29 Jan 2025 15:20:26 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2040.outbound.protection.outlook.com [104.47.55.40]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 44cpd9vuwn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Jan 2025 15:20:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DYEX5OkvFtKpTag9fU3wjbFUJO96oyl8iShaOAIlbObAdr4byTN3dk0yLFo7f8+WBE7r88ws7j2w2vNLHGqCSNx01otykz/fH0ZKOZLr7FAeJkRREbA1dSAJMBgKIxwlmpd7fZ23u+FUY+ffyeGGVvGP/JubKhtgepre8DXuAsmHKB0HiWQ6UA6IOP4HRmXsuj6I/f9b0x/SbFvXEIauCXS+grNkd644O5Z5mr4kkbkRSL3Q2WKV4Dn16uplyK9rzyswG+/GJnR9ka+zCuzpmSqA9G7E7uPLMn8ix+0hzmp+QmgIqLcGiulMGnKnjGEREvcXDWHikRjXhZ7t9uFlZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Zp/feMNjLPWmsSRM7r0W2CGtz48S0m33rjG+bqIW/kA=; b=mY90aLFSuGoAY1ytiltQvJoeWV9JKoQLjfcWZc4rIu+Xvi6rp/6OEsPKqJduRASFYO60xMEClh1zPy96Ar+CjJ2wxom3u4GcIjVXgoYLZusjcmBcqWGephY9OSOjpa/CCc6ChhLC0ss0zKdBX9mBuPlm2lCxS/u7LX1fdNgETsR1g9zq/ItZMTLNY6pqEhtEZlMshlI5cfMCn1NaOINBpfUgc4J6Rj7qIkHgvyP9Gi7QDXk3nMLp5oQWGoQF+mO6GfB+4CU5E39RI9yng6r5SLYsiYCE/Tw/dMUkKKSsw4J6AM3dK3JWKvc9ryQQP4NFT3+sFitEgv+6x6wz5xH/YA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Zp/feMNjLPWmsSRM7r0W2CGtz48S0m33rjG+bqIW/kA=; b=ATBW1ayEo/m5aM8yISbcl1d/Kd0pw9JIEVLUItv/bOzXr0QQXSMcbOhCaCsPnNQa/JLpftjPZsa1Li2PR4pgZpClyXWGIFWNaNl8Iw5OmM5tCNJb+r6gn6h+UoaLRf6yquJUtilRuWQvN8EJWr3PZRjYrwGindmIl2C+Xfefw9o= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by DS7PR10MB4959.namprd10.prod.outlook.com (2603:10b6:5:3a0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8398.20; Wed, 29 Jan 2025 15:20:23 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65%3]) with mapi id 15.20.8377.021; Wed, 29 Jan 2025 15:20:23 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org Subject: [PATCH 2/3] fstests: filter: helpers for sysfs error filtering Date: Wed, 29 Jan 2025 23:19:53 +0800 Message-ID: <274f52cbb8de26703ddad1672bcf9a8dd0a540a6.1738161075.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: References: X-ClientProxiedBy: SI2PR01CA0042.apcprd01.prod.exchangelabs.com (2603:1096:4:193::23) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|DS7PR10MB4959:EE_ X-MS-Office365-Filtering-Correlation-Id: e06d3df2-3a36-4923-b9fe-08dd40787386 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: wtOkIXRrBj+bxiYyjKlf1etOQPWPRFTnt07Ry+zmSscBOGgwkWBir1vb+NkxLcwd7O8UJGaf9AEXW8ZrV+5wkx90VtuusNS7HEq1Xv+/OlsXDpMzcJ6/scb5ofiJLUlh6LVOyOLN9Z1EZuXF5LtLhi0IP/Kv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begdjsV6yxVkS5Meh6uQck2Bo0DEmNmWZAdxqHyZhHXfC2D19GqrZKI9U59A9WeAXWk+u6WMQIJG+SLsyI3JksQjvmimRapPmmavkotPNj4FtEo1XpWbTDrcGU8iBXtEv0v2mir24aJODa7LJ42ILT6PVEu X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UlbTYa/nSspZuLIuc8XQ/KfmTzIh15VNFcygfsiLGC/OgsskxQXVIIOi2o43nsf/1ndCrzDENHN07i9FMfmt2ZDCyAJ0DCFnkmOXvOcgJrU5N77l/XcmrYr14jWkhScSY+TficxYWeKS7uvUGJ7mYdWe6NYt7wv0/RhCIL9j17vomZXGG52syoTR11eE13kzvoMed9aS+xCZsCDSmyU7jAr6ne5/OTIMe87MuvM+FBi7oX8WzAC6Q1anxe+/upy7l0SirYOR5844DaUhsjfqaaPPmcQ3Q2cKF/AngVbqw4dhgQXDnl8eAyRLnY0tAjmbEZwmfIE1HHjLwGxChcm4pdkJa8yEPQmzW8UL5fe6la6nIZoYejEyirYdmmxXSYE2Wu0fyVBBPEE2MHIGLe35eNNmFjPWzHfO9ZsHCyMSE1uC4q2UkUEHNPDkjo3KeUJo1LMe017N7GvCPlX6ruTTDV/1VXCyX3w1ArfphIijqk/7mgMuFwweTzzusHGvB5EU6zze3irhl1R7os02AXYoM+WLBVv0MUPPiFpnKWIgOzpSPUV00i2yI3K1VCRpn1dOKFzR+A7BYB8tph9PBy4pPYX96dFuBmpMeB0UTNbNmt9YiKjbRGH0Et6W9DtslkE3hqQ8y97ZEsaqnXaYGRpk3/DFfTVHVVVTf3fhwa+yihtOpx2pTjbYUAq0YV8fjRrDhmbzFwn2FE7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XTphgCeb7FtnUFh3+lsafpy7jHeix5GGjWUrw9HUaufpLZnVmU56nQ7rp8kh0AjAhBuYncq64NqN8EQgCswksx3PTJKI9Mvp2BxiocmTKylhcWleGWd8gwEfTc3OpX/WZv8T/EhlCHjZFCzUD5nC1unw3ebG+vmDIOf/v1ncVGO+iy72mJex36iEOAD5DoFaRH3q2305pXG0tQ++iKNAs2O6qHsi065hVGJi93wT9XUO31qJ+rvUUtjG1Zyy/smKHb55EahEsRhSmTlX0AwybP7VSd9izbFG2turu67No4ud69I5fOIguvfgIpzPNrbZUjD/GkC1xsyCQhBrnnICLF7qUseP25xL31jNMfAQe9vU47v5PJwA5TkoM0Z6CFMxKJdZW6fJ6xQTya6wfrpnH4zBG8ACHnVoLIvyPmoi2D0V2rTGEjHHQI5xKy9cDHDyXc4ZmJEPPyDtpSk6hW8KW86sdZglqAxLVT3cVrijCxdFI0ctBUekAYU38= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e06d3df2-3a36-4923-b9fe-08dd40787386 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2025 15:20:23.6094 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +xoixplyC4rB69QxRqSWSVJG/TVvlRui2qGlNuOv5oIr6hsUj9sl4ToNLQNOiBdo8N8kr3VvqNWE9tg8CVmIDg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB4959 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-29_02,2025-01-29_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 mlxscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2501290123 X-Proofpoint-GUID: yE1jURJKO52G417eCBHoEKGY_6xh1w8C X-Proofpoint-ORIG-GUID: yE1jURJKO52G417eCBHoEKGY_6xh1w8C Added filter helpers to handle sysfs write errors, to ensure the sysfs write command fails with an "invalid argument" error. Signed-off-by: Anand Jain --- common/filter | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/common/filter b/common/filter index 7e02ded377cc..30bb9161d620 100644 --- a/common/filter +++ b/common/filter @@ -671,5 +671,29 @@ _filter_flakey_EIO() sed -e "s#.*: Input\/output error#$message#" } +# Filters +# +./common/rc: line 5085: echo: write error: Invalid argument +# to +# Invalid argument +_filter_sysfs_error() +{ + sed 's/.*: \(.*\)$/\1/' +} + +_expect_error_invalid_argument() +{ + local line + + read -r line || { + echo "ERROR: Expected 'Invalid argument' but got no input" >&2 + return 1 + } + + if [[ $line != *"Invalid argument"* ]]; then + echo "ERROR: Expected 'Invalid argument' but got: $line" >&2 + return 1 + fi +} + # make sure this script returns success /bin/true From patchwork Wed Jan 29 15:19:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13953857 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44E3B1CB9EA; Wed, 29 Jan 2025 15:20:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738164033; cv=fail; b=tJMxTHxO4WVvg0MWBvPV7KdZZA3HJ0oBy3/ANaOev7ASM5AaL6JGcZjKFZSJDC+AAvQySXPfv+3B4rT0+VbAerPcTMAf6IyZEXJAO4DH3YpNN+kQCmA9EiHxU5d/t8+L8nidBcd0sssYjPy+tt0BovbqChKg4WtPlslQXyY7+tw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738164033; c=relaxed/simple; bh=LEfD6NKdqirmRLK06cZwqwcGIEtSmEptL44H8wG98bw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=gEDp2fpOigaKXLZippQbk/YPlFHru4kujvaM2x3IijlFLk+w0A/JDSXI8C3kn/UiyEFE+yMFwtV3M2IpPOMan0a5YOP8DTGkyXSjpP3NaGjeyunDBGwtdbuFhoVOGVuduXfZoeNNpsaZJ6vxjOnybw2HI5qG2R2NLOa/OJof8BY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=LeQiVYKp; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Q8HhINS9; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="LeQiVYKp"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Q8HhINS9" Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50TFGwZE010852; Wed, 29 Jan 2025 15:20:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=QoEfWFCEZ74ziEnj5XuKx7A8AYffzCEXe01937ioCrQ=; b= LeQiVYKpLAE1dVj9RMb0hWshp1RA7bv75blJHxJjjBE0/6381jsYqFyEdhEaa4UG aOkZdOjj6CUf/SSviKsXkTPrW7+GPzGCqZ26zeg93KHek5iTyhwj6n6dprY9C6HV pGTXoi/yA+l3smmIEuD4sABa7spKe3KRL6WHcEShdtvGINbfXFxHqX2b0KX9rHb0 DDbJrj85vjp/2AmXemCuWUwN2VSyeW+JGt7CqAJ4fj6jOWkoRtCm0OTSNp57vCLp upBdS2pPaQ/PVajMGg2paC2vRLLudiHPG8OLpTIA13N9LcOS+fZzf4IVHBCHP2AX IhnPOqF4X5uioN2PGyai3A== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 44fmut89q4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Jan 2025 15:20:30 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 50TFHNnE034609; Wed, 29 Jan 2025 15:20:29 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2047.outbound.protection.outlook.com [104.47.55.47]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 44cpdfw2w4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Jan 2025 15:20:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZZA9syadOJ2fZKHKUfa+KlYp3Cif5j/MjuKOB/T60jRPYSg6M9+TpZdBpJGXKaMXEUfF6cvEg2hQHm5U1MCY8U2bBy84Uqft8Wd2w39TCJ0r1d+tVjHM9gpVjiUz8CNs6DevEZ1NntMlkzM4uW2imtOMGKq8M8e7Ghp/K4VDSzu3Rjev8cmA3ylomYVezEtmmxhGEZ36vRv7L/dxAjR4Ay1L5ukx7C4JsD0KZzHxJlvNFYZ3FWBW6WVJPPIGpDjPX0fNMi+837dHMRFLqPHr1gu/6N3PDDYH+4Ql10Sygp0xy1WRtzGGKLDCIST/K8l0aI4XF0+eQT2b4dd59SJcww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QoEfWFCEZ74ziEnj5XuKx7A8AYffzCEXe01937ioCrQ=; b=ayrNQZAI6ASWyAn/aC9JKBgOT4b9a1QCTfXNY0pCzLAXZUg37qL7Eo6uqEZ0YjwJatVdf9ZjdDNl4Oznu/EEOjbNFnsgkVzdfeogMSkokaNzw5FMcYL7m792MHBdiNtDvoaJxwsqSVWFpRWE6wd/tR7056zykKx0LJB2TOZylw0iqMa+zM06vP0tNvs5OsNnjUrdTu5XC9J31MxFLyOQYiQYHQEqjgAdR0YZQ3cweDtBeEu+ZsP2rLAFubLts7mnEvgEjM5I/f6li95T8nE/9Q9BJP+V1SBEYMYMHo8OlkyN5A1SGFYrHdgB20ZOV1Fr99SlUwUQa4YqECAklsglGg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QoEfWFCEZ74ziEnj5XuKx7A8AYffzCEXe01937ioCrQ=; b=Q8HhINS97C/xoSwtd7OJtLTR/fo2fy1cM9hlDVM7C62L5LIH9Y3C+ke4CcLM0Y27tx7IUiv8Cw1XKjxOh7K7Vn8Oz2m+XuE1SvjmRvymMj1NBhKa8o874jdWpwDwagFdUqSdbOdhTbn8ZzpgerdxTCEBLvaNTDKRl/Gz/Sm4C/o= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by DS7PR10MB4959.namprd10.prod.outlook.com (2603:10b6:5:3a0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8398.20; Wed, 29 Jan 2025 15:20:27 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65%3]) with mapi id 15.20.8377.021; Wed, 29 Jan 2025 15:20:27 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org Subject: [PATCH 3/3] fstests: btrfs: testcase for sysfs policy syntax verification Date: Wed, 29 Jan 2025 23:19:54 +0800 Message-ID: <3aecf19197d07ff18ed1c0dda9e63fcaa49b69d1.1738161075.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: References: X-ClientProxiedBy: SI2P153CA0012.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::15) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|DS7PR10MB4959:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b1901fb-666a-460f-ec31-08dd407875b1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: IwV2QAhY9CUzOLDvKvLWbvqXhgqXjr+DLla1Kj1rZkWX9zQfSr0k1r7Uz7wiOjvjgdOI+kbcOfVXfLoVpbByH12Gb7y6Uc124nSWd/nVThXKlafR6FRTAoLk/LW3RMPSfj7cI56ysJfgPurw9t6UTDRrTPLvCWJk2dVkYrpdLY/bMlgRp1po2v7ynQnEnJqUokVcItNvADnWjWeA1RI+ZzEYfKoUMBVeTiy83fI0UHAfe2PQUElhSotT/rCKj/jyKABmyHLBHEcLT2m1xrKnCTwqi0Saeq4+s0VvuHkvxtrKDxu1mxKnTKp+91wRG5/psjLM4kCBC2NEP9qQuUOOvEyo0XHsGIBEL1Zq7ucPT2ZCEirBreWIF4RzzAhaGYNbhcyZefFWiwCR6KNONkj5Sehmqg7P6Ykz+QeNB5Gb+imh9Jip0nKkO2m69Q3c6/xbjckgv1G+I0fs464E8cKczKlNFyABsmIZq36kL3F2qfWqjTtoV2GxqtP2u3GzZG4vTeEHsmY2l7lh7kAOVK0+bQ3DDH7JBwuNxAelN2M9kocSNo6AN4he6RE6HvrHyMngSyYt7kJAO0kYDzePB8QTi1ufs6ndoZjoFYNjyGYZZbVL7lYjFI6OeVR6qkp7nyFuqeEgWtw0mo9dKAOkNgSwKyv3Tm8MxJqLJUhql1xaHjqsBBwBO0pZTuL03whiILH3Szoz1Yep4Qyze9/C9LrY94Mw8VTn4HbIDtpHYm2haMx/+Q0axqmzAxiNNijXWlH8Zhzfuj/+YzXkBpb2kR8X5KZy7D37x0rLAkcoKqF8BZS4NQBAafs2QU6JuJgbEoL4slmczrgyqGxigrXzAqFJ+ttkBqAj/GOBB/ZVSkH8aNp8wNaKpBHXWU+gDQgKcqATFP/6yoNhNWl9xQSV0a2uQw2/EkCKKgNljXxS0k30f8bMreARlhwWsEXcawMNguyx6vDqwUf6vnWiHeNG+WaQ13Sd08MF+nU+VR/EnJpYkR0gYLzNAXw5winFQe/CTHc5AzNb7KzrnQDAzUW3ZVFrlqEkS5HEjK9M+sghgPBu7osrktUXXR6dajMBBImCRfY7ZjvfXtXS6yQGVHp0j8BQRlzgfF+w91mIVfOWLcZy4E4+0kC/HIAdn6+iFAC2BdR19XQVP+HhDa/EPUL4Xqvu3J+tCvLRwdqWTD9lugvDUC527GYqqxuDIU/P4FK2PgbdOwn5ZDds6aRg1XsWX6dOrRURNUSpP1TnT+icqxFq0uQXo4/KKc8/sN462JcsRJ0eKEz2AzINmpi97kSVLKVa01eEwDII9ps6QvQHJVS81oCx1UOrQXjI/29rfJA3yxb2PC7WlGGJVEFLYtzQiOpOnBXx94mbxUBBvu6M5eKEw987ZSrvsZrUfruOoGuje5ok X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WPsnZv1Veh8XI/vm/dw8G9USG6qsCorT8xfilJlzz1s68/aK6mV5cHyrCqbAXpIzhm1MsAPleJVOHISc1J61dobckLzWhnlQZ28MVWQVbYIKHXUJPysDYDccE3Ns34y+M8Kle2IY1BwvT14H8vcwMWX7OHVxoWjdH49itg84Lu46G7oRvQkHXqOmok/MMKRhMPkEeMTpOfYdVw8OlNpQHXHTBuF4Jo6RhWAPisEtvRhQN0l4x1sm0/5f6vQ5LhyW5TUalR+wCysq14Igf17Jtt2WzS+J6NTNx+S6WA8D602TBa20EkAiouR9b3VV7aHkc4IvGWxTVtzBlkW0+uy0Lkn6Sfg3du2+K8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7EMQnzO+lz3gV+bn2foKrtu+N+wYqH8VKrDe6Pz02GZy0j2pXlMjQCMHQ2HtBISG1ZcNT8weqtzTSmfQyPl5x4Gc2Cgr6a3q1GsldbvuE61FzG3x6oXVZEMKc7zIK0mxKuzZJhkguDo2sXE5DZTwZ7OV8Yd4wdvUH1XsKL X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 8BPwsf6CIh5+hUdxxd55c6y4Um91c1cXr6iicKi0ce05wnlb5wVH9VmbFkwKb9POmvXknhzEqhOx5OBrWbYoXNgXJ2QfVqXVL99VNqcSfJAJzmSCVpMdwgdRxJYqvC4jZiY36ql+bA/EmQuAJWarTyK1HiWUz1h4qXQb0OTszw6xiH8eXaTMEULbH3BxLsWzKvSIkoAXc6EYjDILvph5vyGiEzLHkWoL4GPBSTqJTHI2nZwj/36WSoN7zS/AH0nRMeD9oSr5+PvuYpW2pgPxsGpTSEpdhr55ZfpryHMil1AMu+yG/wvw7FBYtSFWPijt5OQ5eV28Hng5Qz/SqfPv4UTIeYOy3HkELymRDPls6DxbsmrPP1cQq4CbkDusbfaUlOZV5/zRtKv7PiRJbhX4MYgTQQWOtuDY1K9CdrpGDp6+oi61c0vGFFS1B8vr5eDRj/bkIHquawfLLi0xmalz7MPqa8tcaw8UucERdcJencrbc6oaMy8J5zSwFbnx/cbP4pYn8k3W5jOLmjt+Kyg408a8Am81Ccz/pL0Z7pulRGXj6b7sDxCNqVV4TTwjHaMt/kyo/fPOV8Ab1MZbh/5kMUc6ys60/AjW+pkC3G5BPr4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b1901fb-666a-460f-ec31-08dd407875b1 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2025 15:20:27.4286 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VlnE08GfHA25fXMQ3li+BJhUb29YBgwli5i7x8DCfYxkO3gJF/5JIVKVZET6s9jrd4MuSzK7562O5uaGLiA+zA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB4959 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-29_02,2025-01-29_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 bulkscore=0 phishscore=0 suspectscore=0 adultscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2501290123 X-Proofpoint-GUID: rTbKwhOJwcF9equ-sJJHSCha_6oyi7Of X-Proofpoint-ORIG-GUID: rTbKwhOJwcF9equ-sJJHSCha_6oyi7Of Checks if the sysfs attribute sanitizes arguments and verifies input syntax. Signed-off-by: Anand Jain --- tests/btrfs/329 | 92 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/329.out | 2 + 2 files changed, 94 insertions(+) create mode 100755 tests/btrfs/329 create mode 100644 tests/btrfs/329.out diff --git a/tests/btrfs/329 b/tests/btrfs/329 new file mode 100755 index 000000000000..9f63ab951eac --- /dev/null +++ b/tests/btrfs/329 @@ -0,0 +1,92 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2025 Oracle. All Rights Reserved. +# +# FS QA Test 329 +# +# Verify sysfs knob input syntax. +# +. ./common/preamble +_begin_fstest auto quick + +. ./common/filter + +# Modify as appropriate. +_require_scratch +_require_fs_sysfs read_policy + +_scratch_mkfs > /dev/null 2>&1 || _fail "mkfs failed" +_scratch_mount + +set_sysfs_policy() +{ + local attr=$1 + shift + local policy=$@ + + _set_fs_sysfs_attr $SCRATCH_DEV $attr ${policy} + _get_fs_sysfs_attr $SCRATCH_DEV $attr | grep -q "[${policy}]" + if [[ $? != 0 ]]; then + echo "Setting sysfs $attr $policy failed" + fi +} + +set_sysfs_policy_must_fail() +{ + local attr=$1 + shift + local policy=$@ + + _set_fs_sysfs_attr $SCRATCH_DEV $attr ${policy} | _filter_sysfs_error \ + | _expect_error_invalid_argument | tee -a $seqres.full +} + +verify_sysfs_syntax() +{ + local attr=$1 + local policy=$2 + local value=$3 + + # Test policy specified wrongly. Must fail. + set_sysfs_policy_must_fail $attr "'$policy $policy'" + set_sysfs_policy_must_fail $attr "'$policy t'" + set_sysfs_policy_must_fail $attr "' '" + set_sysfs_policy_must_fail $attr "'${policy} n'" + set_sysfs_policy_must_fail $attr "'n ${policy}'" + set_sysfs_policy_must_fail $attr "' ${policy}'" + set_sysfs_policy_must_fail $attr "' ${policy} '" + set_sysfs_policy_must_fail $attr "'${policy} '" + set_sysfs_policy_must_fail $attr _${policy} + set_sysfs_policy_must_fail $attr ${policy}_ + set_sysfs_policy_must_fail $attr _${policy}_ + set_sysfs_policy_must_fail $attr ${policy}: + # Test policy longer than 32 chars fails stable. + set_sysfs_policy_must_fail $attr 'jfdkkkkjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjffjfjfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' + + # Test policy specified correctly. Must pass. + set_sysfs_policy $attr $policy + + # If the policy has no value return + if [[ -z $value ]]; then + return + fi + + # Test value specified wrongly. Must fail. + set_sysfs_policy_must_fail $attr "'$policy: $value'" + set_sysfs_policy_must_fail $attr "'$policy:$value '" + set_sysfs_policy_must_fail $attr "'$policy:$value '" + set_sysfs_policy_must_fail $attr "'$policy: $value'" + set_sysfs_policy_must_fail $attr "'$policy :$value'" + + # Test policy and value all specified correctly. Must pass. + set_sysfs_policy $attr $policy:$value +} + +verify_sysfs_syntax read_policy pid +verify_sysfs_syntax read_policy round-robin 4k +verify_sysfs_syntax allocation/data/chunk_size 10g + +echo Silence is golden + +status=0 +exit diff --git a/tests/btrfs/329.out b/tests/btrfs/329.out new file mode 100644 index 000000000000..9794dc15960d --- /dev/null +++ b/tests/btrfs/329.out @@ -0,0 +1,2 @@ +QA output created by 329 +Silence is golden