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/Kv1abuHxFopFiv5UqoosbR0DGxuAUtf27q1kxzrgaxg+j5oFyHbr651oVHwCgEVRIG5XPW+gA9TYZbW+fkGfnVXzHcbV3mUFwIkzP3OCphExfzW2QYYcOII9wu6upePYIhB9ipzhD2lrFY8dEV5jt4ktMsyCzF+74+t8eAadw+cxq+DnW3vKCp0K5mB4Pru3u0/DrXDJQwq33idoEAy7pDyKw5rpsQBZvSsi9bBAcsP4lj+Ye5iDxgWHbde/gxdVc0kUHdPOLEYFNUiLv12iNqCwfNE4em4MOsM2ppOw1Te8AJv2LzhulpDFuBMqT5HOqySLtDSy9x0xsfcxpdGxh6aCQXwkWjlGM/G0cRG5g2sFikk111KC+59Cc9NR6a07tKKMJxxEg/LGqagn5Cl+2FsMlISQlUPGlKpVA6/6vsczednL7J/UpHP/0WrJ01r2pQRC+G9W8ij/o09dv+Ry55HvogF6T7QikfrK5ryP5otimbid5qkvFKuioX2dutedWC7BQ+GT3dqQQ6bMLyzvCCMt48otasnUliFiRUr+jjUedlbzD/cGdtVJdklT2agPt6S/oB//vpmKHalF2AFqihu68/v3pdv+Rdvuwl+Nw1OkSbrUqADgnZkX4iTdoJBb1CaIH5PTXT6sY4wPxNacUNOH5Hkbg41PsGShPSqfmXsGsUE1Qqdl0GogWLBVj2BHQ9rd2r0kUH+z+SGez2zVqgn22evuMVETOf7NDVqLcy0W986yX+MJX8B9TZV2msP64C1JW4tAi0lVhYsl8SuODzNzpKadgDDb0d5U8AkpjSKvJ9tB9jVPGsUi8HCh8tfakS5atk3ufLH5hdaMaU9rPzu7yjZcHHRyZMKKHMzkiCAJ3iU35cqs6nIOM+pYy6P0KGHu/LLOVgavfiFEK1otZVejxABzo8Q1znYIAY8kCWvru3WGVjGpajg2E21nlVHT01ahDDLjAotAHwECstFOe94OyzqRYQV38cAzr3Bmp4KsjvaPhBD+kCn09SXV91Pu1kZoUfUqUuOjuskaPr/liiGxRC9kSk9jfg3IWFm+eDHGgW22V6s/Nh/vJRJkNisisX6ZfikmbrzbegdjsV6yxVkS5Meh6uQck2Bo0DEmNmWZAdxqHyZhHXfC2D19GqrZKI9U59A9WeAXWk+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/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JdZW6fJ6xQTya6wfrpnH4zBG8ACHnVoLIvyPmoi2D0V2rTGEjHHQI5xKy9cDHDyXc4ZmJEPPyDtpSk6hW8KW86sdZglqAxLVT3cVrijCxdFI0ctBUekAYU38= 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