Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp865946lqc; Fri, 8 Mar 2024 14:13:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWh//kF/G8WJLttqu0HoVs5WfDi2qM6QD5lWzf4sBAW9ha4AwOru29Vva8sAuxngM/117M0ZySvJya2OXv+QTvRDzxalC/TNQJCWuD4SQ== X-Google-Smtp-Source: AGHT+IHQzwORvg6pXOap4r/7UW9HHTfZiCsgWVM9msjx+4HT8SfpJy7RgKTcSzCaYkFYCWPG8gRX X-Received: by 2002:a17:906:a2da:b0:a45:f9da:b683 with SMTP id by26-20020a170906a2da00b00a45f9dab683mr179850ejb.66.1709936039181; Fri, 08 Mar 2024 14:13:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709936039; cv=pass; d=google.com; s=arc-20160816; b=GDNMeQ5zVCVQF6gjx4lm7P/1I2wIMj7BOOlvkmRo+l50RW14i7HNGscsQ4FGXv4ojH ZVhrRTndNF7yQvUWY6p9YT70kpmLJ/mshuoTDjuY9hOHMGEWjmFK3VGbhqWzv4e4uMyG 79Fau1UUouUetgFuuNJhSvO08qCZ3ypMe0jGnh2o12pofSJ7oAbPR25xlmrlX1DKi7UB ecsUGU8E4fhfrzdOGWOHA7qUikq0tDkyA0Id0pQH3KargjrETUChM0YqYS28eDNY9A9B 4txykK2aB82cThWmwBfroWAEjFWTpuKU+3etOBnpSDIvHj7qVOFjLLW6AAY4iqeOfBMI gKtg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=WseZU97Xw6Sh9Py15oLXSQKoMP/RbzvUkRrQxdG5gGM=; fh=2dk07KolaZJL0JeqFGRxwJVwvAyA78FaKBXVM6bwbyU=; b=V43Vb/3T8EoU6cYtFUnZ42d9aIoGVdNnNhTF9QfTYj+3ZMlxwpgTj6byUhV6AuyxpE EhNSWYG94+ymdFWnJ1uThf/VUr7LBIxHUGP1dQG4rcneOO7ZVO48YJiotCyEkgvmvrX5 h5ry/weGsknI0vjhTvGPONKuDnvKb1WKs2FXqv4I9HMZeIoRrgs51pgJ5lCL4GuQxCRa XgmxyVlh0kOdpdwI8OkxAG3p0GBGKOkbGJ119b5CnPyrMCh4ibF5i8boax+8Z8Cr265N 2MD5WzzxXQGvP+3HPTO73+Homj15IPdefHI8pwyIucZtFx/tVmbaW7uFevbmZMOt+ULm HgiA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S9cutr8c; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-97636-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97636-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id lx25-20020a170906af1900b00a4409c3eaa4si167481ejb.810.2024.03.08.14.13.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 14:13:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-97636-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S9cutr8c; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-97636-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97636-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A98F61F227FF for ; Fri, 8 Mar 2024 22:13:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23D2262A04; Fri, 8 Mar 2024 22:10:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="S9cutr8c" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 36246629E2; Fri, 8 Mar 2024 22:10:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709935858; cv=none; b=KBrRMyzY3LpYQTF1XTOUnlZk0lHS+P+0/JMaZ7FveNRpCQikhwa9Lik0LXZuOk3GUeNh8iXkmizPPFoYblV2a3w7NBctUEfrwYoU4QBgW66/AiytmL1+YKnNQPsNfGNKcgzIn49gBGk3Yb8tKfvwgKAvYcVIButBhZcu94/v10g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709935858; c=relaxed/simple; bh=qhWKz2Hx+SC+H9/gRU/WVHYJNNy2Y+xaeP8ticJ8Clo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=f+r+bQUEPdX+TFilYe+vRIcRo41rI0WBFW6uz3fWq0gLYQHcZE3SL8k/VWtXCAbXI49BMyfiNZbQbfXOW7R+pOLjt9qpNDhvxfZ6d2eBVV553DXJXlC3Ns587qNYwkhwQ88epTpQFLI23lDqLuK2k3Bm3Mooqvr2VU8k8hvfkQ8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=S9cutr8c; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3991C43394; Fri, 8 Mar 2024 22:10:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709935857; bh=qhWKz2Hx+SC+H9/gRU/WVHYJNNy2Y+xaeP8ticJ8Clo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=S9cutr8cVnAGZ+0+U60qZ15JFOgcPicvwRumj8vW+1Q8bJV9XVNj3twU2xmG8TfVn wIlBJjZvQywS3uTAmQ6ON4R8q7ftsjurNQV04O1g/7h2XtNOikZXo4PptIbDUgIeWY 4uQ2xVqbFfbnm7i/GvvE5d5X6nN+WFaWZ1anT9okaNLqMKGg+GGCaYFk5x97gLijha SGvl9JCx6xicYiArKscN1W8V3xDl4sdUanGueLXSgxtAgGAyptIGsfa0ZnqSJ2OqWg 2lOZ6Zfst30P9bRm3Rmi0SmrqHIaT152Xpztnbhc4LvCvVDPCG5BBiPwz/7zEz5ZZy hSTaM7TCeI5sA== From: "Matthieu Baerts (NGI0)" Date: Fri, 08 Mar 2024 23:10:17 +0100 Subject: [PATCH net-next 10/15] selftests: mptcp: call test_fail without argument Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240308-upstream-net-next-20240308-selftests-mptcp-unification-v1-10-4f42c347b653@kernel.org> References: <20240308-upstream-net-next-20240308-selftests-mptcp-unification-v1-0-4f42c347b653@kernel.org> In-Reply-To: <20240308-upstream-net-next-20240308-selftests-mptcp-unification-v1-0-4f42c347b653@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2735; i=matttbe@kernel.org; h=from:subject:message-id; bh=hyKC6Mx+pB1z+Ddbi6L//7nB2D7vJLp369U14/WWHzc=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBl64zJmqFOtfe7CB9QgpGxydbJnWN0jqXZ809Xv U41c9p8UEaJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZeuMyQAKCRD2t4JPQmmg czwvD/9De9QKe5Zxvv4hxisXhRIUJYxEldA89+8zDFVZuAhCSU7qgRFX73kvU2CMS49dX7G3NPT SvXiQ85vBsQqPqT/DCOMrvJN1+7p3tbvz5hZR5qtqAPlUX4ffkYqvXYhxvuAPcAwZVDiLHxGQy0 VQKXmfWRZHeIdBqPQHgB6TJH8HBxI0AqTObL55O85aTqJclrHUJ28K7yClN8HAss9UHdaO5Ncev z4966/oifLuBwLSDhR1N9Nri1L1JUp5EX3LP45Ka/NlBt56YlJeY0Le0qGBPd5W4v5srXgKYaOV ToQO6+QBPjZ+P+W5UPhu5P+OwZXYWzpA5NtF+W9PPkZAc28ok3L3WIxCQXPAsdkZvZqhPWmzPqJ Y0wEoGEfXXFYnQJahC0ePEu7AdLW8Tjsv6DtmEwBAc0iSMX3APQidlwNCn6UX2OA/Td35JoMTrO qnmpevZL1ulgaqL3zdbwylxJs/UVQ7eHzPeETp0cU4Gs/77awTV1oyLCIfCxkGO1N5q7o8GeZty ZCTTXvWrTBNpSODDrYi89bhnmSNe8xFaOOtIR/d3itt6t9VbCOt3lWxEvMkcBTD2IojrTzu9yZm E562xQx2DrApH70qyeviA07SEG4l1EImJ/vV/+ljzvIoKBr5fEgreXiPQQhe5gDSfRPV9wkko9P rlxj+7Aa+GtryzQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 From: Geliang Tang This patch modifies test_fail() to call mptcp_lib_pr_fail() only if there are arguments (if [ ${#} -gt 0 ]) in userspace_pm.sh, add arguments "unexpected type: ${type}" when calling test_fail() from test_remove(). Then mptcp_lib_pr_fail() can be used in check_expected_one() instead of test_fail(). The same in mptcp_join.sh, calling fail_test() without argument, and adapt this helper not to call print_fail() in this case. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 7 +++++-- tools/testing/selftests/net/mptcp/userspace_pm.sh | 12 ++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 9f67b9ba97d8..041175ec1304 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -452,7 +452,9 @@ fail_test() { ret=1 - print_fail "${@}" + if [ ${#} -gt 0 ]; then + print_fail "${@}" + fi # just in case a test is marked twice as failed if [ ${last_test_failed} -eq 0 ]; then @@ -2834,7 +2836,8 @@ verify_listener_events() print_ok return 0 fi - fail_test "$e_type:$type $e_family:$family $e_saddr:$saddr $e_sport:$sport" + print_fail "$e_type:$type $e_family:$family $e_saddr:$saddr $e_sport:$sport" + fail_test } add_addr_ports_tests() diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh index 4e29aa9c2529..bc2f0184b1eb 100755 --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -85,7 +85,10 @@ test_skip() # $1: msg test_fail() { - mptcp_lib_pr_fail "${@}" + if [ ${#} -gt 0 ] + then + mptcp_lib_pr_fail "${@}" + fi ret=1 mptcp_lib_result_fail "${test_name}" } @@ -239,7 +242,7 @@ check_expected_one() if [ "${prev_ret}" = "0" ] then - test_fail + mptcp_lib_pr_fail fi mptcp_lib_print_err "\tExpected value for '${var}': '${!exp}', got '${!var}'." @@ -263,6 +266,7 @@ check_expected() return 0 fi + test_fail return 1 } @@ -412,7 +416,7 @@ test_remove() then test_pass else - test_fail + test_fail "unexpected type: ${type}" fi # RM_ADDR using an invalid addr id should result in no action @@ -425,7 +429,7 @@ test_remove() then test_pass else - test_fail + test_fail "unexpected type: ${type}" fi # RM_ADDR from the client to server machine -- 2.43.0