Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp77258rbb; Fri, 23 Feb 2024 12:19:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUP+2zFnU+PH8197GQaQAJsggUepRIGReAh1W7urAyabafB0ytmbznMEWw9iHse4nxXg//l7GnLI9uUpCWBm2L+bxWwq9JDj7ftJ9noLw== X-Google-Smtp-Source: AGHT+IGOf1X/WXTOwehItjUA0S1mEb8cgLby96/6srANlsgKYiREfQdbZsuZjTDZkRejl+53T7QE X-Received: by 2002:a05:6358:e491:b0:178:75b1:c403 with SMTP id by17-20020a056358e49100b0017875b1c403mr1337362rwb.9.1708719571965; Fri, 23 Feb 2024 12:19:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708719571; cv=pass; d=google.com; s=arc-20160816; b=JT+Mhjg3IgUuCplEFZFiLDPy9sbKC8/6VUtE5KKHdf2f3pG8NTeI6vLODLRqXYNJwV WDUWC18wJOyBv1aT8ite9DPcd+yZLl+e9jKM8KhV3cQLBDPONbfDJ1l9okMB9hCJcZvI 19tKCAHQX/0I1nC+OMwdJqd5vO/N8s1pk1KKIfupLiZF2EgJ5Hv0f3tDc0nP1fHx+7Ha ZolGvOdnBbOVek1fhgQdnOJq4E4FaBLLuv7FdoA/S4Mg2DvRg/QA7QLUGAR5k0pGKKAU Dxl1GvoyOaSdEbBHGdEL2RozlLLUVaiHtyUyTBgDIhnNceifN4HVN9bBoDOeRqQf8nDg YoUA== 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=rXej12euGIKYeeNGe3Phyc1TOjfoA5JD2d5OlH7n8Lk=; fh=Z1YWgvxkmJ0/+y4FkLRSZ5mzUdtmyDAS67SU6REkp38=; b=X8bGNFXrXUc0o06kWLEtwlbYkaC6tY32QK+dS/P8o8A7JixE6lFOSnd1OSm/0PjtPa ieVsj74Oc0t2jfwYC8ht5hFpx75kCEBY1V94bFfEQpBBxOOsRDoF/jDwWfNERo9P5zu9 rHanEsqAEXXmbLjnmCfkiPbyvQXzkSxy+89g1CITz88yFsdOtabyoxI7WxDqgj6ysYxV dv5/bqK0QKahTEi6urHWTvVrIEkZzdECOYCWkdzpWXlVewf0V6VlULEWsrKlQpZHDtiF c/CsSzftjAIUyZ9si39YslQQOdhlIKtb5xkaeNkHA45KWHsJK/M9ztFlio8z3JGarvw3 +L9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gKIQCYw6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79083-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79083-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id c16-20020a056a000ad000b006e08068d6dbsi11342895pfl.265.2024.02.23.12.19.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 12:19:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79083-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gKIQCYw6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79083-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79083-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9E25F284A8B for ; Fri, 23 Feb 2024 20:19:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A5BA1474C1; Fri, 23 Feb 2024 20:19:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gKIQCYw6" 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 4EDAD12883B; Fri, 23 Feb 2024 20:19:00 +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=1708719541; cv=none; b=kn9sfnCGBzXsPuxQivDyxzeaJXIoMbvgL2wAUuo0oOBMQm4bxWBzt9qYUJjzSiFG7//sGr8miu9imTfPvBz9RVzbw4XEpNkNvvE+hEdaNAY3XazlpmGUluBXytXopkqA/c3Dh3/ZfabTWKlZjo9whV3l+cct78u0CUypXThNYDs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708719541; c=relaxed/simple; bh=z+O5DtTWdH0ZKK/rzyO8SbI2hdiB5u9quPFzJzLc4tI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CMerL/rocs7Mt53IZ+B8+cY28Knijz70b7ZKjinMSvRp/evspvCEsoLdS56RCG9x/2vu7351Adv6mNNUtn8RZCxLy6yM46n5JCHNLEZLFTppy1JBiLj9H1e13kEaxqKKjwdtfQQ+LCTFpcZ25zcAG9yuEcomYPRtOUkcbl4WYls= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gKIQCYw6; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6AD45C433B1; Fri, 23 Feb 2024 20:18:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708719540; bh=z+O5DtTWdH0ZKK/rzyO8SbI2hdiB5u9quPFzJzLc4tI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=gKIQCYw6N2s6DxzUOudonCL7QgrcZqvtqXzOPUFOH+VxLOtrysHPu7XL+NlloZvEc M70+tduBaCIt8No+omhZblUa/Mzl7oYvjMnnAzfu5RD3DDLd9Um3poxca4lj4KTyL3 hCNAj5bHlC1/CP32tnejlZN/ZKK6CSKe6uywv6P/S8EzyCX19tDNkk/XSonkjmu2Dx QEgz0zMPsc+/0PHhLXLpTtqiu9x/jGG7slM4aKlk+KZL/iEIFzp84RojCd8X80b5/Y 69A8cdQEYiKy6PtW40M4LrEqtRz9cV3LnwunUGH82BBDidB0dkzipTgIvK8vS7ATtX 1KSUPM5CQ8zuw== From: "Matthieu Baerts (NGI0)" Date: Fri, 23 Feb 2024 21:17:53 +0100 Subject: [PATCH net-next 1/8] selftests: mptcp: lib: catch duplicated subtest entries 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: <20240223-upstream-net-next-20240223-misc-improvements-v1-1-b6c8a10396bd@kernel.org> References: <20240223-upstream-net-next-20240223-misc-improvements-v1-0-b6c8a10396bd@kernel.org> In-Reply-To: <20240223-upstream-net-next-20240223-misc-improvements-v1-0-b6c8a10396bd@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , 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=2321; i=matttbe@kernel.org; h=from:subject:message-id; bh=z+O5DtTWdH0ZKK/rzyO8SbI2hdiB5u9quPFzJzLc4tI=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBl2P2qSO3J+Sp8+XgiWWduwESPxAdtI98A3QFLW tTkm2+0VqWJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZdj9qgAKCRD2t4JPQmmg c4i/D/9+Wl4OazvQpjJdSwVqTdj9zFoIfpK+clG8/d5OEyq56TGiLr/+bIjT5hreS2Z35QP+F3H WmOeTKVDA5NKwBuXDUzPnn/BaLSLqS93PsSktND9EI7ME/FNnyPHJOcVyhWnJDA4SmkT1cg2p4l YPA7AaYMc26/Qw6fwjCPnK0xYwGwZnYmG/lF6wvRv0gs298uJtAN/A1QTvYDkcBlOSuy8brXliA ia+L68IoF8vKIg0RM1OTOHQqDai5/QmcnXUlKN/iylrG4zIUdYWwLlCFxJCpN4jNvQET3g+WsYm 6QW1CCV/lNFDiR28G/Ce9DI3QUGa0fqVPAZy4D9/uJ4Tou/Yb5k3n9Kn/kLgRDxVWBzqngC+5qh cYsEl2j1fedeHR+TNX586VQbU2zeXXRgcUSUJvbhFVtFvYZWBytI3c89IZkmUSk7lhpHqtohVpw 2Gr+yC/dwG5c2FuNn8H480LryzeCZKvc/d/fot2OYU1yBXQe0MIq4fYWqTcbdDGoTrgENp0pNk4 OFEgIH7OkxAjXUYeJaMLkyCWWo+NVzC165nAbLs9Qxxp4nqOhm86WMWxDe8ef1NMsS1okqDAmPz nT3OmpKRp5vuVxG0onZYh2yUFCj97sZfWV7I77cmMxvMoUBt/cl9o5qKJMsK5dtXMbjRUi3McFG UXB0wgxRodV9cvQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 It is important to have a unique (sub)test name in TAP, because some CI environments drop tests with duplicated name. When adding a new subtest entry, an error message is printed in case of duplicated entries. If there were duplicated entries and if all features were expected to work, the script exits with an error at the end, after having printed all subtests in the TAP format. Thanks to that, the MPTCP CI will catch such issues early. Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_lib.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh index 3a2abae5993e..037cb3e84330 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -9,6 +9,7 @@ readonly KSFT_SKIP=4 readonly KSFT_TEST="${MPTCP_LIB_KSFT_TEST:-$(basename "${0}" .sh)}" MPTCP_LIB_SUBTESTS=() +MPTCP_LIB_SUBTESTS_DUPLICATED=0 # only if supported (or forced) and not disabled, see no-color.org if { [ -t 1 ] || [ "${SELFTESTS_MPTCP_LIB_COLOR_FORCE:-}" = "1" ]; } && @@ -146,12 +147,26 @@ mptcp_lib_kversion_ge() { mptcp_lib_fail_if_expected_feature "kernel version ${1} lower than ${v}" } +__mptcp_lib_result_check_duplicated() { + local subtest + + for subtest in "${MPTCP_LIB_SUBTESTS[@]}"; do + if [[ "${subtest}" == *" - ${KSFT_TEST}: ${*%% #*}" ]]; then + MPTCP_LIB_SUBTESTS_DUPLICATED=1 + mptcp_lib_print_err "Duplicated entry: ${*}" + break + fi + done +} + __mptcp_lib_result_add() { local result="${1}" shift local id=$((${#MPTCP_LIB_SUBTESTS[@]} + 1)) + __mptcp_lib_result_check_duplicated "${*}" + MPTCP_LIB_SUBTESTS+=("${result} ${id} - ${KSFT_TEST}: ${*}") } @@ -206,6 +221,12 @@ mptcp_lib_result_print_all_tap() { for subtest in "${MPTCP_LIB_SUBTESTS[@]}"; do printf "%s\n" "${subtest}" done + + if [ "${MPTCP_LIB_SUBTESTS_DUPLICATED}" = 1 ] && + mptcp_lib_expect_all_features; then + mptcp_lib_print_err "Duplicated test entries" + exit ${KSFT_FAIL} + fi } # get the value of keyword $1 in the line marked by keyword $2 -- 2.43.0