From patchwork Wed Nov 22 11:30:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464611 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2073.outbound.protection.outlook.com [40.107.6.73]) (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 D5ADB51035 for ; Wed, 22 Nov 2023 11:31:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="HJpZuGQj" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C+jV0huIcUAgI5KhsOt8wtqNKNFocI/qbH7AeIgJT/KI+cOwxTaNsSfpg0cELG/Ks9bsymMMy3f2uNleeOJjBq9Xeu6gArpySDE/8U+kGpn6N3ggC/tyZ4PdZio3XjPo/9VPhY863Cp1ZFzPwlzY1pz+d063E0L1dFVnI6vFPxnHwXw87xbvTpO07W/hGI7QsRiQNNJrSH6QKHT1umgTyh/JsFvmL/TdRo8bB6NyCz2wEQwgHy9ELkmi/OJl2PD7j18uCV0vWbDExhsZTC3ZEG2nd6NrVfmg6tOx4kfCquE6bmxmizC6/PoB8Zg1nInC227GF2WhQL2WZ4BJOrBocQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=CPbFrkXrcB7ELReVEHyEEIziIOmLkrcv9jyYbHUsJGA=; b=UUzmddrrsnvAeXUulqx18mVTfP18cV0D1XxsOBKV2zz6ex45pEZ8oPiFkwJh6fkZ0EPq+CtbJ48NJttA/Yuvt1yfYC3ONnVpC5MkItADQQdQtZ9ReNV+Ch1MQefE8La8So9hinq+6KEIU+bppRhTfKFFmI9fKEk8Ec7DfcWP1jGZj7MHgpemvQQAYn7PguAoON46pAMQZXMzs3yrsN6NfQ7at4MU2oBAGFCRC1gJXS6TO4s5SsWOzoPM3YfmNcaKRzonq4pbn1elev7+p76xsao3hCJomslm7DxQR4lT5Lxbc+XBe7YH0npo6pbZ01IeYjEcjgFFvuDpvy8DYOlzoQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CPbFrkXrcB7ELReVEHyEEIziIOmLkrcv9jyYbHUsJGA=; b=HJpZuGQjeSmbmz2zNGo05+HQPNriUmT1cRp1QjcaQhW26W5OtDoS3jnY2Apc5yhgBjlaJcmNv2d+NeUHtV+2+NBtFHwENS7ap9qPPRieCIY20GL5McYTbV9nJLZB4fJoGdNuOkZiqWQ6VmbBk/tpIihxPh06893E+pfXaqQ6tvVHotmuj4W0LaF6hT5IGrMihg6dvi/zJmg2Nx+CGqPF11XINRlY1mIQOg7u9ChR0cGvm0P1NuBeMdm/Qvj3hLXt9xzBM+W9QY7BqbGVjFx+EkswMy6TLoDrSFz4H2YkcffNCiZyL79Kaoo1BQD9HAeseMC5gI4O6zY4GrMq5qeMvA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by PAXPR04MB8333.eurprd04.prod.outlook.com (2603:10a6:102:1c0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:31:15 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:31:15 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 01/33] selftests: mptcp: add mptcp_lib_evts_* helpers Date: Wed, 22 Nov 2023 19:30:49 +0800 Message-Id: <6e1422d85db5ddc8f8c0fd017629e36dd85acf3e.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: TYCPR01CA0013.jpnprd01.prod.outlook.com (2603:1096:405::25) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|PAXPR04MB8333:EE_ X-MS-Office365-Filtering-Correlation-Id: ec8f98ad-cf62-4f7a-ca82-08dbeb4e895d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VWtNxIs9DYAgsyJIBrdfEpI774BlWumn2CasIRwxTjDvZBdl4olUIb0QjQ/BY+9uGeadojAze6nngWlO7F59fSXhTJsn6kKovgq0mISADPpwM11M2f2LgQP2vovhYasymrUv9I+L3kAvC4Zy6Mp4p3RGybLBWsr4uZWqB3Uqa1ZdvNLL+apy0EA4OH4Gy2+4wa+JAiJ3JD8tZeU6AHZT+hd32Nv/CPKWUBQOlzQuP6DgoAir6VH6NCnASOhdznXhEehghK74bcxMbe7BIcbR71wXpdYbukfW+syWp/pkdvy/xh+4ZOI+vCml46QnS03tBZYOeiaJw5TKxEJFxXJZ504IGhTULB5eC2fvHfbqHLiSswkUtNkWljH6hza4d7C3MivjPaLlL33K1vO0saKTKlOjKcfGLzlXTWv7pgTD06MIesMOmH0fqW/cJJp40c73Yp04K8k6r6QLXXv1cqGJjYYMx04XqB8Bni6H851OmXicPJI3bZu2i1VFcm1/kOxJBy5MP+tKq93PoyL+k1vLjAbEBAZXtbAaw0jXljwvrffxdv7Nl/41IGCLTWrhPozy+rbyMTcz8cU4QRyVAFo8xuRADpr3zZrSY9aPU3z5Kd8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(376002)(396003)(346002)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(6506007)(2616005)(107886003)(26005)(6512007)(6666004)(316002)(6486002)(478600001)(83380400001)(66556008)(6916009)(66946007)(66476007)(44832011)(4326008)(8676002)(5660300002)(38100700002)(86362001)(8936002)(2906002)(41300700001)(36756003)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: te3luiXkZwLCZXNzb8S69j2q3YcaiHbSsbVH41SvVaXEDXlNDt+gF4ZT+5mPryudOGhatrVDXdPk4RNy48+066hdRfwPpzQ8+3QOx4AHnGURAGmYkAnzRHLMMAfFmiK7xHL2XyYGAamkqccaa7NcjPiBBKGKgqwcFEHm3+5UegcrBDoFMKAYRair2KvZJIPAx2F95gLZ2qjE7bKosciiZruPI/KuzU3oxHNtQ3NHEu+Ppi6iS2kXVQKLr8Ypdfl7YDCALNN3qD9xaMSS77xeyeW1Po28BEeMGQpAhG8AptY8DeS74O4x78LTc0uvVd1tz3XFrozZmVt+HcMh/ErieGxVmBmgTmvfzTdve45tPOUxFmHQX27mShcKsvscBpLUvrf6VUQkgeA5TIiWzU73QszachZ6vj0aFriJd7EZ3nAtt9yMiTpXPueSo+jNXWenivJeHpkz5ZyiNCqM1753xGVunB/XtdUxbbjOMv6fV1zmBsH8LKamUrJbcH2NoAVwMsTrpx0f0DcwgtelcA0eWM3pCQ2UkEYvlD4sdBREkxoxkARJFaYTT5s6jxpFf2z+eYYqfxqg+xxHxFVUXnXYv9WDr3mUPBIJ9H23KNJUSso5FUGbh6H2rE29wBhiy4u2OqjsslCCSRgXlqEJAXLIPwucPkDEL6zS+GfYgHlL8uRLJXmpB/AH9S6i6dclC+09nzqwHxxZsuCLLJcI6IZgu+8ZfuTPGz2s15YfidlyiF/n3EQqAZnwKlD3RfFmftR8Ctsn58BXNgsXYUxIR45VzqVgeNDGkDxaoPNKwDdIrMvgtZdigJ7FDXzRH5ZgQEPAzyBCu5DwmWEFwdJ+YFfdEBNwJ1zIHdqTC2gfLfKYyNmu57HDBkgRfgfKVAkluEyLG6GvksdexJ3gUQ52tTqun3mUsLsEy0+9/hl5L7uxwQNoUIRHSy8N1NNkedzcGFAhGayGmhNB8PNEdw7PYb5hA8+QVPoFYDBHHJ3W53Bs4/htgv76Tl7zdA8kZ8yMhsxzHRYgDXAfOx10LWv+w0GEko7axMN+Tpp/9i1VNzLTmK9Ajg5ZMUIQxKLEGp0x+I9dBNF2Mh8hGJRBUC85RHUzrx6YS4Hq87uSYYgIbtn+z/PfnGM/5mBMsI/UfA/INrR1ehjaw2KW/ccAJ6o2ADjvcywoEkSQWxm8xfYsg5SwX6kVErs3XCvTJPLC0VUR8BCmZ0KqEJmdBKPLcK5kYNjGKOOnp41uyob+i/3DdYdd+yhJkvAq8BqvF6izG/WX13qdPOP+jd5QtQF6l2Ph/ypz0Wa9KoM7fWG1Aycrq95Prs1cv2HmKrPohOM3qaVKWXs6BITcKmMBkv4gsEAZk+NGJzK9ZaotQ23Dbtciy2P2vzocveQ6oEJHT1wdYlnmqOYM2Fy8khF42lTdF7GfwasckYHz1BMH/C1CMyOi0W0h9XKyUJJ0XQVbo3+FBuCbQm6hHT9KWz+HXx6iCKAWNYCrEK/pmruz36+/S0JAczuw4KyGl+JDecON7kODNr7/B+4OFXLeK5+wiXRrp5e4sZCDOvSXZrBGRVipSqqLKpwFDv5kTsB5AMLCoCbnREcGfnnH X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: ec8f98ad-cf62-4f7a-ca82-08dbeb4e895d X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:31:15.1225 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gFlwX2VYjKrDREpsm8xR61Dg12kuE0eEFXQXUe6laSHJ42LLsyhXE0fMLqE+3HXvFIIt6Ldmwx3IUwCJSLsKSQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8333 To avoid duplicated code in different MPTCP selftests, we can add and use helpers defined in mptcp_lib.sh. This patch unifies "pm_nl_ctl events" related code in userspace_pm.sh and mptcp_join.sh into four helpers: mptcp_lib_evts_init(), _start(), _kill() and _remove(). Define them in mptcp_lib.sh and use these new helpers in both scripts. Signed-off-by: Geliang Tang --- .../testing/selftests/net/mptcp/mptcp_join.sh | 58 +++++++---------- .../testing/selftests/net/mptcp/mptcp_lib.sh | 63 +++++++++++++++++++ .../selftests/net/mptcp/userspace_pm.sh | 31 ++------- 3 files changed, 90 insertions(+), 62 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 68cf11ad75e4..ae326fd5340a 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -35,10 +35,6 @@ ip_mptcp=0 check_invert=0 validate_checksum=0 init=0 -evts_ns1="" -evts_ns2="" -evts_ns1_pid=0 -evts_ns2_pid=0 last_test_failed=0 last_test_skipped=0 last_test_ignored=1 @@ -182,8 +178,7 @@ init() { cin=$(mktemp) cinsent=$(mktemp) cout=$(mktemp) - evts_ns1=$(mktemp) - evts_ns2=$(mktemp) + mptcp_lib_evts_init trap cleanup EXIT @@ -196,7 +191,7 @@ cleanup() rm -f "$cin" "$cout" "$sinfail" rm -f "$sin" "$sout" "$cinsent" "$cinfail" rm -f "$tmpfile" - rm -rf $evts_ns1 $evts_ns2 + mptcp_lib_evts_remove cleanup_partial mptcp_lib_cleanup } @@ -461,12 +456,7 @@ reset_with_events() { reset "${1}" || return 1 - :> "$evts_ns1" - :> "$evts_ns2" - ip netns exec $ns1 ./pm_nl_ctl events >> "$evts_ns1" 2>&1 & - evts_ns1_pid=$! - ip netns exec $ns2 ./pm_nl_ctl events >> "$evts_ns2" 2>&1 & - evts_ns2_pid=$! + mptcp_lib_evts_start "${ns1}" "${ns2}" } reset_with_tcp_filter() @@ -636,12 +626,6 @@ wait_mpj() done } -kill_events_pids() -{ - mptcp_lib_kill_wait $evts_ns1_pid - mptcp_lib_kill_wait $evts_ns2_pid -} - kill_tests_wait() { #shellcheck disable=SC2046 @@ -2884,9 +2868,9 @@ add_addr_ports_tests() chk_add_nr 1 1 1 chk_rm_nr 1 1 invert - verify_listener_events $evts_ns1 $LISTENER_CREATED $AF_INET 10.0.2.1 10100 - verify_listener_events $evts_ns1 $LISTENER_CLOSED $AF_INET 10.0.2.1 10100 - kill_events_pids + verify_listener_events $server_evts $LISTENER_CREATED $AF_INET 10.0.2.1 10100 + verify_listener_events $server_evts $LISTENER_CLOSED $AF_INET 10.0.2.1 10100 + mptcp_lib_evts_kill fi # subflow and signal with port, remove @@ -3259,10 +3243,10 @@ fail_tests() # $1: ns ; $2: addr ; $3: id userspace_pm_add_addr() { - local evts=$evts_ns1 + local evts=$server_evts local tk - [ "$1" == "$ns2" ] && evts=$evts_ns2 + [ "$1" == "$ns2" ] && evts=$client_evts tk=$(mptcp_lib_evts_get_info token "$evts") ip netns exec $1 ./pm_nl_ctl ann $2 token $tk id $3 @@ -3272,11 +3256,11 @@ userspace_pm_add_addr() # $1: ns ; $2: id userspace_pm_rm_addr() { - local evts=$evts_ns1 + local evts=$server_evts local tk local cnt - [ "$1" == "$ns2" ] && evts=$evts_ns2 + [ "$1" == "$ns2" ] && evts=$client_evts tk=$(mptcp_lib_evts_get_info token "$evts") cnt=$(rm_addr_count ${1}) @@ -3287,10 +3271,10 @@ userspace_pm_rm_addr() # $1: ns ; $2: addr ; $3: id userspace_pm_add_sf() { - local evts=$evts_ns1 + local evts=$server_evts local tk da dp - [ "$1" == "$ns2" ] && evts=$evts_ns2 + [ "$1" == "$ns2" ] && evts=$client_evts tk=$(mptcp_lib_evts_get_info token "$evts") da=$(mptcp_lib_evts_get_info daddr4 "$evts") dp=$(mptcp_lib_evts_get_info dport "$evts") @@ -3303,13 +3287,13 @@ userspace_pm_add_sf() # $1: ns ; $2: addr $3: event type userspace_pm_rm_sf() { - local evts=$evts_ns1 + local evts=$server_evts local t=${3:-1} local ip=4 local tk da dp sp local cnt - [ "$1" == "$ns2" ] && evts=$evts_ns2 + [ "$1" == "$ns2" ] && evts=$client_evts if mptcp_lib_is_v6 $2; then ip=6; fi tk=$(mptcp_lib_evts_get_info token "$evts") da=$(mptcp_lib_evts_get_info "daddr$ip" "$evts" $t) @@ -3422,7 +3406,7 @@ userspace_tests() chk_rm_nr 1 1 invert chk_mptcp_info subflows 0 subflows 0 chk_subflows_total 1 1 - kill_events_pids + mptcp_lib_evts_kill wait $tests_pid fi @@ -3444,7 +3428,7 @@ userspace_tests() chk_rm_nr 1 1 chk_mptcp_info subflows 0 subflows 0 chk_subflows_total 1 1 - kill_events_pids + mptcp_lib_evts_kill wait $tests_pid fi @@ -3465,7 +3449,7 @@ userspace_tests() chk_join_nr 1 1 1 chk_mptcp_info subflows 1 subflows 1 chk_subflows_total 2 2 - kill_events_pids + mptcp_lib_evts_kill wait $tests_pid fi @@ -3489,7 +3473,7 @@ userspace_tests() chk_rst_nr 0 0 invert chk_mptcp_info subflows 1 subflows 1 chk_subflows_total 1 1 - kill_events_pids + mptcp_lib_evts_kill wait $tests_pid fi @@ -3515,7 +3499,7 @@ userspace_tests() chk_rst_nr 0 0 invert chk_mptcp_info subflows 1 subflows 1 chk_subflows_total 1 1 - kill_events_pids + mptcp_lib_evts_kill wait $tests_pid fi @@ -3543,7 +3527,7 @@ userspace_tests() chk_rm_nr 1 1 invert chk_mptcp_info subflows 0 subflows 0 chk_subflows_total 1 1 - kill_events_pids + mptcp_lib_evts_kill wait $tests_pid fi @@ -3571,7 +3555,7 @@ userspace_tests() chk_rm_nr 1 1 chk_mptcp_info subflows 0 subflows 0 chk_subflows_total 1 1 - kill_events_pids + mptcp_lib_evts_kill wait $tests_pid fi } diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh index 39bdfc6621d2..bb22dc17b0f0 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -326,6 +326,69 @@ mptcp_lib_check() fi } +server_evts="" +client_evts="" +server_evts_pid=0 +client_evts_pid=0 + +# server_evts(_pid) and client_evts(_pid) are needed +# by mptcp_lib_evts_init, _start, _kill and _remove. +mptcp_lib_evts_init() { + : "${server_evts?}" + : "${client_evts?}" + + if [ -z "${server_evts}" ]; then + server_evts=$(mktemp) + fi + if [ -z "${client_evts}" ]; then + client_evts=$(mktemp) + fi +} + +# $1 ns1, $2 ns2 +mptcp_lib_evts_start() { + : "${server_evts:?}" + : "${client_evts:?}" + : "${server_evts_pid:?}" + : "${client_evts_pid:?}" + + local ns_1="${1}" + local ns_2="${2}" + + :>"$server_evts" + :>"$client_evts" + + if [ "${server_evts_pid}" -ne 0 ]; then + mptcp_lib_kill_wait "${server_evts_pid}" + fi + ip netns exec "${ns_1}" ./pm_nl_ctl events >> "${server_evts}" 2>&1 & + server_evts_pid=$! + + if [ "${client_evts_pid}" -ne 0 ]; then + mptcp_lib_kill_wait "${client_evts_pid}" + fi + ip netns exec "${ns_2}" ./pm_nl_ctl events >> "${client_evts}" 2>&1 & + client_evts_pid=$! +} + +mptcp_lib_evts_kill() { + : "${server_evts_pid:?}" + : "${client_evts_pid:?}" + + mptcp_lib_kill_wait "${server_evts_pid}" + mptcp_lib_kill_wait "${client_evts_pid}" + + server_evts_pid=0 + client_evts_pid=0 +} + +mptcp_lib_evts_remove() { + : "${server_evts:?}" + : "${client_evts:?}" + + rm -rf "${server_evts}" "${client_evts}" +} + mptcp_lib_cleanup() { echo "cleanup" diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh index 005251b61d7a..55ed3ea0a691 100755 --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -34,10 +34,6 @@ AF_INET=2 AF_INET6=10 file="" -server_evts="" -client_evts="" -server_evts_pid=0 -client_evts_pid=0 client4_pid=0 server4_pid=0 client6_pid=0 @@ -116,18 +112,19 @@ cleanup() # Terminate the MPTCP connection and related processes local pid - for pid in $client4_pid $server4_pid $client6_pid $server6_pid\ - $server_evts_pid $client_evts_pid + for pid in $client4_pid $server4_pid $client6_pid $server6_pid do mptcp_lib_kill_wait $pid done + mptcp_lib_evts_kill local netns for netns in "$ns1" "$ns2" ;do ip netns del "$netns" done - rm -rf $file $client_evts $server_evts + rm -rf $file + mptcp_lib_evts_remove mptcp_lib_cleanup _printf "Done\n" @@ -187,24 +184,8 @@ make_connection() # Capture netlink events over the two network namespaces running # the MPTCP client and server - if [ -z "$client_evts" ]; then - client_evts=$(mktemp) - fi - :>"$client_evts" - if [ $client_evts_pid -ne 0 ]; then - mptcp_lib_kill_wait $client_evts_pid - fi - ip netns exec "$ns2" ./pm_nl_ctl events >> "$client_evts" 2>&1 & - client_evts_pid=$! - if [ -z "$server_evts" ]; then - server_evts=$(mktemp) - fi - :>"$server_evts" - if [ $server_evts_pid -ne 0 ]; then - mptcp_lib_kill_wait $server_evts_pid - fi - ip netns exec "$ns1" ./pm_nl_ctl events >> "$server_evts" 2>&1 & - server_evts_pid=$! + mptcp_lib_evts_init + mptcp_lib_evts_start "${ns1}" "${ns2}" sleep 0.5 # Run the server From patchwork Wed Nov 22 11:30:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464612 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2061.outbound.protection.outlook.com [40.107.6.61]) (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 38CA84AF66 for ; Wed, 22 Nov 2023 11:31:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="wsKo/mgr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AEHhrO3y9ImlgYCUzxP9Tf7Bky8+dcDHf2fTU+6eovgBCJHYPL+x608vf5GbAK8lMO1DguI0MUKoqmiJ5UlMW2+MFFDtoyGqVZT7GqQadCUtLd12nT8AXjmbvpdntOlyUYlQZr3atYNETlqLs7FKQ+BAN6TrGihdhFJif1iabUchlQjvmFWzod34jDH3H+P72JS5gz1sto13Pi4CYrLiwPCLHJ65uSk78dGvY7C56nAOhVUDB5x+SCjrBAinapgW+OULxsCKtPHDkL8PuWfsbmhe17awSrJ/wZg8U2z92lSxASwyjMXh3AhCG8DWWPI3JBs/z82OPktvlnqJCw8u4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=zegY6h/fmqcRrg/93R+5oej5y1CXdTsZnW37dwfOeEA=; b=AwH2RPejDE1RMdERp3U0ISYXN5S/QuSvS3gXYQR3Y/oO4n2/LqyMd5b/pf0Sak1FuqjTd2A9/fNX4MoGXrKQzeJO08vYPvjDJB+glYje20n9n5Z9pFTqU8FHSB9upHwBFHqWlluUPFHDAZS9BqTIFjnFYATnt7CWQyqe+fzN6haWptJEpHC/dzkYIAI+33mTZsF+rT51ipJNSEOGmP4Y4EtjGdTEbJyLPJUY0CL2FUK0/jbvbdoCPUSvMTRES5Fh+5c9mbWMkWLwf7GftZuqI4JPMuUK9RyMyyHCht3VzwutqOMEeTqfewRi8AqEwqEHAkKvfj3a+X9WWa7OYGKiNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zegY6h/fmqcRrg/93R+5oej5y1CXdTsZnW37dwfOeEA=; b=wsKo/mgrB80JgAjz2QrzVa/+gp7VNEsDJNFR0P8zWc4TPml43/Ru/fvfoMOXJyKRc0q9LTkQYGPQ5IuHyAd1fHMYOU8fpwGR+2BvxC/BFlt08XW+TwN30HXXQbnimF+ck32tSZtxw6BDYDxtjwZ31ZGkouXEEPaRHHsehmKIiYS+Af38lgtmkM4jxttBtIp9j/wHkzL6VzGkTYFV7MeFZ2AeCtH5OHgdITrw6zHJcTCh0cXOmf4+mgmD6+VisSK5qDrLSK1Yq355AtCfqwk5HCPLk4vC+ST2mbq4vR2L8SkiiqEfTROrMeQ1ua706Jr043tcyLuNjDVhY54sAyjPHQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by PAXPR04MB8333.eurprd04.prod.outlook.com (2603:10a6:102:1c0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:31:22 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:31:22 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 02/33] selftests: mptcp: userspace: capitalize test_name Date: Wed, 22 Nov 2023 19:30:50 +0800 Message-Id: <044017799f04e90b0863391e2c401500c49f5626.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: TYCPR01CA0019.jpnprd01.prod.outlook.com (2603:1096:405::31) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|PAXPR04MB8333:EE_ X-MS-Office365-Filtering-Correlation-Id: 02dbe259-7603-4759-7dfb-08dbeb4e8de4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Jf/CHuKEUMJpbdx/MG5vC2LIioO34+k/oPEnyEjLVM6CudkWjF4ATSrGb90LETi8uB4E25TApNm8/d/d9X1UKzfWaMFSrmpDz1ghfIWfkWEe6AB1TejFq7pKLB4Bbp44UxAGn49RzAtbQg0ito0NI86PDBIUUyeEcxpevFTicnO7K7DNExsvysCBfg2p4oyY5hEZnLbpKxWvmUmlkW8NF1rncP6tnbSYaMN2m+FQE2UY50HVzvHmVT7w7+oSsITBmQXeDqdu8pMyqDK7mrwzBCDqdee+7O+nQnxYY2LodCq/1f0+VjcKQ0Pnbgq14+KEjQa5snZdFXy6LrbKxkXZD9yrCaV2klrat4GHCvj6vOx3AEaBNgzeVrn6ysmN+OpOq7MqXDIhlgjBhk228T5TxUN1yJ0i6xXB83Zr4/SzAnwmg23m6Pay005WfY11tJ1XOUofP4AsNRUzyvYfwdJM7LgbPPYwKu2oTFYdEZli/MRSgY6H0O2kziccas4hVTotE6r2njesjEdNNEQQkh3t2uTUzg4Kp9iBa/SN0DYNxYfupjTHg6pEZB4VG6V2bWRigtrAqnY1sFwn1ETTzVmuEkRrmQwAKSjKl2otoifKk+w= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(376002)(396003)(346002)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(6506007)(2616005)(107886003)(26005)(6512007)(6666004)(316002)(6486002)(478600001)(83380400001)(66556008)(6916009)(66946007)(66476007)(44832011)(4326008)(8676002)(5660300002)(38100700002)(86362001)(8936002)(2906002)(41300700001)(36756003)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qQEvHn6YhSw3dqJ5e8lwa2atd/A1n5vJcyEHiGtY+4+0JuTkFlibi8raRC64F0xsz4EARPrPap/WX/Igbt8l874CY1ZXHJ0opTXJE1znTNQfradMSnljOVt+wTmt+9WUBEw2jrzzVJh6rq54EzVSISIdwaFCPK3xa59bjAtG9n1Kk2jPlwrrDHa/REtQeGU8k2u/aIjQ2POlFaKekzU9n1RMYxfYt1BrXCARtEBwdwp9etWs/u5Cz8ECzKrBjgtwtz1FaVAYrD0mdAAUICxCGFXzAgydcceP2FdPwjaYCiil8HL1WuYk6G74F+QBzb6W9+xSIO/2zV+AYdQHodk6tRfxC7+6zrGEVfp72KsvT8nx1+tszQzC25VaI1dL8FZIU7P7lDsghrrDKHPlLM/UKiKuX+4AyA0+qkcCA4K3yzq7I6/X3rzL4aFWdYbj4NBHlQNgLs/d0VQtxXDf213a6SGvuMNwEhyfALDfAW8H+XG0dfOe2rycMjbQgL5uomQ3Kd4ReKvIRz4PCsv36Yz8ZHPk5kaMXJSjfQHa0voxev4e5bfAGxt3tXnP5s1XKm/Henp6SvPBotWz4uo3uBPswD5anQDuh/AalvCOFRXxYQxNgdTE+g6cAq2jJt7uaipMhnjkXzeLs5BUPVHiBQvNt92ZGph+JeJEgjm6u4/IDbIYYO391qagztI0A/AoANpTIvJqfrne24rC24mDB2WUXoxucycDh2ckxOrz5lxa4SDLnwRDqfWewhTxC90n/hmjbYTsob3OQIgtFoeOVksNNfMR+KhvMuueiCFS9E0c2Xn5QFgfN95WKTfiZu0aNRKs2NVqFO4IPKXyqQf3oCvDM9ajDbsd9BmjaZOAgg/vd5mBUwh8y2PMNdXdgkAlZr3t5Ibd6s3ok/av8gE6We38d8fIRFd9bNn5sOFBKVJ1+sd4GZhHMo++/i6lBL+rjzUZChVLlGpiu3K1/nqAerpNQi6ua0vG0VOFkd852eLTXViG9X3u3PcB8/Roivm6xanhYFltRbTz8mcl7fg8gDvvBlWoNDS/hEolUWUaobguT88cTegNhP0/Jn0ovyX3DK/g+isZNv90Rfb8fMLVShEPLuuGKJG/AY4xbS9GQXa/geVa7jSpkbxWeiA/SbpA0gMbTfDbX2clOA4KAPVh7WayI6AM74hrKgEYfWbJufJ032PCJuNzVqHoXBmx3t2gGfh0EAr6JjbjNdaVhnDO2DuOLj1ywsak483UODJA24CUBPcv3+KRDTuwT17GonEJWJd3VLFx9E2z+507jHqSeReLfbq7UCLgKm1pK/5inr6jPv8+q034J5Mgpohlq8RP2hLn6YbFRN8gG5Qvswa5lz84r2PJejdNb2RSrJ0lpdbBK5g61OdekyAOoE8PG2C3WgQ65nPV65PF23CSUhdCoLE4CM4sxO3tePqDIucKiaaBPSfdLCsVgNTtYyg0d1L+LAwZtltlXsatCA6LqxfTAKt9pyNPQoUfqv/les1BVRbjvbhbB0qoMGB3FdkyABlsizTNwErpi2+c5AWJ7bjG8E6/paawFKXDyv2Di652txeLl+t67THfZ58SCdUt3h5oU1bD X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 02dbe259-7603-4759-7dfb-08dbeb4e8de4 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:31:22.4816 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Nn6dyWE5f4/RuJzgSKlQ5tn32zJm25V48uPCJPU+nRVT+M5O4mqWto0AocEA8R9u++qpf/9Dg7M2JQIJfrPQ0Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8333 Most scripts use uppercase variable TEST_NAME, but lowercase one are used in userspace_pm.sh. To maintain consistency with other scripts, this patch renames variable test_name to TEST_NAME: test_name -> TEST_NAME in userspace_pm.sh Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/userspace_pm.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh index 55ed3ea0a691..f1d5cd4ab95a 100755 --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -55,7 +55,7 @@ rndh=$(printf %x "$sec")-$(mktemp -u XXXXXX) ns1="ns1-$rndh" ns2="ns2-$rndh" ret=0 -test_name="" +TEST_NAME="" _printf() { stdbuf -o0 -e0 printf "${@}" @@ -69,9 +69,9 @@ print_title() # $1: test name print_test() { - test_name="${1}" + TEST_NAME="${1}" - _printf "%-63s" "${test_name}" + _printf "%-63s" "${TEST_NAME}" } print_results() @@ -82,13 +82,13 @@ print_results() test_pass() { print_results " OK " - mptcp_lib_result_pass "${test_name}" + mptcp_lib_result_pass "${TEST_NAME}" } test_skip() { print_results "SKIP" - mptcp_lib_result_skip "${test_name}" + mptcp_lib_result_skip "${TEST_NAME}" } # $1: msg @@ -101,7 +101,7 @@ test_fail() _printf "\t%s\n" "${1}" fi - mptcp_lib_result_fail "${test_name}" + mptcp_lib_result_fail "${TEST_NAME}" } # This function is used in the cleanup trap From patchwork Wed Nov 22 11:30:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464613 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2062.outbound.protection.outlook.com [40.107.6.62]) (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 5433A4AF66 for ; Wed, 22 Nov 2023 11:31:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="ZtIxfVW+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SDxHaqwJxX0YWkXBzCEVpJGZDJbXBFZjNTJUGuEpb+BxzvBMUaqIeWfT1SBp/rhZLpoLhW9pyrG6cXQEPjeCUXvo98JS/M5wO3cZPwXJtgBj/Q/eSAqYTvZ2tB9vhG7HzxKUNX5SL1o1kZK2UVS58kAIGS/nm5T1nMyQN2/3lxb7+AGXU0TY320KUzPWLOlM3twr8RWqiF3ojQD0SmlIejlQZoqdtwQrszdGcFUzOno9qvhjCckPLBoIJXnU3Sn3uOml6B0MJub75qnhbDUCxaV8ei88OQ2RSkdNlHo1UTLROCaUfmMqBSq6ySdQIhl0gqNjcS2V2pRoYruEkrfHow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=0oJUm5/XW5RWrBTHLH6gmLAnZQOlxQLI41btQj7K25c=; b=heXPwMj3Dj8dd8CB4p4fym36tnDX6m5e9JS//xexNE+cmANVYng2mdpTq05dCUVk/mPj31CGn2jwyJNsp7/73stTkbSv6KQ1UcZZmjLfBGuK2ylFONa6OmPQTcf248KU4yWJquSMDWUrbTF7NCBjpbEolUuOnTX0/GD6OeOTSlE2ZT2g0uJDTCGDBCaXIt9S7D+JTUGBsD6wBEgm7gUdHxcHiKsMuSuBBbb+CCDnQb5PlVEnpYP/8yuKGTa2yJKP/57xPfaA80qhHhZNIbqK1oZy1p6Uu41KUxT28rII0hIDtMOJxAx/WpBkBOWN4DDYXlEc0cnJVurH+ifMm8oXhQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0oJUm5/XW5RWrBTHLH6gmLAnZQOlxQLI41btQj7K25c=; b=ZtIxfVW+5p3ff3Xx24yXrlDoRpKg+4rt9IIxPq9nPDsHom7e3etQRFccaq7vukBb+qK48GyLlmcI0oAdopXwWia+s7jPcv6NH+hfCeJH/PtViLinROuh0K4QjNYJ4QLqFxTn8N974z/C4r6ht5Mgef62MjFSJeuJzJcbjt6kSjsDbyxi+48ACDCuaNwbMpl6RSR9rb05l+w1G7mfQ5lXeLioi3dbMqfgAm5U73Hlbq9CoqpQpX93JiZUkdQr/rlCKcWbO4w4z5ec1tj6cn0A7EIQSHvmK+uF0c7Q5wgrVkYG9O3xshgHQ65nvdB5ni7Mz1au2aWsisQQMj23XnOxZQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by PAXPR04MB8333.eurprd04.prod.outlook.com (2603:10a6:102:1c0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:31:30 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:31:30 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang , Matthieu Baerts Subject: [PATCH mptcp-next v4 03/33] selftests: mptcp: userspace: print colored output Date: Wed, 22 Nov 2023 19:30:51 +0800 Message-Id: <82489cd44a1cfdae0e12d1c08008c65ed55ff0a5.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: TYCPR01CA0024.jpnprd01.prod.outlook.com (2603:1096:405::36) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|PAXPR04MB8333:EE_ X-MS-Office365-Filtering-Correlation-Id: 57385423-a2f0-4526-32f4-08dbeb4e924c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8bWtfI14y2XAr4Eb9v8cXqTGx8JSbxwuWK6MVxu0ULV/9UAEbG/4KA4MQA1UZp7JJSRx76CXYwbNGl7t9xyBDaKIUh9R0F44DgxFetO2LXINhtg3h+PyCwtysrs8BDls/uTqu+TQcXp29zDNWnq1SK8T+wajYxMu1pVcm0zmgy7enOGopykp5X1gk996Y07w26P56HQbgaBaG/h7zIdHwpV3z5/nNx/c7Nzsi5InshMk94jCuNNjivCzeDbMXQ9zEMevMZ24Xpvuf7hgQ+GRPPBpuq3YjYlldcJzdwtIrmobbOb/HSa7+bXYtdWDnOm7uWW84yOaDjVseVonLR8IlB7ZX2Yym1jB1wo5kA1TCJTsL840u17i8lIfGtAnkAcEOUAtxt2aMSPczQ9kbRb0Bsp3rkJhMYWUMX8EIPIQj3Kw+VrdmcbtckTP+6T+wOl5t1w3ygqNaMntl1CIozSFqM6XAkOBDNoeFoOr5wsG0I6ePymYhJoJ6OSdT5otusmKuueHf+u5vojtb1EIEs/7riHEypbuuqAOaAhfQP6Li/gJAEopBbpHpLH++uB8EwbeK5mc6T3UFbL88nJyKjLISxIDY42J4+5nQ7bNU+uPVWY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(376002)(396003)(346002)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(6506007)(2616005)(26005)(6512007)(6666004)(316002)(6486002)(478600001)(83380400001)(66556008)(6916009)(66946007)(66476007)(54906003)(44832011)(4326008)(8676002)(5660300002)(38100700002)(86362001)(8936002)(2906002)(41300700001)(36756003)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: z/wSa4CyFL0Zn7OekfebG0jfvuOksb/s39/TxuKWv4B8WWA5NHzZwteaym21AmLzphdnUtstQ7izU6l2Tdy7OknKVeMXI1J1ENDrpCMP3gtICresGqs2XbvmoO/DphJwYW43rR8CgSxwIKNmU9qyDg1hp4liYfoKSladPZRXMb8GAUZFKXDw/qW9QnWFaIHosG62aJDVmTU6nc7+3om1v2MiOqjOzb9zAMbQwZNs1OnHUYTm6qAXIV7pEgIecwY9dwiRyYFHfgDgiH2SnbG3OOe5FuG5JSCKBLAz3uT9auHNHEMrdL9T20tsvAco419B5TqtBjFCOoSUriHnLqeTicOob5IfqAp28by+Xi4rB9nea4NlbWtlRZL/5oQw2TyHOCitOof0qT2avh8KSOwZPleaoSt92VVtYVgQbGKsgQfeGExuI+CzRMM1rOyyMJXgFQDHSvWOL2rzXtAYLQxSaL9n94GMWHVcQd+jgGXXICnZO4cD1vX3rkPcOFklhm+hzwtO+re9pgrKPbFCH+waRtALDeD3LTB4oHMiimvwugw3V/1vdOxe3VuQvqOS6S07WVkPLakY9KUSL1v9eEbnUr0VfRPwqrhbL0QtaukEjDTX0J7M3ZnMTr3JNL3SoXOQcT4S60eLBq0mWLMMu1HpREKY5r2ZpLorhwMaGbZy8I4EDFdU1KwDVdQRvDYUISk7QvvMPkLiLvRqxB297Javpaor08YOdlMkv4TaqQWuLmnPl8xdbHQezHgD2Q9gRonG2rDZcln2/d5eP2XaTNYN1p8m4TJN/Fyllcf6mcoxqJZz8ewiO7OKzEtTlHfjvQAXGxmfy+b7WB58jfbU9SZwyYoBKP9BrsVuTSLlwfyATCNc0pg26m4tRF6jz6zUwpFwEx0zxd4dTk889t8WrccM9Vtp6Jw9fdVW56/W8j895vpYUKKB4oDpmA6yp2eABdTxoQD10vr4lQb+wTEEdth33y7uguU82jGx7qtwFzDYAN/aAmwfKOdtlV0Hu0OtwXfNUod0cvSmy02fEvURi3Fy1SevX2JpseWByFiyXVPR4LrhfuXozJAPcLvizdva8PTWbCWoAEhUkLxuleUPFtAyM1u369NvHE4KDnrHOGwdD39I9BSyyOJV62dNs6xBC2fWu6uQGX8UV+c2ebmv/mj8q5/YricXIIweEVx/ytBackJko/LBtvolrm3GE17oIXuijSz391rph2JDZ6SzPKS35wDfXmis16TwhUmeL0B29+fOQmdo8gv8aLt8oM2AORMtVYTAsGnvAtWGKlo0QTB0vTUR98C8cnT0ou/dYseOVMTr9IvMYgtIAJ4kzEfQrK15KS1+gACPTDdpyAahHbjYyZPl1b3b9rHpXdMQnYUtDbVWkWQ9ZfVG2wzQz8K8gZQNm/fWFGViln/kHSnUjqOmrzP6NoRMUEsYCqx0w71/rMdvEuV3fK2DeHKpJcGRKY3BhD2rhicHKxx44D1ck7kLhqIuKjWn12NoVcoa9hADznzIi1lTr2mYY26uIhXWUpW14ueHwlWYH85ZRutoAxvXmmyGzld/12S6pLF01w6R2uWOZXsyY9hMA/P9AJL2wyYp X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57385423-a2f0-4526-32f4-08dbeb4e924c X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:31:30.1121 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5kBluNWX2t9C/dUxVj5nUaWY9iS590VqpcRYEabKc7d3DLGUyFtJax5MdebSSnwveNntEbUdofpbkcApXCgQfQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8333 The helper mptcp_lib_verify_listener_events() will be added latter in mptcp_lib.sh, and be used by mptcp_join.sh and userspace_pm.sh. The former prints colored output while the latter is not. It makes sense to unify them. Use mptcp_lib_print_ok(), _warn() and _err() to instead print_results() in test_pass(), _skip() and _fail(), and use mptcp_lib_print_info() to instead _printf() in print_title() to print test results with colors in userspace_pm.sh. Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/userspace_pm.sh | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh index f1d5cd4ab95a..c60143133277 100755 --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -63,7 +63,7 @@ _printf() { print_title() { - _printf "INFO: %s\n" "${1}" + mptcp_lib_print_info "INFO: ${1}" } # $1: test name @@ -74,27 +74,22 @@ print_test() _printf "%-63s" "${TEST_NAME}" } -print_results() -{ - _printf "[%s]\n" "${1}" -} - test_pass() { - print_results " OK " + mptcp_lib_print_ok "[ OK ]${1:+ ${*}}" mptcp_lib_result_pass "${TEST_NAME}" } test_skip() { - print_results "SKIP" + mptcp_lib_print_warn "[ SKIP ]${1:+ ${*}}" mptcp_lib_result_skip "${TEST_NAME}" } # $1: msg test_fail() { - print_results "FAIL" + mptcp_lib_print_err "[ FAIL ]${1:+ ${*}}" ret=1 if [ -n "${1}" ]; then From patchwork Wed Nov 22 11:30:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464615 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2058.outbound.protection.outlook.com [40.107.21.58]) (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 8FB1F4AF66 for ; Wed, 22 Nov 2023 11:31:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="4GU3+3JN" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ocrx87h2pCma6TT0oxMQs1t+mMHJZ2U3GSC5iM/87eUYgfmtmHule+431sJbLnYm0FhkZg/4TKOeOExOs92H1RPOyewD+vGDAxSwOWyfM1Ex71YHYSYO59PBIr1oZYBCBnLwUzFrilnBPnrNWw+3RuGRwUt386hzLTa5AlLf7V49vyqFwn65WJ6vcpmcT2B7o4LTBawwdZESNH/FORNFq2BUvKbpQFfMylctm+icf710t6ETe6vA/8NlmhbGSWwi9oznPMbcyJInHrFD50KTDR0FaR9iMNfGX88vk82VF26n3gVdgRoRgcskMsCtJJmAJ1qz9JjEUW29Td9bZuMUzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=LRCZdrax6BmbwS4g1wBCUvMGj/SR7QZC84hoyhlIXw4=; b=XatG3m4d/DZxI4v0V/nggFboP9dkSUB1jrFrZvY8uJR/pEMAD5WLGW6856Tb2LT4pBvl+zx99Hg0aYEo3dlzGMifTddL6u9AcGsTsrZX+jymbJNpBcpP8pQXZhlx48exArGWMfjCcVjBaq0FGyC4TBF5BD0n8m/osy6DUDdZQABh5Ox8TGqIMS2N/iOI/OnrpV21U3uDVGKBiFhYfn6XQRXHw3X/NtN8QW31P7CDpRjkkIGGwODsNI5/qj0U7GQb7nB/dfb/GLTb2XFOL0jvmvwN/VnERofKET4jZOb6Cvk5RT9VhvrxgX3EZYvYUrfKg4qqQY33QIWWZHgrTymwsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LRCZdrax6BmbwS4g1wBCUvMGj/SR7QZC84hoyhlIXw4=; b=4GU3+3JNvdLVNMR5SKYyDY5GCOBokvN7KoITsrlncMzr+QbljwcZhFwbasjmyIpBZE+4hHVVpU2kBoS/GXu32XM/v5hAl2bOkQrMBLlpLUHFuSru8m7aPtETcfXH7ULo9bjyTmyJXMgMwC9U3PqdcL3CZzHcpblEIzbuJ72VUQe05OVs8Aa2gSAFjUL0HySTA4vPnp2VYuVCmbSr6ElEvtzS1Azet9aJ/KOYMsZ7H1WLS6ElTPizukWOavB4US3MkXwBtysVvEmnqW2ZrgZr36wlRNrZyxfbNtQxjdYp5kPQ1R2nubDw9XJIvY6bQCMUOo+iN4+twYqdb5LmBNc/Wg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by PAXPR04MB8333.eurprd04.prod.outlook.com (2603:10a6:102:1c0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:31:37 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:31:37 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 04/33] selftests: mptcp: capitalize ok/fail/skip Date: Wed, 22 Nov 2023 19:30:52 +0800 Message-Id: <11b58a268d1425513e4f057643598a60d941604f.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: TYCPR01CA0011.jpnprd01.prod.outlook.com (2603:1096:405::23) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|PAXPR04MB8333:EE_ X-MS-Office365-Filtering-Correlation-Id: 118ba2aa-6eef-45fb-840a-08dbeb4e96d0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B2uzVt5CFI0oTaKK8fZ+7+PD8qf+NuaZCqnURX8XajNf5maB3CPqmwguklKY3Zi8rLrf2P1rpKc7p1MqQEYCaLXhBYHHnjIQjXLYoEZKYnwtiePNApNzVg5FcMlqvSt4NY/PmhPTAO+ovzZ+01z/cK2nOOIjau7BAeyvDYwzwXhaMzt8T3wdB/k6W5GgcuZbLFqWDUuOJR9UwRAuLOdxZL5NlQSa980qn/nODbm8CzDqHaIRhPNG0ud29ulFwqEEIvT/hZka+eu0QDl59SQfPnZMaBu4/o67CK9rwcvyQ+XWgct8oI5z7q8BWPxxJ+B57hEQeA1MSoplgOVFTOw+1l18Pk8h+Yssg2JTJgXWBv8x9MEhbOcUbTscWa6gxclGbk7QEt7aA9S7V7CtERSwCST5p7CAZsLQN64CRoeVnIduRZhB8jqzycnOUSxBkhbsTLEfDQj8vDtqcy6Ow3KmgyX2jrZmLHFeo+G1FVJD1qtEA7KWyArIS/OvNgEUupkwxzqjofkwHh9kBkiaqQuFebmFwuJO+c6lnI8+Cs7L4QPI0miY2sytNDhqTMvtxmB+ViqKN1aFNVWnRJ+UhTd+8OhBeEVtNJ4X+D8pG86xoWg= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(376002)(396003)(346002)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(6506007)(2616005)(107886003)(26005)(6512007)(6666004)(316002)(6486002)(478600001)(83380400001)(66556008)(6916009)(66946007)(66476007)(44832011)(4326008)(8676002)(5660300002)(38100700002)(86362001)(8936002)(2906002)(41300700001)(36756003)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: F4ErvBOmgKF/8Q1GB7o3cwyNaBbSHeQbllF0cuUTiAAla6kMV5cFcFQR3bJBOPe351zwgZsoYv40UHG3E6Gtajl+l3WaIVhy9VoRBbz2olrgqkGuCfb/hrvFnfLuLLiWAGqQvusvpD5RgTV6F1ImuKggAxrQ7n//fNnCR20OG21WArb09T7Fcjb823+X+hOhOH8E7PBQiM3R0ctcRjdyZx0hc2ZdfCp5Fv8ZI/WXmzY4oKJ645Qd7nnSEbwGuAz5ci1fEHVh/JjBzRpckvrBxFUk4S9TEg3oetlTWmmLXIwMNOCn4zFiHVdX/ufnWCO993PPXl8WY/XNWr+vzuQNpxOUP3EA3wPyEF2H0HCNhlCB25s40YDkndRmPupi+zCUicqrcAujsZbL0qF8MJk4SYHxKrUKGOkYbI/K1pj2iNQVrbQju/k9zGZDAYgWntGa9wDJFz8f20csQJkkujnx7GLYZaVL6jqPtH53ROiWRRa99Pnd5N1qwJGVntpn0FrzlRfI4R3FJ3biNH0zVSdFPMsZuNhMOf+NOpv/zZ6bGleZY8HfOJnO3EJ/PWiqCUDkSBjKrUgFerZzLyaSZuth3S1YHtHooy/YaiMCaPQbJ2mMqLWEjx3coqx9Sl/yVqYAxSS4rtoEOFIIYeen/AKzXV+A1CozAvMfvdLQm2NX4h8PmLz1ey6gfdTTN//v24Y9bi+0+V8kiZp6dJAg9H1hap1e+NIpsH23PH+XAUs1i5GnYskhSmIdIGox0S/ahgsS3MH7URWl/CjTF1HmxoKrjqgAvnz3y/w9DqWVpCUr132aEjRLkdvP0GkNpc36MLqxKPUPpRhiOVYOQ/OqzHfA1rFuo2qUloMSAS2viLPOggzmBM1AAQ+fwHmZL3FbBtabpSaaf9XCnMhwU2UY6EIpNRNKuP6LWhwFgH1eBftzpLaqZeLGoRjWHatAbcU7t4epeTof0+58wt5Pf3AuWjJ62Nh4pNANKAwMzESxYI7fkYEbqA7KtcxnhTc22buPunrADGvfS2QK0itHnF52ncuCJzWxxnWMsP6wDfDTDT2DxVrNTTROePLLYjP9xuxb5ZsQ2jyE5ANQGJTSBYwoJI6kYBA1M/6LB3WM9ZW/pFfvZUJXrzVqUZpzXGNwvjIIaBNrTYkY0OYUrZ9EcMLXL5Et+9LTdoZxwFZhzswGiMVgja1hu2MHasW7yfftqMnO1HvJVVE+f4opcTqxF0ZaXCmFSsgohkySw3KXr8xocTDtIab+vGTU/CZvkWJFSscXWK0AzJIlU5PgDyVE6ktSXbOfp6ak1w2RcLkb97gDOqCdS3L9UysumJkt7OSbdr7QrHdjOUCrqs4IpbwFGxEtwuD63m0nal00OlWHPAzPjVe0oImJh0OFQNDiAV6ToMclrEjedUVo/TflmqB0MTOt63/mW7heiguAuNzBr0GJwbjbuAdcN5PHzT/mtGOG+3Yxabul3o/Ar2B960+Gv0jMagqVWBQaeUXINH0iTRgN8pT0uvs4S0ovn35HjVYla6hmv7gpEP9sR04DBLL+zpjWKFCvr5jVinXMU0bnmbVFXOtuYf2ILkpJ3vprA1FV5U7/KFRA X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 118ba2aa-6eef-45fb-840a-08dbeb4e96d0 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:31:37.6346 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mlJI3J6CGdZdB9q3uVA4BMpWCEl3wUTG4ALTlbzobL19OkklNRnalnhvOjr44VFtIrSb6PyzoxneHElMQxpTCw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8333 Most scripts print uppercase [ OK ], [ FAIL ] and [ SKIP ] as test results, but lowercase ones are used in diag.sh, mptcp_join.sh and simult_flows.sh. To maintain consistency with other scripts, this patch capitalizes these lowercase [ ok ], [ fail ] and [ skip ]: [ ok ] -> [ OK ] in diag.sh, mptcp_join.sh [ fail ] -> [ FAIL ] in diag.sh, mptcp_join.sh, simult_flows.sh [ skip ] -> [ SKIP ] in diag.sh, mptcp_join.sh Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/diag.sh | 12 ++++++------ tools/testing/selftests/net/mptcp/mptcp_join.sh | 6 +++--- tools/testing/selftests/net/mptcp/simult_flows.sh | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh index a678ee21973b..ab62737bd501 100755 --- a/tools/testing/selftests/net/mptcp/diag.sh +++ b/tools/testing/selftests/net/mptcp/diag.sh @@ -65,15 +65,15 @@ __chk_nr() printf "%-50s" "$msg" if [ $nr != $expected ]; then if [ $nr = "$skip" ] && ! mptcp_lib_expect_all_features; then - echo "[ skip ] Feature probably not supported" + echo "[ SKIP ] Feature probably not supported" mptcp_lib_result_skip "${msg}" else - echo "[ fail ] expected $expected found $nr" + echo "[ FAIL ] expected $expected found $nr" mptcp_lib_result_fail "${msg}" ret=$test_cnt fi else - echo "[ ok ]" + echo "[ OK ]" mptcp_lib_result_pass "${msg}" fi test_cnt=$((test_cnt+1)) @@ -114,15 +114,15 @@ wait_msk_nr() printf "%-50s" "$msg" if [ $i -ge $timeout ]; then - echo "[ fail ] timeout while expecting $expected max $max last $nr" + echo "[ FAIL ] timeout while expecting $expected max $max last $nr" mptcp_lib_result_fail "${msg} # timeout" ret=$test_cnt elif [ $nr != $expected ]; then - echo "[ fail ] expected $expected found $nr" + echo "[ FAIL ] expected $expected found $nr" mptcp_lib_result_fail "${msg} # unexpected result" ret=$test_cnt else - echo "[ ok ]" + echo "[ OK ]" mptcp_lib_result_pass "${msg}" fi test_cnt=$((test_cnt+1)) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index ae326fd5340a..faaadb2f335c 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -216,17 +216,17 @@ print_info() print_ok() { - mptcp_lib_print_ok "[ ok ]${1:+ ${*}}" + mptcp_lib_print_ok "[ OK ]${1:+ ${*}}" } print_fail() { - mptcp_lib_print_err "[fail]${1:+ ${*}}" + mptcp_lib_print_err "[ FAIL ]${1:+ ${*}}" } print_skip() { - mptcp_lib_print_warn "[skip]${1:+ ${*}}" + mptcp_lib_print_warn "[ SKIP ]${1:+ ${*}}" } # [ $1: fail msg ] diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/testing/selftests/net/mptcp/simult_flows.sh index 436500c55e12..23f5bc0aeaf2 100755 --- a/tools/testing/selftests/net/mptcp/simult_flows.sh +++ b/tools/testing/selftests/net/mptcp/simult_flows.sh @@ -195,7 +195,7 @@ do_transfer() return 0 fi - echo " [ fail ]" + echo " [ FAIL ]" echo "client exit code $retc, server $rets" 1>&2 echo -e "\nnetns ${ns3} socket stat for $port:" 1>&2 ip netns exec ${ns3} ss -nita 1>&2 -o "sport = :$port" From patchwork Wed Nov 22 11:30:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464616 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2046.outbound.protection.outlook.com [40.107.21.46]) (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 05FB84AF66 for ; Wed, 22 Nov 2023 11:31:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="xzmokxa4" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QVE41iH9y1nMuLbGTNmlSCcCg47SOyZXa3n56zx0C/t5/Ih6+iDXu0bqqrWNgeEFWjObJFEJRH/EDDgG6ytyxpVB5MTuA+AvoTmBTivdJxwM3/aXosIagORhiBIE/gIn1MN8EGOh1EzUv192jxIdeLIWSL5fWxeLlJ5M3Row+ON2ohJdmazW98rcltrLdeLPMbrmwLlD9E5UPuYHe7L1X+UTJvw9MEyWM0cbqhYX45lJ5iQLVgJoPtz23PIuSZc3xOw+WEpre0EPzlBrVjYP6zIHrcVBbnSs00wDsuE5G67I6Dv3iCeL8u9lb/8RcNQcPFTZuXOIpBXLGV33N3gD4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=zsRv6aGr6mmmOPvTXHhXyzuRdf8FIBdg1IzuxNO8OK0=; b=aIWXmWjgNKefj55g7weosEODl85LuOubovr0SdVLwDyZIUe8S43yF2+q/vWi+CowEplyE86GNxe21N9quKHynhEMt4KJ8MFDYsShQk3oExnhHOuOkeSOQ/eBiiVmdUMoG+yKDF7LXG/vxyuWjWRVdrLQV87gz86IWUmO0jTJeuXIPX8+xI+44q1RgKO8b3p8HwSJal9yZoHb0lbbiZuGZ9dAp1uUn78X20uDYJx62MFutcl4by7Ab4PYxg1N5fwx3fC41oNq6lifPU46wfQeQs5iKOWy+m6W1Z4WaVlX2pzghlelAmiwimU3d1pGB1XHZEPcCrLg9fxlZ8F/w3AMbA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zsRv6aGr6mmmOPvTXHhXyzuRdf8FIBdg1IzuxNO8OK0=; b=xzmokxa4Wd7ilRBpMOJiYHgsJgdEGYCYjT4mP7LPQiUQ/6+E1Q2uP/6H7yOhBixvR/sawePc+5MfXphpv6vsM+kruOXlU9+alj1gBh0d298VCoS3gXB80wO0c0WAL9Ib36+VI2hKOq4sIEytO6jxNVZ9lmelILxEccIMjkagwOdftHYNbm+u0zrD/YEyIQCP9pZ1+gHaBQxLH+JNaQU2bzcoBqrJYGK/ES/qpbH9fSlQlx3egksDJgUM3TTLq7iXa7+GsVpfzQpTptDLIIXSVKeWyqJetAOz0MlHkWu/Sx4LE+Zx1L7gEgoyoX2+78uSnOkCO5n8fKhN9aM59B79CQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by PAXPR04MB8333.eurprd04.prod.outlook.com (2603:10a6:102:1c0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:31:45 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:31:45 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 05/33] selftests: mptcp: netlink: drop duplicate var ret Date: Wed, 22 Nov 2023 19:30:53 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: TYCPR01CA0016.jpnprd01.prod.outlook.com (2603:1096:405::28) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|PAXPR04MB8333:EE_ X-MS-Office365-Filtering-Correlation-Id: 00ba8e66-4dd6-47c9-fc4a-08dbeb4e9b5b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IE844gft6xERWYklI9o2pzJHQI/RtIkmJR2KhQCPzJqyRvTqhg0dyx8MUNNhgXWgnuZYT+9FBnDHpiWG6P3WXV2m+U+hc2VSu8zCqgXfM/ef3xSUGNNH+I6j/u7w9SpEAx87HiMYJoX5Tk5CCJqX5IkYrV2ypSBWy+vmPLD9lhv8ex0GmTh3zMsOy/ja+IKGuvH4RCFN9SN3c7M5RzqwsigITx9F4GPVCFsOA/UggqexaPFNUUFmdOwQDYlGn64Z2nylWvUVMDklPsPv0zv9yhrtLEab8i8GhjpFrahUhFp/TtuBexqy6BKN+pSAE/qtVodQnQ3MaS8tXp+6rSYBvfvZ/ev01QfYU5027AQqA3jkb57S2medukn4vA9I6wovMSe49Ua0Bb5IcLNpiYTLodyXwzeZMhdVwGJeGyU1p6YwAg5/hAeozD6EwH5HmXL6DLqqrrfpBCsTUsbxqiftGwxJ9mZ1rfob1YnzpH9hMsAtE1spPhlFal0WSbCjsmlAvzLTj+40z6pOnsyjm+P6z9KuCm4BFhpYvUQo+2eyPBlvYdStonxqNxlQp/gnWzVYCL/SV2roJzJ3WEc7kpjSfFI76rG2ZPxhFx3kDlqCFCo= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(376002)(396003)(346002)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(6506007)(2616005)(107886003)(26005)(6512007)(6666004)(316002)(6486002)(478600001)(83380400001)(66556008)(6916009)(66946007)(66476007)(44832011)(4326008)(8676002)(5660300002)(38100700002)(86362001)(8936002)(4744005)(2906002)(41300700001)(36756003)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: waeJ61meb3odJhSSwi+VHDqwUz5DtyD//7MvKJ6IsGdvHJNG+Ai3GtuPAUZUyVetcgf0sPrggZTPEleXYDFLgorgOHSBDVkz6ZJyaI6AipTlmletk3rEccM1lSnVpUvdZE1Zo5P0nH1k+4qZVDGhnCvEei0A+zIrAHWEf7PahiLiqGhwEe6AjWjsQNZpIlbkm/o8608bqmQDExOFKmfw3GPJrI0XScKYofFM5mrqirO6H2rwqsqXy4w7sB7jdJdtoVpsuv2+5A7GR060fMJl+raOw7vHDQUgMLvTRsnnUHzsP6YhQwZF6L1E0Evq1IzRftLpQCurOvee8vXMxaYMBN9cteDosY4z6OVaJPWXLiCNKzsSHSGRNZw0YzqLyA+4KH3x7OiMidshqk9HbS4Sf68FMbY1g4YvAUhrpY7yUkt627fjaW+Lua/IueC5Iuj75uJE0ZSdbt6Wr2QM3xoT026b8I72urk1dr0i8YLR5ITpXj8s4qHnEtDYOAVLctuVxDRnxz3BR3p/JOtdGNr3a9CcURfaTcwTBN9Oc4dafuSHSntwoBP9aRPqChG9h9ZT1b43bbLopTzVIbtk97ryDqoQCprAcDBor+c3yUDhxu+dxYteI7aOQnpfP9a6znnLf0ELftS7VBlaxP0mtdNExWjwIdgzgbbZnwWvRjzGWMbj3v/9zIK/O6nyCGgNUUyknYdqcwxxCKfkxt9NdldW/VmmdiPAUnmDqSB6WzWMWLFEeU4yBQ155Rfwvd2FUXD8IbAVvQUb1HakAQkhG39AslN3Qgq2nxVd0qx9Nbk0dEPPpfYPGQiof4i0WEP34cK8xhre3rViTGdO4wDG0r2MDAs3aZ9BEuzxVcwLoMBSYmapSKoIOyD+vQr18imNUFnT3jjePcOUGFHy89P+4of7YANtqdrTbpG638HF7ocm0wCLXhlNfN+ERsqcCiXHruUQVCpXsoCqTC8ozqTeCWRYr+mM98/PxuOcE8kZRjr+I1fX5qM9u/TJoMDxgJu83lg8pfYzdIDYMndW4A6aWxto6hXiVdYFu5gIH3t5TbeJR5OtevIhCUD88AtMMdGxOnNqkj+VEtBXLCHohLIkurLUsrrM6lrlr9hCthWHaGwhdPh8+M+7mzfHvSE9Qm9J5ssRWbCtrRAjX6UUh+nCByHMfUs1blDTcBKTy7QynEmoSL6Xksy7OiZK/mWmEUoUL9uELdVS+HQWey7/01F8bAh3IEaoEUoZovQpGwx2lfpRosTHQkI0sEDLN/YFXZKPfe0ZVbwuWW2sP57giiFLScruK1N4FXj1PD/k7y0uTilIFa8GWn+1uYC9JyF5I6TT3lxyzaKrC5+RRdtqZpEJtJltcxMH3Ly6F6kPmjSXq6cidFw/aK21wIE6DRXd2v9nEl/uzqCN6WRpXbpD6DOSygByiGgNkrgCT267Xlahng/BBPA71L54gJ9P6iRpCxPELYh34TbS2B+zhVZsCAPn7wuHzaFQRZchLvnLIjIljSP6PBEB47c2W1DpvmLtiBfu1awJrc3Mqg8UjknpFmoxuafUij4jQPbnZbCNy5juMRmc5CSNuxdCC9A2ABfSg42QXyMf X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00ba8e66-4dd6-47c9-fc4a-08dbeb4e9b5b X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:31:45.1766 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Unt+ij7EGLsAZRYHzHsO+6KUG2bAPBdBt0RFn1ZrPlrFfLD/9iPyeJyzcor8gZ+80COHJknXuqxhhc4sszvf9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8333 The variable 'ret' are defined twice in pm_netlink.sh. This patch drops this duplicate one. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/pm_netlink.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testing/selftests/net/mptcp/pm_netlink.sh index 8d30d4a1db57..e995dfca52cc 100755 --- a/tools/testing/selftests/net/mptcp/pm_netlink.sh +++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh @@ -27,7 +27,6 @@ done sec=$(date +%s) rndh=$(printf %x $sec)-$(mktemp -u XXXXXX) ns1="ns1-$rndh" -ret=0 cleanup() { From patchwork Wed Nov 22 11:30:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464617 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2076.outbound.protection.outlook.com [40.107.21.76]) (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 CBECB5467C for ; Wed, 22 Nov 2023 11:31:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="4h8SlnY6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UhUMiPxZQWkKVJkoAzXe4whoeOTxJ1mu/LfIKvKnaX1bLqnuYVPDp5fIuYzH8obAyIGiiTb5VOPLKXTaD8Z9hpdUnWjKO8AemR1vVBeKhCxyvj0RtreOvGz2ZfHRpVPBpmf+FjznX7p4T+yoKwZiOVY1io7CjpijTdB8hIGz002ESr/cmK6MwGYKTZarVQuNj6qk5ueFWLTh4Rg1gYdbuwoCudbUk224hLH+MncpBQyV63EUEIA0oa3s/R3iaM1jYIKioygz4UXOFqfKFtFR05I7KsFs/bibhpNuq1VrocTTSXAVj2EjQ0c5AF/0b+JebkEW9JFhV1rPjz3s6Q2lHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=UcoHGtloDmXOYUr+nMHJF1Eks0Ah+zCbIHNO342A3Cg=; b=Le5mOwelycbz6omBuwUXqLw3S7eJokiTOt3gm9O6n5jVAEYoRej1xmzsqi+hINibRSZuE11sLFwxQkPkSYCiYHf8uBT2j+GcxaiFIhmDM3vNOITBAY9PW0bziF6EyU76A83KbeLErjQcvqCsNF1OxxBwuzLXECG6S97bBaTH1beIG7REVRx01KbAAhV/ootgw1n48nMx5zKy/kgsSCS7wPuU5RbN4V0jaFYJkEXI2JNekabFVA3nWm4vCTl8dUS/jn9ctcRDx/O09DHLBZqXIac5EIYsN7jKU37Q0oKGR6a9/EjSUpWahIoNh/r524oOiBV/p96yqYdqI/ho5k45EQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UcoHGtloDmXOYUr+nMHJF1Eks0Ah+zCbIHNO342A3Cg=; b=4h8SlnY6xyQ3HynPsG0ey2FDvicWmKL06psclWltDnOt1IesSeNaH8T0LgMxmOO29XNTFR24Oo+4QKlhJqir9AGg0rL+Yf1eOk4P939rck+cG3QyOq9NqfUCndU4uP3t4iXzrvT5kHUF7pDnigqULqMZKdR+2PtYO9PQi3/pi9jJIKKaZXjW4UWm6uf5t1TKy7C8LozAXiQUVKMxsav7DpmjXLjfQV1MNJ/rTk0pab/MPSICPuu3sHEUVR4aQBGkLkrUtMxGVAd7yYiR6L7VPnA0B+L26BchdXb+nIDx4nI9jjZrrLBDie8AhOtasuwbyIWITz8HhtrOLW1VOUgqcQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by PAXPR04MB8333.eurprd04.prod.outlook.com (2603:10a6:102:1c0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:31:51 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:31:51 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 06/33] selftests: mptcp: export ret into mptcp_lib Date: Wed, 22 Nov 2023 19:30:54 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: TYCPR01CA0011.jpnprd01.prod.outlook.com (2603:1096:405::23) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|PAXPR04MB8333:EE_ X-MS-Office365-Filtering-Correlation-Id: 4929f5d1-38c5-411c-3420-08dbeb4e9ec2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DQTQn3epE7zwv3mPGBBPo4k0wExJzvYtqE++D9gWcS8Vn3bWTRrEGLKrR8lHvLbW16uU3PVrX0CUSfceaUfD6W0ml7Ql26px6Ae2iYPb6UEovwgxw3+yFC2vnSJNMQ3qE8Ty3Yx3FfE04eYmmushy+JQM4Fy8TZDPtsJD5Km1Jv0gsv/MzEnZwb8N5CzOvD8+1pugzONIlvhnERVelChwxlUsd2P42+PgJLX6iXUXxJmBBY35zpbydT6DZIDIpcYFnd8OkdQmJaV1+vUyJyK+z9X9gBWbwOORbvBhuYa/CBRZgZ/kg5h7ns2tb+9CYg3a8SSHTLrjcMHyu/bM59kiCz/3gZlwv+4k8APNudyzZw7gPmRTPyJ8kKQtDVN/77yxgh6sMkUgIDxe49qUlKb6s5bvpgFxeSlcej3ksMwTEsDNsj3uu64p4yoBLeTGRZWhhT7aLO92HgiXJn08fy79TBczPbcBs1G+mS6T6qPv//MFydvKFkNNQU9aof66i3IwMxmHXCGNv76V2cyJJ4/wQiJzf6Pibau87JHpo8XpaQ6QaNZL73WLrPsqvQGXOVn3VoawLgtVqnnOxxBC5ra5bL6DDHgPwiOoRb8hAreRr8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(376002)(396003)(346002)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(6506007)(2616005)(107886003)(26005)(6512007)(316002)(6486002)(478600001)(83380400001)(66556008)(6916009)(66946007)(66476007)(44832011)(4326008)(8676002)(5660300002)(38100700002)(86362001)(8936002)(2906002)(41300700001)(36756003)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7w3687ZtGcgKZv3lc+pR3As5dXS5OxONRjgrMwxmeJuItXIa18mPPxiaMEKR8d9KxcC+WkJm0rOrgeyrwguT2JA/QgX4JmajmNIp6Z3VkUdStX6n52ZCHa1qTEZqirgombZo6o9FZB7yca0zGqWD9FsqHkb4yTfibt8zMx1Sz5YbTNh46fFm1THGxboEEeJqbmVEZjQtxqAB6v863TwmUl/Ts7SnAl/4qfoNHK9bXTUsMaqPRzbZ6maIndB1pljXITrxtFqy3aO4ICmr0LmROdDGWKTVdtggxEVeRQ6pBcIo38/gg8WO5l5ZbYdsIZLEF+U2j9hcN1+qQL9tMATLIhJXnhnU2IsJkMzkKLLFbRet348G8ModQs91WwLFeMIdLSv7tRmYQlcBD0wLYzTTtBpvLD37S9fultgMIY5WsjwZdAipoijfq5Wa99axwos/6DCl5221o+32rN358RM/S6VQDvzMw/3X8rrPmCX+sWHqUdXFvCphVorf6Jrdz6UBYoQHXi1yVQNlh5f7c2lwq0ZNbVaA1xGmb+Y3+oHTU48eDQv1eehcmw8jLCf1DNvEfXozlxwaSx/V/ZcryJMY8fxyv42lr3Qs8d6+zTrwUv1NBNMAoYQ1/po0i15+TyIzjN6Doe9BQ0pJzCg8AuFRKZJjn297ixN7+BHtNd55rxkY+lawohcgpLFX1hK1WR5D3jgydqKTPixn7I0aA+yzzviceq2F9swPzRy8Fox5JPkB8weL767pdhtc2Rse060J8eI5qmB3kVgbNav0ZBDilVZv5EuvLeNSWwJBkRQNppw27J6Rj4Si6NfKjdR/Z4cD5g8qurQoS5NCe9JYfBSHA8kdgoL3A7XmJez2B2g6z06Vx33FsQnnEkrYoEYGNAcqqyepaXpCcPyFON4qDTMrosPqgQpZguj3ys4l1m8eYediCV30y+pD98EabkGDXx07v73h67i4XAG4sRJmLjoDarXPRzIa4kK7zvu1N+bgdXIxY0rYkglDwqWn+LhNsaKos8PwsHCfL+c7y4pPxV/3rI1j374NOYa0uCdKklwh1QrvMzSjqmSt8s2RmySqp29i8GJZuAF4dEX0ex87smRqSK6MMezb1ve/72Ya57uOFe67wj4tOolP3KJc4yVszVFdTTHqXA2tDOBsp3RErMgkYhHDeLIjqph1BCwNPX6DhEjetx8fQfwI1LmOK+nFGdGWNIdY5xUrWCdB6DVJulw3jtk86HOv7LwXe0GqLvCj3I9hgKPunl3Q8jhVBbTEcEsK7w218dnVtObqsfxjlP7wUbh0KQg4gYB/Ene9J4mZ6eJiN2ZHLgsjBJTUf/qRYZMGpDOBDh8k/C4CLnN/9iWCiGnI++AEJ2QFZaFeCnB2MqiB96hRBgifh8OERVtOMdcoGtzx7GfWyTO1G8RML0DOAKhwswRagUB9qvr38EJrKYPuBy2IFeYwUfR3fFRDTaKmEhlnzQjgYUOcIAxLo4Ge+RZYMTF0iNEy/S48Sx+fl8rYIYXUikJynnShHxIk/6XlVeApZ/Bw/oLyfA1gJkNnKyy9I1oqePeuV+O68450kv6Aaoz6ZcT/vCXk6Y07ItBN X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4929f5d1-38c5-411c-3420-08dbeb4e9ec2 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:31:51.0434 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SASxF5rMvriQAiJQ28nu86nIR46rDvIvYHqLkmov2WRekMqmWLkKiUbZ9y9SIrecr1xkrf1+JJVNAprEy/e4lw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8333 The variable 'ret' has been defined in every script. This patch moves it into mptcp_lib.sh as a public variable. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/diag.sh | 1 - tools/testing/selftests/net/mptcp/mptcp_connect.sh | 1 - tools/testing/selftests/net/mptcp/mptcp_join.sh | 1 - tools/testing/selftests/net/mptcp/mptcp_lib.sh | 2 ++ tools/testing/selftests/net/mptcp/mptcp_sockopt.sh | 1 - tools/testing/selftests/net/mptcp/pm_netlink.sh | 1 - tools/testing/selftests/net/mptcp/simult_flows.sh | 1 - tools/testing/selftests/net/mptcp/userspace_pm.sh | 1 - 8 files changed, 2 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh index ab62737bd501..300aec419dd6 100755 --- a/tools/testing/selftests/net/mptcp/diag.sh +++ b/tools/testing/selftests/net/mptcp/diag.sh @@ -10,7 +10,6 @@ ksft_skip=4 test_cnt=1 timeout_poll=100 timeout_test=$((timeout_poll * 2 + 1)) -ret=0 flush_pids() { diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/testing/selftests/net/mptcp/mptcp_connect.sh index 98f4e82789ba..5e28292e1889 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@ -6,7 +6,6 @@ time_start=$(date +%s) optstring="S:R:d:e:l:r:h4cm:f:tC" -ret=0 final_ret=0 sin="" sout="" diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index faaadb2f335c..a6b32104003b 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -12,7 +12,6 @@ . "$(dirname "${0}")/mptcp_lib.sh" -ret=0 sin="" sinfail="" sout="" diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh index bb22dc17b0f0..4ec23a697d00 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -8,6 +8,8 @@ readonly KSFT_SKIP=4 # shellcheck disable=SC2155 # declare and assign separately readonly KSFT_TEST=$(basename "${0}" | sed 's/\.sh$//g') +ret=0 + MPTCP_LIB_SUBTESTS=() # only if supported (or forced) and not disabled, see no-color.org diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh index 75d8c648f9de..45e5b5810a6a 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh @@ -3,7 +3,6 @@ . "$(dirname "${0}")/mptcp_lib.sh" -ret=0 sin="" sout="" cin="" diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testing/selftests/net/mptcp/pm_netlink.sh index e995dfca52cc..75c7594dbd71 100755 --- a/tools/testing/selftests/net/mptcp/pm_netlink.sh +++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh @@ -4,7 +4,6 @@ . "$(dirname "${0}")/mptcp_lib.sh" ksft_skip=4 -ret=0 usage() { echo "Usage: $0 [ -h ]" diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/testing/selftests/net/mptcp/simult_flows.sh index 23f5bc0aeaf2..3536c7160ce5 100755 --- a/tools/testing/selftests/net/mptcp/simult_flows.sh +++ b/tools/testing/selftests/net/mptcp/simult_flows.sh @@ -13,7 +13,6 @@ ksft_skip=4 timeout_poll=30 timeout_test=$((timeout_poll * 2 + 1)) test_cnt=1 -ret=0 bail=0 slack=50 diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh index c60143133277..108a7548a1ed 100755 --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -54,7 +54,6 @@ sec=$(date +%s) rndh=$(printf %x "$sec")-$(mktemp -u XXXXXX) ns1="ns1-$rndh" ns2="ns2-$rndh" -ret=0 TEST_NAME="" _printf() { From patchwork Wed Nov 22 11:30:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464618 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2088.outbound.protection.outlook.com [40.107.21.88]) (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 A6F024AF66 for ; Wed, 22 Nov 2023 11:32:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="U2B10acX" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DrqBo5E17Bz1qXlN9ccZsbcLqVFeq41OI0VEQwJ58NeGU+5sOOV8rZwE6leQZwDuzZL/mG/b4rxX7rnEiulNL8J18EeBDUpdZTZixSBT4xd61ZJsTrVSkLOSMAnSEWTa1+eKFg7gfoZUJC4wLrGHZpz8b26rziHgIcXjWE7tRQBaCxEw8f/wdm9f2jctvLO3jS634xvl8g/7AoSB6kJfDl3OUfeULHvd6nAdTM9u4hcoQPSB9J8nDYplRtDScf6VJvGKO9BfLt4ueTaWY4AWOLEPNskaQnyz57LsNWqlp7jpuPsBAj4ykc8PUcmHvcvqX5891pIsmLK1HSbeuDSvFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=TLCdd11M8BI59cO3yVnyYd4rQvzPTPGjWD9+nkRw5i4=; b=JVb0lcdZm2NKETtKadkEwRgrrACSorVXIkmkIdrk/cT4ZG9Zh9775jGL1WXdtx+pwwRwb5qNltC1TArhaZyI+a5eZJzzhb/lZCLwYi3LHlk3K7X5QWfSOT9L+/sEpT1lvazpIDImZCpUejbpuVvu5UkD0ga3qObtOaDvxpH0+H9L7uVVDItoEK8fglaeorvZhFfgLxpGEEcVPn8fApCyVAMHkOGwasxbOKK1tAIddXMgbEwbdqhp4rpCgPvkUB90PygkiuW+4oDsS+dX/J/aT/QbRcW4ZT4n5uI6bNeWnn0fWU4aBtE568ekr4plxAwqgtBAs4RY2tpdqEtrqzNROA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TLCdd11M8BI59cO3yVnyYd4rQvzPTPGjWD9+nkRw5i4=; b=U2B10acXYUp/y2rAxdnfZbQHaaHE0wXQ7XdsUS9E3EOIBksd085uDbAEsD8V8kRDPtGam8QeNJ7ow2cLR+zDWoVvwreVJ8LWXvKEoWhW87kPVp5vmSkliHN+qd7Rldxnoyb4y0Y9faiEce3vMQX/huMUgMqIjr25BEV81u7lYrjFw9qUTdOme+EB+dZ5Rp5+2dvnsl/EU0GsCNBqnqJ/jILhUaqcmhqbCOguAIAWzSFEcpl0mGmohhx49bFBFp1bGeesFalLzigLpKgzQYmn06k/krN4//Ho4B7kLpvWUmzoUy5ch28USIjUx6HRPbidwicR4C+WsheAk5KLhX3Z+Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by PAXPR04MB8333.eurprd04.prod.outlook.com (2603:10a6:102:1c0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:31:58 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:31:58 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 07/33] selftests: mptcp: extract mptcp_lib_check_expected Date: Wed, 22 Nov 2023 19:30:55 +0800 Message-Id: <98c7c40ab8d8f0217c56c2503a7add701d0b8c65.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: TYCPR01CA0012.jpnprd01.prod.outlook.com (2603:1096:405::24) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|PAXPR04MB8333:EE_ X-MS-Office365-Filtering-Correlation-Id: b4b3d5d5-2dd9-406b-341a-08dbeb4ea376 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cT992DDfZc8Y3FDHS0lbj7mIAnIlKTNDt1o+pa5kYNyEaDI4YeTRmmKzWvLhry3amvdtJb/nsRCqHE+DJkyDs2DAdbKRbt384dezKyLDhlbPls/UFPv8bdR/k12OK2Szeun4AxPL3v3m2TpNitFl9qHy0PVpqpKQJP+Rta3oCMKvbN950UgUApLCeEeLCSgB/EuuDSdJawA/mbjWqvJERSVoYfl8pSpEM6nNsqgdEbHlsNRbApiWov1w/WGbetQbYzfWtY9+fHdJPhVsr4FgKsZ+fNOrWcW/BnNEanuS5SA6xEE3LkRGVamCRkkSg3L4sZ1SuspxbH1d/u+sYOL83PIFmA8nbxBSdRDYzDoH5VTxm3pOJtz63jHxSSPTi3i25DCyFoD5fEoao/sWizoPC9IlyRPdvcgQ0D/s3vPsbheBdwrkTAkghG+2ZVfh4ecPs98r0g+W7twDN6kTCs1KCh2euxsOOPNEUdB6kD66mE1vxjR9CjFqSPjaNl52TMzGG66Hc3UfRxXFV+xt+U9USDRy9ka/Bze5BOPkoCvFkBHemxfZ+0zfNB4rdnyfB2qoTCfGq40XMQJt5sh4+y2PuR0YA7tnkKq3Z6ibKZAHe40= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(376002)(396003)(346002)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(6506007)(2616005)(107886003)(26005)(6512007)(6666004)(316002)(6486002)(478600001)(83380400001)(66556008)(6916009)(66946007)(66476007)(44832011)(4326008)(8676002)(5660300002)(38100700002)(86362001)(8936002)(2906002)(41300700001)(36756003)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: a2RQO22Y4swlQq73JuyI17MwCjdHfopajD8bP2ml2uD6RvadkcxCZNeYVDW4uTg3txhqi8JM7F6L2/l9MBw+7V4GjWeR8zOsooSsqTVHBS3FfmDKpwdVTZEbLBy8R4YHUn//3P8PjbP2aEGkocUnSxivuxhHi96/DHmQUJvGB3qmyg0DcpewbjsaWWlJtIhZzwTvYZETfv0O/j7JsXZR6gH2Y1CLObbsABgc+HlUrn1t2WIuJCnLWr1oRExDDjF/lhg0YFO9G5xueI6hcYnCJS93jB63w6OINsTzQbXWIZcK9Kouisx+dYWeov3a/B9AIm1BIk4vQMo6olE9q4fU7mTBJTCOfbR5tOGCFeMzQATK4apANPOsZ9MLdTKYXtyxprnAdES8f5tsxax5nqDnu7SCKWGlOR+mE4PABtJuBVsATeF1WHppUKS2Jl1PBVupC+yZ0HNhE92tYAhZXC1CIC7pl1bEjucNl8jIswhAGqTmlImiYGkbWF0n23bvDPbu9vwVFvKHu6EhdzD2Fy+rNAL6fekE7a4spweLeaBHUMd59r0zg8sAE92saOOnj1TJwKkEFy9noulIrIVNmZtaLeCYdX9aKjUMyN1E2B37XxE3AU/Q2DjH7JdTOUNgDlrJpu8CxeDrXks6SQ5vL/CsGERL6XhPgUyHfEBG9jpE7Pyie/HN6MnPJ6e1gGbBbEwsdM+oPXUWcK1fIHzSfNFtJh+CxH4JLGahOXuqwXMxxMr8fUK4dsvT/0WrWlI9jibPk1eIMlyn15pN0thPQWHGREWzBr4p3jvrrqRpL1QNzaDekNWRWdOnm5gkpzacr1SRjy0E2gH2ZuNA5bpP2FvU0JR+qisNuYS8L9QY6RgOZ08cMoabAsDrM68Pkd8DF6bRLaURItuuiKqkZjI1sknDWu3ZIdWHagMnb4SOoE/cliUKudds8YwUz/cwNdioo+rehWdDuDBF5Rrto8hzldk416W4u0rh+mMfKkcS9UixlTxM2jzhpO2i9UUMdxti/jgou2HxtXjiso2HlePzInPLtMmRXFxsteYmx8S54+hsofUxq/ejCEpb1Z1iDYV1xSn0hd6TgnJSteyj8z+dQuUR+DbjbPbIr8EqHn6vbsYaaFzUtf0iHsldtRzYNdCWtvidZeD9RlI3l/ZbWIag/FWLEyianEh+GBhlro2YRkbn5biOHHmbeJCBMBSh3+gvyGjdYkehItNwTHFSmYYi9OSu/jhBQiNRitGb3OHsmKvkMQMvsz3ykhE0gqNH2P+vmTSuyRSXMlwngMQzmXC17ttMiQNTaH1l8shH/kIU31JKkfgM+YbaXYnbt4zz3GpmzfqnYMnGN9v+ppmxtP6YMr+j1vq1YAJyBuaYxPYduHYbsqjhLbuWGVqw1V4g7KOoMLAg9olQntBMGqYAVmOYDDUeztt0gCFMfXJEeTenQGgNiFbpF1o6dLXj4KIZLLvoSSGFwyIOGURFHRRvhPUIqAWau/4oAZ7lTwbxpn+RzE7ZJ+cn/pm2Djm1+GwGHXBfNaBgZZZNw4Rztfr/0DwiylzaWcvFt+m6J/7d6nK6qZfbMPvu82YzBdmQdM8bLHeutxyI X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: b4b3d5d5-2dd9-406b-341a-08dbeb4ea376 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:31:58.8026 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dnTYaQq2b66XAMa0H+eFlqRbRcFdjtOsr1kXb39CKGKcCD7tcjG+EUqbrZspxR1DDNWXkbx1nJw+T8U4jlpftA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8333 Extract the main part of check_expected() in userspace_pm.sh to a new function mptcp_lib_check_expected() in mptcp_lib.sh. It will be used in both mptcp_john.sh and userspace_pm.sh. Signed-off-by: Geliang Tang --- .../testing/selftests/net/mptcp/mptcp_lib.sh | 42 +++++++++++++++++++ .../selftests/net/mptcp/userspace_pm.sh | 41 +++--------------- 2 files changed, 47 insertions(+), 36 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh index 4ec23a697d00..9b7e66364c49 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -391,6 +391,48 @@ mptcp_lib_evts_remove() { rm -rf "${server_evts}" "${client_evts}" } +# $1: var name ; $2: prev ret +mptcp_lib_check_expected_one() +{ + local var="${1}" + local exp="e_${var}" + local prev_ret="${2}" + + if [ "${!var}" = "${!exp}" ] + then + return 0 + fi + + if [ "${prev_ret}" = "0" ] + then + ret=1 + fi + + printf "\tExpected value for '%s': '%s', got '%s'.\n" \ + "${var}" "${!exp}" "${!var}" + return 1 +} + +# $@: all var names to check +mptcp_lib_check_expected() +{ + local rc=0 + local var + + for var in "${@}" + do + mptcp_lib_check_expected_one "${var}" "${rc}" || rc=1 + done + + if [ ${rc} -eq 0 ] + then + mptcp_lib_print_ok "[ OK ]" + return 0 + fi + + return 1 +} + mptcp_lib_cleanup() { echo "cleanup" diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh index 108a7548a1ed..85712f097597 100755 --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -237,46 +237,15 @@ make_connection() fi } -# $1: var name ; $2: prev ret -check_expected_one() -{ - local var="${1}" - local exp="e_${var}" - local prev_ret="${2}" - - if [ "${!var}" = "${!exp}" ] - then - return 0 - fi - - if [ "${prev_ret}" = "0" ] - then - test_fail - fi - - _printf "\tExpected value for '%s': '%s', got '%s'.\n" \ - "${var}" "${!exp}" "${!var}" - return 1 -} - # $@: all var names to check check_expected() { - local rc=0 - local var - - for var in "${@}" - do - check_expected_one "${var}" "${rc}" || rc=1 - done - - if [ ${rc} -eq 0 ] - then - test_pass - return 0 + mptcp_lib_check_expected ${*} + if [ $? -eq 0 ]; then + mptcp_lib_result_pass "${TEST_NAME}" + else + test_fail fi - - return 1 } verify_announce_event() From patchwork Wed Nov 22 11:30:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464619 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2086.outbound.protection.outlook.com [40.107.22.86]) (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 47AF551035 for ; Wed, 22 Nov 2023 11:32:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="ixowEIgE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AKL8wm3f1dByAz9O238Cr8vOL8mYs+8jVPISLj52RLhTCYDQ5kXT97J7+XvszLPsBUNPeExbYPGuJAjSpVFjHaSCJHk99aMIYG/7+F+vZ/mvcjpW7bptale3Y+HCpXvNxXi4uVktU8MScMe55ltpAx7WDW6vbRf6yvaMjeF5ev/CTS3emU1QJ9FoC/WVH2SONCia8aoO1SRp3KNmd543r/j2c2qxYw8aQ5dm6Ykl3D2bgujfBv4LZtEBdNXgtn+r9tcvmPccc0zR4oyxe2BjBGSoQwcF/83xXx4wqUdsmJ8Z0R8SLB4+96r1ndzTGUXWuVCl7gJ5Nlz7gYqZY1ET0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=CxxkpHXGWLByg8enzxrX4/nMrdWsQIMahwMBfO3HraA=; b=HIDUA2k23qpXQa5WEWEUSy9/p4arfN4xgJElks9oc8rweGiKA7wPcBEdG2fLHVf9EYtnve5FVNsggkV0WTr0hnosC2Sv7n3K0mqPs1oKQyjNBUPLPzlUIOcqSteYAh9ONt64C7St3looX5mHRVv24o31fi5ueO2kNUJvvHkQQqBN4SwOxutrCRjXOb3m6v8m5ot1MO3Q0sye3ZujszY7ckUbP4xIE92dLv1ajMTpXWY1Xs09ezRcg/Tpj1b1GGhHCkSVL+r81ODywOde/BE7BIJott9r7cJr/4xTlgS3QtQX1PJ9fYt+VZDnhQKck7DBW58eNPb5wPd+VPVFghNDOQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CxxkpHXGWLByg8enzxrX4/nMrdWsQIMahwMBfO3HraA=; b=ixowEIgEZTwuKzQBxWXteU7URdl/mMPImiNGWmEvMIN4+cX7oz/sQm4/A9d32yop1G0yqP8ambwHx4E29U6AzReIYBrxDWgsR2U3NHaKXwR85lQ80iR6B4dwDfON9vlcRwIc5Yyw4FgSHPrzCOvHrTdJP6+ojYuuU1Vx7ROsBfo1xlTQifwHZl+z4nEfEhwlQoJp4i/QxwXNDpYdywdOysO29djAtB6D+ilajNjfv2xCcT3E9LlAohQN/65TEfYwM03cFjbTswulJBEhvvXd4hhshV4wL8/IbsUACTFRLmCFwtrmAQS/wSkPqSLa09hXWtqPlu8LVZh+koINtjECMg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by VI1PR04MB10050.eurprd04.prod.outlook.com (2603:10a6:800:1db::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:32:06 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:32:06 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 08/33] selftests: mptcp: export event macros in mptcp_lib Date: Wed, 22 Nov 2023 19:30:56 +0800 Message-Id: <8b762eea32de0009ff5a642220658596e6c71979.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: TYCPR01CA0001.jpnprd01.prod.outlook.com (2603:1096:405::13) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|VI1PR04MB10050:EE_ X-MS-Office365-Filtering-Correlation-Id: 79be013d-0213-491b-0ea2-08dbeb4ea804 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iJPGi4UaXfIq7wOVHDFZdEoxXjYpsKkDWG2XdLl18vEhS9rxXssZlpbJ0dmX5rGhbVdoArBYNUhOndmw2y0hxcz7G9rEEtAxqEbHziiosLJA67ClScfxW7mKrbNS4P9llxkQkaWuk/JybtPRSgtBA4uix53WxwIoxGV0hBtUsAz517R+SQICHgCqSEYXds7Amr5U/pen6ard1WzFP1b4OZsH39P1vvyj24ktNqozLMWQMPKWUv0tkNc875gO3pcYKIHprLKMoXMt1tZWYLKNZ6PYkYiLjNfpRVI4ClTcnUxY8Vz7hSYL4N/uciqtbTMekruHRApphe7kulck739oJzO43Ll+fWTuWdSrkGwn5eNN4WAXzpb3vARgd0GwtAeA4j/cQUTIVH26yIYjmWie+AYzfwc4eH5JMpEYdalPUGXb15pEQ6RyN7SwzMr8Iu4z0h9DpiKG2fGdgTH1rwnLAUECaliJfFTSOqExC8hufkIY2sfIbKNxwbaeNi56oZKS4v5gpne0jQxlUxGmSnKax9dMvH+XtDMpxIrz1l4CL9cJqhDDfNc4mG5GV/vlEqXEKR57OYJ4ojnLkOsQZdqFJF3GtTUsfoueWrhGAZts5kQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(346002)(396003)(39860400002)(366004)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(5660300002)(30864003)(44832011)(2906002)(4326008)(8936002)(41300700001)(8676002)(66946007)(66476007)(316002)(6916009)(66556008)(86362001)(6486002)(107886003)(478600001)(26005)(6512007)(6666004)(36756003)(6506007)(2616005)(38100700002)(83380400001)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: a14Dp91//NCkxcLfvbGalrPIjMwdbicqyuvgvd8rKl6suVXti62rZpMt8pPfigvkTRVP4qKnM7yorI4/N+JG0Bt2vvoUPjWZ3sZuB4xtN29M7JWY5zYJwnUr/5G3k4XqdYnSUliYQR6D9FCfdK+MFDaODDhUOcDG10sXsiMC85v3LjiiJRd54/4DagiMVax2/bGkmjTuvspz1ljAXsHqcNuDbHdHjFyLnatRC0y6vhPr/bwHwkTKPQB6SJVXm9ORKhAK5JZLgQGRLE/WuDsIUB6Je4Y8AndEd2h+aXxQbUGhPltGCsRvkWZqo3Q9gBkacmmzO5dMK7+sSa4aD4H7vCQ1F6zoY34pTy+e2U2YZv0lT/1ZjeqFVVh13OEdaCLwt3nAWA2FPPE/tfIglpTjkMFlpW95zC8nu9lDaGNKRAVao5EA11fUd3lsJXhHrr7ur6s8Sq0Ox1ZaaM5NgTgBg65GcvWLEtefcV5Zh8Q8NNrmDt1kpfJS97HxkzIMYKI6r3Z+BIVdRP8hB8H0o3qBX8e/KZ0e+VEPwCWqFPjKswMgThXS0h8AxApRYL75NrUdxL41AnkFpPdJ214zGRBGc+I1X5VYCeO8/THRjdYyU+tcpm5tm9RjsTkLP0Kb6OIg564BmQqM7nI17MQyXIM6dTDIEuCjmu/dXZ0SQ2/Z1EG94YepXmOTQtvmnP3MVezJTabIXQAsB5jEcRrm/+H13coaCkDJfmpYuIF6GnL6a114Y4WYNzv3tSXhcbpuNfj0ez7tmNpCWgc2LnGzwh0DxwG1+zd2Np58n3k60hwbTmIaLFovLVOVUTkMq3VJPGsO9oCoQhi5psF1lsA2v6F4d+gUwnw6e+Y0QT2O6ZjnVJhitiWAgPTMgaz4phsBQAIAbkrw+YljpHPeMv2XbdpXaUSetWqxmDX/HwQzgfNOb4h6EU3aKgHFbjQO3PZpqGMzxw6t8q+egK/cuLxkizhph1eh73RQjvyZh6N1n/drgRFeIkUjez7Shtc1yWUtzcYQDFnpu2pnDwvz8c1qlgk00GxE3UjPUHWCyAeBZBiimYpmCGitjwkQKYbHKvrWaxz0QdI86sZkVrfbdN+R7uI22l9AqTZZHOw+MZLZL6oYbSI1hX+fCyrRm6Uww8qFjUTYDNs/O2579+lTE40NCEunNNIqVOMb60FJNCbUxJKk+WYWzxSdPXKqHdOdGaGN+6bPviLsZuCAexXdIBr0jT1P/G65HsAJruiMuREW//QfF4qX+vYuLBSMUGqOva+Xs/GA8gR7m9QeFR4phA/mBTBTHWkVBjatTagXpQ5jTO6bXCzSNwcq1CfFfKY714Sbq94jjHxffWgj5l923KnSjh3r4J0/lCQS23bQ8qxXMA/msm3pD1mf9ztf+LcAricETbcIbkyVk85HGa6bdgrZ7iLL1X/okynS6uVq0cuUYWUwxmP0YdibWOChZvXmZ495UjggIyYekP5Y7PZojuOqhFNJXH+U9CXneWCzzk1bnTFCQ60pN0wVgoqxIb86JMydkUAQ2Rwyl+f3v9uVH7vqnu8iO8XEdmzTbGkRmTs/UhR38If/xVl1Av94V8t12jmI8N70 X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79be013d-0213-491b-0ea2-08dbeb4ea804 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:32:06.5438 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sxFP/AlcDimW2bmw5sxhJRpjY44TYA6xpPyAkWeoRq5w4AzTWh7aLewFM3k9adKCk7ZLQlpV5u24p53nbjR9pQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB10050 SUB_ESTABLISHED, LISTENER_CREATED, LISTENER_CLOSED, AF_INET and AF_INET6 are defined in both mptcp_join.sh and userspace_pm.sh, export all event macros into mptcp_lib.sh. Add MPTCP_LIB_ prefix for the first three and add readonly for the last two. Signed-off-by: Geliang Tang --- .../testing/selftests/net/mptcp/mptcp_join.sh | 21 ++- .../testing/selftests/net/mptcp/mptcp_lib.sh | 10 ++ .../selftests/net/mptcp/userspace_pm.sh | 121 +++++++++--------- 3 files changed, 78 insertions(+), 74 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index a6b32104003b..79bc894a5aba 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -2778,13 +2778,6 @@ backup_tests() fi } -SUB_ESTABLISHED=10 # MPTCP_EVENT_SUB_ESTABLISHED -LISTENER_CREATED=15 #MPTCP_EVENT_LISTENER_CREATED -LISTENER_CLOSED=16 #MPTCP_EVENT_LISTENER_CLOSED - -AF_INET=2 -AF_INET6=10 - verify_listener_events() { local evt=$1 @@ -2798,9 +2791,9 @@ verify_listener_events() local sport local name - if [ $e_type = $LISTENER_CREATED ]; then + if [ $e_type = $MPTCP_LIB_LISTENER_CREATED ]; then name="LISTENER_CREATED" - elif [ $e_type = $LISTENER_CLOSED ]; then + elif [ $e_type = $MPTCP_LIB_LISTENER_CLOSED ]; then name="LISTENER_CLOSED " else name="$e_type" @@ -2867,8 +2860,10 @@ add_addr_ports_tests() chk_add_nr 1 1 1 chk_rm_nr 1 1 invert - verify_listener_events $server_evts $LISTENER_CREATED $AF_INET 10.0.2.1 10100 - verify_listener_events $server_evts $LISTENER_CLOSED $AF_INET 10.0.2.1 10100 + verify_listener_events $server_evts $MPTCP_LIB_LISTENER_CREATED \ + $AF_INET 10.0.2.1 10100 + verify_listener_events $server_evts $MPTCP_LIB_LISTENER_CLOSED \ + $AF_INET 10.0.2.1 10100 mptcp_lib_evts_kill fi @@ -3396,7 +3391,7 @@ userspace_tests() chk_subflows_total 2 2 chk_mptcp_info add_addr_signal 1 add_addr_accepted 1 local rm_addr="userspace_pm_rm_addr $ns1 10" - local rm_sf="userspace_pm_rm_sf $ns1 ::ffff:10.0.2.1 $SUB_ESTABLISHED" + local rm_sf="userspace_pm_rm_sf $ns1 ::ffff:10.0.2.1 $MPTCP_LIB_SUB_ESTABLISHED" if [ $((RANDOM%2)) -eq 0 ]; then $($rm_addr); $($rm_sf) else @@ -3423,7 +3418,7 @@ userspace_tests() chk_mptcp_info subflows 1 subflows 1 chk_subflows_total 2 2 userspace_pm_rm_addr $ns2 20 - userspace_pm_rm_sf $ns2 10.0.3.2 $SUB_ESTABLISHED + userspace_pm_rm_sf $ns2 10.0.3.2 $MPTCP_LIB_SUB_ESTABLISHED chk_rm_nr 1 1 chk_mptcp_info subflows 0 subflows 0 chk_subflows_total 1 1 diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh index 9b7e66364c49..f711cc0d0271 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -10,6 +10,16 @@ readonly KSFT_TEST=$(basename "${0}" | sed 's/\.sh$//g') ret=0 +MPTCP_LIB_ANNOUNCED=6 # MPTCP_EVENT_ANNOUNCED +MPTCP_LIB_REMOVED=7 # MPTCP_EVENT_REMOVED +MPTCP_LIB_SUB_ESTABLISHED=10 # MPTCP_EVENT_SUB_ESTABLISHED +MPTCP_LIB_SUB_CLOSED=11 # MPTCP_EVENT_SUB_CLOSED +MPTCP_LIB_LISTENER_CREATED=15 #MPTCP_EVENT_LISTENER_CREATED +MPTCP_LIB_LISTENER_CLOSED=16 #MPTCP_EVENT_LISTENER_CLOSED + +readonly AF_INET=2 +readonly AF_INET6=10 + MPTCP_LIB_SUBTESTS=() # only if supported (or forced) and not disabled, see no-color.org diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh index 85712f097597..9b1d8b56d8d6 100755 --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -23,16 +23,6 @@ if ! ip -Version &> /dev/null; then exit ${KSFT_SKIP} fi -ANNOUNCED=6 # MPTCP_EVENT_ANNOUNCED -REMOVED=7 # MPTCP_EVENT_REMOVED -SUB_ESTABLISHED=10 # MPTCP_EVENT_SUB_ESTABLISHED -SUB_CLOSED=11 # MPTCP_EVENT_SUB_CLOSED -LISTENER_CREATED=15 #MPTCP_EVENT_LISTENER_CREATED -LISTENER_CLOSED=16 #MPTCP_EVENT_LISTENER_CLOSED - -AF_INET=2 -AF_INET6=10 - file="" client4_pid=0 server4_pid=0 @@ -306,8 +296,8 @@ test_announce() ns2eth1 print_test "ADD_ADDR id:${client_addr_id} 10.0.2.2 (ns2) => ns1, reuse port" sleep 0.5 - verify_announce_event $server_evts $ANNOUNCED $server4_token "10.0.2.2" $client_addr_id \ - "$client4_port" + verify_announce_event $server_evts $MPTCP_LIB_ANNOUNCED $server4_token \ + "10.0.2.2" $client_addr_id "$client4_port" # ADD_ADDR6 from the client to server machine reusing the subflow port :>"$server_evts" @@ -315,8 +305,8 @@ test_announce() dead:beef:2::2 token "$client6_token" id $client_addr_id dev ns2eth1 print_test "ADD_ADDR6 id:${client_addr_id} dead:beef:2::2 (ns2) => ns1, reuse port" sleep 0.5 - verify_announce_event "$server_evts" "$ANNOUNCED" "$server6_token" "dead:beef:2::2"\ - "$client_addr_id" "$client6_port" "v6" + verify_announce_event "$server_evts" "$MPTCP_LIB_ANNOUNCED" "$server6_token" \ + "dead:beef:2::2" "$client_addr_id" "$client6_port" "v6" # ADD_ADDR from the client to server machine using a new port :>"$server_evts" @@ -325,7 +315,7 @@ test_announce() $client_addr_id dev ns2eth1 port $new4_port print_test "ADD_ADDR id:${client_addr_id} 10.0.2.2 (ns2) => ns1, new port" sleep 0.5 - verify_announce_event "$server_evts" "$ANNOUNCED" "$server4_token" "10.0.2.2"\ + verify_announce_event "$server_evts" "$MPTCP_LIB_ANNOUNCED" "$server4_token" "10.0.2.2"\ "$client_addr_id" "$new4_port" # Capture events on the network namespace running the client @@ -336,7 +326,7 @@ test_announce() $server_addr_id dev ns1eth2 print_test "ADD_ADDR id:${server_addr_id} 10.0.2.1 (ns1) => ns2, reuse port" sleep 0.5 - verify_announce_event "$client_evts" "$ANNOUNCED" "$client4_token" "10.0.2.1"\ + verify_announce_event "$client_evts" "$MPTCP_LIB_ANNOUNCED" "$client4_token" "10.0.2.1"\ "$server_addr_id" "$app4_port" # ADD_ADDR6 from the server to client machine reusing the subflow port @@ -345,8 +335,8 @@ test_announce() $server_addr_id dev ns1eth2 print_test "ADD_ADDR6 id:${server_addr_id} dead:beef:2::1 (ns1) => ns2, reuse port" sleep 0.5 - verify_announce_event "$client_evts" "$ANNOUNCED" "$client6_token" "dead:beef:2::1"\ - "$server_addr_id" "$app6_port" "v6" + verify_announce_event "$client_evts" "$MPTCP_LIB_ANNOUNCED" "$client6_token" \ + "dead:beef:2::1" "$server_addr_id" "$app6_port" "v6" # ADD_ADDR from the server to client machine using a new port :>"$client_evts" @@ -355,7 +345,7 @@ test_announce() $server_addr_id dev ns1eth2 port $new4_port print_test "ADD_ADDR id:${server_addr_id} 10.0.2.1 (ns1) => ns2, new port" sleep 0.5 - verify_announce_event "$client_evts" "$ANNOUNCED" "$client4_token" "10.0.2.1"\ + verify_announce_event "$client_evts" "$MPTCP_LIB_ANNOUNCED" "$client4_token" "10.0.2.1"\ "$server_addr_id" "$new4_port" } @@ -416,7 +406,7 @@ test_remove() $client_addr_id print_test "RM_ADDR id:${client_addr_id} ns2 => ns1" sleep 0.5 - verify_remove_event "$server_evts" "$REMOVED" "$server4_token" "$client_addr_id" + verify_remove_event "$server_evts" "$MPTCP_LIB_REMOVED" "$server4_token" "$client_addr_id" # RM_ADDR from the client to server machine :>"$server_evts" @@ -425,7 +415,7 @@ test_remove() $client_addr_id print_test "RM_ADDR id:${client_addr_id} ns2 => ns1" sleep 0.5 - verify_remove_event "$server_evts" "$REMOVED" "$server4_token" "$client_addr_id" + verify_remove_event "$server_evts" "$MPTCP_LIB_REMOVED" "$server4_token" "$client_addr_id" # RM_ADDR6 from the client to server machine :>"$server_evts" @@ -433,7 +423,7 @@ test_remove() $client_addr_id print_test "RM_ADDR6 id:${client_addr_id} ns2 => ns1" sleep 0.5 - verify_remove_event "$server_evts" "$REMOVED" "$server6_token" "$client_addr_id" + verify_remove_event "$server_evts" "$MPTCP_LIB_REMOVED" "$server6_token" "$client_addr_id" # Capture events on the network namespace running the client :>"$client_evts" @@ -443,7 +433,7 @@ test_remove() $server_addr_id print_test "RM_ADDR id:${server_addr_id} ns1 => ns2" sleep 0.5 - verify_remove_event "$client_evts" "$REMOVED" "$client4_token" "$server_addr_id" + verify_remove_event "$client_evts" "$MPTCP_LIB_REMOVED" "$client4_token" "$server_addr_id" # RM_ADDR from the server to client machine :>"$client_evts" @@ -452,7 +442,7 @@ test_remove() $server_addr_id print_test "RM_ADDR id:${server_addr_id} ns1 => ns2" sleep 0.5 - verify_remove_event "$client_evts" "$REMOVED" "$client4_token" "$server_addr_id" + verify_remove_event "$client_evts" "$MPTCP_LIB_REMOVED" "$client4_token" "$server_addr_id" # RM_ADDR6 from the server to client machine :>"$client_evts" @@ -460,7 +450,7 @@ test_remove() $server_addr_id print_test "RM_ADDR6 id:${server_addr_id} ns1 => ns2" sleep 0.5 - verify_remove_event "$client_evts" "$REMOVED" "$client6_token" "$server_addr_id" + verify_remove_event "$client_evts" "$MPTCP_LIB_REMOVED" "$client6_token" "$server_addr_id" } verify_subflow_events() @@ -489,7 +479,7 @@ verify_subflow_events() info="${e_saddr} (${e_from}) => ${e_daddr} (${e_to})" - if [ "$e_type" = "$SUB_ESTABLISHED" ] + if [ "$e_type" = "$MPTCP_LIB_SUB_ESTABLISHED" ] then if [ "$e_family" = "$AF_INET6" ] then @@ -546,22 +536,24 @@ test_subflows() ip netns exec "$ns1" ./pm_nl_ctl csf lip 10.0.2.1 lid 23 rip 10.0.2.2\ rport "$client4_port" token "$server4_token" sleep 0.5 - verify_subflow_events $server_evts $SUB_ESTABLISHED $server4_token $AF_INET "10.0.2.1" \ - "10.0.2.2" "$client4_port" "23" "$client_addr_id" "ns1" "ns2" + verify_subflow_events $server_evts $MPTCP_LIB_SUB_ESTABLISHED $server4_token \ + $AF_INET "10.0.2.1" "10.0.2.2" "$client4_port" "23" \ + "$client_addr_id" "ns1" "ns2" # Delete the listener from the client ns, if one was created mptcp_lib_kill_wait $listener_pid local sport - sport=$(mptcp_lib_evts_get_info sport "$server_evts" $SUB_ESTABLISHED) + sport=$(mptcp_lib_evts_get_info sport "$server_evts" $MPTCP_LIB_SUB_ESTABLISHED) # DESTROY_SUBFLOW from server to client machine :>"$server_evts" ip netns exec "$ns1" ./pm_nl_ctl dsf lip 10.0.2.1 lport "$sport" rip 10.0.2.2 rport\ "$client4_port" token "$server4_token" sleep 0.5 - verify_subflow_events "$server_evts" "$SUB_CLOSED" "$server4_token" "$AF_INET" "10.0.2.1"\ - "10.0.2.2" "$client4_port" "23" "$client_addr_id" "ns1" "ns2" + verify_subflow_events "$server_evts" "$MPTCP_LIB_SUB_CLOSED" "$server4_token" \ + "$AF_INET" "10.0.2.1" "10.0.2.2" "$client4_port" "23" \ + "$client_addr_id" "ns1" "ns2" # RM_ADDR from client to server machine ip netns exec "$ns2" ./pm_nl_ctl rem id $client_addr_id token\ @@ -584,21 +576,21 @@ test_subflows() ip netns exec "$ns1" ./pm_nl_ctl csf lip dead:beef:2::1 lid 23 rip\ dead:beef:2::2 rport "$client6_port" token "$server6_token" sleep 0.5 - verify_subflow_events "$server_evts" "$SUB_ESTABLISHED" "$server6_token" "$AF_INET6"\ - "dead:beef:2::1" "dead:beef:2::2" "$client6_port" "23"\ - "$client_addr_id" "ns1" "ns2" + verify_subflow_events "$server_evts" "$MPTCP_LIB_SUB_ESTABLISHED" "$server6_token" \ + "$AF_INET6" "dead:beef:2::1" "dead:beef:2::2" "$client6_port" \ + "23" "$client_addr_id" "ns1" "ns2" # Delete the listener from the client ns, if one was created mptcp_lib_kill_wait $listener_pid - sport=$(mptcp_lib_evts_get_info sport "$server_evts" $SUB_ESTABLISHED) + sport=$(mptcp_lib_evts_get_info sport "$server_evts" $MPTCP_LIB_SUB_ESTABLISHED) # DESTROY_SUBFLOW6 from server to client machine :>"$server_evts" ip netns exec "$ns1" ./pm_nl_ctl dsf lip dead:beef:2::1 lport "$sport" rip\ dead:beef:2::2 rport "$client6_port" token "$server6_token" sleep 0.5 - verify_subflow_events "$server_evts" "$SUB_CLOSED" "$server6_token" "$AF_INET6"\ + verify_subflow_events "$server_evts" "$MPTCP_LIB_SUB_CLOSED" "$server6_token" "$AF_INET6"\ "dead:beef:2::1" "dead:beef:2::2" "$client6_port" "23"\ "$client_addr_id" "ns1" "ns2" @@ -623,22 +615,23 @@ test_subflows() ip netns exec "$ns1" ./pm_nl_ctl csf lip 10.0.2.1 lid 23 rip 10.0.2.2 rport\ $new4_port token "$server4_token" sleep 0.5 - verify_subflow_events "$server_evts" "$SUB_ESTABLISHED" "$server4_token" "$AF_INET"\ - "10.0.2.1" "10.0.2.2" "$new4_port" "23"\ + verify_subflow_events "$server_evts" "$MPTCP_LIB_SUB_ESTABLISHED" "$server4_token" \ + "$AF_INET" "10.0.2.1" "10.0.2.2" "$new4_port" "23" \ "$client_addr_id" "ns1" "ns2" # Delete the listener from the client ns, if one was created mptcp_lib_kill_wait $listener_pid - sport=$(mptcp_lib_evts_get_info sport "$server_evts" $SUB_ESTABLISHED) + sport=$(mptcp_lib_evts_get_info sport "$server_evts" $MPTCP_LIB_SUB_ESTABLISHED) # DESTROY_SUBFLOW from server to client machine :>"$server_evts" ip netns exec "$ns1" ./pm_nl_ctl dsf lip 10.0.2.1 lport "$sport" rip 10.0.2.2 rport\ $new4_port token "$server4_token" sleep 0.5 - verify_subflow_events "$server_evts" "$SUB_CLOSED" "$server4_token" "$AF_INET" "10.0.2.1"\ - "10.0.2.2" "$new4_port" "23" "$client_addr_id" "ns1" "ns2" + verify_subflow_events "$server_evts" "$MPTCP_LIB_SUB_CLOSED" "$server4_token" \ + "$AF_INET" "10.0.2.1" "10.0.2.2" "$new4_port" "23" \ + "$client_addr_id" "ns1" "ns2" # RM_ADDR from client to server machine ip netns exec "$ns2" ./pm_nl_ctl rem id $client_addr_id token\ @@ -662,21 +655,22 @@ test_subflows() ip netns exec "$ns2" ./pm_nl_ctl csf lip 10.0.2.2 lid 23 rip 10.0.2.1 rport\ $app4_port token "$client4_token" sleep 0.5 - verify_subflow_events $client_evts $SUB_ESTABLISHED $client4_token $AF_INET "10.0.2.2"\ - "10.0.2.1" "$app4_port" "23" "$server_addr_id" "ns2" "ns1" + verify_subflow_events $client_evts $MPTCP_LIB_SUB_ESTABLISHED $client4_token $AF_INET \ + "10.0.2.2" "10.0.2.1" "$app4_port" "23" "$server_addr_id" "ns2" "ns1" # Delete the listener from the server ns, if one was created mptcp_lib_kill_wait $listener_pid - sport=$(mptcp_lib_evts_get_info sport "$client_evts" $SUB_ESTABLISHED) + sport=$(mptcp_lib_evts_get_info sport "$client_evts" $MPTCP_LIB_SUB_ESTABLISHED) # DESTROY_SUBFLOW from client to server machine :>"$client_evts" ip netns exec "$ns2" ./pm_nl_ctl dsf lip 10.0.2.2 lport "$sport" rip 10.0.2.1 rport\ $app4_port token "$client4_token" sleep 0.5 - verify_subflow_events "$client_evts" "$SUB_CLOSED" "$client4_token" "$AF_INET" "10.0.2.2"\ - "10.0.2.1" "$app4_port" "23" "$server_addr_id" "ns2" "ns1" + verify_subflow_events "$client_evts" "$MPTCP_LIB_SUB_CLOSED" "$client4_token" \ + "$AF_INET" "10.0.2.2" "10.0.2.1" "$app4_port" "23" \ + "$server_addr_id" "ns2" "ns1" # RM_ADDR from server to client machine ip netns exec "$ns1" ./pm_nl_ctl rem id $server_addr_id token\ @@ -699,7 +693,7 @@ test_subflows() ip netns exec "$ns2" ./pm_nl_ctl csf lip dead:beef:2::2 lid 23 rip\ dead:beef:2::1 rport $app6_port token "$client6_token" sleep 0.5 - verify_subflow_events "$client_evts" "$SUB_ESTABLISHED" "$client6_token"\ + verify_subflow_events "$client_evts" "$MPTCP_LIB_SUB_ESTABLISHED" "$client6_token"\ "$AF_INET6" "dead:beef:2::2"\ "dead:beef:2::1" "$app6_port" "23"\ "$server_addr_id" "ns2" "ns1" @@ -707,15 +701,16 @@ test_subflows() # Delete the listener from the server ns, if one was created mptcp_lib_kill_wait $listener_pid - sport=$(mptcp_lib_evts_get_info sport "$client_evts" $SUB_ESTABLISHED) + sport=$(mptcp_lib_evts_get_info sport "$client_evts" $MPTCP_LIB_SUB_ESTABLISHED) # DESTROY_SUBFLOW6 from client to server machine :>"$client_evts" ip netns exec "$ns2" ./pm_nl_ctl dsf lip dead:beef:2::2 lport "$sport" rip\ dead:beef:2::1 rport $app6_port token "$client6_token" sleep 0.5 - verify_subflow_events $client_evts $SUB_CLOSED $client6_token $AF_INET6 "dead:beef:2::2"\ - "dead:beef:2::1" "$app6_port" "23" "$server_addr_id" "ns2" "ns1" + verify_subflow_events $client_evts $MPTCP_LIB_SUB_CLOSED $client6_token \ + $AF_INET6 "dead:beef:2::2" "dead:beef:2::1" "$app6_port" \ + "23" "$server_addr_id" "ns2" "ns1" # RM_ADDR6 from server to client machine ip netns exec "$ns1" ./pm_nl_ctl rem id $server_addr_id token\ @@ -738,21 +733,23 @@ test_subflows() ip netns exec "$ns2" ./pm_nl_ctl csf lip 10.0.2.2 lid 23 rip 10.0.2.1 rport\ $new4_port token "$client4_token" sleep 0.5 - verify_subflow_events "$client_evts" "$SUB_ESTABLISHED" "$client4_token" "$AF_INET"\ - "10.0.2.2" "10.0.2.1" "$new4_port" "23" "$server_addr_id" "ns2" "ns1" + verify_subflow_events "$client_evts" "$MPTCP_LIB_SUB_ESTABLISHED" "$client4_token" \ + "$AF_INET" "10.0.2.2" "10.0.2.1" "$new4_port" "23" \ + "$server_addr_id" "ns2" "ns1" # Delete the listener from the server ns, if one was created mptcp_lib_kill_wait $listener_pid - sport=$(mptcp_lib_evts_get_info sport "$client_evts" $SUB_ESTABLISHED) + sport=$(mptcp_lib_evts_get_info sport "$client_evts" $MPTCP_LIB_SUB_ESTABLISHED) # DESTROY_SUBFLOW from client to server machine :>"$client_evts" ip netns exec "$ns2" ./pm_nl_ctl dsf lip 10.0.2.2 lport "$sport" rip 10.0.2.1 rport\ $new4_port token "$client4_token" sleep 0.5 - verify_subflow_events "$client_evts" "$SUB_CLOSED" "$client4_token" "$AF_INET" "10.0.2.2"\ - "10.0.2.1" "$new4_port" "23" "$server_addr_id" "ns2" "ns1" + verify_subflow_events "$client_evts" "$MPTCP_LIB_SUB_CLOSED" "$client4_token" \ + "$AF_INET" "10.0.2.2" "10.0.2.1" "$new4_port" "23" \ + "$server_addr_id" "ns2" "ns1" # RM_ADDR from server to client machine ip netns exec "$ns1" ./pm_nl_ctl rem id $server_addr_id token\ @@ -775,7 +772,7 @@ test_subflows_v4_v6_mix() $server_addr_id dev ns1eth2 print_test "ADD_ADDR4 id:${server_addr_id} 10.0.2.1 (ns1) => ns2, reuse port" sleep 0.5 - verify_announce_event "$client_evts" "$ANNOUNCED" "$client6_token" "10.0.2.1"\ + verify_announce_event "$client_evts" "$MPTCP_LIB_ANNOUNCED" "$client6_token" "10.0.2.1"\ "$server_addr_id" "$app6_port" # CREATE_SUBFLOW from client to server machine @@ -783,21 +780,21 @@ test_subflows_v4_v6_mix() ip netns exec "$ns2" ./pm_nl_ctl csf lip 10.0.2.2 lid 23 rip 10.0.2.1 rport\ $app6_port token "$client6_token" sleep 0.5 - verify_subflow_events "$client_evts" "$SUB_ESTABLISHED" "$client6_token"\ + verify_subflow_events "$client_evts" "$MPTCP_LIB_SUB_ESTABLISHED" "$client6_token"\ "$AF_INET" "10.0.2.2" "10.0.2.1" "$app6_port" "23"\ "$server_addr_id" "ns2" "ns1" # Delete the listener from the server ns, if one was created mptcp_lib_kill_wait $listener_pid - sport=$(mptcp_lib_evts_get_info sport "$client_evts" $SUB_ESTABLISHED) + sport=$(mptcp_lib_evts_get_info sport "$client_evts" $MPTCP_LIB_SUB_ESTABLISHED) # DESTROY_SUBFLOW from client to server machine :>"$client_evts" ip netns exec "$ns2" ./pm_nl_ctl dsf lip 10.0.2.2 lport "$sport" rip 10.0.2.1 rport\ $app6_port token "$client6_token" sleep 0.5 - verify_subflow_events "$client_evts" "$SUB_CLOSED" "$client6_token" \ + verify_subflow_events "$client_evts" "$MPTCP_LIB_SUB_CLOSED" "$client6_token" \ "$AF_INET" "10.0.2.2" "10.0.2.1" "$app6_port" "23"\ "$server_addr_id" "ns2" "ns1" @@ -889,7 +886,8 @@ test_listener() local listener_pid=$! sleep 0.5 - verify_listener_events $client_evts $LISTENER_CREATED $AF_INET 10.0.2.2 $client4_port + verify_listener_events $client_evts $MPTCP_LIB_LISTENER_CREATED \ + $AF_INET 10.0.2.2 $client4_port # ADD_ADDR from client to server machine reusing the subflow port ip netns exec $ns2 ./pm_nl_ctl ann 10.0.2.2 token $client4_token id\ @@ -905,7 +903,8 @@ test_listener() mptcp_lib_kill_wait $listener_pid sleep 0.5 - verify_listener_events $client_evts $LISTENER_CLOSED $AF_INET 10.0.2.2 $client4_port + verify_listener_events $client_evts $MPTCP_LIB_LISTENER_CLOSED \ + $AF_INET 10.0.2.2 $client4_port } print_title "Make connections" From patchwork Wed Nov 22 11:30:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464620 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2074.outbound.protection.outlook.com [40.107.22.74]) (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 7025D51035 for ; Wed, 22 Nov 2023 11:32:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="alq6aoFc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TO1je12noptKxUsgzW9RX6Pf0Rer32IjsUxRWstSXqLAJSGrqwU94NKFoIzGjxX2+JLLFzigl9ZBDDZzO69lm2aMXpUKjtNV8pg12QdFDDNb/GuAWBQ6NFn3NbRaB868PqcaJRy6t4FSAwYLNj4SHCEnO8y/umckS6jyKDfRyLaBgyLAsC+gfL3hmJGomKgQ8R1HjlGAChjMAQ2MlwWuFz5hfWUUWWTH3LimRn/4oibUz8GPxJ1a51CLmFD0ZPJa/te1CHfzE2kec5/Z+4kJo/3bbUgB4wc39NzPQQ6059EhdzidZXS8LWTRup6XECxTvtn7PQH3rgqf9QmN2JOkTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=ofjNNgVIGGCWHBdYCWjEyrQLgmTpFS68/lop7DT0sYU=; b=OIX6xOxTmpWFGADjj0rcUuG9OtuKKQ5nsLqGTBhwPcJowSK3kuLC2kTOaBdLAIrsgAW7PZo+J7Q1CI14rWeHJPBTGEb2uGAzvWhPCN/H+clT1wcgcYz4m8ULJSNM6gkWaDtMZ0t1DYYG/tsRAX4SYOe8afS+zu/yfSlJXh/h22iDBeM3emiHZ+3QYoapF1x7+c5dpf2PiEWjUWDLTNybZEQaa3C2CSAGRQzEaUu97FRqJKKHvM8fHSdVeH1tythYcrxo5MTmxddMX1M6VS8cvFSjw6/u1+50K1825YsDRJgPndIdqyssClngYLemSFS/WmoErCN7qGeXPE6XSVE3fg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ofjNNgVIGGCWHBdYCWjEyrQLgmTpFS68/lop7DT0sYU=; b=alq6aoFcuhpOzEfCpwMnHna6kfD9tGWFQ0Af5zQ9nojBfDhFZIsraLzDH/8JXfUe4RFr8MVLEIc0mVH11lLL6Gs6QxwgOZu+3ElyC6dUtRVcrCV6pPddshkYWjuXBdYPIUCW7Zy4ZCKtEm6NGdL9wbbsZCFqrK+ka3DC1Qo5DPllzpac2VjNOdFripj9KGu4/BSCBQqRPE7Ix46wCl23TpwWZ9dR2QeamS74uPhN+H5o87/hhYTkbJTKIdQ95OTyfYjzG4h+DZtaibkIhLMSQ6ihI6WXzCSgFteKg8MyLmeeKBQnltPql705WiyXiKYvIsMP9NIaHxXSEdJarm326Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by VI1PR04MB10050.eurprd04.prod.outlook.com (2603:10a6:800:1db::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:32:15 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:32:15 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 09/33] selftests: mptcp: add mptcp_lib_verify_listener_events Date: Wed, 22 Nov 2023 19:30:57 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SE2P216CA0023.KORP216.PROD.OUTLOOK.COM (2603:1096:101:114::12) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|VI1PR04MB10050:EE_ X-MS-Office365-Filtering-Correlation-Id: a1244872-9561-47ad-a644-08dbeb4ead31 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SOsm8sjX5hcwlVqe39WSYvc5Z7AN6lKj2d+dDG0tnpyb5wKWMjpmbbxEzlDdcp/ueDjjGQba4BvF0UW+qcq7Yk3VC3uj0GrdPzjuKju5t+HN31GsYS2SDTd1n11XKpWdDr1Sls3YrwgZEzH3B3zF8jUo646iR8InpkSiefSXf2Azebaf4fuaUEw4oSDAI+spwowwfo8mu6mQa91nPoro8T2ANIJCQeLBkOlVYhDrc6vmxuwqZOzgyxjQmJi/X3F9Q3RVu/sZ7h8K11YvLZcoXrUMWxnNYkWjeuRHOhFQ1+QNeJz4C3XTRItBbfWSyPgmjVqXDOZw6BbvsnLiqPhijHJawwPlGZqud5ytO1U1FnwHnH7KiezkLLMXyoi/PC/ZfmLz0xb1b7elFfuJ5/JUk2gpFVhiSd+qyuGClZ97QadM9g20H5aQTbbxtra0r50EuJVudubsLHVsLLnpCZC9HurwkO+wWfcwKz8K9n9aHp62vWBcMvLs29zhtJvtZNOn9Qg28fTvxqbqEBusSr/N9ULoSU7m+URKwJbZtb26tDd6jVK9hU82V9pngO04D7H9ZROIiSSc0s5MBh2o3Asu2NtBCUXb8jiXCKbuFS95vIm67ZnPBf0BycCDDziSNIjjdaGWA6EoSn3Y6llNfn4TfA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(346002)(396003)(39860400002)(366004)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(5660300002)(44832011)(2013699003)(2906002)(4326008)(8936002)(41300700001)(8676002)(66946007)(66476007)(316002)(6916009)(66556008)(86362001)(6486002)(107886003)(478600001)(26005)(6512007)(6666004)(36756003)(6506007)(2616005)(38100700002)(83380400001)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tCuEUmn8n8wAybY2PHeEIXPmTUYQJY9lnX4vxHyrTpEfyPBQ9Cxos052C2Gk7vig14vz7RQ+V3UBWHX9lZ1n8XT0YqGkLl35uwWM0JrrilwPXPpIrrex6hfxR65rDHaFGjNBnJHToSUNMGOtA5hU642XAkHZAHd6lyxRtg9Mvf/K9p+qoY/OtCJPA6P2XM12R381VUAt5nJ20mDQUWM9xL1aofBKyouW5VUy8W+XHjrbBITNkZLUUou8X3kHTE2aCT2saQC+OglYo6KwEy94X8VSa+QCvpXJJGsKGtu7qXtL4OxBGJsrnigmbbMowARKMWM5GPVnJf9V+Tssm25Ru8gjZ7/x55YlH2F/vbxabWmecigIrSFvDU6N39yoF5JkEmfEtyU0qdOdM4pFURpC6koMT9Fq5aQJdxgElfSyqGBFyspFwmmgePwOGWvYAsen05i5jGCLP1LkGZE8fS5aeWlpFCnbArHGcew0JDMImRL/lWNvoEjRAemjS0JZO+WnwP0wIR2h24VQ1g+LNli9ajR/p1UN+OljweUTxYCvCLBJvDWJ6XzPftPax+4z5FdURsCpFmgHQxLAzzqE9ORwG0cSZQY005e6hkeDf+i2J3/28C3qmkzqp4guPNvuDFqrIiG24TxJ0dVLszazqfrxXAVv81ueNK15CRvxYGTWolTlZE/MBPp3GE0duEwNCimOqDEUO2NurgHMIHV6F5+ALaqFW7T73XaCB2HpurjagzFlqa1D7z8y0DwVv9jFGP0gN4LkhGCykteCl7irpLUnrkn+MOWEJxVUlR20ghls2yMZ5Po9TIGymyf5AX0Kpy942l7FgOeb7812dAIpnxtrrINSCumsL3uwTOlxK7X32QE92YykNQRSVU/jRNZyaSnYhKoFTCJbdDwpnQra+2aiLTozUPLtp19UnOGWGIDEghEXpFzurHMUaqq7+svyi8fQfR+xoVD8xI4Y2pTX7qNQaKpyjTktRsxJBQobB70xegGFN2IHwQLaKysnAnSKrt1Rk3GNSZ9xd438mWtElWqenut6tCIFaecN8sHcD0gu+Jjq4OrUIF6pbYJjFIRh9wDw7Rtcx5iT6yXYiv671lRS7WIrzxS1A+v41ErovK1tV/r8C/ze3KnczLD8EQv3SsitUkl2JciE3j0LOUWctjBwgLhI/mNkexzuDbvNGkx1jE4QiNF9b84pGcZ+aNdnJNlLjbten9jIN+qhzk8hxvRN0vq1tKHzspG+kcEF7v/ZA6EjJWssucpt+lug09k0FU9ecsW53Ae1BZqZgsoSf3MDxOfnPOG1eJoHMUSbBpKrckHBZ0TZ/rF7vM7cwNmvsUNi0n9xdlaqO8/OZ3a54soHKfFZ4UbLlhXq4bT+Vcv9E1sf7YqazadB1dzIMMzdouo3v7sFhV4uOHSAW0iOF0Ge6XM5P1xO/JFjY3amDbgX8uJLR+0UONie8jJD1pwmOoVk7qrOJ5SvDRqx0ugm2cTPPMqFoKaF76aPBqoy/5FedXcF3csF8BZdsflOfQ7v+WBWdIKL8s+uceQizxfQYn/4JQ/FzMn/1jBUnenSvKGz6T/g4NxYtZ+PeNRTN3vR26L/vvzi1otaFs7IXOxHCD84jw== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1244872-9561-47ad-a644-08dbeb4ead31 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:32:15.2420 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +HtxqAbjPONvjaJwR/jym2XZSuD8VvZ39A+Q+Eys11uAWNg6orgj2jBqvkSU0+rONZRbUle3LY/aach4dxxEyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB10050 To avoid duplicated code in different MPTCP selftests, we can add and use helpers defined in mptcp_lib.sh. The helper verify_listener_events() is defined both in mptcp_join.sh and userspace_pm.sh, export it into mptcp_lib.sh and rename it with mptcp_lib_ prefix. Use this new helper in both scripts. Signed-off-by: Geliang Tang --- .../testing/selftests/net/mptcp/mptcp_join.sh | 24 ++------------- .../testing/selftests/net/mptcp/mptcp_lib.sh | 23 ++++++++++++++ .../selftests/net/mptcp/userspace_pm.sh | 30 ++++--------------- 3 files changed, 31 insertions(+), 46 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 79bc894a5aba..69bc8d16fc14 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -2780,15 +2780,10 @@ backup_tests() verify_listener_events() { - local evt=$1 local e_type=$2 local e_family=$3 local e_saddr=$4 local e_sport=$5 - local type - local family - local saddr - local sport local name if [ $e_type = $MPTCP_LIB_LISTENER_CREATED ]; then @@ -2806,23 +2801,8 @@ verify_listener_events() return fi - type=$(mptcp_lib_evts_get_info type "$evt" "$e_type") - family=$(mptcp_lib_evts_get_info family "$evt" "$e_type") - sport=$(mptcp_lib_evts_get_info sport "$evt" "$e_type") - if [ $family ] && [ $family = $AF_INET6 ]; then - saddr=$(mptcp_lib_evts_get_info saddr6 "$evt" "$e_type") - else - saddr=$(mptcp_lib_evts_get_info saddr4 "$evt" "$e_type") - fi - - if [ $type ] && [ $type = $e_type ] && - [ $family ] && [ $family = $e_family ] && - [ $saddr ] && [ $saddr = $e_saddr ] && - [ $sport ] && [ $sport = $e_sport ]; then - print_ok - return 0 - fi - fail_test "$e_type:$type $e_family:$family $e_saddr:$saddr $e_sport:$sport" + mptcp_lib_verify_listener_events ${*} + [ $? -eq 1 ] && fail_test "$e_type $e_family $e_saddr $e_sport" } add_addr_ports_tests() diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh index f711cc0d0271..20c260aa68dd 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -443,6 +443,29 @@ mptcp_lib_check_expected() return 1 } +mptcp_lib_verify_listener_events() { + local evt=$1 + local e_type=$2 + local e_family=$3 + local e_saddr=$4 + local e_sport=$5 + local type + local family + local saddr + local sport + + type=$(mptcp_lib_evts_get_info type "$evt" "$e_type") + family=$(mptcp_lib_evts_get_info family "$evt" "$e_type") + if [ $family ] && [ $family = $AF_INET6 ]; then + saddr=$(mptcp_lib_evts_get_info saddr6 "$evt" "$e_type") + else + saddr=$(mptcp_lib_evts_get_info saddr4 "$evt" "$e_type") + fi + sport=$(mptcp_lib_evts_get_info sport "$evt" "$e_type") + + mptcp_lib_check_expected "type" "family" "saddr" "sport" +} + mptcp_lib_cleanup() { echo "cleanup" diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh index 9b1d8b56d8d6..e78a79da3960 100755 --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -839,32 +839,12 @@ test_prio() verify_listener_events() { - local evt=$1 - local e_type=$2 - local e_family=$3 - local e_saddr=$4 - local e_sport=$5 - local type - local family - local saddr - local sport - - if [ $e_type = $LISTENER_CREATED ]; then - print_test "CREATE_LISTENER $e_saddr:$e_sport" - elif [ $e_type = $LISTENER_CLOSED ]; then - print_test "CLOSE_LISTENER $e_saddr:$e_sport" - fi - - type=$(mptcp_lib_evts_get_info type $evt $e_type) - family=$(mptcp_lib_evts_get_info family $evt $e_type) - sport=$(mptcp_lib_evts_get_info sport $evt $e_type) - if [ $family ] && [ $family = $AF_INET6 ]; then - saddr=$(mptcp_lib_evts_get_info saddr6 $evt $e_type) + mptcp_lib_verify_listener_events ${*} + if [ $? -eq 0 ]; then + mptcp_lib_result_pass "${TEST_NAME}" else - saddr=$(mptcp_lib_evts_get_info saddr4 $evt $e_type) + test_fail fi - - check_expected "type" "family" "saddr" "sport" } test_listener() @@ -880,6 +860,7 @@ test_listener() # Capture events on the network namespace running the client :>$client_evts + print_test "Listener event LISTENER_CREATED 10.0.2.2:$client4_port" # Attempt to add a listener at 10.0.2.2: ip netns exec $ns2 ./pm_nl_ctl listen 10.0.2.2\ $client4_port & @@ -899,6 +880,7 @@ test_listener() rport $client4_port token $server4_token sleep 0.5 + print_test "Listener event LISTENER_CLOSED 10.0.2.2:$client4_port" # Delete the listener from the client ns, if one was created mptcp_lib_kill_wait $listener_pid From patchwork Wed Nov 22 11:30:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464621 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2077.outbound.protection.outlook.com [40.107.22.77]) (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 EA2E54AF66 for ; Wed, 22 Nov 2023 11:32:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="WINl1MBG" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uu2JsoDiNgGRTlYhoP60LNRU8ZWYbSplVS5m+C48x8L/x7nJPSbAg9HHRGLUjuqX1ZfKzNv3kEHR+EIeq6UxeRvfRlSUZuqV82+JKQRBEprGtmOCn0kD1lmTLXbDzW2JxeDqPwrF60Jwa5QJAS5q53o5JDjGaoyfoS6oXHU4IN+88iUBMZazJXlE0uu6Lh+rRJdCQ5bHkotq/CzNnKsjBjD6krk91XDPTjhkKdbCcvDeq3LRqm6D5L40RiPlNie4nm6FYl79R7HCHs6eD3i2VqVDSYUENyyX1NKCPzc9NrqF9BB75y0pEhJkR24rZPqqvXMac9HmCOqKqhNCWbDDcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=GByRMhoJmYKTOwoDzD3yf4AzdlJtmvjNU7vpI0qa3p0=; b=SJ27a8tmzJqsnqUi+/bP+Tm/tUHOU8z8t9BVg6GcoERze2yznIFB45SlsL6bWnqtnBkADLdogN9BJ3xpDqFP+PsZQ16RF80gndrjZvJc/kIG2b+l8CxUrDqgCj91WXCWLBe/A+xVc7PQK5xAAVS+CJse09Ka6GPtnU2qqFOtAyjY90Q/GHa+kdsuu3E9MXHR2Lo2DEsGflT6DG7uBH5ysrmlMkVWjeTN5uDz8Fav3FB2R5ARmNHyAi4axwhvlXpcDU10T9W+XK8dWkXTlCDNudQJczaCJ2Lpj3XU74b6JfpvZS6azwkSgKikqXHkBMAgeWICnDRz6FByvAaz31AyxA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GByRMhoJmYKTOwoDzD3yf4AzdlJtmvjNU7vpI0qa3p0=; b=WINl1MBGdEXZf7FxLJCg0CNOkI0qebqwrxb8vhQXeqEYb//JSQXKiqtz8cFWRRgbHA0YOhdpGTFDZVZzrUaoSR53iS424WAfhQHJAbDf83ePXpTtdYR+/YKNOwWjySsiMq6vyVhOMhUHu9ffZC+6Rxii7hcQ3ZAnZyAhOywSWFMposR8Ai2PvOo8kElKAOxRNTpWwwK50JptMi4I7iASl32gQOlz2aGol8iFjKwGx6MaTxAjKLu+0IVXu/BDFB9yfRUeqUNCG92+kzO+x+H7AJX+ktwzH3j4cfWx6dUrLDKpKIT1nxEWzcre3+DkVT55dDBAm193S41t1V0B7Ene8w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by VI1PR04MB10050.eurprd04.prod.outlook.com (2603:10a6:800:1db::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:32:24 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:32:24 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 10/33] selftests: mptcp: unify namespace names Date: Wed, 22 Nov 2023 19:30:58 +0800 Message-Id: <1480d7fcbd5402855655af6e82e3dd310fd01232.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SE2P216CA0027.KORP216.PROD.OUTLOOK.COM (2603:1096:101:114::18) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|VI1PR04MB10050:EE_ X-MS-Office365-Filtering-Correlation-Id: 5cdcb9f0-5bde-48d6-16c6-08dbeb4eb258 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5TUssMqL0qKu+p9UDFkbi85tnEyYQh5Z1vGJINPX28EJ1fbYZv3UQFy9XFnsj8r1XUdrtwihzxrS4hUF0AcXPegrH3xpSkVusR+qWnRGB71V/thzmGNhSbKrDgUbYjBfmuvxOCNBFriBYMqxIn2ewE4KWIzxK30acNh97ZGkwRqAN4DHCIou+/jXAFfoEaLB41QHiFE6PHthtdlYVLXUYZWjp9rkZMu+sLqFMbUYTTFx04GC5F1XClgesiOwsX3DrF1Esl/AKUcd/j3f01uIOuZrwTy/uL+UR8zqkOkzEp3tSF9RPZWJYJgFwa/BboREbxLyOoZggMoGwZmDJoKD1C3ONY+CkLX/Jl5tD04iksl0NlolaMHfJ5njXBi7p88i1Nsr3+LM/VAVMeXf0ZSQhJonQZLhFN9jihGWoiXy8RdpK9Hv8o+WGJy16esJ5l0fz8N3pOVnWWTaD9Kj600Mk+dJoCfadFEAQ9DnuOrrdVCv/pIlNigUVnnV0w2+Kzr8irPAsWZS8yoFXAMuhXqRStEna3ARhv0VEH9gJBAJyWaJ925jg7jGvBuFmjAMDrdGQq5HgIpxUexLfzJohCCPP8GKJ4VQfL9CSvBNogKFJX0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(346002)(396003)(39860400002)(366004)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(5660300002)(44832011)(2906002)(4326008)(8936002)(41300700001)(8676002)(66946007)(66476007)(316002)(6916009)(66556008)(86362001)(6486002)(107886003)(478600001)(26005)(6512007)(6666004)(36756003)(6506007)(2616005)(38100700002)(83380400001)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oB+H8UOcNsdJpAgTTR/NxopBwDbUvBqlQHWReXXLCcVQFEvNGz/cHt0BIlH3NSaXOrGZ5ricJZynfvc81Fnib75x7ng9C9fkp4jPf/gBf+wurBIwpqPPTjxcuNbkMfDfwq+Q6ll4fr62H2BLQxgNTnk+E/QFQOeyRA8k9HPfReRxLTKFKVyLctBZATP6s2+/4e8Y61Kvp7qZxbLgj9D1dm7jDExOMlEe97ETyQsJSci3EZQuotm4QL8KPoOJT/BZU6kdP5boeF6AZJTB8HNIAIdXyeYItN7K8/Yk9jdoOCirotR84flzMh/XJZ6bMheoGJIT+OEMBhGzAeywk3A1MT7D1+DA8P/01hVo9jwDDdG1OQeH4d/1HS3cQYa+t/khYqQeVCVT7i3N7N8VhoO7wllaA/GCrnMC70tI2WI9n4DxwOQm2ljid3apKdpOBmPA7ElKC6LmA1X5dviLrfeLRxDh7lLJuc3RsrgNj/OupM3oFBg8sOd+woa8zyw8x7kWbN+V6b1lkT+nikNpcBHpzu3eJUBdDesxYd6ikIZqmLpKn00tUMqLoTZ17U0lts6cpE/EaeMcDi9qLsLsQL6cFVvTsx/FYsJu3cuts4Db+vnCXL3NQFIw8SSWv5oR5TzRivFu8cldwfsEaKwRiELMuEVAlNULFt3zdRdBw+vh3zmQa1387/x6KrZ1A3NKv6ZrpTqwMSavCBFZAsqNhEpX52PkMsRRkznSqiHo6hu1rSAKTJHyGPLaZ5uOHyU2CDtpEFCy7v1rc55NXlY4egzTLsx5plpUfwBMCoIjVqx85/dkUCK61O39m1aGxTcnvdOpYWz4e+zTaLtwVWdzWPczGAyDxvy/MnbL5hhTC45Db8AiNwVnWLTjpzjLwzUDTxjxahpQCSQS0HxCjZOQBChI/mrsS7BVue9/8BUd9MEZRqqv6N45enS15xk90EjgHLKVnhKLc1K+k3cd0c/UT56eZsK7KQ4gRgjQJY9K6JqC14s7Lyd9sRehvx1Ugc2D9O37pjxk+txD9M5bmfPITVmK/q2HPQE+5/3gmenyQrqVR0IG5BKeuYKN+lU/JRznOIu8pi6JY5CJhrPdQjyZUv7Y112dKA6u7iahc/kf/yy66dfCrnFf+lKN5saVF2ZyKmsr+Wb3t0ESoS9kbIBZ+1/ei/a29Rr+bviAyvjBnV6xbNivuP5km/g3Zqj2/tFesExVnuGHebGqmohHACKE7eKj+5ZkKj9Uoz2FrPNAg8Kz8q8u6o9WDqe+9y/oaDRreKv0inT5OHaTxxzBoj0oJ3GlCJ6WeaY1juy9uK4wuBsKKRoCbt77z15pp3N+O44tqr2GmnnIypvm6dkTNllAkC3Q7B3sY1TTFKWTZpHkPh1xTfp99G6eP0Y93X2XNUXYxRyOkOzBcGHlINa6OWAdOQJV/rDqiUyfxwogmYKDVHSSNcd5C6SSpdKiFtZtCq2a/sO/k25gpTu/Jwk1fRQkvZspz/fG/8g0tWmtvKxWPTdcB6Cay0oxlaPoejiv5Xv1WNY/Y3+9eU7VvxLW6ePj5O53tH/7PYBHDSKLhugfJIpOnKrB1xQABULyKXztJ3qKk/emS5gmpsTB23gBBWJgmUxznQ== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5cdcb9f0-5bde-48d6-16c6-08dbeb4eb258 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:32:23.9219 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Skd/mnSN2/Qr0+LucHZyji/pFPMiLOVQEk4dTJEFyu7cL4blNFRd3AW733dzDiBLET6IhMOFrU6IuXAGqsT1Tg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB10050 Most scripts use ns1, ns2, ns3 and ns4 as namespace names, but ns and ns_sbox are used in diag.sh and mptcp_sockopt.sh. To maintain consistency with other scripts, this patch renames these variables: ns -> ns1 in diag.sh ns_sbox -> ns3 in mptcp_sockopt.sh Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/diag.sh | 46 +++++++++---------- .../selftests/net/mptcp/mptcp_sockopt.sh | 12 ++--- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh index 300aec419dd6..bc3f24c454be 100755 --- a/tools/testing/selftests/net/mptcp/diag.sh +++ b/tools/testing/selftests/net/mptcp/diag.sh @@ -5,7 +5,7 @@ sec=$(date +%s) rndh=$(printf %x $sec)-$(mktemp -u XXXXXX) -ns="ns1-$rndh" +ns1="ns1-$rndh" ksft_skip=4 test_cnt=1 timeout_poll=100 @@ -17,19 +17,19 @@ flush_pids() # give it some time sleep 1.1 - ip netns pids "${ns}" | xargs --no-run-if-empty kill -SIGUSR1 &>/dev/null + ip netns pids "${ns1}" | xargs --no-run-if-empty kill -SIGUSR1 &>/dev/null for _ in $(seq 10); do - [ -z "$(ip netns pids "${ns}")" ] && break + [ -z "$(ip netns pids "${ns1}")" ] && break sleep 0.1 done } cleanup() { - ip netns pids "${ns}" | xargs --no-run-if-empty kill -SIGKILL &>/dev/null + ip netns pids "${ns1}" | xargs --no-run-if-empty kill -SIGKILL &>/dev/null - ip netns del $ns + ip netns del $ns1 mptcp_lib_cleanup } @@ -48,7 +48,7 @@ fi get_msk_inuse() { - ip netns exec $ns cat /proc/net/protocols | awk '$1~/^MPTCP$/{print $3}' + ip netns exec $ns1 cat /proc/net/protocols | awk '$1~/^MPTCP$/{print $3}' } __chk_nr() @@ -83,7 +83,7 @@ __chk_msk_nr() local condition=$1 shift 1 - __chk_nr "ss -inmHMN $ns | $condition" "$@" + __chk_nr "ss -inmHMN $ns1 | $condition" "$@" } chk_msk_nr() @@ -104,7 +104,7 @@ wait_msk_nr() msg=$* while [ $i -lt $timeout ]; do - nr=$(ss -inmHMN $ns | $condition) + nr=$(ss -inmHMN $ns1 | $condition) [ $nr == $expected ] && break; [ $nr -gt $max ] && max=$nr i=$((i + 1)) @@ -143,7 +143,7 @@ __chk_listen() local expected=$2 local msg="$3" - __chk_nr "ss -N $ns -Ml '$filter' | grep -c LISTEN" "$expected" "$msg" 0 + __chk_nr "ss -N $ns1 -Ml '$filter' | grep -c LISTEN" "$expected" "$msg" 0 } chk_msk_listen() @@ -169,7 +169,7 @@ chk_msk_inuse() local msg="$2" local listen_nr - listen_nr=$(ss -N "${ns}" -Ml | grep -c LISTEN) + listen_nr=$(ss -N "${ns1}" -Ml | grep -c LISTEN) expected=$((expected + listen_nr)) for _ in $(seq 10); do @@ -197,24 +197,24 @@ wait_connected() } trap cleanup EXIT -ip netns add $ns -ip -n $ns link set dev lo up +ip netns add $ns1 +ip -n $ns1 link set dev lo up echo "a" | \ timeout ${timeout_test} \ - ip netns exec $ns \ + ip netns exec $ns1 \ ./mptcp_connect -p 10000 -l -t ${timeout_poll} -w 20 \ 0.0.0.0 >/dev/null & -mptcp_lib_wait_local_port_listen $ns 10000 +mptcp_lib_wait_local_port_listen $ns1 10000 chk_msk_nr 0 "no msk on netns creation" chk_msk_listen 10000 echo "b" | \ timeout ${timeout_test} \ - ip netns exec $ns \ + ip netns exec $ns1 \ ./mptcp_connect -p 10000 -r 0 -t ${timeout_poll} -w 20 \ 127.0.0.1 >/dev/null & -wait_connected $ns 10000 +wait_connected $ns1 10000 chk_msk_nr 2 "after MPC handshake " chk_msk_remote_key_nr 2 "....chk remote_key" chk_msk_fallback_nr 0 "....chk no fallback" @@ -225,16 +225,16 @@ chk_msk_inuse 0 "....chk 0 msk in use after flush" echo "a" | \ timeout ${timeout_test} \ - ip netns exec $ns \ + ip netns exec $ns1 \ ./mptcp_connect -p 10001 -l -s TCP -t ${timeout_poll} -w 20 \ 0.0.0.0 >/dev/null & -mptcp_lib_wait_local_port_listen $ns 10001 +mptcp_lib_wait_local_port_listen $ns1 10001 echo "b" | \ timeout ${timeout_test} \ - ip netns exec $ns \ + ip netns exec $ns1 \ ./mptcp_connect -p 10001 -r 0 -t ${timeout_poll} -w 20 \ 127.0.0.1 >/dev/null & -wait_connected $ns 10001 +wait_connected $ns1 10001 chk_msk_fallback_nr 1 "check fallback" chk_msk_inuse 1 "....chk 1 msk in use" flush_pids @@ -245,16 +245,16 @@ NR_CLIENTS=100 for I in `seq 1 $NR_CLIENTS`; do echo "a" | \ timeout ${timeout_test} \ - ip netns exec $ns \ + ip netns exec $ns1 \ ./mptcp_connect -p $((I+10001)) -l -w 20 \ -t ${timeout_poll} 0.0.0.0 >/dev/null & done -mptcp_lib_wait_local_port_listen $ns $((NR_CLIENTS + 10001)) +mptcp_lib_wait_local_port_listen $ns1 $((NR_CLIENTS + 10001)) for I in `seq 1 $NR_CLIENTS`; do echo "b" | \ timeout ${timeout_test} \ - ip netns exec $ns \ + ip netns exec $ns1 \ ./mptcp_connect -p $((I+10001)) -w 20 \ -t ${timeout_poll} 127.0.0.1 >/dev/null & done diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh index 45e5b5810a6a..b82f7b0b85bc 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh @@ -17,7 +17,7 @@ sec=$(date +%s) rndh=$(printf %x $sec)-$(mktemp -u XXXXXX) ns1="ns1-$rndh" ns2="ns2-$rndh" -ns_sbox="ns_sbox-$rndh" +ns3="ns3-$rndh" add_mark_rules() { @@ -40,7 +40,7 @@ add_mark_rules() init() { local netns - for netns in "$ns1" "$ns2" "$ns_sbox";do + for netns in "$ns1" "$ns2" "$ns3";do ip netns add $netns || exit $ksft_skip ip -net $netns link set lo up ip netns exec $netns sysctl -q net.mptcp.enabled=1 @@ -79,7 +79,7 @@ init() cleanup() { local netns - for netns in "$ns1" "$ns2" "$ns_sbox"; do + for netns in "$ns1" "$ns2" "$ns3"; do ip netns del $netns done rm -f "$cin" "$cout" @@ -240,7 +240,7 @@ do_mptcp_sockopt_tests() return fi - ip netns exec "$ns_sbox" ./mptcp_sockopt + ip netns exec "$ns3" ./mptcp_sockopt lret=$? if [ $lret -ne 0 ]; then @@ -251,7 +251,7 @@ do_mptcp_sockopt_tests() fi mptcp_lib_result_pass "sockopt v4" - ip netns exec "$ns_sbox" ./mptcp_sockopt -6 + ip netns exec "$ns3" ./mptcp_sockopt -6 lret=$? if [ $lret -ne 0 ]; then @@ -282,7 +282,7 @@ run_tests() do_tcpinq_test() { - ip netns exec "$ns_sbox" ./mptcp_inq "$@" + ip netns exec "$ns3" ./mptcp_inq "$@" local lret=$? if [ $lret -ne 0 ];then ret=$lret From patchwork Wed Nov 22 11:30:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464622 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2078.outbound.protection.outlook.com [40.107.22.78]) (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 1F9CD4AF66 for ; Wed, 22 Nov 2023 11:32:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="QFItyE5i" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XP/B0MP5roD4V7s0LOYnruW2DpV7eWkitylrSSeovysaEzzrBp0UPvFH/MeYJt5rjREZoYBQf/C3DxA8QL+emLD/L6KoXiViSWoRzxOzS9ATPEyX8jDYesTz/J8y2AaFymTeVf0vZZxDP3qjMP8p3HN7vLTw0P8Xu7bkHX/aAtMwZlsLkrFcDV5ikrjf83GWscX12ZtD99X9Sp717AdExTLzRWmQH+2FLPwOvIW3qndazl0tjLUfZIOqOlf3cGPSccwTXeN+hrpsKrBb2nXmNRZh0mwNezKUfsDNeZsoVoJvScay3FKdfrFToOYVR06ZJt8VZo8k2xb3jtNm0eEsKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=ppbpJiv/ID5CZUNyMRbeCxK4rtG8qjYSCPuK+rKK7dc=; b=XCCC9VQ+6ai4aJfcI+0sdb6DhFRhWgw1YZPgPnA8xMdsaTrpby5BzLBCNcW+t7GlyppACKn3DomZelr3Yc6K0i/5I2sZg2+g5gbypNTGFOMzGd/XbzuSgoe7FgOTpyagjzOyxNIGWfGO3huSMCS6LOdEVolQkhedBbN2LjvHgNrF+KUNf1RrEa1rmsIcdlqlny8NqiEeUdYrZYGhaQYegY69sobgdBHekOkrGNWlnvlvsEBcX3aLp/DPPrys7UDzo0/owyf7JHyR4bckpKqPq+bn8XZdkAipZ8xRX/oaTuD0zINhkQJ1Dy9XBbYTMyFHF3QIf69shrGJW9GXWS85mg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ppbpJiv/ID5CZUNyMRbeCxK4rtG8qjYSCPuK+rKK7dc=; b=QFItyE5icRkeZfdXBljOZNR1f3nt24PLswtBmJebbIBeMIRKYW8nMDUqf74J45ur+qJpZcjXO+cwhZgjAmBFTicmQKQ7EyN2up3JsfGG7R14Iqf3qS97zmNQFtqzs21r+02wpr4v/545wXD+Tu2XYd0G7qVoi56xcOv0bMxeM0tK7qfvW9JgK3OItfU7+YIOKC+2q9NFM3uL5XepaoFTtTUWwfbVD+5GnMl8xU+FXtBu/WZYvZ83w127BC9vwy+xFinTHuLpcaI+R+8y30qDdJgg8Cv+QvdAn44PohGx5njgW/dJqykQ8cINLWIvMa7TleO+QcvZ5+eh05nQlUpmEw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by VI1PR04MB10050.eurprd04.prod.outlook.com (2603:10a6:800:1db::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:32:33 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:32:33 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 11/33] selftests: mptcp: add mptcp_lib_ns_* helpers Date: Wed, 22 Nov 2023 19:30:59 +0800 Message-Id: <7a8935d0bf46abf614ec51a6dbc702f9c65e4e35.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SE2P216CA0020.KORP216.PROD.OUTLOOK.COM (2603:1096:101:114::11) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|VI1PR04MB10050:EE_ X-MS-Office365-Filtering-Correlation-Id: 381f6e94-6e5a-4ccd-4776-08dbeb4eb7e0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b40AnQxf7wtktZr+mYepB+Dp2nMIDCBeYPMqNJ5d6qwgvPH6INR5zNhynaL7PSUrt6R5Mywf+ASlsmYBi8Vh2csE62FNfYz8vbaBSJhVFBxReUaKjKrELHk/qii18dMXdg7qgnaoD92FeomdbBnFHnpNZMRcJJY8pcKQulHJHPiGM3IDIH0rLTGueCcYOwx+/p3//a0FRqHWMiQ6zWTY1s282zFEyjeBe7IrNCJgq6q/+BqiPcgftHYOkT1azfgoPjh8fOb3eJUV6CNuUojhj0frngIKqaTCNONiuAnkWvoWfLciytWoJA7klijgwQlSNkhWwdxscEw+wdNpWNA6PoEJzG5ruFUqo2nO3fMobWBmwc9IOTzCAT0odP9EZybuGZLHgbORMZROt6/4W2s9H6tzNkx2rtgoV7lWDLs58fqqEF9WtRDTcFUiCi2wlpwBrCxVbNCkYiwMXynTq6nwUzW56FxmqC7zQ0q98VC1ewdTs13IpA2xbC5oMQIC/P8W7gfeNasKZ7xAp2D0PQarsZRdsz6gs+83NhFQoduOs2jTe4pzRePOyRFSMZsFao8LL391Xzpz1Rwiaxee9OEq9I4W3R5Widb97NG8+ZoIMhE= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(346002)(396003)(39860400002)(366004)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(5660300002)(44832011)(2906002)(4326008)(8936002)(41300700001)(8676002)(66946007)(66476007)(316002)(6916009)(66556008)(86362001)(6486002)(107886003)(478600001)(26005)(6512007)(6666004)(36756003)(6506007)(2616005)(38100700002)(83380400001)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4wAm0jbqGlg9iR3fLDTQTFrtDaQXk9dJB+0aHFSK1VK3TyRt2aR6VPOLP77Loc/1EnjhogvSWsDmKPFjen2BQa5SjymIZdujZ85gCwBztRTplgZl5Bx15e+fNMq7n0KsoMmwwFVvLUc57jcvMbaTnReFC852Rjls4Vaaocerr0I7ug+yVvej+uxtJQn+IWi68+AtpB67h9aGkgTV4GuUoO7f6hew90JgnceinT7V+gNepZ/Jn162dTmdMRpLnBlHxnknVaKnEP/6b1+A+hFZB4w099QFc4pY2lrXvWkIfV4PttrNHdiqAJCOTKnfv+wY7QgXAfCSJpg3PratoYhcvpd1rfh9Hl5KUDSsZyxw1EIURzy3Y62r/igLr6P5Nmkg3fPOJlg8Ua4FsdkVXN3/B9Gr15dwnN7wUCK3HqmyW8zm+yl896MefwRMHbJa3Ett91UHHmj4Pd2NSYDxaMW7a4dqBiyxSjIvWkfOh1PoGgGYFNImRvkDCof2EVRZ0lXBMrhp8iIpRrinm2YKFj8UBnQmN1z2gH7tZeFklPkDcrIL5m1ZzIWT91OlBYWVo8mquQQ3rK1FTArt1jpoS+8FBu0ds7ox5oGLc242+gaeTCOgul6AwLEYtVC+1K7/hWAk1CCchFyK8wSx3nPzB/1YlEt8MxM4yni/U3ARioBWr3Uayp+DaQQROOig7Lh9A7wBjuoIxvuMc2OvxUbFfB4fIrR92/rzniDtgSu24wyMyk3X9nTBXDyTm2hV1saumPMm3A8q9ATuOVCKWaL/K4zVkCw8LYxh4k7JbI9FqtB9oS0VLduZCzaAotjLZwVU2+JYmpDphmrfWEAEp3RThiZlDo/McRt5u0We119LSj2JQsChL+bU2XWhn85BGMIx10Y1EZ4ZaKs/l7g3mf1rdKRQKqnNJ0YfyelncWf8xMhUCY8EPCcDito/QAms2VJ0r9yja1lMxpg3/aWadjf5pM6bvbWNKJz1rSL3jIJ3HWGpl670ilYqCCAUHgIVg6AgxtDl7vg8iCAPTtX/fJJH7WmEXr/W5yXnkQ8DvTfG6IgkdMuBdcFhGd92i7Iuen4uzd1AWQ/K2sVBMgltKS31Oby9skKKSnUryU33X3OutGgQb/EHlMJ7NP47LS8C2nURkFzXzkPXCYEygbkGO3PvG4n4o+AgEomN3EKSTgCBM2AP1UNXablGRy971/NNG+235oNHF8e7zj9l6lirYTLlKL5Y+1eCoB0Rp3dIaEoJm4iuxwiTu+arQNT6wAb/0b3V+7gDV7zNCkl8yk+COqzoey1buE2Hz22acCQjuBhFcBGkZP/Oy0vivREXhoNVBV4nvCIzjeL4YN9UttYmR0eVlOHoQJfZ6ZMhUiyFYi944d98E7QH94hTcdqD/lnQRrnvh1U8GgNu/dTBobGJs0ifAMy7PrUiGxHr0/lUQelOm2tv05qeVsgsC7nqCB0AVDyiYHzr3m6GOe4AeVjjXBja08gpp/SQH201mMXRgB3sLttlCb2YxrVKuoCJsBupRQXz/k5oQqiJmM4o6Gp5GERIl9J6OU8sdLpHCG0Hkpy3bDNmK8Vx7oAXAacmFdho0V/I3/AtBYsWQdt3Smvwp5n4craOUw== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 381f6e94-6e5a-4ccd-4776-08dbeb4eb7e0 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:32:33.3030 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uaCfFsil4TqCI1M40I+BcqGnKVL0t9FpORfxaxWJMH3f0HaH1MrlYlxbO4jpuHSP70lwgcEu5T0Ghsj1LR5EpQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB10050 Add helpers mptcp_lib_ns_init() and mptcp_lib_ns_exit() in mptcp_lib.sh to init all namespaces ns1, ns2, ns3 and ns4. Then every test script can invoke these helpers and use all namespaces. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/diag.sh | 8 ++--- .../selftests/net/mptcp/mptcp_connect.sh | 18 ++-------- .../testing/selftests/net/mptcp/mptcp_join.sh | 19 ++-------- .../testing/selftests/net/mptcp/mptcp_lib.sh | 36 +++++++++++++++++++ .../selftests/net/mptcp/mptcp_sockopt.sh | 15 ++------ .../testing/selftests/net/mptcp/pm_netlink.sh | 8 ++--- .../selftests/net/mptcp/simult_flows.sh | 18 ++-------- .../selftests/net/mptcp/userspace_pm.sh | 12 ++----- 8 files changed, 50 insertions(+), 84 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh index bc3f24c454be..3119811018fc 100755 --- a/tools/testing/selftests/net/mptcp/diag.sh +++ b/tools/testing/selftests/net/mptcp/diag.sh @@ -3,9 +3,7 @@ . "$(dirname "${0}")/mptcp_lib.sh" -sec=$(date +%s) -rndh=$(printf %x $sec)-$(mktemp -u XXXXXX) -ns1="ns1-$rndh" +mptcp_lib_ns_init ksft_skip=4 test_cnt=1 timeout_poll=100 @@ -29,7 +27,7 @@ cleanup() { ip netns pids "${ns1}" | xargs --no-run-if-empty kill -SIGKILL &>/dev/null - ip netns del $ns1 + mptcp_lib_ns_exit mptcp_lib_cleanup } @@ -197,8 +195,6 @@ wait_connected() } trap cleanup EXIT -ip netns add $ns1 -ip -n $ns1 link set dev lo up echo "a" | \ timeout ${timeout_test} \ diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/testing/selftests/net/mptcp/mptcp_connect.sh index 5e28292e1889..5e0263e691a8 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@ -120,12 +120,7 @@ while getopts "$optstring" option;do esac done -sec=$(date +%s) -rndh=$(printf %x $sec)-$(mktemp -u XXXXXX) -ns1="ns1-$rndh" -ns2="ns2-$rndh" -ns3="ns3-$rndh" -ns4="ns4-$rndh" +mptcp_lib_ns_init TEST_COUNT=0 TEST_GROUP="" @@ -137,11 +132,7 @@ cleanup() rm -f "$sin" "$sout" rm -f "$capout" - local netns - for netns in "$ns1" "$ns2" "$ns3" "$ns4";do - ip netns del $netns - rm -f /tmp/$netns.{nstat,out} - done + mptcp_lib_ns_exit mptcp_lib_cleanup } @@ -163,11 +154,6 @@ cin_disconnect="$cin".disconnect cout_disconnect="$cout".disconnect trap cleanup EXIT -for i in "$ns1" "$ns2" "$ns3" "$ns4";do - ip netns add $i || exit $ksft_skip - ip -net $i link set lo up -done - # "$ns1" ns2 ns3 ns4 # ns1eth2 ns2eth1 ns2eth3 ns3eth2 ns3eth4 ns4eth3 # - drop 1% -> reorder 25% diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 69bc8d16fc14..7b9e3e3ea8c4 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -21,8 +21,6 @@ cinsent="" tmpfile="" cout="" capout="" -ns1="" -ns2="" ksft_skip=4 iptables="iptables" ip6tables="ip6tables" @@ -78,21 +76,12 @@ init_partial() { capout=$(mktemp) - local sec rndh - sec=$(date +%s) - rndh=$(printf %x $sec)-$(mktemp -u XXXXXX) - - ns1="ns1-$rndh" - ns2="ns2-$rndh" + mptcp_lib_ns_init local netns for netns in "$ns1" "$ns2"; do - ip netns add $netns || exit $ksft_skip - ip -net $netns link set lo up ip netns exec $netns sysctl -q net.mptcp.enabled=1 ip netns exec $netns sysctl -q net.mptcp.pm_type=0 2>/dev/null || true - ip netns exec $netns sysctl -q net.ipv4.conf.all.rp_filter=0 - ip netns exec $netns sysctl -q net.ipv4.conf.default.rp_filter=0 if [ $checksum -eq 1 ]; then ip netns exec $netns sysctl -q net.mptcp.checksum_enabled=1 fi @@ -137,11 +126,7 @@ cleanup_partial() { rm -f "$capout" - local netns - for netns in "$ns1" "$ns2"; do - ip netns del $netns - rm -f /tmp/$netns.{nstat,out} - done + mptcp_lib_ns_exit } check_tools() diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh index 20c260aa68dd..2d28d0980b85 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -466,6 +466,42 @@ mptcp_lib_verify_listener_events() { mptcp_lib_check_expected "type" "family" "saddr" "sport" } +rndh="" +ns1="" +ns2="" +ns3="" +ns4="" + +mptcp_lib_ns_init() { + local sec + + sec=$(date +%s) + rndh=$(printf %x $sec)-$(mktemp -u XXXXXX) + + ns1="ns1-$rndh" + ns2="ns2-$rndh" + ns3="ns3-$rndh" + ns4="ns4-$rndh" + + local netns + for netns in "$ns1" "$ns2" "$ns3" "$ns4"; do + ip netns add $netns || exit ${ksft_skip} + ip -net $netns link set lo up + + ip netns exec $netns sysctl -q net.ipv4.conf.all.rp_filter=0 + ip netns exec $netns sysctl -q net.ipv4.conf.default.rp_filter=0 + done +} + +mptcp_lib_ns_exit() +{ + local netns + for netns in "$ns1" "$ns2" "$ns3" "$ns4"; do + ip netns del $netns + rm -f /tmp/$netns.{nstat,out} + done +} + mptcp_lib_cleanup() { echo "cleanup" diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh index b82f7b0b85bc..ff49ee9b9cc2 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh @@ -13,11 +13,7 @@ timeout_test=$((timeout_poll * 2 + 1)) iptables="iptables" ip6tables="ip6tables" -sec=$(date +%s) -rndh=$(printf %x $sec)-$(mktemp -u XXXXXX) -ns1="ns1-$rndh" -ns2="ns2-$rndh" -ns3="ns3-$rndh" +mptcp_lib_ns_init add_mark_rules() { @@ -41,11 +37,7 @@ init() { local netns for netns in "$ns1" "$ns2" "$ns3";do - ip netns add $netns || exit $ksft_skip - ip -net $netns link set lo up ip netns exec $netns sysctl -q net.mptcp.enabled=1 - ip netns exec $netns sysctl -q net.ipv4.conf.all.rp_filter=0 - ip netns exec $netns sysctl -q net.ipv4.conf.default.rp_filter=0 done local i @@ -78,10 +70,7 @@ init() cleanup() { - local netns - for netns in "$ns1" "$ns2" "$ns3"; do - ip netns del $netns - done + mptcp_lib_ns_exit rm -f "$cin" "$cout" rm -f "$sin" "$sout" mptcp_lib_cleanup diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testing/selftests/net/mptcp/pm_netlink.sh index 75c7594dbd71..32265d4ecb41 100755 --- a/tools/testing/selftests/net/mptcp/pm_netlink.sh +++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh @@ -23,13 +23,11 @@ while getopts "$optstring" option;do esac done -sec=$(date +%s) -rndh=$(printf %x $sec)-$(mktemp -u XXXXXX) -ns1="ns1-$rndh" +mptcp_lib_ns_init cleanup() { - ip netns del $ns1 + mptcp_lib_ns_exit mptcp_lib_cleanup } @@ -43,8 +41,6 @@ fi trap cleanup EXIT -ip netns add $ns1 || exit $ksft_skip -ip -net $ns1 link set lo up ip netns exec $ns1 sysctl -q net.mptcp.enabled=1 check() diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/testing/selftests/net/mptcp/simult_flows.sh index 3536c7160ce5..c1a21cd8c076 100755 --- a/tools/testing/selftests/net/mptcp/simult_flows.sh +++ b/tools/testing/selftests/net/mptcp/simult_flows.sh @@ -3,11 +3,7 @@ . "$(dirname "${0}")/mptcp_lib.sh" -sec=$(date +%s) -rndh=$(printf %x $sec)-$(mktemp -u XXXXXX) -ns1="ns1-$rndh" -ns2="ns2-$rndh" -ns3="ns3-$rndh" +mptcp_lib_ns_init capture=false ksft_skip=4 timeout_poll=30 @@ -29,10 +25,7 @@ cleanup() rm -f "$large" "$small" rm -f "$capout" - local netns - for netns in "$ns1" "$ns2" "$ns3";do - ip netns del $netns - done + mptcp_lib_ns_exit mptcp_lib_cleanup } @@ -64,13 +57,6 @@ setup() trap cleanup EXIT - for i in "$ns1" "$ns2" "$ns3";do - ip netns add $i || exit $ksft_skip - ip -net $i link set lo up - ip netns exec $i sysctl -q net.ipv4.conf.all.rp_filter=0 - ip netns exec $i sysctl -q net.ipv4.conf.default.rp_filter=0 - done - ip link add ns1eth1 netns "$ns1" type veth peer name ns2eth1 netns "$ns2" ip link add ns1eth2 netns "$ns1" type veth peer name ns2eth2 netns "$ns2" ip link add ns2eth3 netns "$ns2" type veth peer name ns3eth1 netns "$ns3" diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh index e78a79da3960..93f8b200ce49 100755 --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -40,10 +40,7 @@ app6_port=50004 client_addr_id=${RANDOM:0:2} server_addr_id=${RANDOM:0:2} -sec=$(date +%s) -rndh=$(printf %x "$sec")-$(mktemp -u XXXXXX) -ns1="ns1-$rndh" -ns2="ns2-$rndh" +mptcp_lib_ns_init TEST_NAME="" _printf() { @@ -102,10 +99,7 @@ cleanup() done mptcp_lib_evts_kill - local netns - for netns in "$ns1" "$ns2" ;do - ip netns del "$netns" - done + mptcp_lib_ns_exit rm -rf $file mptcp_lib_evts_remove @@ -118,8 +112,6 @@ trap cleanup EXIT # Create and configure network namespaces for testing for i in "$ns1" "$ns2" ;do - ip netns add "$i" || exit 1 - ip -net "$i" link set lo up ip netns exec "$i" sysctl -q net.mptcp.enabled=1 ip netns exec "$i" sysctl -q net.mptcp.pm_type=1 done From patchwork Wed Nov 22 11:31:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464623 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2088.outbound.protection.outlook.com [40.107.22.88]) (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 8B7954AF66 for ; Wed, 22 Nov 2023 11:32:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="p3xdzFw6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h13eQ/r47uz2PV88MJD6sRtLrhNZE3tI18VtUppSon12jf2LeEKMJqXxtdP8T+cTZqYoFFAsRUT3GFZ1XnFRV1tv+D44racmMk1kCzul2g9SZ3Mu3otxa6mOFPf0gPSFGhqbCafdk3kqwwc4hFaWk+laMEBZIIxjul3rzzo0JynrmR8mpPXDKhqlkII0er485E9D4F1MlmovVb3ruBb5+Aq+JI1d0mB+1rjMpv+d52LnE68VnN/TPbVZspYrHGUt635moBNPbkBT2A+WiEs0HZeZUDEREnyinoCpvK9MIRNThGw5kYDldxNJHGSDRTYIfhhtT9MbbTNv/bxAit0bWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=T38sL+r3/wWcw1Yc3opwLZGblto/rvJgRPxzV6SkvKU=; b=g0StEwivG13jog8OUdpKbm039DQUpQUW44dopZq4u3ItVNwUjPQPsomsNatbalXESph6tw8yR9gUUjSMpLdxjeB0N0+babv4ntY3YwwOKg+ghP2sTOQSYGPzxnV9EWpFx4jHYfE0ZcPoLlUl3iZtIzecH2KtN0Prz++6MasEIsCZKdvmxKCZMJsMWXxjoAgxIIHORJSYfrdGPTE/7X1RTq1mUbJJSOoOtWElv+0eoum386RGVMB9rdnRK9xx3ZYmn57Z54/31O0r5U0x05JueFKEcgUi7U+txtRZcfuzx673f5apStgVRZyVECbY2kVlCl7kT+y1ePLaA4yypR/d2w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=T38sL+r3/wWcw1Yc3opwLZGblto/rvJgRPxzV6SkvKU=; b=p3xdzFw6YaoecwFcuh7RO5pylIBrWEASsFH7t5+igGtRaE6/De1mcao8NZOFDyirKizzihi2ae/RyxjMZG9HXcsXyUm6Z4ttXoN+kdGypJJ0bdhAzO4czqwwWbmIUarYFp5N+m4pzupeVyMCw1/LuKR4M4iy8b0YOuSWl9y06kwLFSA6EC/nhnZ7t/INRY5v+fYdmiUvFyIuyDeJnLJ+B1w/vQ4R7IYOYKqTLe5q6TdofjfDf1Ws/fQrcem8FXfCG/iBtucPbc0W14l+ZcZy7BrQsJbQHGk0iIGGZ8na2kSkztHdYamFAGWOi4kX0p2BwBg+f7OPOBbLI/eC4J9Oeg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by VI1PR04MB10050.eurprd04.prod.outlook.com (2603:10a6:800:1db::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:32:40 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:32:40 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 12/33] selftests: mptcp: diag: print colored output Date: Wed, 22 Nov 2023 19:31:00 +0800 Message-Id: <7ef9aa16320a8221786f2ea9490f6cf1c36bf998.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SE2P216CA0023.KORP216.PROD.OUTLOOK.COM (2603:1096:101:114::12) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|VI1PR04MB10050:EE_ X-MS-Office365-Filtering-Correlation-Id: 1e9c8035-afb1-4ae0-c467-08dbeb4ebc0e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RqJhwfk8qYPjYCN2fTeKpPkJbRgM2IW9EVdh3zCNm/SNJjGvrczZ3r2Jxm8W6vG/Bygg4U+Flyte8X70vmzHO/pxAbD+DW3HJwGrwJjS+hkOqehKFiDNTntxQT0ufQhuzYA+iVmR9Pqq0XDDsPA+xgC9FC0JJI/iW7Pzjq6znv2TH209w1EtLISAh4xpvLsVEc4JL10eHrAroCzZyOAKXsdROoATFY35RDcY93iJBrn8YCybqoqV0vJ/oyBmNhA3eMbx4woptAc8Sl5ouup75YF9hkHaBGRhqLu/WoNM2icyznS9QxdrG5HiJ/DV0n7ZxEouwFYicdfRK7N6IkLlRnL2nuNZqI0RUiWCuA8YkX2TxxX32hGnPI9vcqTlsRFYCdOPHd4Ayorf4mvLqdOTphkA4pYIn90MEbJQbt5CYRkEPXy4Ved5n/P9VU8q/USjVtKpVOG9AxeXOcwmfo+9djANeLFe8Sd/5oDnJesyWlckb9ABB7l9+dOVjTN+46Gc+YegSURB8W51trqx1VHtRIdW8BDzBYaiShmoFjWbOL9Ju8DvG7LgbYuoSAGOIqnOBXCRQNiE2nPvVztw6gplpdkk3DTGFKZHQTrXSn8Q2rY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(346002)(396003)(39860400002)(366004)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(5660300002)(44832011)(2906002)(4326008)(8936002)(41300700001)(8676002)(66946007)(66476007)(316002)(6916009)(66556008)(86362001)(6486002)(107886003)(478600001)(26005)(6512007)(6666004)(36756003)(6506007)(2616005)(38100700002)(83380400001)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LQ2EuY9h/Bd1M58XtyttzJ55xdc3F7b9FRjm40bzsAs3Vm+fnSzU6Jgmig00nRGlKH+en0YwwaWTPoe5STxJ8JGTb4C6fn78iFH8l8jWJdOV14QOhexgxxskMiSUOW11X2kwJbKE4ug2HjwYYPHOlYgEz/Rc17GKJFHh2QRda+77MCZHh1bsRQJtFHx+dxDIb9azaBN/WWZNhUAvQHpbhqgACn7r9KAOgF9y8DDPOl4Ps/CbZ57nyMZ+6Nu5XEEviPi5Sb6udsdx5VfcTM9gl7XlqfpGduocH+EVtmgE5bV3hh7GuUCbZj7rYOLkS8fZ0dWbagzFSE6YTtzdoycsEs5lDEHPeaKjs8ig4VDe4CDDL2zjL5IA6d6nAUzdU/7RtzuldaQidMXhNUVGdzPzVnHC6yMxQlENyQ2KlhF2Y7faTOAic2fAc4qD5x3a6NB7qPWqkd6hiM3msFgRBhUK5erXdImpLoKzMxDD1S+9kxwnEf05IYi1Oltsa9uQGrcE6AycEnPL6/Z+s6qRXeDbJcn2EcJCKt3CyQSD2scMw5ZN1sFnNd+XEbc5scaQ21pj5lqPXoaaD+y3HsxGah9h6V23awoG+MSNsZb2KhhjJzrU5hX0aX/QGQe4eeQJ5Eg41vBzMIpaUzUSp3qLpvA4fQ5g0/Rarevi1Dbh7aXQi1EOtDjmOpVPESdKqvonG8XK/K7JSJzL/TeHeiGeNLeg7nw6ApHrYnoILAIRwcYQUUyZJQKK260E4jnvbpihzr2Dan823kztv3Sg1JXlQbYlV301qmpA1mAnMB4ewMvbk2YC6AMfTkec/kpqopeWOIskYMORVkY/elbACX7rxGmtsGSTXNc3SHMlYCCiHiXNW8/g6HqnRdiACM8R71PLrDxOlRBcRA1aStpvKN7GyR0KkTQTALZBB4w5s84NWSj5mIC4rKSmgprGshk3Hs9dXLXrYILAsLr5pIF1TS4V34nWr3XbGTDIqSLE4n2LPCP8bFwdg/ce0k9zu7nlRA+OTr5xyIl4QJHiW2GPVqw9oklj1OOoPTedVoBErOcdkGhMadIVToMAy8bK2uzxMeh7+Lnd/8MeNlBtu/ptz6e4DMMQdaW0wiNp9oogg1Wu0f1wtoTkJukfKw3Itj7X90ifdWqr5mrRn2n37HAjg4y2936EdSrMb3SFhNLMV6j0LnU9SYy87vUcOGr0eAQ6A2s2jpSc+dp10nhGkZShPGTfjvsUSXab185tNQjcxB8SaCJvaWvkKgoJ62o/QJyE9aMt9ur1xEzlpzcBtDfYCcPXE78Ax9O7f+CFTsipfd6de9o6HbHWSxVLiHai65BUb5ncmL5HGf2LWslfM8tJ4rFGG3H/rNlUmzLt3Dz0gn39jAIxPCxiJGM5mdAMutZixywfTr8uCFFk0xX4f6Q6VSr5LsY3CVHq5vXDj8AmxMTTxCr9x3FMvGmz/y4AifTqRaI8J+P5r8CR6/mcxsyC7wpbzUsRrEmwx6oUWrTzAmWGYES7LuhVEYLlVh5MAlipSq8hZ18FUzC3zkRl3hgyS/KTDB0sqwx3/ffgy12S46sWdMe/Lul1rPbE5Lx+xZLhKaIWG1SE5joHeHctaRcJIHBC+3C3Mg== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1e9c8035-afb1-4ae0-c467-08dbeb4ebc0e X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:32:39.9642 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vlMlpOJc241BbcXgpkrMqGi7OPaE/+ffO32D/VPOHrTb7bRT/GzWcXfo3VVcRK45Lu3qmg2508f5vb1xobqAoQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB10050 Use mptcp_lib_print_ok(), _warn(), and _err() helpers in script diag.sh to print test results with colors. Having colors helps to quickly identify issues when looking at a long list of output logs and results. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/diag.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh index 3119811018fc..7cf1f602bf48 100755 --- a/tools/testing/selftests/net/mptcp/diag.sh +++ b/tools/testing/selftests/net/mptcp/diag.sh @@ -62,15 +62,15 @@ __chk_nr() printf "%-50s" "$msg" if [ $nr != $expected ]; then if [ $nr = "$skip" ] && ! mptcp_lib_expect_all_features; then - echo "[ SKIP ] Feature probably not supported" + mptcp_lib_print_warn "[ SKIP ] Feature probably not supported" mptcp_lib_result_skip "${msg}" else - echo "[ FAIL ] expected $expected found $nr" + mptcp_lib_print_err "[ FAIL ] expected $expected found $nr" mptcp_lib_result_fail "${msg}" ret=$test_cnt fi else - echo "[ OK ]" + mptcp_lib_print_ok "[ OK ]" mptcp_lib_result_pass "${msg}" fi test_cnt=$((test_cnt+1)) @@ -111,15 +111,15 @@ wait_msk_nr() printf "%-50s" "$msg" if [ $i -ge $timeout ]; then - echo "[ FAIL ] timeout while expecting $expected max $max last $nr" + mptcp_lib_print_err "[ FAIL ] timeout while expecting $expected max $max last $nr" mptcp_lib_result_fail "${msg} # timeout" ret=$test_cnt elif [ $nr != $expected ]; then - echo "[ FAIL ] expected $expected found $nr" + mptcp_lib_print_err "[ FAIL ] expected $expected found $nr" mptcp_lib_result_fail "${msg} # unexpected result" ret=$test_cnt else - echo "[ OK ]" + mptcp_lib_print_ok "[ OK ]" mptcp_lib_result_pass "${msg}" fi test_cnt=$((test_cnt+1)) From patchwork Wed Nov 22 11:31:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464624 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2087.outbound.protection.outlook.com [40.107.22.87]) (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 0D2034AF66 for ; Wed, 22 Nov 2023 11:32:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="zAxUN4xg" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=deOiLixn/uqgcS/inLLE2A84yxYXCxn2+QJzXpfygNJQOBaYQqlKM1MrZ5roaonfF00YJOClmXJMDGX1a0FtCqZFsWj4//jPtbM+74C3/GZ9AZ1asNUhPfemMwRWA8QXF2SvP4bQd3i+y66CgGA8S2/8NzY/onC//+dey8f7kM3pIY+w4N4KSCRhFv52bQzO9nwTbhCwMMZn2zM6eB2arCC+yeDF3E4urkhbmUKsIFvp5gTQ6+Zl3IFBh+uqL91q72ATn2symkq3fpmowEFGoyACBVotsHSSZzD6v60G2Ssegkvn9YACxflAvaVnmhBFu6wIoIcmwa7cdCPcIsxauA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=Kk5E7V1oRZ+qCVhmUP7eSPJSAk3aWcVa5p6NQ4nG2Rc=; b=kKLGfAXsXpRYw3odmkqUi4wb//2/TVaksCWtwuQyrXUGbwPmgl6uBM3z4cJPjSefUBnBT/s6J0+8Oy1GSNZs01xEvNt6QJfVICCZrb8HjnPXBcw9UE/9xXoYzI2ZN4YfJVODdixA/16VQUYOOUZfPMQcFvvY1JiQ5cgDOpdUYe9byaxfVmKUwubJyCg/Bx+sMJ3t7bh56jzFv1/Ky2gBDgOQXPv1f30ui9LAAwrRLOBvg65JmR2I9SHQIfvJi7ihrII2nWtC5va//kfUJCvpAlG9+fXs/IanG3vLHHKfaB95mG13r7YpEsNfjQ8DN4wm9enfimM2j35ZVfobyZRwpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Kk5E7V1oRZ+qCVhmUP7eSPJSAk3aWcVa5p6NQ4nG2Rc=; b=zAxUN4xg85D47RkbMh3ynO7i3J81nazZq/dlruAdIrh1iRr1sl8UYy+VieQlvsjO0AH9DO2wlEnfil1lehbxfFC3fWWmAvy/GRMnW4PbSlKgTMManuv6jMF6+GvmftKXUl/cQGyKW4mh1zDgSdpdntGeyH//Ty+5gsVieZuvLoMHkKxV4oQFkHmzDZOm0j5lI5R/OOBqhTr8AHoARuP3Oh/px1kMfkr/hbe2Khmnyj6t6zWc/1uR/b5mCfP40pRSPY682fT+EaoKE5udgosDXaaq50KCBtG+9EPNhLRcvfytR7mLEltE9dtME1o55VPeufJRC86LHfl/x3ceMBbIHQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by VI1PR04MB10050.eurprd04.prod.outlook.com (2603:10a6:800:1db::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:32:48 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:32:48 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 13/33] selftests: mptcp: connect: print colored output Date: Wed, 22 Nov 2023 19:31:01 +0800 Message-Id: <58797410ad20582ce1887b515ba1d9dad777c4ed.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SE2P216CA0025.KORP216.PROD.OUTLOOK.COM (2603:1096:101:114::19) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|VI1PR04MB10050:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ba39ec4-6613-4ffd-4adf-08dbeb4ec10a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZBMhhk6vTQwOU7+RJcy748px6AlPA0hQa0lvvpCoTCAucNh+lk9HTAz8DYvSvq3lQEibgDcq/9PTA1qk6Bb5KhQpjoUpgfVdSxzyOADq2Mi2sw6tN+A12sfxWRbgg46Dp5WrLlEg5TU5v16hIcrJ4JTeOAYpNX6Y/GfQK9pPoIxOTiba6MvGusczdDe28Iaw8HVZ/HlDLgOZcFjFpq+hAWneTDYiFHorjE1vuM4AXa4PVYBCVlBSLSfSBmBYvq+bIg2QZw/0sIOnc/8IU2VzNxhAHwtHPzdud/eMu8muBRv46lQC+it3pZfQ0IAs4cW4OUpvuGjt4xv/D5xzv8EtKavpAAuCWzGriKcxY/3OK888p1aimg7UrA2YUasZ+fJU/Qx9jM9yvekR6cHrgGk8dKm/b6DlyymvffJqSNeo+kLbc4JcgpFUUx6wSBSw2EOkYZbyG/KdM09VmmznTNkHZBy3lUSMYBZxO4n/B42Wf2RbZqg6R/oqJjb5ugI8ApssgiCz7zbsgnuaLcexyY1XE0HCwFQTLkdaVp+EA2V8CHL1nceqpWmn5yfKqxG/d9aL3JNykxxAQrp6InSD5/gi+2w4cBc+mNfpkumtNvehXR8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(346002)(396003)(39860400002)(366004)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(5660300002)(44832011)(2906002)(4326008)(8936002)(41300700001)(8676002)(66946007)(66476007)(316002)(6916009)(66556008)(86362001)(6486002)(107886003)(478600001)(26005)(6512007)(6666004)(36756003)(6506007)(2616005)(38100700002)(83380400001)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: r9xH5hF9xzWKy1YKDnZCLWlqDqTUZA7Xdh6km38wQkzat4wv/qvWQtcWuU2sRTq2uD1jDvze/KEpj5z5LgesbSM7LDZ+ktA0LT/rxYAIZjfD0zqvSYyMwON0fGyPrNJeUjfS00yiiZ9F36S5RO8KqQHyRhDE/pX5dbBwtd7SpOGoVW0daZF8cTyMP/I+xip2rmwN2gXLrp8Fd+aPITC8NoMmRDqfGxaFvNCirxzDv+6mYnij2oeJY+uoPr8uZJLA/WUSDcq4GbGBCsge5LurYKDHq6aS80RfljZM+Pl1gnSDnJvZCgTm1J0P8BcOgh74vixpYNzWF+ug0GSwnUfL9KLmVB3ZTK4AXGN+mn02gbwsUjJTTC4LctTrr8sPgkdyiksDUrz//B59n4tetgbT3HDnbE0u0YbdxpczvHNzhPWQ6y7PE4gaWO2CkGhdwSaHtHMnEzflmmf7DVbDPO4cMrlC28mkSvwyO1jS1nIHHeVsSAcB29ByBcD9cEiuY6GPlkKAPzs/tPo/ilUXUAJEqm+fJAuJSkafZk1AbQFeh8DjujSB0jfZ442EyzGrEWaElHHiz6In6r4XxfYK5HcORrmtyV2sSUyHS86i4Zb6LfIH6povmylh/Zdt8PYKZ9Xa/aSq3I4aB9oqJW3CoxQRoloTOx0nccqGnspMK+0rKh8K89Su3btxvPwyd893z7NuAnzfWddg/2G3OF3bphICNYsXHg9dudW6FDUFt2WFQrIFyTz0gxNqrktEgk4c9pgRko7Sbo28o0Vkv1zwHu8Lk4Fls+42VBAwXR0kgJqw4fJkMQP9bIbvnEZJdBk62VSiissGsE+n+tYWF/X4UfW+4WwCUVKuLJ7T6UMMOiCIRYwf7+Lb1KRfXyiMLJ2da7OcF+0VNC5ofhwk1bnVrlQju0DJNosgMmJqCJvLxxmfMtbyO7cfex41LzhvKXL5yN4PuLOtd58Nv8RHx/yLkIjI71Vl+vuS8qwL2ma4S1eGF0e9ZgDyr+a4UhP4UegSjpcYSZ67XOl3hmmDGsLUTJ1JgvlB7GQAHMcnIH6oJL66PRwofOc7d5cXrGUMRhA4LkI9ivFs/PpBxLS4BAfVwhzOhsUUoZSLKogl6XRR6GEDB90WQ0qhEBD9w4aRcai2yF7F/+TIC3Esn55qiN9Wr7GqwWlLbAW3ixIPrKg7lAhQrjgzAdq1dM+YUNklGSSGHAvihm9+vtXU5kg/UHIewhc8qnnSJ16II3OoLYgjDcOZjfHmEBK6VjmpxItS93HqiOuNUeCznx3MsG+GV/CDcU7IToE7K+lAyIT/qWgDPvxQjYB5mOWnkQt7+Nc6NxkzrCHNTxuGkd6h1My4wlMRCMcuAVPDB5qcfwHewpS4r4jI0W+ytU6FZDdvDnP51HuuNgK64WdjEMwZ6+tICseOwAALUX0PYgSa9lJFZqndQQ2VlRHNLpjnnkwnm58aGYTFK6W6o3u7D5iBuuYbzAWTAZSEWkJhu2ibhRCwNprrysgkxtv8oXOTWt5dkzHd91QS8d3iCxDttvreFBSV80axmAfWsmY5kAoTsABbGev475C0BCsArlD+Qu5wqv9TTwyoBhS0m0UqeuJ9Xv4WxinDZqErwQ== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ba39ec4-6613-4ffd-4adf-08dbeb4ec10a X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:32:48.6228 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dsNj5MWbGrkrUYrPn8SKtrOI0Szo9h4Ma3c7OSzSCAwxCP0vO9yXhElnGdVZN9uvoLkAh3O6QHtMe+USrSoA+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB10050 Use mptcp_lib_print_info() and _ok() helpers in script mptcp_connect.sh to print test results with colors. Having colors helps to quickly identify issues when looking at a long list of output logs and results. Signed-off-by: Geliang Tang --- .../selftests/net/mptcp/mptcp_connect.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/testing/selftests/net/mptcp/mptcp_connect.sh index 5e0263e691a8..d085a32f662a 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@ -266,7 +266,8 @@ check_mptcp_disabled() return 1 fi - echo -e "New MPTCP socket can be blocked via sysctl\t\t[ OK ]" + echo -n -e "New MPTCP socket can be blocked via sysctl\t\t" + mptcp_lib_print_ok "\t\t [ OK ]" mptcp_lib_result_pass "New MPTCP socket can be blocked via sysctl" return 0 } @@ -482,7 +483,7 @@ do_transfer() fi if [ $retc -eq 0 ] && [ $rets -eq 0 ]; then - printf "[ OK ]" + mptcp_lib_print_ok "[ OK ]" mptcp_lib_result_pass "${TEST_GROUP}: ${result_msg}" else mptcp_lib_result_fail "${TEST_GROUP}: ${result_msg}" @@ -513,7 +514,6 @@ do_transfer() "${expect_ackrx}" "${stat_ackrx_now_l}" fi - echo cat "$capout" [ $retc -eq 0 ] && [ $rets -eq 0 ] } @@ -689,7 +689,7 @@ EOF return fi - echo "INFO: test $msg" + mptcp_lib_print_info "INFO: test $msg" TEST_COUNT=10000 local extra_args="-o TRANSPARENT" @@ -716,7 +716,7 @@ run_tests_peekmode() local peekmode="$1" TEST_GROUP="peek mode: ${peekmode}" - echo "INFO: with peek mode: ${peekmode}" + mptcp_lib_print_info "INFO: with peek mode: ${peekmode}" run_tests_lo "$ns1" "$ns1" 10.0.1.1 1 "-P ${peekmode}" run_tests_lo "$ns1" "$ns1" dead:beef:1::1 1 "-P ${peekmode}" } @@ -731,7 +731,7 @@ run_tests_mptfo() return fi - echo "INFO: with MPTFO start" + mptcp_lib_print_info "INFO: with MPTFO start" ip netns exec "$ns1" sysctl -q net.ipv4.tcp_fastopen=2 ip netns exec "$ns2" sysctl -q net.ipv4.tcp_fastopen=1 @@ -743,7 +743,7 @@ run_tests_mptfo() ip netns exec "$ns1" sysctl -q net.ipv4.tcp_fastopen=0 ip netns exec "$ns2" sysctl -q net.ipv4.tcp_fastopen=0 - echo "INFO: with MPTFO end" + mptcp_lib_print_info "INFO: with MPTFO end" } run_tests_disconnect() @@ -767,7 +767,7 @@ run_tests_disconnect() cin_disconnect="$old_cin" connect_per_transfer=3 - echo "INFO: disconnect" + mptcp_lib_print_info "INFO: disconnect" run_tests_lo "$ns1" "$ns1" 10.0.1.1 1 "-I 3 -i $old_cin" run_tests_lo "$ns1" "$ns1" dead:beef:1::1 1 "-I 3 -i $old_cin" @@ -816,7 +816,7 @@ check_mptcp_disabled stop_if_error "The kernel configuration is not valid for MPTCP" -echo "INFO: validating network environment with pings" +mptcp_lib_print_info "INFO: validating network environment with pings" for sender in "$ns1" "$ns2" "$ns3" "$ns4";do do_ping "$ns1" $sender 10.0.1.1 do_ping "$ns1" $sender dead:beef:1::1 From patchwork Wed Nov 22 11:31:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464625 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2082.outbound.protection.outlook.com [40.107.6.82]) (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 975B451035 for ; Wed, 22 Nov 2023 11:32:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="HzHhB67n" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fSav+UxI7jt7BF+ogD7Ng9sR/lxC29rxjpoRjCyaEdIYwGozjVUd2oS/5S3P6x7jhLPcf7RcZPlbJoIoHx8WbPfuvsvWSDq3qr6143XsHlunQUXfKdKnd0BMFSfzNz+wEWjiyMv+U+SGDF7jHLA3MdRPio5StsPwMEYBv3kB1zaH5YE33uhZWWzdH8WRwVH30Cq4YXpFiJ5vQaDwP1bLkSx/eCUIxqMScmnOycKJfcpj1VsRmfuBYnvkX1J0MHYtQONGPim2eelc/DYtRk35w50j2TBAEDSWc25tQxDctNd5qZOK38jgIJGp/7ZkDN6iUAe4M2zcJCN0fzPiEhJ4GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=XQRS5uEfzetn0fPm8Jcjcj+ipA7eCIm5/BJTKHB1sok=; b=GnUR8VJPBg8W1vbVQwI2ulFaq2sKMO5KNHvwxGYxW1zfh4S75Cw4Gzm2fGGGvhIUnKtRsgtAh0YdjWD29GCfhvY8bTmtY3BVfc8bhYAizfkaqtVCCxbGlqUu653rTa9nK9r/sfHRh4KCp1Qi5peLiR+gy8mXVxRO1nUrAW5UrdrmWGsbsR4fLS9xU/kVBuCFI11bES0TyYoj7/Z3IJXApZwpluIFL7W4O+JxMlGS+jrovgMrloHSGp1bfud7iN2fCb0H7L7a1bxUYbN+QTeiIagjxfXEnnaPaVgfCB3kEHvo8wlVX3ZikocgGgFAjqywjpvK3ttwQlm5hnVi04yeBg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XQRS5uEfzetn0fPm8Jcjcj+ipA7eCIm5/BJTKHB1sok=; b=HzHhB67nPYMfQ+UkMGu48eDQinWQQx7ARXyZSzB9/q3tEPPxPYPGmKX2eDBsUKNXbg8ZN2ZbTpUlvjk/oC3tV4ax/9k5XiE2/qzOLf0/kC3FNmXoTJREtyDm+TMXCIzdn8GPwyszsXqWB2i1ti7n3oiBiYooSgQHpxaSHz2MvE5HiPoW/Z+m06cCzQHolz08JPUkkJhoZPGW51dhul2ICivjOtUE7OlFdZnIhx9ZQm/r9VViOHOwQwNG23+N93As7eZCahZ+FDy8U+TIgL/SltqPaglRFRRRT27UtwlYDJfxztIe7MCV/MqV7cFq2kpUeCDX4s8FUTRs82VqfHm0QQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by PAXPR04MB8333.eurprd04.prod.outlook.com (2603:10a6:102:1c0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:32:57 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:32:57 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 14/33] selftests: mptcp: sockopt: print every test result Date: Wed, 22 Nov 2023 19:31:02 +0800 Message-Id: <969ecf72809657fea20fc896975856920e7dc333.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SE2P216CA0021.KORP216.PROD.OUTLOOK.COM (2603:1096:101:114::8) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|PAXPR04MB8333:EE_ X-MS-Office365-Filtering-Correlation-Id: e56d05e0-818e-480c-9429-08dbeb4ec629 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GxBVFT5DWsNX43/H0oYL3xghzQ/o9qzJn1MgRQlyIQ51dLpoqMz6iADptsku4c2gJXIIcoRSI2VnrdZQFZKtz4A5+TPY0zHFL/aT8Ik3pXzd+zHYzLUkTTj2c/Zy+DOV4mOEOgNnjCp3ZpWlDNSiQwXoDzPMFumJxRcUO4zMD67C7qAxVPydeKwv0uZCPtvqIpROM/7KkeWssL08NFCcDB0Db2ca08nvvBaHIMViYTIEA9NMthCmuPorrR3W9z4qIQDBocL6QhFVMPTBrv1v4FjIltdhTUqY1t1fEMCr5TiE8qT3/Mx8JkUzEwISdwJ6BLWXELp+ud6L9xaxu3QD1n+XWUAHSzjJqYR2ze09AFVjKF18PJtGDeEL5UXGlEFIcrmE78BjgKK6lRBMzF9iVXN52QCS1oFtiu1fS/Vp3Ir4oCXscJrdbTp8JNaL/BkwPwcqbl6F9NGs5clmnx0zEJGfD1NTyvTSkJPfDYBlXehmKtuRKE+U/qZce9stmw9YupUDSwjqHUiawvJBAHwzW/ZtZ/04vjsgmfFSTtG1lU6dIHpP32du5C3yc4JgXE2HhBAzUEqoqetTpGJTLFuU4rBkMJGRchhHYsmixSbp6/Y= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(376002)(396003)(346002)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(6506007)(2616005)(107886003)(26005)(6512007)(6666004)(316002)(6486002)(478600001)(66556008)(6916009)(66946007)(66476007)(44832011)(4326008)(8676002)(5660300002)(38100700002)(86362001)(8936002)(2906002)(41300700001)(36756003)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hKO0IZUZo3+90CsaDzkSLZEGczIq7dkvMqg6Oc18UWGUW4NMiRCak5j0c+BmcBggMkDaGJiZ1NIEDUCP1K2lTgjba1k7ADAaBvxkebwAEIs6n5bY/zc9JOMRbFUv70ZV578jJckd26I7fRtmWQb3wXHjGs6m4kHphyLdjrzocBrU5yHWJpphsaEaz0K1/mVKQDEvgmkquPZYNFN1CpHT+HJ2gMmaIZYH4r2j3wLOinquP6kiZrvnwKtHx4Wg/SqYzccu348hqCOUZv/5h8HO8ZFXLYTJccrQMLUsU4gGb9THtcRVJi0n8BaWpuF3VZVPkitBxhrkBLYzPY+y0OGP9HtNBJRlc7wZaj4uz4VBTbQLs6uQs4YuagJ3RF+aDRMoT22MFnvs6n0LgSKchHsAUXPK6fOA80VxUWPs5IR5d/ODZM4KsQJtPoL7WHdprBJMQ2sF2SVRsWl2Z86hHxGvN+sYhSY7ST5rULdpRbZI1YvQVU0xJxmP+am8wYdsHFx/YnsN2+lsevqtFclDqGWcxVSCj3wXeK7QUi8LE/46PXUag6Ix77e6ggYm10bjXTWI/5prHXdtk9DowymbtQiGX9GytDY6FqyVBo+f0/lKfuBwuC8iDC2I/bVeZ5f7I1goGcPEZ79o+/hf0gPG4dccL4ga7ThvRWcL/z8NTbUmQxINhfQuk6sZ59GpFXNj42I+hV9vLbLGsJN7P0RWGuQHmdLFGSFeZrQM9Kk0v8rJu0pdUbC7aZzrLjA9u/wiNCoei62nP1HJYZ2H3wZNRmH/bF7Xo7XhWaejX3KZZc72nhhUw3CsMYuEIlco7YNcTCIWhA3Es9NpSMpaxFalplEJIxvb7ZqTe0v2EGTwvapPr4LmXeBLqJBh0WVuaU5294rvkh9FsAr4MKaMIFSbELMdmJ0nnx2JevkkxzFgsJHjE60UARSi6x/2xqybiq9xF+Ioj0oNurO+7mBcYMOCKIuCJoelQ74FtdjgCycfhrx09+wcbsUrh2JZNazhIdGQ9X6uE84cTyfBWhuXF8Hv3q0bVBdfcCTerzzG+Vo39W+NyaWVNdUYKIgRUTAkj33cMFiTXP0ETGGLECHPDl6qy2ZtUcLDTIFk9tLwF+zvwLmmb1r8JJDjkPewizqfgwklQ1Mqnn/umC6UJN39wT0s4hZ8lR2BeZP47ZC+Z9crTNkWPOxTqALc5MUybMcDGZf0Ip9+KHKnhptxF0SiPrD4/ZOd/Zyc0I7gJtRrVfoMmCeRHAPeqT1lR6DgZWKLy1Ie87Xy0KooNe92mWvNAs/qMpPQEkKnfQu9EuesM/WzopXKcO4S8lSbmkzqrquKJizBqGUt7bbyMXqYwZpdZvuJ0Ney4coh8n4rDaH3M1blLrSh9cApT4RpA5r1BAl9h0VQGjWHe/jMwmirxbJBPV0KRvUP1oiBzdXPB3ezuclsqGWaoJ87pxkp5flxHTKHu/ruM0w5lIGoTHaoi2XGVAsWmSRTO77s1ETFwgTsQrGfGPWtj7SSqcyHbw0iEdOpjz14rlEO3XWVzg5BJFMjfkbIQt6An72/cehzeeM8+gwIjSH9t+WJ+VEd5DEZ7Sf7KGWASTsUxcHWUmASW1fXZg8rNksp+Q== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: e56d05e0-818e-480c-9429-08dbeb4ec629 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:32:57.2255 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +AXYLqc0iTgVoXEDEjIHNCIPqkYmDekH18AlX4+KMXYp+RnAhkIXfLHCgnJIicuy7HAfOsEOBiOnIG6BXcLvYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8333 Only total test results are printed out in mptcp_sockopt.sh: PASS: all packets had packet mark set PASS: SOL_MPTCP getsockopt has expected information PASS: TCP_INQ cmsg/ioctl -t tcp PASS: TCP_INQ cmsg/ioctl -6 -t tcp PASS: TCP_INQ cmsg/ioctl -r tcp PASS: TCP_INQ cmsg/ioctl -6 -r tcp This patch prints more info for every test result in each test group: transfer ipv4 [ OK ] mark ipv4 [ OK ] transfer ipv6 [ OK ] mark ipv6 [ OK ] PASS: all packets had packet mark set sockopt v4 [ OK ] sockopt v6 [ OK ] PASS: SOL_MPTCP getsockopt has expected information TCP_INQ: -t tcp [ OK ] PASS: TCP_INQ cmsg/ioctl -t tcp TCP_INQ: -6 -t tcp [ OK ] PASS: TCP_INQ cmsg/ioctl -6 -t tcp TCP_INQ: -r tcp [ OK ] PASS: TCP_INQ cmsg/ioctl -r tcp TCP_INQ: -6 -r tcp [ OK ] PASS: TCP_INQ cmsg/ioctl -6 -r tcp TCP_INQ: -r tcp -t tcp [ OK ] Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/mptcp_sockopt.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh index ff49ee9b9cc2..f6b9660122ea 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh @@ -173,6 +173,7 @@ do_transfer() wait $spid local rets=$? + printf "%-25s %35s" "transfer ${ip}" " " if [ ${rets} -ne 0 ] || [ ${retc} -ne 0 ]; then echo " client exit code $retc, server $rets" 1>&2 echo -e "\nnetns ${listener_ns} socket stat for ${port}:" 1>&2 @@ -181,12 +182,15 @@ do_transfer() echo -e "\nnetns ${connector_ns} socket stat for ${port}:" 1>&2 ip netns exec ${connector_ns} ss -Menita 1>&2 -o "dport = :$port" + mptcp_lib_print_err "[ FAIL ]" mptcp_lib_result_fail "transfer ${ip}" ret=1 return 1 fi + mptcp_lib_print_ok "[ OK ]" + printf "%-25s %35s" "mark ${ip}" " " if [ $local_addr = "::" ];then check_mark $listener_ns 6 || retc=1 check_mark $connector_ns 6 || retc=1 @@ -202,8 +206,10 @@ do_transfer() mptcp_lib_result_code "${rets}" "transfer ${ip}" if [ $retc -eq 0 ] && [ $rets -eq 0 ];then + mptcp_lib_print_ok "[ OK ]" return 0 fi + mptcp_lib_print_err "[ FAIL ]" return 1 } @@ -232,23 +238,27 @@ do_mptcp_sockopt_tests() ip netns exec "$ns3" ./mptcp_sockopt lret=$? + printf "%-25s %35s" "sockopt v4" " " if [ $lret -ne 0 ]; then echo "FAIL: SOL_MPTCP getsockopt" 1>&2 mptcp_lib_result_fail "sockopt v4" ret=$lret return fi + mptcp_lib_print_ok "[ OK ]" mptcp_lib_result_pass "sockopt v4" ip netns exec "$ns3" ./mptcp_sockopt -6 lret=$? + printf "%-25s %35s" "sockopt v6" " " if [ $lret -ne 0 ]; then echo "FAIL: SOL_MPTCP getsockopt (ipv6)" 1>&2 mptcp_lib_result_fail "sockopt v6" ret=$lret return fi + mptcp_lib_print_ok "[ OK ]" mptcp_lib_result_pass "sockopt v6" } @@ -271,6 +281,7 @@ run_tests() do_tcpinq_test() { + printf "%-25s %35s" "TCP_INQ: $*" " " ip netns exec "$ns3" ./mptcp_inq "$@" local lret=$? if [ $lret -ne 0 ];then @@ -279,6 +290,7 @@ do_tcpinq_test() mptcp_lib_result_fail "TCP_INQ: $*" return $lret fi + mptcp_lib_print_ok "[ OK ]" echo "PASS: TCP_INQ cmsg/ioctl $@" mptcp_lib_result_pass "TCP_INQ: $*" From patchwork Wed Nov 22 11:31:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464626 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2081.outbound.protection.outlook.com [40.107.6.81]) (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 A446751035 for ; Wed, 22 Nov 2023 11:33:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="DI+GSAGL" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hizAtS9bzhBfhLVz6NqGHxhaH5pqlsnwKYWaBvZlmWaC/BNa6nXywdwwWxL2gtbwwflnzsyAuauu/BVLNKEUagtsD/G8rDIFAelPIVUNvcz8x2T11jVOZphTZVu9urPXX2U5t58KuIZX8AuR2odrC3cosyLgu/tyn+0RNXqDAak9aQwK0TZdya9ia7O1+sQTTABe8g6uZnLH508nxdt+9WMbszQaAG0QXpVRyAQl0hK1Qg8Ch4ZiSslGXDzPZ3SQf5pLKqRXjgh/jLiGvfDTzEb+tXa0AoZRE6zpOEJbHQUP5ECw9+jS6wwL/F51G2t+an2ZLyB5fusLOh0esZuuZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=AkZYV6WFJHFXQfrGqSpqVCjOBsM8VJaS355gfq4Ru6s=; b=gfxJBsyVjAKoy80PjeXBjF9eIlOHoWobgjqEWVohE4+dDXN7u5zho1qc0qFHCfMk6kEIiOMlgmVQaqb+LtI602vlDx7X4d7atxVbCYrRmrQGOVhOv+g9MsnPFWAM/SeQdaKhYKV0D0EpBw7gaOHvKExJQvPYvUq/fxeKoYHWlLe82CkTNIZBrXzZo9Bf86LQXGHrNueAD8kH3/fEyuatOoswLYf+7mUJd82ABuO5Xd/eP/+JyITH54XYUUG1cVJQbOII1lBm3mIYafJWhtanYW8liZX2lEnh5SlZ0UHCrNZ2e5ntSIo3gL8OUsllB/cQmcgQ86tCUP9LMFHuxNN8eQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AkZYV6WFJHFXQfrGqSpqVCjOBsM8VJaS355gfq4Ru6s=; b=DI+GSAGL6LSo+iMpGqxOBuE39ewK3aGeLUHwTftsX5z12vM3uhw+z7SyKZJRtMdZ9tBPQ5tkVqypN7cNaGEx0BLjfna6gQ/ZtgRysjUHVAwPGHoMu5c+wUFO78P+uDm58KpgfF7uFPy8XfVeFJl9/VKSGBxDm+AHYZy3YKAAtqSypPVNw0VgMEF92dF/0M0QWiGDFUU5CTHUQih6L5nwDsq9N9cAKjY8gsswBKSv4h4xGD+Ls+0XDJYV53HP7hVNk2CccftAQ5AidYwWGHeTz5ejvMaaPEK/o5VjYmEelDwgiEUvQ0gmy+6QzLbCv3pQik+ZNHweVZ8wqlfNEDrYPQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by PAXPR04MB8333.eurprd04.prod.outlook.com (2603:10a6:102:1c0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:33:05 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:33:05 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 15/33] selftests: mptcp: sockopt: print colored output Date: Wed, 22 Nov 2023 19:31:03 +0800 Message-Id: <6a283cce60a2674e5dbda5db1b70a8835e3af2d3.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SE2P216CA0029.KORP216.PROD.OUTLOOK.COM (2603:1096:101:114::6) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|PAXPR04MB8333:EE_ X-MS-Office365-Filtering-Correlation-Id: 85628d6a-8133-4a0d-912c-08dbeb4ecb1b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MLC1htGF6ktrPeZ5cfuRqx3wVw7mrX+FbAsQ0PayqwYpCLnxX0vtYBwoKGBqVs26B4OaQgjAZh0fYoy9TmcvEpwglkcPmEqdIZKkgvWPAmWBnhuxqfl8R/uVUkE5NNYh2DLyZiloQRSot6BcR6zPZmnR8O5GLgOpOgko+QxUnwyQRsHK4syARRdOgWkheqt6WgkEaw1fP/WwFq2KteoargcLk/ZEFUV0mSkzd6RBysNUA7xD145k1WIzz5BDJ+vhg0zj5zxFewLK8q4tSSLldHdRqMI6gwxE7nwbA+jPRoERXdItWkXQCOZY4mgpbbP9eFpVSrkzs49O+xEuZBf9Ft550fCIxNuFgZwfttdxqmt9aHD9zN8OlGW9n+I33F+LrnOxzFxgE2/qShycnCbtS1Wf5exZpzweCxrXW0fdfy7377zlPRd99D3bzPBwzkwSM6YbQExFQ46msaiSWbda7JYJby9Vo3E2zeiVTtNeNsWrXlGQpHDAZgasoZXod0ClbsB1kxEJSD8IuAQm6qncFYsGXitO7nz94890rHQd+dd5cSjowfkgP3eXowx6VS51qngl77EZMSkV3QEqRpIXuDYgTt3W3T/85DDQaf8V+88= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(376002)(396003)(346002)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(6506007)(2616005)(107886003)(26005)(6512007)(316002)(6486002)(478600001)(83380400001)(66556008)(6916009)(66946007)(66476007)(44832011)(4326008)(8676002)(5660300002)(38100700002)(86362001)(8936002)(2906002)(41300700001)(36756003)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yQp9MNkKx5UGGMr564UQ9NRHNHHDW2jXp+1SI5tfRFHG2h3XnbkE3pNHJLbEOBeoSaOF1t0adzDaocQDR8MieWaWIh3jOS/ybTJC9qdlSseULEkS9KI6QvPoBxGTwUFynL6AbZMU7kfW61Yx/NKZGDYxdfQcbfdVkGjn1XngVvHIymBzysKzkU5GERzyztjhO3H+plm7IfMI/U/KlUQba1GKiF5dhs2iauLe700U0Ixi8IQky1u1MjsfsmeWV3P0ZMo+VUXyYU3Zbwhj62y2lV1zyxH1JZVjKQCoTiNYNuzxQfQLdN3me6EVHWZOtmqsseWd9P04kbN89U26JP0f6dSuLEhtc5hK758CgVK1EazH1m2HK/VVKf+Ei5VnD1bojkfOEjGPkLjP3jvcxfqUBRC4NDs0fNB3t8GbgPIdSQjB93WUT37g+/GWCr9PV/86OuY2FgqfTNSFnRBAicrEz1WxNcsX7GsJjSPHWLAjG0azo5w5D2KkJcBQajcj5qy9lmEWWVQeVWyeWv+iO5fxPsbAXnhsrrqEsAFfSD3wcx1ToaCyXzSOK9pT/4wV3lf1mBC+Yw2vGMQNs1GZyQYHeEVmdyghbSp8zPMxUEsEzujGDZANLgEtJFsFWqZJhzJIXj27fIgmFQh9c+zAj1buTLvMgpiZWNGUvq4BanQo1Hr1kgTw2mPCaJjx+QvFDy6POs49MrXssznsrcKPxD2vSAiyUKXQI2Mk1Zg9D2IIxjDJ5H1xDrqyu3Pwv3r9aZ8YJar2Y1gVQmRFv6sk6L+fLGqR59i8VfqPkWNw1h1HIdwnTIZ5ElsT0xmWUbZzZMVXbJGPVwG9J4YGxrDmDJHA5EpcJJThZyQfDyulPsIWoolBICDblChQujxVLAZHcXf2noZy8Rpf2NCJ/G4LDZK1uNgsS/6Cdj4+zVW4nwbMd5HMxcd77A+gEI7vJRoJIBng+x8euzBTnJL345OFOchuFRvrjEMz5RF/LAW6dOTsxfGfiKXFe7WnKcR7N1qr9BUCyh+q6njUnBDIN/mLUgxsjjA60crSSDOWYvnl/Hy/ifyJP4IB91JwpvXu90TTMVDlwZK2LON76YVLwCBeJyQBVfd5HJnopf4gUmj+71Gj0jBhMt7DxzUm422pRgf2IJN1JEWzY65QqQ6m7yoE/ka/4M0gfEt9qZMcI11jQu1ahfSecddAISjXuMRBYPA3N5iMcnqfSWme7DxT6Py0tUtAw1tgcb4W0z3B3CP2z4hEfZ6WIGshSLqjDJZAyk4FHc/nx8d14RUcE/X3b2A6t80JDb/HqPV3HBuSl+LRaRpwIsQb4crHOzJ6uEaZ/AbA6BjSYcZ6ArSz5vnWmEgb630pJ4uwdwXXwrPWxpMZj/WCkXwmq6YLdCA50ne2ZnPYYorYyoFuq8tjkiLXdmnzeAfIa1K3z4FjAF2r5QDJuGWGuohGM3aUGlozmPX+AhiqJiBoZqTSXHsa6X4fZGROg5k4Yz6p+LDhn+nPrqlSOmCOhCtXg8QOZm01GjCfL369dmuZCtLUehQPeRElwXwP2C0tiheZXTDSMBH2eFxNS6qYkcSSWInSZ1R7la2eLfKhGcj/IVmfhPzfu5QqcwDCHljUPg== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 85628d6a-8133-4a0d-912c-08dbeb4ecb1b X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:33:05.3346 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +NWjhpNX1zPa8LehZsE4Fva2XJ6ySIsjb50vtPY+I/Uj+uL7tCabJG1Ps9JH+QtHYT6pqkOQbw3fBMOECIUGuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8333 Use mptcp_lib_print_info(), _warn() and _err() helpers in script mptcp_sockopt.sh to print test results with colors. Having colors helps to quickly identify issues when looking at a long list of output logs and results. Signed-off-by: Geliang Tang --- .../testing/selftests/net/mptcp/mptcp_sockopt.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh index f6b9660122ea..9baa103055c4 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh @@ -230,7 +230,7 @@ do_mptcp_sockopt_tests() local lret=0 if ! mptcp_lib_kallsyms_has "mptcp_diag_fill_info$"; then - echo "INFO: MPTCP sockopt not supported: SKIP" + mptcp_lib_print_warn "INFO: MPTCP sockopt not supported: SKIP" mptcp_lib_result_skip "sockopt" return fi @@ -240,7 +240,7 @@ do_mptcp_sockopt_tests() printf "%-25s %35s" "sockopt v4" " " if [ $lret -ne 0 ]; then - echo "FAIL: SOL_MPTCP getsockopt" 1>&2 + mptcp_lib_print_err "[ FAIL ] SOL_MPTCP getsockopt" mptcp_lib_result_fail "sockopt v4" ret=$lret return @@ -253,7 +253,7 @@ do_mptcp_sockopt_tests() printf "%-25s %35s" "sockopt v6" " " if [ $lret -ne 0 ]; then - echo "FAIL: SOL_MPTCP getsockopt (ipv6)" 1>&2 + mptcp_lib_print_err "[ FAIL] SOL_MPTCP getsockopt (ipv6)" mptcp_lib_result_fail "sockopt v6" ret=$lret return @@ -286,13 +286,13 @@ do_tcpinq_test() local lret=$? if [ $lret -ne 0 ];then ret=$lret - echo "FAIL: mptcp_inq $@" 1>&2 + mptcp_lib_print_err "[ FAIL ] mptcp_inq $@" mptcp_lib_result_fail "TCP_INQ: $*" return $lret fi mptcp_lib_print_ok "[ OK ]" - echo "PASS: TCP_INQ cmsg/ioctl $@" + mptcp_lib_print_info "PASS: TCP_INQ cmsg/ioctl $@" mptcp_lib_result_pass "TCP_INQ: $*" return $lret } @@ -302,7 +302,7 @@ do_tcpinq_tests() local lret=0 if ! mptcp_lib_kallsyms_has "mptcp_ioctl$"; then - echo "INFO: TCP_INQ not supported: SKIP" + mptcp_lib_print_warn "INFO: TCP_INQ not supported: SKIP" mptcp_lib_result_skip "TCP_INQ" return fi @@ -339,12 +339,12 @@ run_tests $ns1 $ns2 10.0.1.1 run_tests $ns1 $ns2 dead:beef:1::1 if [ $ret -eq 0 ];then - echo "PASS: all packets had packet mark set" + mptcp_lib_print_info "PASS: all packets had packet mark set" fi do_mptcp_sockopt_tests if [ $ret -eq 0 ];then - echo "PASS: SOL_MPTCP getsockopt has expected information" + mptcp_lib_print_info "PASS: SOL_MPTCP getsockopt has expected information" fi do_tcpinq_tests From patchwork Wed Nov 22 11:31:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464627 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2078.outbound.protection.outlook.com [40.107.6.78]) (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 82ECD51035 for ; Wed, 22 Nov 2023 11:33:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="ltaY1qfG" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mC/v6Kivak+q9AuYXxGfFiTpge7H/YpkTVVKMq1164kJ9EgALCL4vi5wLecrt0TQoUxtzfxPHZn6cqYNcLtORWtWepeDcJVvaXhWHTVriwWlupnoBFDJjAs72z5WL7+/z4YSHonHVRLFCMoDzLQ9Kg8RMwlzGdr6UukyRPJys1UINXhJ3cKCxiitai/KeU5q1eJFso/Z2CJx+UUkAuKeaNbp/uu54rj9LhEGjmwqMV8UndWRF1u2FfHfIiUH9sJVvCTHcDwrrvsND1tEpNFwfwksunD/GxInsNSdGTDcoqU7iZuHcAR0lu66pm0KFRK+KacrEcZMVXA/4cbs7w6Cag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=ysUkp4mVylQeoPS+00bES1AMp/um1WXzpOnC8sAj910=; b=iCm66ZZ2XWLviMQpDGYxxaQP9NCyESt+4hPOCooIJ/+3cegVo93Dq55MbpEW5UzcUsFJgFI67pgAO8Frb83PYdAgqevOFtAbN3bxFM1q452irWp0CbRWT+3YmXjXF3VQulD+mkfAtgJ3Igw9jswR6ITCPg1lW/4XNLsT6OgliLbnmTJ4bl76AVcOtfM5ASQiesRigdE+wpuvXTm8n6M5oApgy25FNWTzGOfePXtXxTx7hpUEIWKnbqPj0T49AymWGjYP5YIh4+cOxU786QF2z5ojnB1C1mmR67uh5D8dUNZWKHFcmH1xc4Q+KyqWcqTTyPhIxyu1iMDG9Vkj1A84Fg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ysUkp4mVylQeoPS+00bES1AMp/um1WXzpOnC8sAj910=; b=ltaY1qfGJPP9znFiFyfvhO0hhd6Vei2F3iI3Os8GJpvy3h1LzCs7QIN+GaLXPrfXJci1gLBDQKOiTGMb9C66Q2PoE+GiwXh2m2Jvl/Dd6yx/dgbozAPllIXhzRVFCBKw1aZaddgK+4vEnOE+S+uLOEBLBCCEy6b9CiuTB361GQD6oVS05bC69xJ8UwvhaS2eyU0HyfGLX3mhpEG/AJcNHh5CJhdyur86d0yOGz1ditjyjfPEV2pFnwg7c6cUzOKe11kQ4VbwgGZJn0dKXoG1qsBsMX9CN6P6432+OzV6YWRKV6SrriOknNsbPHVxMkafkzh2h7gJfk9Iha9BRU0Egw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by PAXPR04MB8333.eurprd04.prod.outlook.com (2603:10a6:102:1c0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:33:13 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:33:13 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 16/33] selftests: mptcp: simult flows: print colored output Date: Wed, 22 Nov 2023 19:31:04 +0800 Message-Id: <6eb7d66bfe03fe769f9cf058684e05f9bcb4280f.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SE2P216CA0030.KORP216.PROD.OUTLOOK.COM (2603:1096:101:114::7) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|PAXPR04MB8333:EE_ X-MS-Office365-Filtering-Correlation-Id: 9cb4431e-033b-4be9-c97b-08dbeb4ed008 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lTBQoMHNL7wzpBdwXmXzZDan8J9RMVPF4wLV86LwttVazH8Yyk2Ptzj8jV7VUFiwMU5ineLBrIm2vzdD2v5gTQN/zy5Fw9qOvYnUUkwaOd7KSO0UW8TVNG+jFHTDfA3fq+pp2+QDxJ+ou1AG4hFgpA0LLhACXSFYVFOcF7ZPzbDjY2XR0lchTTT6ZhF706oHakQt0OV9eMFNWSnFQLMrE7aOwdPJJ221Gr6AOYqjHUGSc8vJoAVMg84mlIsNNhXjpEnDHfGRRvo7b5cuDWIXzFS0J6cpQbpDYXbKaVzfNdY5DgX49ZxN1dUSRZX9Eqk0rhaTDYgvZdkWd3Ja5FOqffb8qWqjpgNBTcRViPS1S8nd0ilqWqSn8u/g50F8DpKj69gZhwaTxFplQRg6cqddtAQ+uEsZnA28rYAYPCA7+UR3MLle9zVMIhQhW8+UPz7P7+q1/i3SA5Ik1Kt7aFdaBI1R6VOHYbdYwmtLzIH/IBkdOg0WVcrS0sq/agQNogyk3lllqLjid94ctp0xnA/hP/J0OEBlwyzcgsfLxKSGORyk5KRIAuKXKA5s5thVlsRyDGt9oxNQzirNvbW2DIUYhpZmrjriElGJQY2qyAV3Acc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(376002)(396003)(346002)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(6506007)(2616005)(107886003)(26005)(6512007)(6666004)(316002)(6486002)(478600001)(83380400001)(66556008)(6916009)(66946007)(66476007)(44832011)(4326008)(8676002)(5660300002)(38100700002)(86362001)(8936002)(2906002)(41300700001)(36756003)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: y61kQR5yDn9RTKkZMNqMN5n3+bHIeNN0lc6YldQnG0o8BXdSwYMeRay1oS5RSInptrTdff3bLMuPjfqfXnpjzgOXsWb5lEypYRbK7GRQ0Ss0QHGQraw1wdbq/9cOABB8H4Z47JdpcrFeC5AayTqPaJvITdC86BqMyRl7ab3pQc25raAuu+tGRQ0+Jj1QOY8MaoYo3Un0qVwcP33DJhX82yY8fJCrf1PaJODFJIlnqUj7Mc29KkTeiOAVyGv/ryQqsZA3tpvNCtCmDqnlVXqhti/kbs8YicQmuei3JZWZVJorUvYmcWGu57Ju2KTz6oxztNBdH9pI2AInq2wqKYAj+juLZKz/rGf4tnUn/q5p/7O4L6xKSy0G+zA4ab/cURCLdF2aeveV5BR7KQ0pOrnfrz3pbS1eYxe1uBkpzfLkxwt+zBknO1BQce1Ze4KG/uAEyAA2rWN7XlJPDLPFpWZDyHWzutWnk5RetWt5ugXbwIBydpYkB5hfkizvn7qbW6aLLtGbIqgoj7uK4EiQYIOfUbYNrL6u8IYdqOGBNyDW67UxSvnxcMDl9YqXRAeLhf6Qar07N765UTBovIMJK6lvYkPjwzkMFc14R/8hRQvlbvLj3dNIJgbPvRNnpilFVgNcWCzC/W+GZZZ/2eq7jptRUsxe9h7IzoXBNKIKn05T4cxG7TohzxUaWPmPWz2+tvMuC8pztHwG9HYOhVFVrrXA9L5bf/+9Ps45iOLzG6sPeyvycw70SFeXs0BGdrVnHnKIT32DGa9D7ajtSN868uu3h2f5P1beK+D3Py02AzO0ki9UPPIrHvdt5MRuLo8/oeZMpyzR6xtZO2lgj16RQLdV+9tJ++e2v+h0SGcWY7kLSkcuTyWLEa6a2fjYWJoyyP8Mfwckx+lBZB+kgpopDmh2dSwJBINjmtoD63N0bQUNHNR2uv8rexlBJLb5QSChrGgMc9vcG/+tR2jI9b9LmEPBt6dFR/3/opoPSYRozDBvvxw3PSRimuGAIfBhisEMc4to89vr8m4K393JauKRdn1SYrxlQBMgurXZ3GnsAMkVqpowSpIJ1i1kuNu6oja/7VhhuMgb1QEWIomHAJKvKMD4gc0JSgYxRsDOdw9TW3ONNWnUft/4MEqcqzjvA4raoG2FN6vQJWC2s42mlrP5dFpHIRcnfaFeOz7NoHVSRM+Sn8DPYKYOMSwai814dUpL17wWMI6fkaRbUET3Kmz7BgniPvs2xXKOevK+4kAYydoL/mO2xmTA4Rg4nPqWJVe3M+bGkfvxYm1fjr1fvkSHNe3Y0qlfCOpScBD2x4Wt56aAhAbWIlaJ0k1d9Wf9/0ZEi9LF/E8MRKvr03arfYaTo2KYRmeEd65S9hEnUrGA0sLIiHtMTaCju3iQNFoMjqQlAIirNf+u/xw6TBAKhw2nef3WJcvf+U7+87+BTu2ei8ESnOCsJkW8o4IJybIFeTr35txdJaowe9j9SJJB53xFNOxoSGYk2WZRdrmBf+28RVd4PJsPNl60Xs5jYzlaL1RUHTnn45fqdunjkdizJxLnzSjcBH6HfHu8cs/mkiGLooSzfcf2SwSL8Nlb0wERFdLfOiN5qmKTPZJQil8QJ5tVLy4ehw== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9cb4431e-033b-4be9-c97b-08dbeb4ed008 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:33:13.4276 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 009uTpkHQFRP/A0KPBPGVa//RI+7uv0wRi7U9oxTYyTJPRkJeO/mcnBKXnjt2DvkMq6qKlHW4wq4c3pMMQjIWA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8333 Use mptcp_lib_print_ok() and _err() helpers in script simult_flows.sh to print test results with colors. Having colors helps to quickly identify issues when looking at a long list of output logs and results. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/simult_flows.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/testing/selftests/net/mptcp/simult_flows.sh index c1a21cd8c076..86f021bccae0 100755 --- a/tools/testing/selftests/net/mptcp/simult_flows.sh +++ b/tools/testing/selftests/net/mptcp/simult_flows.sh @@ -175,12 +175,12 @@ do_transfer() printf "%-16s" " max $max_time " if [ $retc -eq 0 ] && [ $rets -eq 0 ] && \ [ $cmpc -eq 0 ] && [ $cmps -eq 0 ]; then - echo "[ OK ]" + mptcp_lib_print_ok "[ OK ]" cat "$capout" return 0 fi - echo " [ FAIL ]" + mptcp_lib_print_err " [ FAIL ]" echo "client exit code $retc, server $rets" 1>&2 echo -e "\nnetns ${ns3} socket stat for $port:" 1>&2 ip netns exec ${ns3} ss -nita 1>&2 -o "sport = :$port" From patchwork Wed Nov 22 11:31:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464628 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2044.outbound.protection.outlook.com [40.107.21.44]) (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 B912451035 for ; Wed, 22 Nov 2023 11:33:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="YbeuS3hs" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zhyf2gCU78MNPP4XIPwbKqPuPExsTgwM8IwK0IjEg4pHUdMuffP27s+vfo9lE0nFxUGa961olYcqXf8rWYhwIUcbpE2l6F9HNBwjWpeNrSQAFVTPOhe4R58T3d8EkEd5oFOXzDZFLJlzEPCPUCyHRbLTqEHHW2LUy+lb213+/DsNe6BRZZypovKalH0mHSTfkfJ7Tw+ueYvtZv1O53WDScFCHxM0FflnX5PX6TXXuawLJWXLoHYBc/LwPNH1N0Mi4bcCgvE4pvqgXZ7rMY6OULgf6gp4kPsA+9PPv0aTArBlvr3IP/3Sz4W2/Qlqxe8Vcu+J0/7wwRgzjMZn5VXbug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=PLOe+CQcYe9FqZu581+QjycQ0uUj8Rq0ecFVdF9B/fQ=; b=bKRDIUryMpA0LjQmEM70bKvoSVrZjeiwu09SElfVySLBpyzJMs3TXy1eci8VW+bcF9Ntux32R/QgbshjavJ1pxcw5l5NaI/gNZneR9glx66wZUBohHJ75WTtf4NIh1Sp0lwvOJ2x37LGQyA9z3xG3FcxwO3AItp3VXV4kHQGIUA+2UxfZGhTvjAI+kZjtBdBi/NzRKmvnn5TR0wA8rO1gslYeRGMiKhC2si8Wvcr/dkNluJcSoetyB7fwCqBJjoEKqReSAu4Uyc+2tmPI56R7zw69537VJ6mw6gCzSw0HneJZKqvbWTl04PqiKpp0jAp+3O0aP0cxzBBij4QCqiZaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PLOe+CQcYe9FqZu581+QjycQ0uUj8Rq0ecFVdF9B/fQ=; b=YbeuS3hsyLxe+slLCvWYJ5msRk0DCrBYoWe9dNVmQBchitkIaCiIsbNkVT9vzMVTgNzjg0ZY6D+q5jK5R+/QhHqCMjqe+hoPVHnVLtD510rOmA3X2rV2wylnmVclkVQ+ya+gQx9THtOV4enJkMj0Aru0RsPTuC+rpoixu/vDAmvhv+vzytMiq1zhVT4hFfXnWx7bCPrF4NwecggyqHIbPPXw7ot6OKPL3dler+Pkc1fay3SNivr4Ep/CZiTW5O+ZJ9nzUW8nLKBxq0E2eX7+uG2WmQCpSbKBwtnsHeX9QUIqDt2k6qOdhp4vsgdtX44jodWdkLTMLP845/TI6L9z4A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by PAXPR04MB8333.eurprd04.prod.outlook.com (2603:10a6:102:1c0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:33:19 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:33:19 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 17/33] selftests: mptcp: connect: add PORT instead of TEST_COUNT Date: Wed, 22 Nov 2023 19:31:05 +0800 Message-Id: <904771031cfaa44eeb41df15fadd7cdb78d4b0e5.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SG2PR02CA0088.apcprd02.prod.outlook.com (2603:1096:4:90::28) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|PAXPR04MB8333:EE_ X-MS-Office365-Filtering-Correlation-Id: b848e7d4-c23c-4f13-3cb4-08dbeb4ed36a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NZHlBKvfkIRxHNpgZDcT+SutT3muR1c8qIK6Cpqlu4rjtUZVcyfjiOrf/PCLIYm71RzoxLebxbFxbWeDvyvoz9hqL5Z8HDssR3A+nnl+Fu4EqilWO7siMx85P/tyHXHNdAYAAGVXGWNu0PnMWZIEFWm6Xmaey2E/JASCuIrE0F1fPjJQOtiveQRJSHviULrjYclSDtcskzrcm2GNc8IzrpJSo7YZeN5I5OmY+lU1DYfuS9l4Xp94eALR8+RPvJiXQftzgzdOhFWzHncTX7UwDIweBkCLSF0Ca2vixCX8yPtQwqxHR4nodJ0fU28ukULo/TnG60lLoYpkDKNnn2F7aYMz1d3tXDTXfDOcOX9Kaf4QnBqdP38dIieLYnNeDzWRlpWcURMD0m6JOM3NBQiS+oboeKMNvizy8aS47TQVh1rp5B1aCJg5uqV+8vlxKGGi4A9+uJosiSuPRL+m+6+2YaQsO4IskYSHbEtuKSDQn0tG/FhnxJ7kQ4yQoTHc1wd/Ky3S/4zYphq0MmB2rF5+Bg629JKlm5GOHMykKSsXaVb4keJzJ2Bznpu8ajdXf9V9HYxefrgI0JQlenQhkXZsoY0cMfdHiJKiNh6TUm1IhNI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(376002)(396003)(346002)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(6506007)(2616005)(107886003)(26005)(6512007)(6666004)(316002)(6486002)(478600001)(83380400001)(66556008)(6916009)(66946007)(66476007)(44832011)(4326008)(8676002)(5660300002)(38100700002)(86362001)(8936002)(2906002)(41300700001)(36756003)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bfQmuceRckeep5kYs256SZQdwZ3vRHRrNPjOCvZLRWUm1t5UwPSz183clDUFD24z3MrIH95nz3cH6KVmPLFXWlFk3jfPbTsW1LPHZ6ONKyEL2wpz89JYdG4/q565IKGnR0BP63CiH/RiAXCSv+kB21A4QQh8az6lLlLLkRfLUe1FL6o7+aqGjXV+SDufJKn2SJjccljFGzXWLci7D9xXA/P1wJE6zqBKgvTTnijOV9PiuUFxTpbElWQE0QnadiCfSUrVh2tRt0uUcOc+XW+3uQzxW8TjtsMONdO2bsXLF3NpCJvyVdpR4B3DuN3L/WHgtn+nbFQbDEmAgOmhApBS/tKpYv5Q4n4pD6FU41+G5xDXlmIfu/XGVJo04aktgB2BFaXdaKV9oahKZCO8nw8m460+Dn02laXXn3w+72NWXNnasyjIiDAbNz4We+W1n/CKMYr7PI6SDOoTNBPeryUm2KA83zjB32QNTev3qRFN8uQFFTDf7l/gJkt9srrsOXZvi+4wKQovOjnfuc+71tKHTdTY/4t5zU49y7JzRCYc8Li5KAujmvbpAuE8TlPYoL405AQ3jslEEqTqpM8O6FR8UhVV5Ey5Q3gSIzpqlyT8Gb6k9V3gbkhiyEpMvbqeovViAiJb94+yUSO7ZjDRo8aj1U/+uEoQYW2pIiiLVTJ11rR0JPxJ3DOTJ+fS2QuIryHW+Gy4Gggt7oAojwt8FGN3dblrLZRfMG9NK46nUsct0NTtYSkv1890Mjs9uR13vwDfD4627IP8Y7FsFH/w1kOtFsgR4P9H2+UkeDBR1cYkrkR1mdsCe7WQB64H7mVaj5Juqboku7uzabEVxjmnPOSTs47LmNtqg5UrMWW6gGCMHECJi3MWnZ80BcqCeL/7SarsZdX+ON+XsJ855Ef6DlgGUCW61godHixdegJR7pd+VgVRcC0SSOdGzhg/teAzZ+WxQTgjrQyc+2rRPigMPVwEfdySn2LLzWPvDSy9Y2KKES6Mao5paKZZM/+WY7D8lcJdxHGqf+NKQqt3kJOCb2QxZrBoFEtETbQirCXLmD84BizPC8CqwEqX105Gxv/zyRuEtZbrJvi7jQ+s8ycrQuL2xpJepUEvmqsGGr+LOa30aqtDQ0af4Fz6vrT6z+HELj/fDFqRWGlIQog7nbaBRrym1/zpdz6fR3Chqwr7H35BeHSKsH/P27ZUp9KSAs4+d68MJNrkcGlU7lHYZvV4FLCwnGM6HwhtrL4yAA+9jjTehRLp1wqqpHqWpMMl96BIw9/2yW3MnRfLtsyLjQ1YhJOfsQoawedQrfbLvicaTv94giKLcN23gN1lIOlv/wvV9cAQjh7bg8qWb9mY/Txj9DKFyq9Hy71RUYsHL3zSM80PgNEWQnfkyzLp7EBRr4LfNipozmUD6bOQG7SZWZt+5SMGmi9giMlI4S/iitFhKjDWBcfa81glOm+Ps36409S0rR+boMZqy32G9KlelTzAwOSkGCu/b6zChniwJ7xuHgX7dPB5ykjoNurcPRxfronF5Qiu4FpX4kZXGfASV4xY4BM9NI7nJBPLfpqNMETh7cdStIuevoL5P9lL7l49iIEcAV/TVzYAzXWCDqjw5DI3e8aYCA== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: b848e7d4-c23c-4f13-3cb4-08dbeb4ed36a X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:33:19.1228 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UIqh9RvbGCB+FmbRgElqr7WU56bbYn1AWDuXP0yDVEgOD86U8TnvUqV8+1mqudohWgvpgk4/8QbJ740S6Qeb8Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8333 This patch adds a new counter 'PORT' instead of TEST_COUNT to increase port numbers in mptcp_connect.sh. This can avoid outputting discontinuous test counters. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/mptcp_connect.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/testing/selftests/net/mptcp/mptcp_connect.sh index d085a32f662a..560eadc1de85 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@ -28,6 +28,7 @@ do_tcp=0 checksum=false filesize=0 connect_per_transfer=1 +PORT=0 if [ $tc_loss -eq 100 ];then tc_loss=1% @@ -308,8 +309,9 @@ do_transfer() local extra_args="$7" local port - port=$((10000+$TEST_COUNT)) + port=$((10000+$PORT)) TEST_COUNT=$((TEST_COUNT+1)) + PORT=$((PORT+1)) if [ "$rcvbuf" -gt 0 ]; then extra_args="$extra_args -R $rcvbuf" @@ -691,7 +693,7 @@ EOF mptcp_lib_print_info "INFO: test $msg" - TEST_COUNT=10000 + PORT=10000 local extra_args="-o TRANSPARENT" do_transfer ${listener_ns} ${connector_ns} MPTCP MPTCP \ ${connect_addr} ${local_addr} "${extra_args}" From patchwork Wed Nov 22 11:31:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464629 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2041.outbound.protection.outlook.com [40.107.21.41]) (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 C93CC4AF66 for ; Wed, 22 Nov 2023 11:33:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="y1dGBc9t" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hk6QuZ7gFtjuOrq+vqlW89e56rdMFOCV17KZoX3uV+dFMKztuCReNB5f6+qURMrCVl2zuwWC+crolujOsc4ArNjoyCJ7Fktq82TaGHxJ67/uhoYdYYw0RXcG97yE+dGyOWHtiGn0zNGMDrbhUJNgZ7jX/jK5AxLLD0P+PJuMjgl/pPmyDGt4Sl7A/5tULIhuThWhleRv49nXJtl7J+8TkNBh+1Sem5lzEat7oLUvho+PMCBfK8DSkA8iRYRRwXP+gAw1FhEFOI8mHnyAkUDIlOWGI9+0AedXGaibg+lv9PLoXv7zMSZ1524WTumu8LFkqNSsBE3NE2AM3b/yxxzWlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=8QOhoyYAf+Rf2hVCPSnJxSnOiUca7Z+9mBIlHq6lQMQ=; b=P/O/WcK0knJJ1Lb+GIIXg7y8E+St2lnLD/srNTV/eZyekD168f5m2kYKJGJe3k25BABOY35JPyUUbHsFBYmf/VOr+4ZQxDRsO2b/jg+HB5+HmEqfqZXaxhHRmscVawquttDKCPHxiFntFroiOLznZeVyoZ/gonIRxgKB0oc4c422ayQAIExTzHU3ulQWIhmLV0i6bJREMoVQ/VFEHc7x6/sL3Ahr3vm40EJPYtnPJAnKiOAGrp5wf5XtA4SBNJfdMCQ46AF7djW1V1sl1U4dVohK44xZu4f0ifQTx8vqNyFIeksspvDI2fWi1usxYQJyL+WWYoW+CMm7mw3eOxOdyA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8QOhoyYAf+Rf2hVCPSnJxSnOiUca7Z+9mBIlHq6lQMQ=; b=y1dGBc9tAXBG0zp8qo4kyjhFXEQHGoy85XmC6Uox+uIzhs4VHfTQVFqg+ffv9A2H+fN+3OLy9/rtz7BsigmNjCTsUgFL3FKb8PJdnXX38N8MS26ZqumE/IJvyCNBGQ7w/X5ugPV6sl0zwtMTKaiMUEHdvDHai0MBy2IRqhPSubE82l5sHzlYaCfm7tcIkVouBIzDV8cjfC5c+6mBUezMfhTxvvJ6YIFVQqefhDL99cF/2B5vLPKZ0OCUSN4rUHnIaPJ7zp1CPjLrx7VXBMOIAr/jC40Kn5A+sDJIGxQgHl0KsAsqO0ZeEUGEdVKc0IdlpKrW72vLxmsZrsgR9vIgDw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by PAXPR04MB8333.eurprd04.prod.outlook.com (2603:10a6:102:1c0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:33:25 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:33:25 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 18/33] selftests: mptcp: connect: print out test counter Date: Wed, 22 Nov 2023 19:31:06 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SG2PR02CA0081.apcprd02.prod.outlook.com (2603:1096:4:90::21) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|PAXPR04MB8333:EE_ X-MS-Office365-Filtering-Correlation-Id: 98612187-8bf6-4966-d541-08dbeb4ed6f1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NKkl5yK64s/FMqNb3+GH9AtrQt2/DYihGR8r0b+OhT6JVYXDGODdbgHPooi4Ji8M50jrUdqJrUVtpKUjg+2OsQpbt9KvlK7H5dAOL5P08RbwIM/6/8oqe2GVweLyjHw3Qre/r4zDMlQWv8iNT+Q1QPVkgEl5odTAT2bxZMLeYddzDS7ygc5k5bV8KSTSxqGBvdAhMO9O4vFHWsOwabnzf8FDNOOC6hsJJsFOe90C7ZsJklRlXZpbIcL9PEtG23a22Wyn8Cs4FzimHxMpf0Zf7n4oUnbSURbRqe0KmNFxHXhaYs1RHD5yeny/xFbFTFLv5uI2RDqKODEVEdNgg3N2lPLJPWO+4l4NApLp+AvDAk2uo7GGyk/EKvLhibAT6FfM6q4/hZJkaFa0N6USgfODugMJN/ks2xWx04a+Aq2PVPZQElT2cfkvMABnk/LjWy9rkPaBE7TIac0Zu1Y2w+n+sOkAb+W+3XleWVXK1LfIZHZK8b0H9KIYjEAJiFnHpMbEuxmQoHMKrrNyDwE+ZGRwsfILI9BF9i5ncjswGJ0H4WvuhP93xVr0P13j9G5mAtCorJFyBF9xvkt2vK4mGAfC7rxAFtcMzedrJn1zUwzF+z4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(376002)(396003)(346002)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(6506007)(2616005)(107886003)(26005)(6512007)(6666004)(316002)(6486002)(478600001)(83380400001)(66556008)(6916009)(66946007)(66476007)(44832011)(4326008)(8676002)(5660300002)(38100700002)(86362001)(8936002)(2906002)(41300700001)(36756003)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nTzf5yTRR3nXW6SVj6t/yujqD/kYJPCCZp6X93VMA9SzgxH6NLEJKRGQoysNh0RfxdoQ7dvXxdDHcD81Kq4G2yuymxGDBdZIUemGvwv85Xg4eDc+KSMUVKYbWe+BJVzPRFXeriBOnow4SPBzA8Yb/RD6mJChJ9+zrj1zSktHVwZzpibvw+M919LPSOBW/3SzOPbQ0Bo8xO6N2rAroeJY+g0XmD/21hzk08ww2rTlxQNhv1dJaO8gRalAOdg+eJcKQahbwdt52rTYpDnyuwmJuTsoG0OI5+2UB38xEmL9tZcon+zGCS5RL/KbKf4o6S5aPo7pxL6/0wyf8Xobioer1n8BAZHdlJXlQ5PbzuLazX5GXG7IRka3RyxCzqJmzybjgYGqkNCLGdyK8fhe7hGH5x+hdUmMvU8wN9rNeK7SqZRZAP5Cf251no02blnK1xHQDxFMg6X8OvQajATGko1y6E8kca2XDrr0gVsm9iYM31W0KpVzt0TUKRxMlX9GJ11Clm1/zlu80gBWSC276AmMiGfAVo82IG2tQWCK+qX9Z8Z2diPr7SqLx3TvCCsCOPcBZfkf7CxJhC2cANE+GDDWAK+lGgeFqIYmyYrQWYgyenAsjXe1JNCp+Fmi5pxtdaL+YZAkb+dqHLj0GJNSRlMBWW4c2Vbtzpp5DpgZACKL9/eoim+YPOTYlFWPfwbegUSvqOtWIq/DgIJBMNnjyX5h/mpu07XC0QhCR68TPyeEWXxOTLbbpI/esQOTLlo/7+3ynVlc3CGPEXvZRIMIavT8THYhD3julhFIGoT3wDfNbf8iy7i87WkdD3AEwJAFMD45Bw3P3yxNz8+iP8s5q4h0dbPSOtfVi1wx3DH6JxHFx6QJJBtcIE5Yw99OxbniAs1vJIrAZDEdMKet/CCH0ocUXYhNJ/KEfxLlcStnv7XXEtakO9Zal6ilX2dGK87H+q1s4XqN8q6fyLQLXIxSrhXBy93Q5xN2DOaIMAvBHr+hsM+RwcfTR73Yk7r6tUW8KNpCvXiDAL8SadN3gUIvue1OQ23kyN/TZGnBunAR/k6qEK6Bsj5zHZRLPG7kjZ++QR3Fdz56qiW7u9fbCYbkafGlH6OdvYwtRm/2uktnH1iKLfMjPhjiv1ER++32Dcrge13qavKkp74z14vToAqrGdyvvpM2AIFyTt6fNu+sCPLMsMtFm6xBVVg92Qj+gcjoICgSONF+gl5zgJOzqNQPopciK+FJPEyrXVZCEglKDuiNd+opyCuUOhVI227++MP8lkXeKR6yb2ex7ANnJM+dwnM+No3bB94pLgN/ixIj5uojCoCH0Wve+Fx26Ff2YDvpebLDNzonbyP0ICV086LgIHCPypborMGb8qWKFfgMaecNacJyTdPP6WzLdSlEeftN58sYfYfxkcm/YF37RBiAKnV/6uPPDKT+b3Mh1R79NkepJkro3v1kVri/e0PefCqcE3MDnX36FJOEdcFAQqPSKJMusuhxSWWnwN2jf8+apjcHX0W+Gh4D25q1mbrdHk+b5dYNH1zdF5CAZbrfEGsSwV5vAQ3I5RnQ6xyH+6GcH8gWhWmacXt61DLyM9XYS+XH0Fbn1aUVafUySS+sw9Id69uFOw== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98612187-8bf6-4966-d541-08dbeb4ed6f1 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:33:25.2219 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: f3D8cdaEoMaxaUCQ/HMGd1tvuFbItOMMl9BDNWkOPZ6CqZUJ1gvA6dmIiBEIsUE2Y/IqjKrnS01rYFh9j/B3oQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8333 This patch prints out TEST_COUNT for every tests in script mptcp_connect.sh. The output looks like: 01 New MPTCP socket can be blocked via sysctl [ OK ] INFO: validating network environment with pings 02 ping tests [ OK ] INFO: Using loss of 0.16% delay 25 ms reorder 97% 63% with delay 6ms on ns3eth4 03 ns1 MPTCP -> ns1 (10.0.1.1:10000 ) MPTCP (duration 116ms) [ OK ] 04 ns1 MPTCP -> ns1 (10.0.1.1:10001 ) TCP (duration 33ms) [ OK ] 05 ns1 TCP -> ns1 (10.0.1.1:10002 ) MPTCP (duration 25ms) [ OK ] 06 ns1 MPTCP -> ns1 (dead:beef:1::1:10003) MPTCP (duration 128ms) [ OK ] 07 ns1 MPTCP -> ns1 (dead:beef:1::1:10004) TCP (duration 31ms) [ OK ] Having test counters helps to quickly identify issues when looking at a long list of output logs and results. Signed-off-by: Geliang Tang --- .../selftests/net/mptcp/mptcp_connect.sh | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/testing/selftests/net/mptcp/mptcp_connect.sh index 560eadc1de85..f4f7112a06bd 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@ -267,7 +267,8 @@ check_mptcp_disabled() return 1 fi - echo -n -e "New MPTCP socket can be blocked via sysctl\t\t" + TEST_COUNT=$((TEST_COUNT+1)) + echo -n -e "0${TEST_COUNT} New MPTCP socket can be blocked via sysctl\t\t" mptcp_lib_print_ok "\t\t [ OK ]" mptcp_lib_result_pass "New MPTCP socket can be blocked via sysctl" return 0 @@ -337,7 +338,8 @@ do_transfer() local addr_port addr_port=$(printf "%s:%d" ${connect_addr} ${port}) local result_msg - result_msg="$(printf "%.3s %-5s -> %.3s (%-20s) %-5s" ${connector_ns} ${cl_proto} ${listener_ns} ${addr_port} ${srv_proto})" + result_msg="$(printf "%02u %.3s %-5s -> %.3s (%-20s) %-5s" \ + ${TEST_COUNT} ${connector_ns} ${cl_proto} ${listener_ns} ${addr_port} ${srv_proto})" printf "%s\t" "${result_msg}" if $capture; then @@ -641,7 +643,8 @@ run_test_transparent() # following function has been exported (T). Not great but better than # checking for a specific kernel version. if ! mptcp_lib_kallsyms_has "T __ip_sock_set_tos$"; then - echo "INFO: ${msg} not supported by the kernel: SKIP" + TEST_COUNT=$((TEST_COUNT+1)) + echo "${TEST_COUNT} INFO: ${msg} not supported by the kernel: SKIP" mptcp_lib_result_skip "${TEST_GROUP}" return fi @@ -658,7 +661,8 @@ table inet mangle { } EOF if [ $? -ne 0 ]; then - echo "SKIP: $msg, could not load nft ruleset" + TEST_COUNT=$((TEST_COUNT+1)) + echo "${TEST_COUNT} SKIP: $msg, could not load nft ruleset" mptcp_lib_fail_if_expected_feature "nft rules" mptcp_lib_result_skip "${TEST_GROUP}" return @@ -675,7 +679,8 @@ EOF ip -net "$listener_ns" $r6flag rule add fwmark 1 lookup 100 if [ $? -ne 0 ]; then ip netns exec "$listener_ns" nft flush ruleset - echo "SKIP: $msg, ip $r6flag rule failed" + TEST_COUNT=$((TEST_COUNT+1)) + echo "${TEST_COUNT} SKIP: $msg, ip $r6flag rule failed" mptcp_lib_fail_if_expected_feature "ip rule" mptcp_lib_result_skip "${TEST_GROUP}" return @@ -685,7 +690,8 @@ EOF if [ $? -ne 0 ]; then ip netns exec "$listener_ns" nft flush ruleset ip -net "$listener_ns" $r6flag rule del fwmark 1 lookup 100 - echo "SKIP: $msg, ip route add local $local_addr failed" + TEST_COUNT=$((TEST_COUNT+1)) + echo "${TEST_COUNT} SKIP: $msg, ip route add local $local_addr failed" mptcp_lib_fail_if_expected_feature "ip route" mptcp_lib_result_skip "${TEST_GROUP}" return @@ -840,6 +846,9 @@ done mptcp_lib_result_code "${ret}" "ping tests" stop_if_error "Could not even run ping tests" +TEST_COUNT=$((TEST_COUNT+1)) +echo -n -e "0${TEST_COUNT} ping tests\t\t" +mptcp_lib_print_ok "\t\t\t\t\t\t [ OK ]" [ -n "$tc_loss" ] && tc -net "$ns2" qdisc add dev ns2eth3 root netem loss random $tc_loss delay ${tc_delay}ms echo -n "INFO: Using loss of $tc_loss " From patchwork Wed Nov 22 11:31:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464630 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2077.outbound.protection.outlook.com [40.107.22.77]) (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 5B29B51035 for ; Wed, 22 Nov 2023 11:33:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="QMz8AGm1" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KlrdPUqGnj11CNQp6tC/942P/aYs3Q7fnSsV8uGbQB9c6AXOOzkrH5f2OYjw99E+1C+5XFLO0YNOvwb87icaK8LazOqTNPHS7zdcpWPFhA9cQLOv3ZTZRx0NsPkwMX+9FP6Eqk/vnCAGH0sLGDTgqEaHkAgA1IjlI0vg+CKIlOmR2ScVtClNhHEBo/EmEVrE6lHFP1PVJmnEsufDZslVzptF5CnpihVcS1IpuuQDwLrWbblPMwmg/HZiynilcr/8co7aAo/bpki2dVm8qwaXsy3kPZ+gSF8K6Ya2uWdGrrkxYga+lze1dR7EHcyZiVz+OQ6ZdMyLSkav0ltFpZvOhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=pstlKgHJVkC1IFYS0OtawCtL3Nx6gmiEQybXiFmd+Co=; b=WWoSlIsXAKwvguWS/nZOc052Io7JDeV+xV/quWlQaqElgECMZ5PeWZiQ650qt+myQucWR4TSKfvHuBjkmn6cPhI7dBTy5kKBeIbhk+5lwej1DSHDKBK9RRwcXARJD/iA25eSLiJV8KW+dFeCfkk1sRT/b9xlnHBdcPh9pOv3U0pQfqkzHsl3JNHCv/dPSXGznhgNtxOKLryZiAhxqtjeZ4LSgGNFcNaTVFyFFneJkHLD96Mo3PbKICwhIamEcG+Av1nnM+WRvP7UEF+0UJcBOuL1GKm2LostpTHysZ50dXazxWRWOyqHMU6ObafiKbFA0Cg9o5+rewPPpdz5IMzkDw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pstlKgHJVkC1IFYS0OtawCtL3Nx6gmiEQybXiFmd+Co=; b=QMz8AGm1uV9HT+u716Cweh0shSu3ciUttG7S/oHmuMFQYK8G2iKN9NvmTYhyH4qwhdRtVKfPTi03qyBUk+Gx4fwc+yV6FP8RO+6a/ii2ayWfdfFGxmccfw9sLQLv+/c7L+DJbQTdZOmVg1J6QvRtH+E6jLMYB215oO6Dc5GxkYPexx1YRdHPSh+rWck1w4u8beFZSyyZLaIUn5b7OEJfB5Dh9GFgeYMj0lLYB+a5ZKIk59l/vHCA3gyFAPWeA/ZrzlovSEDtuxeOZgvwnCe52XXMl4jb5psGlFq/dpasmQVF6NqYzsx5q2+ZV1l9aHHj1pvTCkNSZSgoF2zg9qjjyA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by VI1PR04MB10050.eurprd04.prod.outlook.com (2603:10a6:800:1db::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:33:31 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:33:31 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 19/33] selftests: mptcp: rename test_cnt to TEST_COUNT Date: Wed, 22 Nov 2023 19:31:07 +0800 Message-Id: <8146c8161134d4fea96bebdcfbc6cf96e22b32da.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SG2PR06CA0238.apcprd06.prod.outlook.com (2603:1096:4:ac::22) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|VI1PR04MB10050:EE_ X-MS-Office365-Filtering-Correlation-Id: bc000a12-dc20-47cc-f731-08dbeb4eda82 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y6/OaU31qSR1fZ6W2tmrAHWL9vf3qg/G2zOvAeajIVqP4+PulqSVDIN3QSv+aWpScie3FFf3uMQjcb262S4Muw5fn5YHy5/AGJLNnciRm9IsGKVkSLrG6ontWwixIetZJ1vIKcBlwUAaKYMWNqGUCB8VzsNOVk3Fjf0zda2+5O8uY3Xp5AH1VYdeMwU8G36k7Eqy/mNgkyJS5aOURUARlML7cvNaqgnZ2d8yWmQdGHyS+U1yRgBZVbflEmLu77bCDhw8wqMUHuoE6gmHy6uIJX7FqIaUtGtgobKyPAfciJ2wgdr1oZE50Ygef5N18WIFI+IeZHuaKwww9vEXWIOcH7/bIy6yVPnV6KlneiX109BJAfDkNunEyNigVHRIyyq1F0H/81A5ijmfcK0VvNY63ANham09YfHgU7MCG9qKMx0Js7+ssWpCbyQq5GWmovkNfZ+ubEI3ZFO6hnhodJNFjlT2Up2VqrUWxExSbdnb3U76grqlJxkUHkjwoGcVB5qhIHwx3DElyFaSDDuk7duKcNxryiLwkyHpeO5hl+RTFy8iCjfAEOADGjlxd4FL9/54lBvoJxiMuxweyWmH9H4Oq7WZfQYfMzzj9nng96eNFMM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(346002)(396003)(39860400002)(366004)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(5660300002)(44832011)(2906002)(4326008)(8936002)(41300700001)(8676002)(66946007)(66476007)(316002)(6916009)(66556008)(86362001)(6486002)(107886003)(478600001)(26005)(6512007)(6666004)(36756003)(6506007)(2616005)(38100700002)(83380400001)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Xfc9aI7E+A+osajVzq39gFFdVYhdGGQPs5w4U3t9XH6wHMEboKUnyUzygqh49GL1FCwBG8OtHpl+GC1Wjpqzxra7ImA2Mawu9jqJ7mrOd1VTo/0cwKgnRd3FBNHtU9x0AuhVF/aJTd8wXlTKq49xUW1NcV2l5LQapKi+IAfOHps+t5ooblFcjUWqJPRzwoKgFeWwVMgquMiGt+OMH3MxE10Y6zzJ0jWQl+pTYuineneGhagGO6Co2pxSB+V5kBKVm0i43vUVY6hgxq8s5oUgTMKpZPU//bL5UPaoonZh3xwY2Xg6GVqkFz8pADwkFmBC088Tq+WLmZXLMf8BFEs86/9z3+QLFOJHhcDtkW+tJvCRU0GNF3n/imuM5f09g3oVmnHU9WIZcCQ0fYx41Yh59MmnQ4CTRuUXUnuGsCgTPy+ljjSn90xWfCEAGNV5f0FP7hhyTJ8Ii2/HMusMncvzUO5pw4/Q/iT8SVWKwbqbLEwt76oXcTNxwqMyYz0ePvz8N+bwS00I2DOUaRB05Wkvr39DfjtqNzOsvUT6Rpi1B3B18oSyKtTtkznRaiuezbrKy3RKVCj3fy6NQnxThIPR4B6AuKWAUOBlY7KrBZW7h9yRTdL/7BWKHJzVZUnHT441M+FzalTMryhAyijVYQx6hTOt0gC6ck+eH/UrUdn+rxL24pEbhtG9eLw3XLYjpfObU5BfaaCbaSDv5ITbl9rYWFUirtJNKph/76xdLO91uFJcIBzdpLoUxy32BxuWuzCJtrk9bn9Od1p1W0TosozDsPRu36PMAi93Hf9tg5WeMHepRTFKhGG8H+zVShzFJ1UqkEHB8ebq7/urWfqxIKQ/WMjU8DR3RTiRqejSm9ZeJk+J++oEWeLJEZxHcHSkxmvrspvmjd0Ci5dCq7Ev0Z3ced13vfXJeP+QU9UBTF35MQcQ/VleZm8T7GVo41uvG7m0I2CKCvCREzR/V/66INRPqIyVbR6IfiqdQXj5Tvuy9BRT0L9ZNaIabvzLyxcC8BgtGtxc9BlX1jm2iGT2wQ62euN9qZLFtMFf7eSwMhUkGH6cucQRWxhRYxX6aS8gdCzw4F0EogBXk4rfZhHltrnhJ22bqRspoh1BBVxmzZ6lRDUqLXMPVW8G/SzeI3NhoWTWUiVvsAzTU5BmhsEhXey3Ug4joBulB/2i/h8ofoeU9B2z0ZTBOgNHP0Zr7OhUVf5q6RyCdrW0O+QULu8hax8X+WDCJq2TqhoIGMjksulG/0J1qTSvFrSpp/4rSZnrJDAhOLBwIZ6gaBB6vI0TX6Iv15fmPEpq7kY44Yr90m6dCbH4HiEKaHVasWw5f/NNaQxYJ4GJJSW+0yCQgEA1HJF9/0GAIVICpV2k8jPLA5CXijrBa3pch1QBLNTW5QMf9AP2gsZkWtboQc1h0uueVwHo3LenwZ6/UV1QwtmBnOGrSjQYijBuziOgIyF0veG0w8CQv29OTCTMTUqrQTG/SyqCEKaFfvGDFJ1pKhJIsrUQH/WtxFylJVflAQlDududSxOdY+y1Aglg+zSpvpHHUeFUXK/M5wX7bZI61xvTM5HQonZoRT7or26nKSipKBN7sF/gXzb6xe/IulYLvYiaWdneMw== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc000a12-dc20-47cc-f731-08dbeb4eda82 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:33:31.2394 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1g0y0rEo8vCaD23lME6T5E7whWhO7Pg1SiERnBN04Lif45eiaoMPhxlMa8P8e1ytHIYtgrqdSH6nu7MY9Wn+Jw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB10050 Most scripts use variable TEST_COUNT, but test_cnt are used in diag.sh and simult_flows.sh. To maintain consistency with other scripts, this patch renames them as TEST_COUNT: test_cnt -> TEST_COUNT in diag.sh, simult_flows.sh Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/diag.sh | 12 ++++++------ tools/testing/selftests/net/mptcp/simult_flows.sh | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh index 7cf1f602bf48..541a9d2d128c 100755 --- a/tools/testing/selftests/net/mptcp/diag.sh +++ b/tools/testing/selftests/net/mptcp/diag.sh @@ -5,7 +5,7 @@ mptcp_lib_ns_init ksft_skip=4 -test_cnt=1 +TEST_COUNT=1 timeout_poll=100 timeout_test=$((timeout_poll * 2 + 1)) @@ -67,13 +67,13 @@ __chk_nr() else mptcp_lib_print_err "[ FAIL ] expected $expected found $nr" mptcp_lib_result_fail "${msg}" - ret=$test_cnt + ret=$TEST_COUNT fi else mptcp_lib_print_ok "[ OK ]" mptcp_lib_result_pass "${msg}" fi - test_cnt=$((test_cnt+1)) + TEST_COUNT=$((TEST_COUNT+1)) } __chk_msk_nr() @@ -113,16 +113,16 @@ wait_msk_nr() if [ $i -ge $timeout ]; then mptcp_lib_print_err "[ FAIL ] timeout while expecting $expected max $max last $nr" mptcp_lib_result_fail "${msg} # timeout" - ret=$test_cnt + ret=$TEST_COUNT elif [ $nr != $expected ]; then mptcp_lib_print_err "[ FAIL ] expected $expected found $nr" mptcp_lib_result_fail "${msg} # unexpected result" - ret=$test_cnt + ret=$TEST_COUNT else mptcp_lib_print_ok "[ OK ]" mptcp_lib_result_pass "${msg}" fi - test_cnt=$((test_cnt+1)) + TEST_COUNT=$((TEST_COUNT+1)) } chk_msk_fallback_nr() diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/testing/selftests/net/mptcp/simult_flows.sh index 86f021bccae0..6a4568d8f596 100755 --- a/tools/testing/selftests/net/mptcp/simult_flows.sh +++ b/tools/testing/selftests/net/mptcp/simult_flows.sh @@ -8,7 +8,7 @@ capture=false ksft_skip=4 timeout_poll=30 timeout_test=$((timeout_poll * 2 + 1)) -test_cnt=1 +TEST_COUNT=1 bail=0 slack=50 @@ -115,8 +115,8 @@ do_transfer() local sin=$2 local max_time=$3 local port - port=$((10000+$test_cnt)) - test_cnt=$((test_cnt+1)) + port=$((10000+$TEST_COUNT)) + TEST_COUNT=$((TEST_COUNT+1)) :> "$cout" :> "$sout" From patchwork Wed Nov 22 11:31:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464631 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2081.outbound.protection.outlook.com [40.107.22.81]) (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 26EFC5467C for ; Wed, 22 Nov 2023 11:33:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="5gXGFbFa" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Aq/Y6lzhxKspGLu7rf/uLOvq2CT47hlkRztWQ94klXiswkk+w5oOlUcgrzvo6KD7P+kggtwUusakIeAtuqAmER4yWZ5YGi5eM49qYK/O0aZR7HWmxM++pkpvGDuVNZ/LLMdLkTKAcJ/PFSO/erYjan4WD4Yc+J0jJwoIVptBtNMZr3fYOJkFJBhRlj8CaNGpMg/Cu1S39opraseipmvUboDD/d3I00O3MXZEcxrTTX94TNNVDmgPeMwcV9hnDQcl4gREMPlx5QNJcJZwgnsCQR0hNP3jWuL+ZEEZ208yrX7QgRnWTmzFo7YmvBFurlp1B5hdGUCJO6xjmYjQdwP82A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=ylyB2i6xIwqVSug7eHgYL6mnnTQJMkmRI7REsg7punY=; b=jTj5/Tv5BewYI4WB4QKKnVxy2WviHLt2WadlYQzdRfaAoPpFT7PE4KabkFMmNpODntr9OIhnIYpKW+xnYLMP6dvUqver687etTfpJsqY1vWwRCk4jh5LxyT2O9lJl7BgP5IsKfMG+mpUl6U44M6sFTnAnRhT48UuEYeJZCXE8CcobJ0k0VTlzzI/tJftzhmHKnvH1Df7esxhuwbIvA38goHUmnBMUFCXQ//PErDapnZZAuY/PvWWUNHXLf/c3HEfNeDqLft7MTAhQcpD8E7zxSkLkwv3fzva9zclEQzBnpecN3t85ecfqtn9FYT5fkWA3gPKZgQPIZNdN6qWu/sEEA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ylyB2i6xIwqVSug7eHgYL6mnnTQJMkmRI7REsg7punY=; b=5gXGFbFa4Hsnw5HN8T5q2UETkQTqSZiE08mKsQhHaWazFpDYlyoLa1eu51C9TZKdurBd4sYL7nA7cB8iK9jine6nravD0g5WJrYXC8H/0TvUKqrLwCmR3j8gOsaxxG/tuxicSXicvGM+teEksWHfR5cw8I6IRGkwJ050D6sWk7JYwABeBqfEbbNnGf3i3jTucKKPdjPvHTxbCGte5nenlrqLN9mCpdeFZTb9Wt6dcS0qEOwgb+8GE6F9GnTKyAS0kY85xU16kD1UkwNpyAzYDCY5mvtweoYW/Nx2JPg0IRCSoSPBqZx9WL2WbxZWfSHIAlGM5Gdu5VGrjlBuyu7+KQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by VI1PR04MB10050.eurprd04.prod.outlook.com (2603:10a6:800:1db::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:33:36 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:33:36 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 20/33] selftests: mptcp: diag: print out test counter Date: Wed, 22 Nov 2023 19:31:08 +0800 Message-Id: <6fe6c32dd9c4d01ac2fb39d4ce077964d693c555.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SG2PR06CA0248.apcprd06.prod.outlook.com (2603:1096:4:ac::32) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|VI1PR04MB10050:EE_ X-MS-Office365-Filtering-Correlation-Id: 37ff43fb-8cf6-4658-2f08-08dbeb4edde9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V06mbFknyCX/CB5M6L+wa/st6jknp0OUUQ3PVgA1leuSF86eoT6wQzMzIbVOvshXwkPSUqGXapknWIOxDKBLAdwo/FXn/Cvywev65haG2XsLnbz2fEHliSivJGp4JKi6gGmbTzHI7LxwRbsOwR4hpj8zFayFFAbUEVmGGhVrXu6ilt+aPa+d+F4GB6rY5f9aX4mnk3kJF+N0gmC7HfC5w1/hhGslRS7OY78jzvqCS3+lx1TRRCEVcwuB2Kq0TovaA/9ikDtqhDZhvpn+E6PyBbC24hr3Ai1qt7bkjQMBMvuuqJTYPc6jENY0PyGlFxR7lJNHJSu7+CEtNlgJz2xw0P9b/mdFA60EWW7FPHogI3+OPC0C+vo1yGhkZuKlGOfV16C0Pi8SEtwqikK3OgwlI9Ytt+EsX8gmWsIovXrrVJb7pp1IxK6HYnY6jR4u4tp5CY0Kt969zq1kG2mPteQj3l1+07lGwa0ntmSTzDpmEtn2oa8pimYDrF7aQfv8A2AITeadEz+Ivo4LqCU/YIMkTIkwZEf4T4FhQ1ZniVYZYyHj17I3w5FvsBiaOA95OQQdcOOZZ92i37hsWKkTjiGEeGf0DxLiqZ/QJLK77AS4UDc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(346002)(396003)(39860400002)(366004)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(5660300002)(44832011)(2906002)(4326008)(8936002)(41300700001)(8676002)(66946007)(66476007)(316002)(6916009)(66556008)(86362001)(6486002)(107886003)(478600001)(26005)(6512007)(6666004)(36756003)(6506007)(2616005)(38100700002)(83380400001)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WNAHFp8RyqYS1SyxUvlm/DkN2d9Ey4gsLwCxsg0NiUlBz+13nf2BV65/9uF2yChou9acaZx64LH5o6UIkTvkIyTPSuKUnUOFDuTeqekHPoyg/ZFNCKMw5RGZH+Cb5rlYR38L1hHBTBFYC7+sIYj2Ph9ae9YydYE1ktvKSe6r5f/Vwwdd7o8mNyIiZhoyDMLOtJLMDfHAndqZKHb0vkKW1pJhXpSKezVEV7+b9vgmdgR8AXcJBYmgmek+WvCH9/RZ4hpBhcNIUMhW/xD+SBFQc1yHDbWFBpYuf75cQqam7mS/+P7tX4dpOgvYcxkOM3EDv/Qzj/0uRbJWuNjLgdHEKYJAd/r4w17lSOU/BvBqd84EgqJHzOr6zsJFVh5Sg/nmtme2SabdL59zrtPjcERx0bWn4ak0BkyOKJwT9XLx2zkvXah6gYJ80xzfJPSVa9nfI5jCwgmMboEgz0LRv1WFvRceGYD07/cwzDsmOryH9ZyVYhK96FWAt9yh07wVOrePYJSv6rN4qU7JFQmoLu2btwwP3uV8VZ6vzpmMRfsUOC2NMgASQPBHILGuuEZk9L4EToGqNHKfDlCGt0U2o4RTo5tGldJislqdWLG1D8WejE0Y5PC6ZogiCqy5n7tyg4Er7fqwbHspRmzGcU3KQdGNZBeS8xVRl51Bm9EPp/JBg1CJ942ESBKUHx5Avg4SypcDArQ2WY2BIhNJY+eTsIDHb4XE0iM+qKRs2lI7oS7NZWDc4t4xF4q7jjswjaFB4kPMFHzxENv/NrjkeDjXqp4IVe8M3WLEexsr8x7NOx+ahwcVPKmeTvqCWFNXJojGz1gRyZvsOluvBNdxbeIMut6S3+aOYWIl5cgmQJ7GaK3Abx+A2ur+5jfuOU+0Wgv6F2EM10XL01AeLsFX0O8XwaAPLU8AQFpJD4NDpjuXR21aDY5ob4aij6NGHsFeKVRqb/fwY1ylTyVazsmVcuZgYlTZvfC3BIyJVa7fD7etOCsPcnD1fQEIYBPZGIBIVhBa6DEN5i9pRW9JIUOe5AWYnBCEyzbubL47HCZgZr4Uxm12hlczRMLBPbvPu8vhSx8DR5m/b6MVLOU+PeZKXyD6e2YjhH/H6ij88iIPWOEJhGleKE77on3/ERb5bQJ8ykssD/1M0f05IaVhF5C8TFBj6kpNekJzO5lwOzhlXXUkT73P6u10m/1jFW9eO/uyr45ebLdEIpdBfVdLWOt6RpuJxq86blN5FhdEF794vlFRdD5T51wJqh0CGOiwh9mIpPk7qBuKQfZ29mVv+0QLlf6R2ruzciSHWfSUyruTyo6N4fpgNeZeBJI6zkVHXqffS1aoARle5fo23MbADxVdP9QN1Mru30AcBeJDu0d6StQmvFyJobUDqFNHmRo+goucLR4iAhsPcQeoCsQU2Y9ZELpu6TZEmClfUyH5V5jMtKSOkgTPcEsprdBTl4UYOtE+pvKvqSGTDf9uQ3rESMrmEIj0yaAkbrqvsjGdMHJXpS7/hGIJExQPUtPOWNVEB9zMFFLB9rJBWfPI7sxCBzxXg7g4PDqXlykG42nZPJtHMf8jrSZcN+m3pAQ+lslqrPMAYKMFnLH3dcKG3IErfZMLLCFrGxuW4A== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37ff43fb-8cf6-4658-2f08-08dbeb4edde9 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:33:36.7210 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: M0cW94APkhb3+G2qKaoLRuVSpLrP9sieN1MgmKFWhh6pbSNd8KcXinTXBeDuTHuGU3HT/5gNYKOKExcFlj1iJA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB10050 This patch prints out TEST_COUNT for every tests in script diag.sh. The output looks like: 01 no msk on netns creation [ OK ] 02 listen match for dport 10000 [ OK ] 03 listen match for sport 10000 [ OK ] 04 listen match for saddr and sport [ OK ] 05 all listen sockets [ OK ] Having test counters helps to quickly identify issues when looking at a long list of output logs and results. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/diag.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh index 541a9d2d128c..4279bb59939d 100755 --- a/tools/testing/selftests/net/mptcp/diag.sh +++ b/tools/testing/selftests/net/mptcp/diag.sh @@ -5,7 +5,7 @@ mptcp_lib_ns_init ksft_skip=4 -TEST_COUNT=1 +TEST_COUNT=0 timeout_poll=100 timeout_test=$((timeout_poll * 2 + 1)) @@ -59,7 +59,7 @@ __chk_nr() nr=$(eval $command) - printf "%-50s" "$msg" + printf "%02u %-50s" "$((TEST_COUNT+1))" "$msg" if [ $nr != $expected ]; then if [ $nr = "$skip" ] && ! mptcp_lib_expect_all_features; then mptcp_lib_print_warn "[ SKIP ] Feature probably not supported" @@ -109,7 +109,7 @@ wait_msk_nr() sleep 1 done - printf "%-50s" "$msg" + printf "%02u %-50s" "$((TEST_COUNT+1))" "$msg" if [ $i -ge $timeout ]; then mptcp_lib_print_err "[ FAIL ] timeout while expecting $expected max $max last $nr" mptcp_lib_result_fail "${msg} # timeout" From patchwork Wed Nov 22 11:31:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464632 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2075.outbound.protection.outlook.com [40.107.7.75]) (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 A324C51035 for ; Wed, 22 Nov 2023 11:33:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="vbrQremn" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kvt+lrwYloKhBSqj60gDAwDxFoyBqjBwjzAkZjMpT8zU77Ozx2/6cnuWM1chMTYpx4qho6AboNd68qB2NwVV4tFkAcuMuQ1ximJYB0WGnsMHihCUVjunguqZ9KtNBYSOkhEQEUa3hix7lq+Iy+TC6BTWhPsp+of+TmIuV0vLGgPgXSe9PHTmymlHrJBe3RYB1Mp35gIEX1yax0BAIZmAoQJhWG3ip0+6KzHOk6UDZgESa0hLhjcRnkiNw8wxgKzi2pGXS8BJ70uvDW8BQbXUuMnbWaxPkZ8ZjYmxBeaTKeJhaM/hC7BUOp11MFSVeUMATVm/nqW/L0c9KP2kW2Im9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=e/gQyUaHUhRxW9N3xngLMLuBruOs0x9K+AgcCwzAmQk=; b=VvmYVr2GqjB1JxnPOa9MSvTSCJUBJdfj2c6qM46YY+J0fbgpeHckhiHUc0jhV4CfBTop4SoZuyTgs8VI45DYSTgD8BmUnmWAAhgcOd0nLiQK68guG88saPxrA0WJXo2Evvya3nOZZkqDSrZebAPAExin4Z0s2fpHSS07fZuUvpWh2Mf4klJADcRsYzRT/TNvHrTI9VkxkwlETpRdSDBmOyL7xtKmFL6srm7M1cF6/V5GhIQxX0y/SWKjSet0uJ8KThUW/p3m7QQvAEmthVs/ONqUidPtFsQN6ryN7T3/rEGux680rlFWsW839wN2jtqFWyhlSf/nrnQg1WEXjP6DYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e/gQyUaHUhRxW9N3xngLMLuBruOs0x9K+AgcCwzAmQk=; b=vbrQremny0zfNY1lNQfljCSwwbdyMjiJLRW4p/4l9N/aI9WZwcZixQP22gOKIGEKRPuXuEBRJUEHNboDbYIxxAL9JYFbR3NX0DLtfkHKc3bs9w5HitP6QE8D+XcjF6gZ8feqWu1Kc12iPGYgc3BiTkons0/jH9kIQq2aIrzWtyHKwiOgMvuPVO2rYECCeH755jIqS6RgKeGzhOmamdRtZbcy+4/awtPuGSSSnjNE52bBNswKZfh3++mejkfqNy5rpbIAfNSLxPnPXrK4RFT9tb15eZWuamr4Ghglg4IACqa60i6AhntBnF10eCmgr8u2Mv/YOtmd9l4yBJ7+0/7QMA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by VI1PR04MB10050.eurprd04.prod.outlook.com (2603:10a6:800:1db::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:33:44 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:33:44 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 21/33] selftests: mptcp: simult flows: print out test counter Date: Wed, 22 Nov 2023 19:31:09 +0800 Message-Id: <3953c26697d21e46df34c8fd1812378b425c0f7e.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SG2PR06CA0249.apcprd06.prod.outlook.com (2603:1096:4:ac::33) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|VI1PR04MB10050:EE_ X-MS-Office365-Filtering-Correlation-Id: 0cd69b91-35d3-405c-dd60-08dbeb4ee145 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VQbqCvf/EWcCOPyzfVlh2G2r+8qGEZgcITJhn0V4wnrdcFfGuHdR6flaHelOQHpOcXq7nLapjmoc4EiJ+r0iwsKzDIj5jGJEuN/cdPk144As6t3GtQ/IcggvwK2KaU5SzmcrBKnLXhCTsb/l+Ljc19qzHhc3m8f7prCv6vseK3ffawukKDFgBQpl9hiYIiQ8JZ1tb1BMU/p3pth66lNfWxVts9qms1QlCJ7AonmL3gVgaVogv6g3AzJmXjh2NHgrHtAjGZ3PuSYMHC1sCS+1QcF57ru2Du1Rg2zX1UU6B0SB/v5W09D25lGBKw96I5LY255GReTL7mtEEVBbycWYK2KxPxTLJ1Fxl1KzlP86LCPNmzTshlfgIPg8clz7yZEkaiCuL/UliMrjNl6TFVG2jDK3Q2lDwnkT+C7hze+Q+g7WRYG4h9u03Yht4TPWz/NQFBcPKT5IisAuukcq0dpQkG/piUqJYA4TP86brWmWmRCxS6aYf8eKkvRpSU3URwUVx/qasDl/V+1yqLI8oCjPmB3G2I75O0lVarxZ+d8MTwO5TpqM+xGX9DXg/6ArHWl/08tLN6BgkKd6HtZivS4cUtXxK4e/CwG2I1d4kqmqy4A= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(346002)(396003)(39860400002)(366004)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(5660300002)(44832011)(2906002)(4326008)(8936002)(41300700001)(8676002)(66946007)(66476007)(316002)(6916009)(66556008)(86362001)(6486002)(107886003)(478600001)(26005)(6512007)(6666004)(36756003)(6506007)(2616005)(38100700002)(83380400001)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zPw+/nOLq21Sb7WmUVYDEcbnq91DCRllZ56sZt1JuDik6EvGjuWbyymT1/pV4BqXo2MbQE23kM/ewtFEcjtuAobuueHHdR3Qz8/KC4YJbWgoX5aNhyXhV3hjKU3KQu8/2/pRG41DYllgo+U6/1+Fy3QYl0J2NtUQOX2kmzvRLuR/Ks8khY+fTvzEMVrIoCTtLh6TUgOoLYRa+qXROo9uStA9Cca/pAn44CQQaXbXI3IDttj1KcfEyz9TBaLKmTYFCIoXRKNUmw93kkqs1zEC4H7oixm85K8UFNPCghIXmustsWdWKtnaQSXMFgFYEQLOO5DBUdMtsU9V10EMFHIRc5uErXGlMJMEkYd86rv5Flm4tl+uXWmeq2hyPNQAivi5Q9OT5VQdQKd6EckpvaJ1+vdXsUbk8847wb5fy2jlvx4IsUnp2yajpGZvCWLmflw3CvGzDtUjoUoNyOwmrSAH7RCl1gUS4+ccyGZJJl73HcZ0mhmTP671fSYhZiJ8HWnx1C+jGNJleVMpBfzGdmtaLWnBEW0BZy18+yv1BiAYsnGMY9KbhOxx0iZ4XpmVQnmRIL4dqPeqSwWUV2W7xyjYRG/XOt2OP7SJcS5wcF3m0Ss72swawJB529Vf57EyjoHTidQC6dPmpOgfTChheMlu3h+cahsRBh/FkcE+mx6LMYHovZZgyhMFaTZdLJZiivMqAFlwoMpx5kxiy/h9RR9uzMGtla68EezDBor4xszVKNhlir/IcV9bKZ2GbsD9S6JLbFZcKPL6Y/JJlufdBWBJ6LGn4oGmprcSM0yND5AU8vlzVO9XgW67NJJIEHpeYdOyYmaVLqtgQE7/K6ccjY0hGiADuOXJUMG0mgBgT035qjlWEzebQ6kqIMRCOv1zU1JaZwYdLKIX5EJtjqKx0xPZnyMsAzLJIzz5HoJdP6n9kWxpmuem44AyFjz7tGgeo7eN6N4Qcv3gLg3sP7bWwCf5UkiUjZlTQmqwYARxrcI8xl2c610A4dyaSEsBexXgwTJcAsAymHCobWUumTBj0DjFuPg8zCytJQ36+Gpu3zTVq9u0yky4Lr8jEwWf7vpDY6w4ww4QHeAQWZGuxgV7dQCa4MPEI0sULLQS/5xhKUtEusU272qjHevyG3AoFbgJHxOR2O+pf0LPXUZit+UNf4XT+tv7lsckr+Xo1dOjtAulfpYkdST31Qj6WpPPbec5YqB50romVRg4X4xt9XijiKfcWvfVMRMy+KElpcBN7tMCU1dOtTYQnnUWsOZ2F+htXbrA//YdnpLcyc+9qWzpnKHQ9/FmTDb1Ba32MK7P38ilQgHLi+7ziSwvrD8YxBiExBAYArpHoX7ZMHKMocPaO93H769X8epXuhik5+xSelnY30/Cl/ZtT2knCXl0HVBJnXzLRdyPIqgioot4jdXMxbOWndJRWdnbDkF7SxksrQB/m+bplwQfs/GhvPK1BS/71VXssxrHBm2wVkh5Gg26kkeLGkBDG21CYiQ94Ip8CfClRm565KTbsSaFnkcmVJuBpwUMypQk1KHSYPk5+LbNcbquxEhSen/LVVS1iz8tos6WICemCrwcHbSmksYbeVmjuvBmQnmvv7fsjgcj3Ku3yDfLHg== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0cd69b91-35d3-405c-dd60-08dbeb4ee145 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:33:44.1786 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: W/b3VEzzDelumiG1PQOxH0bB2XFOdZ/TCg0Xxwe84DA0dSf1PIg/MyUSo8Bh4tiJNPZS+RhJp48XcLlNm3Z2ow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB10050 This patch prints out TEST_COUNT for every tests in script simult_flows.sh. The output looks like: 01 balanced bwidth 7411 max 8456 [ OK ] 02 balanced bwidth - reverse direction 7380 max 8456 [ OK ] 03 balanced bwidth with unbalanced delay 7434 max 8456 [ OK ] Having test counters helps to quickly identify issues when looking at a long list of output logs and results. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/simult_flows.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/testing/selftests/net/mptcp/simult_flows.sh index 6a4568d8f596..a9e14698c179 100755 --- a/tools/testing/selftests/net/mptcp/simult_flows.sh +++ b/tools/testing/selftests/net/mptcp/simult_flows.sh @@ -8,7 +8,7 @@ capture=false ksft_skip=4 timeout_poll=30 timeout_test=$((timeout_poll * 2 + 1)) -TEST_COUNT=1 +TEST_COUNT=0 bail=0 slack=50 @@ -227,7 +227,7 @@ run_test() # completion (see mptcp_connect): 200ms on each side, add some slack time=$((time + 400 + slack)) - printf "%-60s" "$msg" + printf "%02u %-60s" "$((TEST_COUNT+1))" "$msg" do_transfer $small $large $time lret=$? mptcp_lib_result_code "${lret}" "${msg}" @@ -236,7 +236,7 @@ run_test() [ $bail -eq 0 ] || exit $ret fi - printf "%-60s" "$msg - reverse direction" + printf "%02u %-60s" "$((TEST_COUNT+1))" "$msg - reverse direction" do_transfer $large $small $time lret=$? mptcp_lib_result_code "${lret}" "${msg}" From patchwork Wed Nov 22 11:31:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464633 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2075.outbound.protection.outlook.com [40.107.7.75]) (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 0A3E951035 for ; Wed, 22 Nov 2023 11:33:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="vufi23iN" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AkwBCvfGVVtwcONS60UROFG4toPYIu892/tb/h3+X+02UQHyDzE/3AFIRjJI35UXxLqTQ/byNC2TY5E6ami1/OIvGfhxn8FwmECr2u6/wZ50NUdoXVYy/4KyiY+r6rSKBYYwV6e+tDobH/Awx4apuxsHj2HZI09lhD7OBuIBH1QdTVpRsNthXYLgjE6XBSQZ/zsPuIphf19YFv0JsSeOmicDddGPN+92ylbQ/dzwWnTj904Mwc5cXyejAbCvPPdGF4XsdTyFH71fS9MHzDX3FrBUEwWflkeBN7QuHxHZeLmledcPJYHKdYl5xgEENmj66/8vMeGCwnoDzIfDqedNSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=LQkxNoCe6dpOQFraOb6hwmZhqymdwFCV/IA9RNfj1iU=; b=N21tlXv29zImbggg1S6bsYzzdKc1xBCWglEyPFdoyyxciXxXdScUkwV++3QImy+XfUV+rka/DOrKBaA8hL9769Fs0ufsTiUqWaCzYr2qa0d2uKiuNpdsvTQpCpxp05Wxgb0KSYa7/xYIgOQ4lyCnMqeGeTPRbADUNuPA/eHHNLf2ejSIEHmygGXH9zU6HNCQuobE3LnYNBwOQCsQzSFI4IPvrPm5iWPps8otnYOIRgpy6/vj0GaESTKUHmeuaKRqQ7ZgEuTkNumLhE5HOJlISBJYxclT8Kr6cIzE9at2gVjvFWXQQ/ZouodJuSHIBTj/+KxBnaZezbHMxJTePJAKqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LQkxNoCe6dpOQFraOb6hwmZhqymdwFCV/IA9RNfj1iU=; b=vufi23iNnDY2PgdR/hhtldwEG8w8hoViEyYgKV4G3WMmCdRZhvg4C0ESI1D51XGlgaWdQioUrH7e6sJp+KPuFBhujvUe1SZVdO1LsbpWmn7bRAFR+eYXOBuLZ8y8d865jSc1GTHidZjfCQr+qs58YiJTqGJGTytdw9qqSz/IPwbsukQtGIZjalUTV+CR7gJKK5nn1TWWUkAv5AL3uPMPy6Roy9tRvnBVBlR7C/9tOwBlNDjXY8fh8RsjP3ulqW1ZeRoBYPQDnGuz1MTQxcn2IAa1bW4wgzUXOqkdZqLKXsh8AZAq5TPDjJgimhl+manPH2ysASRJ7O6QVETQfllfcg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by VI1PR04MB10050.eurprd04.prod.outlook.com (2603:10a6:800:1db::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.17; Wed, 22 Nov 2023 11:33:50 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:33:49 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 22/33] selftests: mptcp: sockopt: print out test counter Date: Wed, 22 Nov 2023 19:31:10 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SG2PR06CA0229.apcprd06.prod.outlook.com (2603:1096:4:ac::13) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|VI1PR04MB10050:EE_ X-MS-Office365-Filtering-Correlation-Id: ce9507c3-c046-4559-1d53-08dbeb4ee598 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bgbEp4UlZlCfJqvp2ZF0xokNDWcoyp/lSBVIO6tfK70VKBlQH40QQeFT8ElcfLkZAz1FFyFsax4yB3ASaoAs8nC88xxRMO6GHWDuvIb5Pz68SeVWPMTnlubQmTWfhRwZXJuGCaOBAgozYDcf9MhOxq/4d2Iaea3xQ1zcI65d0mHSG18BlEoBqTEg2QP+YzLKIUr49YNNP7rU83J4f1LbfJX3m5ZdGmaDacgVKHZQDBoQ5OfkRL5D49cU8XT9zFX9+VirgrEiK7aDSzEQatwXpWpz0XrBGBWRlcbeGtiTepPr/RUJlz2ZIBdEK1UtTvviKN6eXe5e3C1qkjJk0vcL0NS/pX7hHaMU/vj3S172d3Ig/KnZ2yx7gDSbWrsEvPZ7fvuUvz9haYUEHvLBki87QKKbBhnYmfh5z9qHMACZWn/knsjv7w+cF7eAQ9KVCU0wxn/WORwfzUaH0JBXaDwQjU4Zkxpah9wySMRhzKVJIcRmlYxAe9FCJlbhriPMUC5DP/53lBVwRMreN8UTh99dy8ukDwEHNr4SJ+o6E0CxZ31vdUqx0j4Mh1OsTQ4JSBOdH8qaoGQmYpj8yxF3HQeIpIBLzgZJ/SJ9gxFxJkuGzNg= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(346002)(396003)(39860400002)(366004)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(5660300002)(44832011)(2906002)(4326008)(8936002)(41300700001)(8676002)(66946007)(66476007)(316002)(6916009)(66556008)(86362001)(6486002)(107886003)(478600001)(26005)(6512007)(6666004)(36756003)(6506007)(2616005)(38100700002)(83380400001)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZNtYmkSw1lEz8i9L8jqNV+1qqE78lrLxdiC33mKP9CSfjSx/id8LU1OdN5et5kTaxxbnI7tTCC+eo5o4mk97yl808jrPLD5SC5q89II8rUF0RKkLgfYTg32coxADA8Gpp6sHuJlZBdTHzBrjz+PRFsAcGPPmExT/Qx04Mvo8p5xgh0p5rhrMeccTLPwUOUgP9smW1okCZ3mEplmWzRFJSLmNlsTCymx9buYCFCJNrW9U1kP+wag1jaxxcgWLxGNX3My+D4JUlkTPSc8MeBI7OstdOkOLyQpJi1200Sqyvb8Ok/Q+iQAXNcWj76gvugQnS/y5ut4tNJNw/59ayJ3RPCLNPKMba1ZK0Nq6QA+z29JdbNB8kvyItRVUSXJrsu6FquxJ0/6Qv6iukD/bx6Ihn8ygIedCcHN95BJ5w+Cj0W0G5Q4O3+do5oVId48eZvRl1gPAYGmk6VAuzdZ1APlVbpSd7xwKg4NM2tgJpmLfzFETdudbZlVdRC2vIwmHIZynWGD25kyvfyh/1AHUpaX8jlfAAihlrSiJduMsMxMHyzdVfCiABgwLv/kAHcQYgVExJONIP0+GFUycGIRrAHvJ3iIz6UFaXF/XZP2WavZRIa7ZkiFGzSNVakqrqRpjumgTQ9nQC6wZE8yot0+Zyf42HGMZETQo5ESgCkybWKzZizSrtXZsZtKStG5hP3o/CNDYxropL7PmZP8ApdDiyn7pKuAh6r7jtUJWw/56/BH7iuvSxngg5A3sgTMVMqKxpO5E9weNPMGjUKbyWlo5p26MRr4be2fEs414yPgjn7e62CHJ3LBDPs+TecLrY+jELw4960AY/bzfEQkaCQaIl+21j92uETPOI4/xJh3b0ws0zbwurxZ2PHK0ptVw8raGme75LcROkDeZ1HpBUY60aOsPBWQyuz2kzCOkv3wAlmJTzW5xTBiWW3bO4i10onxivIlwhVlBZy0PqrYmNmNb6YaGo5kYoRVU+LEGjYXUkYK6v9YMnqfhm7T5JIBp4Rst9IF3CYsmzHDKTjiX7j6uRDI/VSOhvn/59EJ8bNm6J1ZK5Vq6ju1WCWSgomOOYxZpUjpDPdrKZBFCteQGCcR1Me8BGIn7GNW2mi1rX7vtpaJci07g1zOmNGBY563QQAsOOwf+m7xWwg5mYgofYxRl8Bf6+krjcYvZkfd8E9/Jh50CamQC8Ns0MJP1otCqv91zjZ0zwP2rTcVbXLxaKYp8SsdAtSNbGYPwvDb11QRCXYdLF94F10yb/zcaoW/a31eHh0qDkxZR8+2beuKH7vgDFAnVDAjoofmnbKybXJL+aVkORlEA/XdldifZrqojZt7ODpJPKC5o9/MkZ/xvci4lyHPEQzOiNPDHfNtZxvn0CvEqRksvKGDpS3twL7ADYsQmVSH3nRKvZVnuMYw2fH0Rc8xCiMHJ/WIv/ZVZ5CvHw41fs5l1kkpzZIXlkM7tgdGzXz5LLKGVxTG+Kg+zz0U4zC2nLUSTFi4CF2f4YUrcdrwvQIFRwMrPE2rngC7RERHil+pzA1VoXqwAXE8nxUk28Vb3cO4nEhyShlQNYlxaLhdNbDIvlEHRsjawV8JRa8Qr9BhS5Uo+9dNH3Sx1hl9HzV/IdA== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce9507c3-c046-4559-1d53-08dbeb4ee598 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:33:49.9218 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8CYCx6lji8UbSLCHXvVqpIoaqg4viuEcKLkVmeYmPpnRtUwSSI7cG8ez4iEGyPmU3Se1GMHJAAVEpvMfZ3BACw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB10050 This patch prints out TEST_COUNT for every tests in script mptcp_sockopt.sh. The output looks like: 01 transfer ipv4 [ OK ] 02 mark ipv4 [ OK ] 03 transfer ipv6 [ OK ] 04 mark ipv6 [ OK ] PASS: all packets had packet mark set 05 sockopt v4 [ OK ] 06 sockopt v6 [ OK ] PASS: SOL_MPTCP getsockopt has expected information 07 TCP_INQ: -t tcp [ OK ] PASS: TCP_INQ cmsg/ioctl -t tcp 08 TCP_INQ: -6 -t tcp [ OK ] PASS: TCP_INQ cmsg/ioctl -6 -t tcp 09 TCP_INQ: -r tcp [ OK ] PASS: TCP_INQ cmsg/ioctl -r tcp 10 TCP_INQ: -6 -r tcp [ OK ] Having test counters helps to quickly identify issues when looking at a long list of output logs and results. Signed-off-by: Geliang Tang --- .../testing/selftests/net/mptcp/mptcp_sockopt.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh index 9baa103055c4..2b02689a92f2 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh @@ -173,7 +173,8 @@ do_transfer() wait $spid local rets=$? - printf "%-25s %35s" "transfer ${ip}" " " + TEST_COUNT=$((TEST_COUNT+1)) + printf "%02u %-25s %35s" "$TEST_COUNT" "transfer ${ip}" " " if [ ${rets} -ne 0 ] || [ ${retc} -ne 0 ]; then echo " client exit code $retc, server $rets" 1>&2 echo -e "\nnetns ${listener_ns} socket stat for ${port}:" 1>&2 @@ -190,7 +191,8 @@ do_transfer() fi mptcp_lib_print_ok "[ OK ]" - printf "%-25s %35s" "mark ${ip}" " " + TEST_COUNT=$((TEST_COUNT+1)) + printf "%02u %-25s %35s" "$TEST_COUNT" "mark ${ip}" " " if [ $local_addr = "::" ];then check_mark $listener_ns 6 || retc=1 check_mark $connector_ns 6 || retc=1 @@ -238,7 +240,8 @@ do_mptcp_sockopt_tests() ip netns exec "$ns3" ./mptcp_sockopt lret=$? - printf "%-25s %35s" "sockopt v4" " " + TEST_COUNT=$((TEST_COUNT+1)) + printf "%02u %-25s %35s" "$TEST_COUNT" "sockopt v4" " " if [ $lret -ne 0 ]; then mptcp_lib_print_err "[ FAIL ] SOL_MPTCP getsockopt" mptcp_lib_result_fail "sockopt v4" @@ -251,7 +254,8 @@ do_mptcp_sockopt_tests() ip netns exec "$ns3" ./mptcp_sockopt -6 lret=$? - printf "%-25s %35s" "sockopt v6" " " + TEST_COUNT=$((TEST_COUNT+1)) + printf "%02u %-25s %35s" "$TEST_COUNT" "sockopt v6" " " if [ $lret -ne 0 ]; then mptcp_lib_print_err "[ FAIL] SOL_MPTCP getsockopt (ipv6)" mptcp_lib_result_fail "sockopt v6" @@ -281,7 +285,8 @@ run_tests() do_tcpinq_test() { - printf "%-25s %35s" "TCP_INQ: $*" " " + TEST_COUNT=$((TEST_COUNT+1)) + printf "%02u %-25s %35s" "$TEST_COUNT" "TCP_INQ: $*" " " ip netns exec "$ns3" ./mptcp_inq "$@" local lret=$? if [ $lret -ne 0 ];then From patchwork Wed Nov 22 11:31:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464634 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2043.outbound.protection.outlook.com [40.107.21.43]) (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 553E251035 for ; Wed, 22 Nov 2023 11:33:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="d/VDoNH9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kzEfGZAb8HBX0XBSlvWgjm/jyx7hd1p+pBWAsZplBYI/rVO1zG4m0AhkjITSTpTJJjPGaizRsKkorD3iI8kTziLcP3k+Jgls08TpFWtC9dYEt+1Ydmavwq08SUJmiG605mFs96idA/d8d+hJT181MLuLizQYOzyZG9ele/WbeoujDCViR7oIM1CUm03ePjjxWHLYh3Mk4QlKobH/epPFY2DH/AMkYz2giqo0rOnWzEELAk37IdIzX0Ow3QMQlNsqhd8zOjKwnqop/ssKDhzuLP1B1ubxhoM5gVwnkWvxfLMEPiZ9Pd2SSiekYxs7Yl3NS2an4DhdUggEu6KJDKS60g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=zYr1NMFMKvfGcN0MRxRaig0LTgbAKiIHMgkQ7i4xZF0=; b=U99MjkbmkdZDYkp4pElBRqF1jE17sFPsNHOcs7qWgMcYasNv2vo/DaaPY6HQH37G7gHr7H7QNRgd241DoKLf+3FD91QhOgfNpeaLFP2fYj8z+Zv6JFcYcb6Xo8s1qjG29WLITXPSET4UB4V6xDw0dLNt68w8mfneqzFd/qFyx0xVSBPCLPtev1E5ilU53Pgx2QySmXFHD/R48u9tzxrenqjdc9vWR1Yr8Vvqrj1nA05szzPzN+XF5HzdLf3TQnw+7NuuDdQHhrIasvsV1fig1LxMAShIWkwVKOAKVrGn3Esj7uGdjpa0vzcvp4Rxt81JAFsxGZASQYs4unkPtc36+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zYr1NMFMKvfGcN0MRxRaig0LTgbAKiIHMgkQ7i4xZF0=; b=d/VDoNH9PZVZEQMhadKuML2ySS776Wgvi8dvWeu9JQZNe+puNe830lidv69UDHZ3GiF4AMDrRMY+T3VtVGY62sV+cS128AXOcVXIJ3o7tgBtwJrYBHffQDU+WitE6Og9sS2nh9lP52bGBaqdvFPG9a9wtAEx1NGTDHd721f81OFB2wZ3MI8HXbHyd7KzGa7THNlNRJdcYTZn9onpvVCZvCjNxlcBWrC1NyekgYcZ7Za4BOExbPMJjssDUUV7UPB9AdPxsPvy7YwSNbAXN7dKy/oAN9iVLpDVxPUeQYJnvobLTI2zCEVolxFXsV/3/P0rXRwWFIuUsREYt7OFzvq2XA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by AM9PR04MB8858.eurprd04.prod.outlook.com (2603:10a6:20b:409::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Wed, 22 Nov 2023 11:33:55 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:33:55 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 23/33] selftests: mptcp: netlink: print out test counter Date: Wed, 22 Nov 2023 19:31:11 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SG2PR06CA0244.apcprd06.prod.outlook.com (2603:1096:4:ac::28) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|AM9PR04MB8858:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f956b29-21c7-4610-a1a5-08dbeb4ee92b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5fdpBUpe0mP3C+5R/qHRkJfE4ChObpvc0DYmH5pF3V9J5MIKRaBZecYDQUXEtNPoBH1DOH5IEt9OAQ+mJTzNpGr8Hm9vpAs5EbMSN74Jls2TXpZW/sshn+9+4s5LwSSpmypBccGWaxbV0OHZBVfUERwNdjI6LhNTCUpKyYw0WSyC9b1wlyBmBAr4QJ06DPay5HsXOk+pNHjaMhfvhltU6M0eNlhwLGDPhUFhQ4J4S/qVpw1Qo34uIpBmoV1qOH/dwqegqo+RnK9icJfU3bQL8Fhnms88jgH868q/1KgrZI6sq434XGpRlRv+REr+TnGkpyracJqb8irklcV5rua8ldr/teN3aRKlVRpNOdUUCsuu/QSO9ceqjStrLjzu2cujD83bOhADLmegR7n6fzDBWIhK9bmmLpxICtJQ8+5m5CCwN50xsIc1x5UUxBSVPdumU7qTePs9hUX8CVBOvKljkdoAcCxPx+VyTYsv8XWjEA9DtbgbTTHH8K5zT+p0MIYPn+93EBgd9ja39SzJTvM6k2tZX673+98YZtP4kLFYojxwntt4GLesY86VWGLo9W/KEC3YtR66jTOtEkJo0fdyOvRIyNI3WcEt2lkDhWoHtEU= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(39860400002)(396003)(346002)(366004)(230922051799003)(186009)(1800799012)(451199024)(64100799003)(5660300002)(36756003)(8936002)(44832011)(8676002)(478600001)(6486002)(86362001)(4326008)(6512007)(316002)(6916009)(66476007)(66946007)(66556008)(41300700001)(38100700002)(2906002)(83380400001)(26005)(2616005)(107886003)(6666004)(6506007)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FA2/Dx5hZ9C1+GL8ygwl+f9qtiU2p1I6XCYiwTA51Zbk9vRSQg6zkUT77s8R98cA9peE5t2EFJwcmSaoc8kQmhZ+icjnJT/Hx+X20e4yKLwWZ4x+Vv47/5Z6SjlCZymIunRqyOAGDMfOfze+JHdYj8Tu0zDktCLHysQitwVfPyUQZe6wuJuMH1u1I9Y+5WpfJk+dXcVpprs1hSW0J9ZVPcA4yPvgkg06r01ixuejKGJ+sgJxm6z5W1akBkcRJmNpbXrAAHRyEs3gry03aXygIDVdsZrOsjUtiExDI+8bT7Gxv8YcnyWkCAO8j5xbKM/cSLwFh3/HnIBtTvlZofxt+g+r65E/euNWz9QC9lsZy+cS4rdVzjr6uGwRQPaVNSNekixMeNlElwMuT0igHYp1MAx5rYyZJWraMcm3r8I4FU7ePQ36xSHoi0/nCLLxeyL4o17VqGO81wnFb74Xwn3fzAbXwJb7zEFz6XKCLQLKKzbVAYNjx/GeLaWp1VcjK+pXwn4wOHAyOwPsNGP3dCMYumNBJC1+rNEm29+L0eJWsT0nUX3fMH85gO9hx0+hzVRvwexHqj9jUYmhsZ8/n2a6Hd0kUgaOYgplAh5y1mpC4UxndHnQobqPRle6CY/Kdf7hv1n3Zq9iUIVM/nMBTklLwBHHHmLVnXu0BAHH+itSGWTc0qV3IWajpeNBlfG05mb5LltmQb19I8kgEKS1GumFUZKfK0UCDuvYi1gQbB281yhGGKYTvugg79rOPnXSeTa7TgKYZIw0RHDLG2uj02BSJQLkcjQtCAVjJSfKgEje3MaYYTeH2WUChByRKuDzG0XjGqA9mYGS1GmpaShmXo74gtNHzmyWD1Sb+V/3KixNhSrxUgiRE64Bc44owa+4kQK3D0+pMxPaA5RmXZn4vYaS3x8PDqBfFksid7eobamnEGh9efXViY0SA2ZuazlMpQp/9T+aq9+M6aKHJQdRSROwWyNnBCa8oADs+Go7vLiOPkJAeTDFnCGLHu1Zpbc2E7+qxaHhLHiFUoDStxIfIjXje7aG8IP6eKf/gYfwcsVkhvN+CINRRdP/2h+1WgIOKB25lZHmR1wLmD1aULsjdUl3xLaen2v4uczRhUSWq6PaGyc+m4YEr/9WS5pHi9Vd69/zZs6An7rSxwJEHPeYE82GFYCNmE2dXEUlaBDkrC/1WYyd9WJPVL2igULiHo3LsCOSnkAT+1DYWTx1NvbVNvcc3VTTaHwvN1olxv73y9NqPhka4Bn1YUJZK3xfv149vJxFdo94KFW0nDQFs4JEsTz/xb4JE5SOq5ikQJIc9nfT4x+JLDEuYbDjSGnsKIuoLW5BqVeEqHkus+bJKr223YAm1pLN/Jq7rgjVpeymdPCLPIo0cbQ9nCCeI+jGIqw0FoU1Xjd5kClp7CJVzRcMcXPQMwvj3z0j9PdEZ7QoXFmyphJDDdmEIPBAA12CIvANSknK1QWApUctUK0bv4G1Lx/QrVgX8/UWM2gkzj3aHHb8tGCqXLRYnDVAlUx2c8bbF7PB8/bjBAkUJb4hVUkhVFc8aORq3K88fbr6ZMHwkphM6MxqwkKZq0DcRNE0kKBLvxyGFGhMC76HWyZCLUNUUfLPZw== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f956b29-21c7-4610-a1a5-08dbeb4ee92b X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:33:55.6152 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: prxjsV/tb71ijHu/KK7zE+wg601dHYpQu4AABLeMO/2AG5lbQ3bhSIHphjZHGNVa7qT/kREL6ePsxEZB8rpsKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8858 This patch prints out TEST_COUNT for every tests in script pm_netlink.sh. The output looks like: 1 defaults addr list [ OK ] 2 simple add/get addr [ OK ] 3 dump addrs [ OK ] 4 simple del addr [ OK ] 5 dump addrs after del [ OK ] 6 duplicate addr [ OK ] 7 id addr increment [ OK ] 8 hard addr limit [ OK ] 9 above hard addr limit [ OK ] Having test counters helps to quickly identify issues when looking at a long list of output logs and results. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/pm_netlink.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testing/selftests/net/mptcp/pm_netlink.sh index 32265d4ecb41..e89b78e7d4a0 100755 --- a/tools/testing/selftests/net/mptcp/pm_netlink.sh +++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh @@ -45,6 +45,8 @@ ip netns exec $ns1 sysctl -q net.mptcp.enabled=1 check() { + TEST_COUNT=$((TEST_COUNT+1)) + printf "%2u " "$TEST_COUNT" # ${*} doesn't work here since there're spaces in some arguments. mptcp_lib_check "${1}" "${2}" "${3}" local rc=$? From patchwork Wed Nov 22 11:31:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464635 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2041.outbound.protection.outlook.com [40.107.21.41]) (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 59D274AF66 for ; Wed, 22 Nov 2023 11:34:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="YmynZ1rw" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YJabjA9GKvWNV56tebcyWt8gFKbsYZ5AJ5XNr4EOgudL74/msIl2y3BeFuqd3poMPJJgRNRaHQT18kFaTAYR1p6T960pEsa2yAjKiHlA53y6rUjGcnnqTmoT1PkBjx30j6z/XpqTIIKcJnBcOFaQrViAX6W4CT8xMFlJzRllB5XHQ0GsjRJSuZy0tCJ8nBAknRYDbAAOYAavcKrFACnAkIK6TwKCi7gAOnCXePuEY9aLDBYhUl2jU8piLPT3CaGSTn5KTpfrTnQXz0phcIFWZK6ezRRavVe+fG5TdH6uuyy+GUFZftN8AUqls+pey2Uk15jQAKs0t6qTbPOd714o5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=jPwCLfjOAzEXOluzrsobxL9Yrk7FkFZXeG7b81W4fQI=; b=SYLvWOUGpmAnHvglKthm4P8OYDeeJJZa53iVMedWqHCm7xfRLJf8Mh0w7/vRRw8m7t6ygJWMVVlSFZ54bfUuPNUZj+uQpi0kvVduCvICqUOouDoPHb1ZPIrtiZYZatINe47rocEh6F4m4jzUXQbkzBLB/3W2WeoNSV1AuNvF6TlX8PqsaMCgxiKZNQ57s0pH8nk8rgBm5H/HMdTHlA7kTuefINi6Mz9K/2cUeYQog5eKMfn2ZH+6tog6y/hblWBjCrafV77wmWkjVpB5fD2dlrxoYXbKaHfSXQgsI96b2th5UuKy71CPQEraJawPa+js3tMTplWQ9oiS8RaeHkMg7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jPwCLfjOAzEXOluzrsobxL9Yrk7FkFZXeG7b81W4fQI=; b=YmynZ1rwZPqNzOENF+n4znUPY3ClDi1sSHENpCxFOJb24z7xueQhMDDAGa4gS/AberoNhq7dbk1pYQXZ7ZW930iFWSJYIr/RjSEgAwVI9mkv1OkLK9JPviIR1Zq0hLnHjYduefkUVkKZWhlHr8ZiQvWgIWfBZraXdxa95j9hkwYHb/WQF88SJHXWiVeXEILYClKenX3PYSGr7Uc3ZHBzazLTNZiXNxMSbiw/8VL7LB9xCzIs8ucrT7PZpHg9bZKM7CF3vRBvHYdP/eRBiJK/3Rvkobt1026tVPRy1k6pQzbkugFZsre3oqQIt6AdFYejUUsuqo/xBVs1AS8JZhBRYA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by AM9PR04MB8858.eurprd04.prod.outlook.com (2603:10a6:20b:409::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Wed, 22 Nov 2023 11:34:01 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:34:01 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 24/33] selftests: mptcp: userspace: print out test counter Date: Wed, 22 Nov 2023 19:31:12 +0800 Message-Id: <7ec189777cb3ccd22e513f5bd5ecb2205a5b0a65.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SG2PR06CA0233.apcprd06.prod.outlook.com (2603:1096:4:ac::17) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|AM9PR04MB8858:EE_ X-MS-Office365-Filtering-Correlation-Id: c02334c1-d877-4b73-d7e5-08dbeb4eecb0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ndA0VeI7XAmgAAX6iV9nk7xsvjRDTt4GXOYgExBPaqxTFGEjRzdmDEBKq3HxL36iFnijL91OpFq20LVrI2WBSERCmgwAKxuCcVtfjv+Q/rXKZOQ3D16CM7sUoSCwpSvgGVtKr3JgQcEPF4uFMvplwfNg5nu1QTPwekBfVd818ehBb6CIjfJTx8aa/srpdQVZC3f3M88RtCE2OgjDP2r+IV+zqyo4mpoFrFmJ2zAlKKptrv0hcepluGr6SEcOmbsXhFKaZhyX14GJm4qu691APNxrotQQQLB7s7NamCSciiWqdlo+LloaWge5IMaeBs3+vDTMqRkNLlXijskwxEV373ggXDekMbhcH+a05O4mZRgqcWyIIdiduS6ORHnCKyCuYWc61C9nNwOguqe62ErHDpvZay93Dnl35UV81nWqR/Q7KdFLHaQiDAjgwgXktEWH8A1nrp9qbqm/et4rC3aoDV2mJjGWGJ9EzPwaeZ0AIjDYDZAAD5JsP5EXJ12Qf0DycDYL3ytQ4wnsZ2Q9EFDrvaDVXTLfSnbQeXMkv/ffod2bX8AxKo19sxFy1gdMt1RRFe2O9lJrfhRoQ7ZVTjmeuFNpE/QEA03KySfwE/2X7R4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(39860400002)(396003)(346002)(366004)(230922051799003)(186009)(1800799012)(451199024)(64100799003)(5660300002)(36756003)(8936002)(44832011)(8676002)(478600001)(6486002)(86362001)(4326008)(6512007)(316002)(6916009)(66476007)(66946007)(66556008)(41300700001)(38100700002)(2906002)(83380400001)(26005)(2616005)(107886003)(6666004)(6506007)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SoYE/DXja4TVLUqD2Iyx3iYBNjAGyOWk0DcEVFG3499L6Mk/zmBQbSXtEk736iiUFrcBZmeOvfeLUe+4y2VVKJG4DqMSgt3LD3yx3kMrx9Eldz+7vSdJCkF6rW7+yh5rxhbplt4YALR407RzS4ow6FZcLHWpArq3MVamJQ/mQBCiK/DV86g2OISYTpcShk+Z3b82rA8kanvTrA8BsZ7KHSdZj1DV7tpKLwp3yoZ1QwwyEDTWtGtQc6Rznl/x3Z+sNYb8ZbI9GOY4YE9sTGv6LspZKL+wccFTHXeZQGm0Qk0Q8D7xAmwQqaPmG5iF+o8CXb++EU1BZpD80d/UNKyEjd8T5Pp5oCkCynhvvkJWwAnTXRSYBt5pnysKB8hDpnYTm1MnydKUtTWxOb9ysgrQ5ZYZ9JEysqSgPW2kdZxAO1QTyjrelfZiFuuG2eidR2/8RDHSOClIRqQHcCtI5eJoVDMI1ArJymiZcr4oflRJXPKl170vOOM6J9Db4lgZvL1VpzlM2hs3g3rVu4MoorauxKWXbvhG8Mo9718D+eCIwk6hS7Ynbxw9pWkxuGB00cB7oR0OM/Gpy6X3ssL+mlHCvcnFcua10zH1mJIIDY2dJjE/Meiiaa6OICtIIawTbXZI1cK0YYWdtxquAhnelqHuDfT/5Jp28SerRCsFmGVxRALS/tsgIxgJCA7e57WN60SwOqzDiPeNc/FEj+UKlv4RY4o59mCvomEXevhqWNsi0vUbPNBzzDJc3t65AhX0KrvT2COSBx+LnF6ZdT4v4uhcvzbg1tIQg1gjxvXT36KAhT/41X0DgU/plm0wpcdxQQIgy11IrlBc3960T9ErHnCVAj/N3Gmmr42UIefXqj6QZUddZECwIgeBsr2xLmzo984JzRFQ23nA3w7Spb4I+oqlDgWI4DhY4pZrBWl/kd0W2DNC9a50hbFmwO9ilDHlLN9jomWgGWZ0wl3x0SWL93fjsvLIgfHogUWYJnxvt1jbnrPrKPIPA2QkWKKmxEmxgqfvzS8Vkp5EtdAwlHSIWZpDs81gEfFdFxm19ZkvIITHdpCMtM7R+yif4fe9KOaJmwJ3tyMQnY2qfXx+yG6QsW1cWg7ck5BegLutcE8wFxurAoGDXxTDWifAR46T0OOGEKzSRYuObXXZQzu0llj93bWxsB63ZlZj7MLua1Qi4ZZBRVY7kZngfWui04xk1K4vS4H2R6EkVfnLwmGHDP6wLQ3TNHRrAtPEmUP/7L7Oc4niRpwAJ6a9/dfyHUQXOsUn6HBT29lcsqgD9iRpCh3auFXvyg9TR9E1B4b+8oP8rzzuPZZAFs2unK119yEsoj3BTAzneNbA8D0yLYa+gdZFfOp1pzS0DAaqSkC6zlQd5AhFAe/wdTG21o2L2vivwjLzu6a45RAn30BBQsPxSabkytKq1NygynqnYbX70R7b5CTb6rLnL44/fbiE816TC7J47MfKuWLryRQeMfZXcR8pVvnKbFynzOWebgpqKBsVUZOJRj5GmvCtswdZQzOHEKxBI5Pa8vRPSt9+ZjM4LUGlEO1mbq91vH7RT4c1CLQpZyhigA/cNOazWnQEcLyyPiFxOjQCdQ+mRVF29x+SQoA/vPGFzw== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: c02334c1-d877-4b73-d7e5-08dbeb4eecb0 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:34:01.5425 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fOjdbkk4PrXMK8M26X4vPQrFw/6bV5H91oK/maL9/OQLP5ckKR5ETuLv72gw9f1Xkcqc6iVm1g6ix8gUjjSxUQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8858 This patch prints out TEST_COUNT for every tests in script userspace_pm.sh. The output looks like: INFO: Init 01 Created network namespaces ns1, ns2 [ OK ] INFO: Make connections 02 Established IPv4 MPTCP Connection ns2 => ns1 [ OK ] 03 Established IPv6 MPTCP Connection ns2 => ns1 [ OK ] INFO: Announce tests 04 ADD_ADDR 10.0.2.2 (ns2) => ns1, invalid token [ OK ] 05 ADD_ADDR id:14 10.0.2.2 (ns2) => ns1, reuse port [ OK ] Having test counters helps to quickly identify issues when looking at a long list of output logs and results. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/userspace_pm.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh index 93f8b200ce49..f1fc0a4f3624 100755 --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -42,6 +42,7 @@ server_addr_id=${RANDOM:0:2} mptcp_lib_ns_init TEST_NAME="" +TEST_COUNT=0 _printf() { stdbuf -o0 -e0 printf "${@}" @@ -56,8 +57,9 @@ print_title() print_test() { TEST_NAME="${1}" + TEST_COUNT=$((TEST_COUNT+1)) - _printf "%-63s" "${TEST_NAME}" + _printf "%02u %-63s" "${TEST_COUNT}" "${TEST_NAME}" } test_pass() From patchwork Wed Nov 22 11:31:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464636 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2061.outbound.protection.outlook.com [40.107.21.61]) (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 DD74751035 for ; Wed, 22 Nov 2023 11:34:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="Iklhxcqf" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nV/LSrW1cTcAg5RgGva4/zC/50APy6ZXhIIV0XR6TagjTJVPvredaA9ksnGDppJVHoY69/WWqzAC71E6b4ra/iS0UBLQbBsPG+YHxGFs1Uz6y5HKeeUQfnJ0mwG8BC/kmVmKyZfMvE7B6mN8GxJX/wunOqWjWAghcBNlGLyEiicEnWMfD1TbnI43KsIGVgjdpzZbm6XOcJFmVMVl1PoUkuJETyGuQ6n0FNYOf0pntlZOTMlJmuuOR7cpt1PpzQfYS86/5DXh9a5FbQTiNjruT/mn0LcXJhjdi7KFHFfJzhMuaq0G65yPSt6rSxDXnGzWnusWqfzpPKKmXCQ4B0ewiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=DXdhkXyIhwwBHZLmJMvqfT9N353Nof0PwdnLlwcEnLc=; b=et2WhqhGtdvYmTftq9uw4d0GlLcYDDoW2/JOB2cGLxuGwJV5iqDKZ3YsIrE4Lv1wj61vbHgLdA83a8Uw0LPGDzJCEoZirhBRqWj3Puwg1o5ZGhV9TtccrFCrqx93FhdwrrmGJtVnSsjSYzh4Okcfts10xZ4audz7ddqbl/YESDehmyVDDiK0GMdZIWwr+oB3RocczPcvFfaIG5hyUMAu7sBsPcQqiOuYNL54YMl4VoHkOTFHOUhmQe4FNWWw/Srof5GJSJ+uq2Si3vvx0kOdL0aalpuI4yMVCuLhyG3a+WGiOZ4rRxIQoGkTzcuu+w98E9pNcwVqLBTp+hMGOTOAYg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DXdhkXyIhwwBHZLmJMvqfT9N353Nof0PwdnLlwcEnLc=; b=Iklhxcqfgcv2mYo0TnVCRXQ9I5DSbDHjpubvCzg9tgcLpI7YvtFR9KoKtV4DYOewaVflG448ITpEvhaSEfT8F8ZnVh2HjdA8IR3A2KE7/Q5Fh/mIRBIpP6qC0aQBiesWcvNxlaOjXQOfqn7+eZiJ7iFZ91unijFo04FEThLUUUPz/Ty2RrXbOn2Qif57tLRXbWyUKuX/BfQEnjgZ5HApmndrkCR53y31FOXuxRYWeAbpMu4KuLjkZYYfHe14DMuzWx1iLScoclFcFRfwi3EJIRnpq6ctS8NBLJvoX1zJDj1kTzAmRqxDu5RQACP7gf1lYGMx/b4/sfoCgVwFa+T2hw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by AM9PR04MB8858.eurprd04.prod.outlook.com (2603:10a6:20b:409::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Wed, 22 Nov 2023 11:34:07 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:34:07 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 25/33] selftests: mptcp: export TEST_NAME/COUNT to mptcp_lib Date: Wed, 22 Nov 2023 19:31:13 +0800 Message-Id: <710932d51dcc62eaf27963a7cbdc69f27bcfd026.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SG2PR06CA0242.apcprd06.prod.outlook.com (2603:1096:4:ac::26) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|AM9PR04MB8858:EE_ X-MS-Office365-Filtering-Correlation-Id: 1497b636-626f-404d-ea53-08dbeb4eeff0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1vWscwVG9vTlgqzhSqd1ddayc2AJV4PaYT4UudZAXJhfNO5kK12UQEGyz/ItLTYkUGD82d/PpwE0HHdc5H3Dv50WtuojVVy7whPHeDG1WtqXBPaDjQqmNMM7m9KqJGW4pSzitkku8zUoZClLxy37AD/mszRHg/twQJKd7xwqRTK7x7DSA9p+Ua5m7QwfQH1BTUycGaaBQfUykL7JKr5HioD/AiFZ4q+OVbGnZJbw/oAupqyLvYBpTnTLTaUuym1/PiK1/r+67smWXxDwmJEqp+OFuYEh5UQIvpEVNqiWxNMRujGQIlPzBMKCZYCWQjiBM6obn6xti/VSJQpCmZKpuIr2uLcXBl363aiSIf+TwRVyPpvjuaFz2eoSwR+KxHxHl3umBO4wbSBzeG8ck0f1wVVS2DgpLc5hKa7dwEc9DV0X/uayIvSdhNGGjQORtVvnDpG4asKCpS8g3/sBiQFdsFzgLV+v/zopqgTiyrCtuJw/WthCa38ih/F6mM5N1O7QZkyahbtyGGHSKqoXNFb3RNXP+L/PiCCYAslMtLWH2hSAxA4HNPHLauIt9THXs4zvdd6DgHEvMe2uwFWKUs/m9XRUILijCpO2UT2bijASqB4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(39860400002)(396003)(346002)(366004)(230922051799003)(186009)(1800799012)(451199024)(64100799003)(5660300002)(36756003)(8936002)(44832011)(8676002)(478600001)(6486002)(86362001)(4326008)(6512007)(316002)(6916009)(66476007)(66946007)(66556008)(41300700001)(38100700002)(2906002)(83380400001)(26005)(2616005)(107886003)(6666004)(6506007)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RZ/oPOIYvd2ib5qfnir1wbfTug7TJpTvg33aqkH0ovNnr6OvhHNcFvsHrGQrBigwD5oolrfs2ySBnqqrA8MVzPmb0r0eAM8FxbnR/e9eMhx4/aOfOOr3jrTu4dXjhzvEcsGoMwdTruDhKO9/m/JqF0XY7zfPemE7Uqv8Qw4XSjHc4JeYfajjtRn5JyQhaxpEFDZawEnvfZ2+kAZ3iGKbDs8qE2IxDeBnmQutXENATeSdfLVJlphI64OxjWL7kOIlYXOT8/N1ybpSFKxWOktbQ+/Gr02TcFctlQ8sM08URGBFmjRpf695cAviNzMECOcgIoFL8Xk3Z1o+gpt9MnNFTET7ZdyijpcNzw8ws3w73s1qyfQzU9KztUaTzBIkRTb/BVozei3sgQVUHDmSCzgv3M06FW1Uou9abPb5lRuJUq95G97EA9GU2UT96E+yB6hd/Eib/xQQKbwx7x9cwOnXQ21vmbcLBOApSZKk0ysEM3CluZfoL0ZBhY+8HqXl7x1ETtjde0hy4Lag1itOi0hE5rpsKHhNPB/kfDL2ipbuu0Qm7eIQnm/W+DK0T1s/IgyJuErTd2/tC+BC8vPSVWDnt0Uen8m1J5Tz5kcqesQ46S/KU9dHVSgal4HWFe9aG+Wpo2VnGYshSam+3MR9zixVoIfjEFqG2lp20DOIsrpBeOaIop9/cj6HhguH/+d358hyzPuh3/K4KfqCtgHdnXUTRBCOGWGO2KO+YePmVcf1kOxmnoqSHkBT4xkrVNXHvD0C5G2HS2KDgWxnABLcgBda7mXfxHF5zdp/pm1m86seRXIQMbUYX04iguqTPKeiYM1lEuS1mjddqV0BOgSCVHw/29MV8F0CZFr6Nt14Hr8no5DURyUskLztxRI8M3Dda/fKCk+aD+C+jHGHBGVnb6JqK2npYVszl7/3E3zB5MJ9JGjJXj6oR2/ftdLXNOeQyAoqMIaA+56RjLsSHnflUNYqHiZUEzt86KYu/tM0c96f4x4iZtbVPNmoBkaA27daPK7aLOXEjIehHHk7v6LhJYKg3PGIMpdFYapi27hYJjsTFu3jAUxfoEymkt1wIcMexbjtfLT8ydIuFOhPPJX5yxR4ch1uhqhXjyBjPDcQzm3zKU3mC/etN54IqL+3weiAvQLTWhvBaHfjcc0m/D6c5TtTY5QGQy/pEHSslAosGD8WH8oSiGV9Lr1z8XTr/fuFOHnviXkVPDAosgC7zCAA8gBb1hRwR4WFVLb5BrvWtlbSr5aq8WeTNneAFJXtOb67l808ICnKN1E8CUwU8LuHS/leG6QEzpjEZDW6M9ejL8kppIaWsV2u1m9MmLcXn4gBvGG0l2yEiihcXPzS1k9jeaArYmHWDO7gb++hThTKdN09IynmpB3Eh6CTs3vWJ/YJU/rGF/jpZrP82IiMfNn6ZFzPSS1vL4Eq14NeUPS2BV61B8ekDuUVL9KJE7u3CeBYUwHbZgVzDIyDtYSg/XWfBqIw+5NIC8temqdopHFOrxr0uoe1/kgBu9g66DmzqRNIDjcaynDz+Y2TTxG8HtfQZUxdeWc5ez40o6bUymsrhedPZchQZz2dHOTgFYi4pyvDFFcGfJTZ8bFzzghIaITVoBFTxg== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1497b636-626f-404d-ea53-08dbeb4eeff0 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:34:07.1675 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: M46FD6QPd3wGb/0C/KbPKC4k53Z/26+QBI1zpdBBUA31T4N9AZ4lMYF9PQ1KNsOjVkc7JcogjWJwgi2aFphueg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8858 Move the variables 'TEST_NAME' and 'TEST_COUNT' into mptcp_lib.sh as public variables. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/diag.sh | 1 - tools/testing/selftests/net/mptcp/mptcp_connect.sh | 1 - tools/testing/selftests/net/mptcp/mptcp_join.sh | 2 -- tools/testing/selftests/net/mptcp/mptcp_lib.sh | 3 +++ tools/testing/selftests/net/mptcp/simult_flows.sh | 1 - tools/testing/selftests/net/mptcp/userspace_pm.sh | 2 -- 6 files changed, 3 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh index 4279bb59939d..c7a7c0d2792c 100755 --- a/tools/testing/selftests/net/mptcp/diag.sh +++ b/tools/testing/selftests/net/mptcp/diag.sh @@ -5,7 +5,6 @@ mptcp_lib_ns_init ksft_skip=4 -TEST_COUNT=0 timeout_poll=100 timeout_test=$((timeout_poll * 2 + 1)) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/testing/selftests/net/mptcp/mptcp_connect.sh index f4f7112a06bd..a52784a14b76 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@ -123,7 +123,6 @@ done mptcp_lib_ns_init -TEST_COUNT=0 TEST_GROUP="" cleanup() diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 7b9e3e3ea8c4..eac5485616b1 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -40,8 +40,6 @@ declare -A all_tests declare -a only_tests_ids declare -a only_tests_names declare -A failed_tests -TEST_COUNT=0 -TEST_NAME="" nr_blank=6 # These var are used only in some tests, make sure they are not already set diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh index 2d28d0980b85..070c277cad4c 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -20,6 +20,9 @@ MPTCP_LIB_LISTENER_CLOSED=16 #MPTCP_EVENT_LISTENER_CLOSED readonly AF_INET=2 readonly AF_INET6=10 +TEST_NAME="" +TEST_COUNT=0 + MPTCP_LIB_SUBTESTS=() # only if supported (or forced) and not disabled, see no-color.org diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/testing/selftests/net/mptcp/simult_flows.sh index a9e14698c179..e1f4ddf04bc3 100755 --- a/tools/testing/selftests/net/mptcp/simult_flows.sh +++ b/tools/testing/selftests/net/mptcp/simult_flows.sh @@ -8,7 +8,6 @@ capture=false ksft_skip=4 timeout_poll=30 timeout_test=$((timeout_poll * 2 + 1)) -TEST_COUNT=0 bail=0 slack=50 diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh index f1fc0a4f3624..9ed8cafde8f3 100755 --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -41,8 +41,6 @@ client_addr_id=${RANDOM:0:2} server_addr_id=${RANDOM:0:2} mptcp_lib_ns_init -TEST_NAME="" -TEST_COUNT=0 _printf() { stdbuf -o0 -e0 printf "${@}" From patchwork Wed Nov 22 11:31:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464637 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2052.outbound.protection.outlook.com [40.107.21.52]) (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 231DA3FB06 for ; Wed, 22 Nov 2023 11:34:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="Bw+1GF7y" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a6EvWEDccBAIKtvdjRtRrKRDirUvH0OWD8scFvOopEIIWziFWGV5LadJFGinTboMKUZkT3GNOS6vRR+tyrYKqG7678yXNup0p9VTclRx58PhfmXNZLD0FZgnAAGpZKNHLJ6YdDi6cL6ZN1sbnTiVJc+WusvJBc/MMLfPDHxOZcoaxXMxnVubMLrF3ZOy3ILMf1NFr87GzkTf3VbeIB6A/x2Sp0j530uZ6zOMGep/+KpCwoAVU2toadvJwbaT49mNcL7J5ME3ez2vm+5e0SKT8TUwH6PPMv3rFk+MnuRJs01yr0D/b3OnAOa7aylU8ZeeY1xg84E4f1+60RP/sdd/tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=fnrbHek0IzYTAneu92fpPXnq2J8mQLj2jvDJNMUCwJE=; b=DjzhnPqLDHQ9Rxfme7FAo0m6vKFybD0jqq3McP/JmKA505gxIoicJAT2AVUfZb8QRCi0DkO2xYX70u4WNZbV8i4WQTqEIjmor/21/neFpMCUhL90gVHc+rI2CTDorBmeBiEAwXN6zL/Xzx3g6cxKk+1ufX3lBlFogcM8oXOUNOuEIawNtGY3dXzHUZcL2ih3gXBQk4NYMsV4EJp3gfoIMHkd9WrFYUWMky3OTYFvqT3Yc7/PZkmOh7oL/Mw+E2qNWQceKy/CZLL9Gb2rxzNcvIhj0CRHgh9dIJP55CX8SLwMAJemXheTd0Qak5ebgD3NJEJdljZNsM9pJhKyU1l/Kw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fnrbHek0IzYTAneu92fpPXnq2J8mQLj2jvDJNMUCwJE=; b=Bw+1GF7yw3DOFAIiY5OPItwEn0k4PEoHJsPdcgB6TJ+VYZ3U84NNtvsfdlLq53D9JGOh0w1vFHNwuvr6gP+Tx/ZH4kSSr49piYoSatEudbBNCoXy/Olst2DPbuv9DvGV0VgrOfUuRamfHglKEC6fTPxHL9XO2Y2DygvVSp5ea0NgiS40svS/d9s26lXskYDkFZclHXnmIyYoZ/0c14HbElE4N8gisEGMx1yQOnDl+ladX4xQtnNU+qn23fJwS43Sa+7UD86IxxPF42xlk8CcStadfo0s3STI7kH7ORIvoCXkmWMAOlpAozUceiSUodaLHXLZtDiRzgCjH0ybsCNdyQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by AM9PR04MB8858.eurprd04.prod.outlook.com (2603:10a6:20b:409::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Wed, 22 Nov 2023 11:34:12 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:34:12 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 26/33] selftests: mptcp: simult flows: define missing vars Date: Wed, 22 Nov 2023 19:31:14 +0800 Message-Id: <3746b16095842327de5f84273f70a08c4f25c002.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SG2PR06CA0252.apcprd06.prod.outlook.com (2603:1096:4:ac::36) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|AM9PR04MB8858:EE_ X-MS-Office365-Filtering-Correlation-Id: 772b3973-d903-401d-48ed-08dbeb4ef35e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A9280O8oF8UCep9R5v2xQURxpsy5Kpf5UQxJCz5YXKa3z8ug3AkS6KTe7IPGuwNEcvr8zCZ8bgcx6HzH3i4+QR7G33RC9wJBqMjzjVZa+AGjEIpQW2SuS1E/0gXOAaKca5qCQaQ/tSUH5n07AFwTiTXFiVH61KiCRC3FIQWuP00QIlhbaswxWzIw5jWwKgWJTdWmi+Yw0p+FTNEecGVWjW8TOxtvnKkcaoT1paHyuQ0PDdgjGhgo5D43CzpoyM0E/45MeRNYuxBakpM6tUP5+m4LNGqjlu6BeBBYW+xRD9Ij5WytyVuHnBTFI21SkCDa5JmIycx0AQhc4aoLJ3f0JIo7VIRC5Ymhfgs7CVoFEkrWSQVeFzuZ7bqoR7ubKQfAF+b5lrjixTIosifJoJGm9R6MWrji9vl6peyWQA0FtGtXK9uoruBQs6kEE0ltmEIhY7RZ+TuQZMRTFVwAmRlO09t48a/rHKMGLSIrwn+oxQXsS+46BHG6vauReoHJwXbFzDYKgVkXLTGjYQJE81v2llB5kOwyf8IEYQ+XuQcvi/zhalTGUHBYudHYFAO4YyZa9xa1y1JKc4+X0N5IHEZ8AZHLvfOXf5gEtNYKqLaOzPw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(39860400002)(396003)(346002)(366004)(230922051799003)(186009)(1800799012)(451199024)(64100799003)(5660300002)(36756003)(8936002)(44832011)(8676002)(478600001)(6486002)(86362001)(4326008)(6512007)(316002)(6916009)(66476007)(66946007)(66556008)(4744005)(41300700001)(38100700002)(2906002)(26005)(2616005)(107886003)(6506007)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: p1EBr4fJjY1WuXIaBnPXHaMsMJCizPpOOnJ3Mt0XrYbcimld73TG+J11V3P60NKU1UOOQIdhBBurMlVwr/VC0+GCXVTccs2Pm8pmVeiREIhmZYdOhUePqQgvO3nMPE6gc0Upg1y1E95OHbmuA0IJ5qivcazLcDDB2nTm4NWhpb1SlggYj8UHHpK7sQ//vare1W3JGv5Y2WjmRm+5Yp2m3DZ2JAYGj1BTInBEKkF5fRzUwuTJgPAU+uSlb9VJNEEHhrtG0gDLI+GKolVbWpZhtWWv6o3/1UIqgUP9fUDWB8OPcVPxCYlbPJ2bhaqha3ImcrBNG+H74CkvDj/2VvT5rNvQsDuqatTCtK9ynabyZG03URqowhT+flkAEE5Ub8hHnCgRKt7fnlaEPtmkC5DqUVULgTDAK4o3Hu6xLvRKc5NXfi57FBQfevnwxT2LTMv6WoYzvHVuAIyqimw87GeI/p5tAAu6+eZQUJ1IiUiZOL6uUqEGzRZKgn9u9t+/o8nn6TPuvBNhCR/BYZW4grlke51JYXI6vn0PXAMUaYHgT4gU3W97hzrf8Qj8A8kL1BpjfvAX2wYyg9ojMgF18iqR9Kix40G1JR2SOjiKo4GGjRjBQPqvKtoJ6gmekwFHzxG9uOg2fZhQvNxPOGaRQB2Qf5DF82Skvs6EISkxCFShbdjyFgiLmEWk7Zp/eSt4wMKK9z3nsvfzRs2To9W+sl/WBJVQ16g7FHdJ0fxX/YEitT8Xo/Ik/NMAkb2KemsPcsuvn2Suj/OsbyvEP29tFf3yq8X2uB+1ZiCMRyeAZajFrlOx4lhsKxIm2SkGx+ISbTDyMRpBsGWzDqz+EClWHjOME4VQpoD4wlRRAfjH4AWbmOtSf2LalYz7shuIBut094Jw0y2RSkHzcgRV4JBRSMT+4+cjQaxtybXdz2ZI/7LaH649n3OevJRr0m7nC7Mqp7oum/+EHqL3z8ycU0zlOGeHMfVLVKqDrzYDPyVZ3YCXfcg7cFGAyUC29Fr2CXb2XwrYP8s3DhytqqmgXD2S0yrgaxCl/wDM/4nRMg/9CdEWp0va6REthu6i4hSJVQJkszR9wdU0fGdBtvEQDw2uTgY5M+m6yTbiTQi5RHtGOYvaYRuxCTsuayDBHCJmsU/U8mYZvHife4HBG5dp6z2WZLEhuMjGv9d0BolO0t9FWPMstm9lZJ87FwLsq8SPos6lm2WdtjhsIQ9KqMaTHiw9/y4hzpUMaob8GLnWJgrNdb8onVM/u2MdyCBYk+ovo7MH14uQV92e69Qj/5BDQV8FgV6WAVdHAwy3Hp8/OrvMSNQOSkiQUZE0ldhx1/e9vkfHpy0/TYC1BoMBGJpqpSDjj3G8zD/cpzwn9KVqekroANuuqj8HJOAJgtwVSRl2avDMBh2c5KeO3c19AMdBX2BgXB6e+c82DvwxUGfdmrLWPO+aFvYlLKxYLXvS02w5YYtsG6QWGxQ0ZXpiZlhsEfFK9Ozpy+ztkha9cmVCOOoRBxOH1g16apiHQ2LGp4NMyHMSUFmV5/7YG3HAJ8MZiKQTauSmHn58bdJyolblmQIfCU/CYctTJKF5Icvv7LcQ6SJA7fn/oghI06ZcpTDKpqsoc7+1Uw== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 772b3973-d903-401d-48ed-08dbeb4ef35e X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:34:12.7184 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Ji40Sb0Fr42w/YgWK0kekNifnVFFtKjJIwxXsPyZqQ+VrzIYdx/OPM5fV+zIH9DgvZ03z5G3cMsBK8FLm1FNyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8858 The variables 'large', 'small', 'sout', 'cout', 'capout' and 'size' are used in multiple functions, so they should be defined as global variables. This patch redefines them at the beginning of simult_flows.sh. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/simult_flows.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/testing/selftests/net/mptcp/simult_flows.sh index e1f4ddf04bc3..a85c9ff21e54 100755 --- a/tools/testing/selftests/net/mptcp/simult_flows.sh +++ b/tools/testing/selftests/net/mptcp/simult_flows.sh @@ -10,6 +10,12 @@ timeout_poll=30 timeout_test=$((timeout_poll * 2 + 1)) bail=0 slack=50 +large="" +small="" +sout="" +cout="" +capout="" +size=0 usage() { echo "Usage: $0 [ -b ] [ -c ] [ -d ]" From patchwork Wed Nov 22 11:31:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464638 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2055.outbound.protection.outlook.com [40.107.21.55]) (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 6D9974AF66 for ; Wed, 22 Nov 2023 11:34:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="HQOXAuN9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jLwwv5z7qqkn4ZgFyePiig63+JfzXjh6Jcrjx276uwYUz2BIKyVErR31LlwVoA/N2ua7pFwgmEyJZCQyN+Ke9CPdhBYCAO9OUsWj9qLqwcoY6JbW93AdnGn7BVaqx9KezQ7Fzv+/Oyd9QgZC0Y3W7kUy1JECCCe2OsOffHuOOfWjZbSxmtV1zTTqsrUVq6Fs7+wPEDSUBITNksR1ZPJR+6O2p+y7+nulqkJle1LcBgw+YTI8yHsRjruGPnKaL+lxLKwlCjtKl0xZrGS+YxvxQgGR2i5LLZU21OUfcjzohbuC3ZGNhhJ9MnTgbB5p5Y0nUw5Y/1hdOmPm+W3ap9BtyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=gkDzcPInB01FgHRiLn/fJWqMw2C6tyY5KCXY5sH7Qw0=; b=Im0ECmCFHncWRnrqJB3jU2kOT7OpCDJ0b/olcfZwDrUIhL4meNengQsRFkpdzZ7TEgcpUDrMuj7LZydWwFxJy+13R5D5MGcdJbYVgt4VHDSEKn+DMvojz1uOrQo5rxAqQetre9PBMPB9SDqPk5eaAnFHAwyyC7o5f8FsAdwP1qQ96PE4vEhz1mG6q9Fc4+wf3naz+w20rhLGJK4FsuPizFOvQOHbYeAQFvJmB+L9MVDq4hl8+csOnxHl5uhyRXkxcjCcxJUpB4X2Go975dttESnlTrnlEZ5FA7BNPn6ezm/Ra6kxFV4NdToBiaDBc8PGbHkQK2AoQEQtJkYcuJQVFg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gkDzcPInB01FgHRiLn/fJWqMw2C6tyY5KCXY5sH7Qw0=; b=HQOXAuN96vQ+8Jbrgc1GPaFsAOXnN/S33dqETKjkBBCXw+5dqxpbvy7fKR2gsl6Ym+XipMCT83BvT5rZM0BpW7REqXvixz+ZkptrYT76QDqnNcI2zYukNGdQjpNJYDkr7k0eO+sSx8DJjh9c/iRjaekbUzhiLKox6E3YCQhDz3Vkv5c8Nj/wNKFWGCBXnSqiUlgbipKmyg3EGq5arzhkUJDbbWdnpbPVv7FBDimgp7GjShwNNt7jJ0uiO2izdpXTbAYj/hOsDiUZk/decSMPrvypGStMkYGwtEQrF0TWwML8dyyTDCXNgiosxDIKkaN33UULDxdKhc2eVfdnX+yGEQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by AM9PR04MB8858.eurprd04.prod.outlook.com (2603:10a6:20b:409::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Wed, 22 Nov 2023 11:34:18 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:34:18 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 27/33] selftests: mptcp: export cin/cout/sin/sout vars Date: Wed, 22 Nov 2023 19:31:15 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SG2PR06CA0245.apcprd06.prod.outlook.com (2603:1096:4:ac::29) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|AM9PR04MB8858:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f34636b-49ef-4a69-6c79-08dbeb4ef6d0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DwJtd/m2PEBVQYsuuqInzVcQk1mruz4sc/pH9WXpBYfILqkRoyrRvYIEea0Mav9WqzZhi04inKJzGeDHdaGA+rh6sHGwQY8Lm8oWnr8pWbni/fem0C992qjFxOWoLgA+bO+M1Ur9VWISWcTXb9y2jLk2STEpCcmNzJhXkacGUmvMQW5E3Ut1DavSeiioNa2ig2mtiFRKr1y9Lz0aUa1Iw8dwlFwjVeRi+jIW9LhO0dqi4rNUh4JBPxxQ2m5F1uO5yUlFv62FR1ROCfK2/1aU5UluqCt44B3kfLlE1IG4tWnw1rMFCEbH+FC5CYGTFFHwictWg4Wa8lncWVtrKQF9vlog43/y7FFgh0lPvtCm6PbOCFKvBqQeKxOosIH+RZ+mr7ERCj4EKyMElF2D0/THwb9kelOGjONUqx6p30RRBkfXSKyXXz7yrNhjDVlOa2TrB1iapvybJBNDZh93PqVjDA/u+ANsaQGC8kPsCv5pt4f46OhTacC8tqho5jOb8cv/UbJf6mLCL5tfrwxUvInlASwyU3MzN6/ce/cGumzvXoc+mIg32uj4yixXPDouJnLFs1fU0RbbnWdZaR88JrpseHJbOBdVqsj+LrZeGwWYaoI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(39860400002)(396003)(346002)(366004)(230922051799003)(186009)(1800799012)(451199024)(64100799003)(5660300002)(36756003)(8936002)(44832011)(8676002)(478600001)(6486002)(86362001)(4326008)(6512007)(316002)(6916009)(66476007)(66946007)(66556008)(41300700001)(38100700002)(2906002)(83380400001)(26005)(2616005)(107886003)(6666004)(6506007)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7Eg72MgmSBBtumYj5iG9C29biOZr2S/NWnRyeXtITM6rC402Hr+RrCBruuZ1qg7yOSUOw4zMIN+xlwXURnTV90oIR4nXvF5w5aRe/yH52axwj/f2D4G2jzTDwrAaq6yiQDyR+hOcDOogGEN+OSCyGS6GCjGk6+ONneDsLzGWTukXZUKaju+4Uv70uYCuA4I/DQVwBt+tdijsCAqc0d1ZMK868hIOcWmpfg+YV+9ymXLtpstb5kdpmKmN1psIexKeykLHwdb8F/wDd8dqsWzEmIWBXSB3eOgm3N+oBzKYx04A1s+5QCsZImYZkrVuqOby7wD/Q0ziTPH1uebe5zuhzm/Y2m2PdqtuRZIaStAAoYWCSe7C0jNGcNWvUFpwK9qPpw0BsxVCoaXTwT/1E7QthQLwZ/ag8QUE147HiRqPCgXXfZXI7dP/JpGTE3cMpUeBXlX7AeZHZ0ZsxfObNiZGJeXFMKcpiNJyBl3iSzg7PqCNO2V9+NhN5q1Xiqgq4FnSbOwGfVBF8qXRJ3Et114Aun7lvFPDgy2Zp6ShzObdSAce9NaG4mV7hbcRzI+28rL0Zgp4EJn7VhS+glTD2y7GS+SeQhgqqldCn6qwwJm1lIvAZq87wUMt6g1XcAdzj+jBWkevsjwnomxVByL8kdYqrbDw/3rN7hTQrTClurOBMr0MyluSuPkC8eQmKhzs6/Pxxskz++f7b6BxheHJ2us18NqGBgNRjNhm9ihTa6hU+pCQfbgdNc+wB4RPKOaQ/N0nlxhFZ9fHLEn+0F+WhRpQRc6hAkXWeMQrrvjalrQ38CQ3OaB/Zcw2IjiGDKdri2vtth0zM2ziPybvTokB64Dtz/BdLvcq0aivtyYDNG8aux3HHNSJlX+0QvtfCWMBc2JfUIjjNA4o8Uh3ZF+DK/2QYPYdHVGXnnS5j8159AL5yu2DMg/n36pT/dR9eHz6Oi+NJVSyOpgUdvrOTmqcbH54NLHB8Osij/tbs0chz4pw5xTZjq5zhj7qxN37gyIp07p7mSUJYK/3Y7P1FiLZGL4iIWGniknDBHvaK7RkiAsT8alB753tTQUi80mjQLp23mgfOJOjozzcK1qgRKNWnGMNczmBHc8F6KD4t4AsauIvqw9ec1sLVyg3+a5d9aEGn03QYCurL2rg6/CSU3GIhpa9SEL9FCDlysJsjqAYn4Zr9neKGvicR+/pGVdVnaUrXVuKTSjvGBp/k4gKZwScB9cYzrBXliEEt3r2SpK9OZPBGmc+U1gXZHf+FekW4J6pIW9sM1EddrBTN+ruDhjlezoBwKdlsftto1l5R6CyXEPEvc2pBszjkIG/45VzEei0dsavtqxhXwJXzbrikuith/fBuUn6w3zdDlSPpeKOFhFpEnEbWYTGmG3r7l2gabXIVK2azTfvFtyFRcWLgk34228veNMpFy/oZ1lPbFqFgDrLRGms1vOYYvbmhhdRg7VPabFpYAxRWYrlGh5v9o5iLT5yBqKwos1xJ1QT4olzvD/rXUiXyQmXvjEtNRjtvXMzCNHahA5xzRwY+eZ63Q0ZD4S0FpLkxjRWNqquLhyQxpzO2IDogBqckZppF4J88oTWAZVImfK2dGDrKN+WIc4j5cGgxw== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f34636b-49ef-4a69-6c79-08dbeb4ef6d0 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:34:18.6973 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LhD+nmTHXLtslMbfacFjwnvClml3U41Eiivb01ymijjIuwbdWlC+pzBF0YdsyiT288HqT4Rm8lwACETv3YMfXQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8858 Export cin, cout, sin and sout vars into mptcp_lib.sh as public vars. Then they can be used in all test scripts unified. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/mptcp_connect.sh | 10 ---------- tools/testing/selftests/net/mptcp/mptcp_join.sh | 12 ++---------- tools/testing/selftests/net/mptcp/mptcp_lib.sh | 6 ++++++ tools/testing/selftests/net/mptcp/mptcp_sockopt.sh | 10 ---------- tools/testing/selftests/net/mptcp/simult_flows.sh | 5 ----- 5 files changed, 8 insertions(+), 35 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/testing/selftests/net/mptcp/mptcp_connect.sh index a52784a14b76..f412c6cf7d3c 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@ -7,11 +7,7 @@ time_start=$(date +%s) optstring="S:R:d:e:l:r:h4cm:f:tC" final_ret=0 -sin="" -sout="" cin_disconnect="" -cin="" -cout="" ksft_skip=4 capture=false timeout_poll=30 @@ -128,8 +124,6 @@ TEST_GROUP="" cleanup() { rm -f "$cin_disconnect" "$cout_disconnect" - rm -f "$cin" "$cout" - rm -f "$sin" "$sout" rm -f "$capout" mptcp_lib_ns_exit @@ -145,10 +139,6 @@ if [ $? -ne 0 ];then exit $ksft_skip fi -sin=$(mktemp) -sout=$(mktemp) -cin=$(mktemp) -cout=$(mktemp) capout=$(mktemp) cin_disconnect="$cin".disconnect cout_disconnect="$cout".disconnect diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index eac5485616b1..806eae63fbd3 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -12,14 +12,10 @@ . "$(dirname "${0}")/mptcp_lib.sh" -sin="" sinfail="" -sout="" -cin="" cinfail="" cinsent="" tmpfile="" -cout="" capout="" ksft_skip=4 iptables="iptables" @@ -155,11 +151,7 @@ init() { check_tools - sin=$(mktemp) - sout=$(mktemp) - cin=$(mktemp) cinsent=$(mktemp) - cout=$(mktemp) mptcp_lib_evts_init trap cleanup EXIT @@ -170,8 +162,8 @@ init() { cleanup() { - rm -f "$cin" "$cout" "$sinfail" - rm -f "$sin" "$sout" "$cinsent" "$cinfail" + rm -f "$sinfail" + rm -f "$cinsent" "$cinfail" rm -f "$tmpfile" mptcp_lib_evts_remove cleanup_partial diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh index 070c277cad4c..ea04b2888bf4 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -25,6 +25,11 @@ TEST_COUNT=0 MPTCP_LIB_SUBTESTS=() +sin=$(mktemp) +sout=$(mktemp) +cin=$(mktemp) +cout=$(mktemp) + # only if supported (or forced) and not disabled, see no-color.org if { [ -t 1 ] || [ "${SELFTESTS_MPTCP_LIB_COLOR_FORCE:-}" = "1" ]; } && [ "${NO_COLOR:-}" != "1" ]; then @@ -509,4 +514,5 @@ mptcp_lib_cleanup() { echo "cleanup" rm -f $mptcp_lib_err + rm -f "$sin" "$sout" "$cin" "$cout" } diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh index 2b02689a92f2..839ce692e099 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh @@ -3,10 +3,6 @@ . "$(dirname "${0}")/mptcp_lib.sh" -sin="" -sout="" -cin="" -cout="" ksft_skip=4 timeout_poll=30 timeout_test=$((timeout_poll * 2 + 1)) @@ -71,8 +67,6 @@ init() cleanup() { mptcp_lib_ns_exit - rm -f "$cin" "$cout" - rm -f "$sin" "$sout" mptcp_lib_cleanup } @@ -331,10 +325,6 @@ do_tcpinq_tests() return $? } -sin=$(mktemp) -sout=$(mktemp) -cin=$(mktemp) -cout=$(mktemp) init make_file "$cin" "client" 1 make_file "$sin" "server" 1 diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/testing/selftests/net/mptcp/simult_flows.sh index a85c9ff21e54..de897b226d40 100755 --- a/tools/testing/selftests/net/mptcp/simult_flows.sh +++ b/tools/testing/selftests/net/mptcp/simult_flows.sh @@ -12,8 +12,6 @@ bail=0 slack=50 large="" small="" -sout="" -cout="" capout="" size=0 @@ -26,7 +24,6 @@ usage() { cleanup() { - rm -f "$cout" "$sout" rm -f "$large" "$small" rm -f "$capout" @@ -52,8 +49,6 @@ setup() { large=$(mktemp) small=$(mktemp) - sout=$(mktemp) - cout=$(mktemp) capout=$(mktemp) size=$((2 * 2048 * 4096)) From patchwork Wed Nov 22 11:31:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464639 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2054.outbound.protection.outlook.com [40.107.21.54]) (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 A2DF64AF66 for ; Wed, 22 Nov 2023 11:34:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="uOk/ooSO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HsWkYd8AFKQKqiTiHuHU6L1aJ9DVwIHLhXzUdEIM0hI7Kz5jz3GXWbz9xm9qjen2j9gJQFx8tOIrfEjh5nNUBY6duwfpAiOKU4mBj5fUDlLtp3llXxG7d9wfylMceDsK4sorvc2wceNbJrKY19iT7TXptwUezxKYc1VwCdqqnzJWcLWd2y2wwzNA1H1cGhudbnVdFqfASM7rMJZXjwwfeaJ3ZU0AqQC+xEyos9ZffpiwUAbyaLPqDXm0O92oQrJBxE9n/CH8C92+IhjniiCv/geCgo9bqq4qrS9TZ0t9RUIt65FXyNRtnqJQrq37/VaKx6QSF+1UdpCLSFS4Pr51xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=R2QngMQ+PGthL67bj7WCrZbNsdo8Fzl9hFgUZqDUCys=; b=OXp2l8byKXqMxlY9PTGEjrc2Q02ARPumH3wM8/UTJl145s/rDT0nv5MmzE4CZ7Y2PPpi7xAA+xxctHNPFkUflplEuSees+R/hi8KfEBd22SgstSabIVp47bR+ho6UAcRWXKhjx3+rqBWhyrYYjq+XOMvlu1lwePL5Z3JW6qi3mNnY4cJCjWERAos0dDdTu7A77JcQa+QF3Glgoa7s/9PgsjRx6IMh7NS0iPaSuyzWHcL5UAhbxX+nm1vn2pwUdNOrfKfC2hsTJZzXb5QKxPRV8hz6lql+wg+qt8hIY6IIX4be7gLS/kyk+XpGHG7RGuCnihD2oxgHGIwvsoDn3uzgw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R2QngMQ+PGthL67bj7WCrZbNsdo8Fzl9hFgUZqDUCys=; b=uOk/ooSOzw8ozImeiiFuiDX8fLZ5mst/yZ/S8lDCEABJztxTIt8Vg4CPakwqv3Y4A8+aTTqBXLdoOE8KB2+XVs0LQNRf89yPFflT58OdnzqD6Zw14W64ulirE66JpVFHeY1AyIekYhS23aYhqpXCif0jv9M3mjkQNqGUUWelnTe7V1zQlx7KoQ2h6lxUTBjQD/xJ1yOTMcYjfZQKOTjKJhhfrGRVnXaS1M37LjJcDzAlofcOeQEzber08Krz/fc21ThCr0QiD5aBHWafwhGGgUCmxnkdq7+oul/lFpPqMfmrNqgRrPmpro6bPTRyRzLiil1/qL931OhkHnEBgXv9yg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by AM9PR04MB8858.eurprd04.prod.outlook.com (2603:10a6:20b:409::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Wed, 22 Nov 2023 11:34:23 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:34:23 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 28/33] selftests: mptcp: join: change capture/checksum as bool Date: Wed, 22 Nov 2023 19:31:16 +0800 Message-Id: <14dd4340471de6ec6a8e085218608c1b2e0eb0c6.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SG2PR06CA0242.apcprd06.prod.outlook.com (2603:1096:4:ac::26) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|AM9PR04MB8858:EE_ X-MS-Office365-Filtering-Correlation-Id: b1a10bd0-9db9-4426-3564-08dbeb4ef9a5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8R8Z2KJ3JC0x8K0myWeM8MAYqQDbWYc5EQjrj4jFsuLPR9RiY1pn1UuJuDqoBqCbU87n1q9gcY4XnCQAdZsgZaicoOj8L1649kpH9AXMkA80PAYtVHxxsG0BcWRl3rWnUxX2SxNalVdTY/JDI2MY6LnZNSiG6xpkD8iOc07Hgt4g9Oq67B8z2jbL9YFqUbPi2/dDWXo5RhRPVTFN5u8++/j2osCf6VQWL5wDPiBtQUnDjhgHVQncq0kJuMvNYXegtzk2dCcsvW8KDLJf5p9cCIco/dcJRyGFQOibTQGmL//jjKmXxDLIvCx11h8M8MY27+iq/RVzil2DAQDhUOaUeGsmDAGQNKM0EgdTklx10Dp4iIrDF5m7qSdFJQCLVOUfMikAT7hIUd/32+ZLzbgtmPuaW1n5h3sk22k0OFiQZxqhs6uuB35poRAj/9rU0Ccjrrz8O+4VVCa3h4EQPBze7BbNBq37EOp92zi1HWqUvG4I2/+o1+tB5gGRlFdof9DTEiosRUENqbrRBd2P7jB18yYmuWvsDgOePQTt2Zl6FwdQ6K1MBggM7a+dsmk3anaDDf6xzcRgwjFyztR3lGEwoHnYkXoyp98/n++FXxJToEM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(39860400002)(396003)(346002)(366004)(230922051799003)(186009)(1800799012)(451199024)(64100799003)(5660300002)(36756003)(8936002)(44832011)(8676002)(478600001)(6486002)(86362001)(4326008)(6512007)(316002)(6916009)(66476007)(66946007)(66556008)(41300700001)(38100700002)(2906002)(83380400001)(26005)(2616005)(107886003)(6666004)(6506007)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gQ6D/kQKIDN4QRuGZIeRqNsp2/PzvDkBJTNSje9l3d8wlwDLf+efX2sY+TawKqnv/RnfA+MGaMumtiu3jcdDHc0rFdIKsrXDuNmP9M3t8UonIZ62U/VUT3xQDs1ng+jxcgR7nnChvZPjSvouR4FUFTiSQjErgYoh7scHZi1RKrM8mNgSQmOhRCdfbvcMTk9XZkseRGtDO6Q1DGn/yvzj0cxMePTE0ioFj02/tjOVgLHfJYd8C5fE9g0T84XVG53Fhc+0xBlHzPU8IS/ktXPXc239nbnn2X3CDkmmJz1E66/CVRc4+kOLvFUHybb9eU/R7xG+Qj818GE7G1H0FviRgH5x3OFbGxjP0MTROLWKv0SmZmU10oNmG8LzZ3PaN029iaV8ybNH758E3lUVcVDWS+qkkKkr+zg77FIls4GJrqLPnUArbiZeuQY8Zw/v2onopmh40aqv4hw4iC5Ph6cvR7hwIXO0g5RBBXXeSo0DWUaOoI98ynXPKTsx7EmO6LXXNhO7XK9ZPPJXdr8CqAhVAGXgVx4vlsMjJdf8GgmwLAFN/CSyZRIGC0Mk20HDBkytyNkJqpHQK2XGSw2swknyT8p6RSJJZ8pHscvcfVvEy/a/ZsRrbBSFhQT3ynZ7Pznr2DgkEuq5yahJvJzoIPVmGzZPlupz62qw9Kc5tTpBHBie426jjDFycD+XVI0f1daOz811AiUNTkGz+eECFtxx45Q54pkpwWST/eM79oxCeDtbVsJGVPWipv3+nrJTVrOuiAymrxL2rRkbecjmtUPvU7Te5ZHMcWaJ1Ru5sRgXxaKYnVXwt8jh7oMbSGXdWKQVbA4A0jlXasY1LZ1GMUcrqLtScuJp+bFeKFwkj6XW9E9wc/zIttQAPLayK+aTukuIx4ShIA+fxWq6yDQtFFl4w1TdFNHz9XKIv5KHtTkAOKFRibW+roma2GAGek/j+NVFEmBBD6oD/7zFYD6P+hpizKt3tVXh2NU+ehfWiFl3y19u7Wd8u8kVckxUU6l2fUoqRJO5v8rlon63KtKCphf10/qYXaVrbLMZdKj+7L5/A1tVPC2Hx06SP840pMcyboWNlM3FeoRyjHqyiNXZ2fLCSNT3hscPWCzFr+VLPNMHkt3DGPpy/stBURcncw7OhkgQJDziGmkXnr4x2E+EJoZZgAczcjv7alFV67xI22Nl0L63Ui9SY5AOpcquZ4R4T/bIN1cWLDpo1NQRj0mcYAq6rm9fTALxJlfueCyn5UNckIJ/cfAE12GMpSI8yT4lR9y+qtTr3qSWg+wmOUlcvXQ7Y8gEqNZO5UUhpLY29/Pe16oEyqpYL3HAAiaQEx6u76b4Ae530ZkW6r1+gyAI77WEDw1Yx45Zo+WKTphZ7ILZFDtry/HX19B/UoF6PcriCWK45FLhcgc2PGOWxJ8CG9iMoESI+JRBcseZlH1n71AWkTMxU+7jACYjvnepSEFxdVnnbV55v74Y5YLACBCaoJWuBVgKgi5/lV9WhKdNeSfmHgtiLJkDZS96wsKQcx3W1L2pHIkIQv6J/vDOD5gx8H+s9LIH6fV4fll0Ai5kVfrnYxKNIVNi13udCggC+xuLa11gktNkySWn1kBFnYyIewka5g== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: b1a10bd0-9db9-4426-3564-08dbeb4ef9a5 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:34:23.4373 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oytqQBiy2DZN6whxLZqRsoXMtAyMgMK93NSpmeQqskgcPAZ9Ukv4Bt62C0rTFkWzYastYDuMB3LigoOwBN412A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8858 To maintain consistency with other scripts, this patch changes vars 'capture' and 'checksum' as bool vars in mptcp_join. Signed-off-by: Geliang Tang --- .../testing/selftests/net/mptcp/mptcp_join.sh | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 806eae63fbd3..a3b895c845a3 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -22,11 +22,11 @@ iptables="iptables" ip6tables="ip6tables" timeout_poll=30 timeout_test=$((timeout_poll * 2 + 1)) -capture=0 -checksum=0 +capture=false +checksum=false ip_mptcp=0 check_invert=0 -validate_checksum=0 +validate_checksum=false init=0 last_test_failed=0 last_test_skipped=0 @@ -76,7 +76,7 @@ init_partial() for netns in "$ns1" "$ns2"; do ip netns exec $netns sysctl -q net.mptcp.enabled=1 ip netns exec $netns sysctl -q net.mptcp.pm_type=0 2>/dev/null || true - if [ $checksum -eq 1 ]; then + if $checksum; then ip netns exec $netns sysctl -q net.mptcp.checksum_enabled=1 fi done @@ -348,7 +348,7 @@ reset_with_checksum() ip netns exec $ns1 sysctl -q net.mptcp.checksum_enabled=$ns1_enable ip netns exec $ns2 sysctl -q net.mptcp.checksum_enabled=$ns2_enable - validate_checksum=1 + validate_checksum=true } reset_with_allow_join_id0() @@ -381,7 +381,7 @@ reset_with_allow_join_id0() setup_fail_rules() { check_invert=1 - validate_checksum=1 + validate_checksum=true local i="$1" local ip="${2:-4}" local tables @@ -953,7 +953,7 @@ do_transfer() :> "$sout" :> "$capout" - if [ $capture -eq 1 ]; then + if $capture; then local capuser if [ -z $SUDO_USER ] ; then capuser="" @@ -1054,7 +1054,7 @@ do_transfer() wait $spid local rets=$? - if [ $capture -eq 1 ]; then + if $capture; then sleep 1 kill $cappid fi @@ -1442,7 +1442,7 @@ chk_join_nr() else print_ok fi - if [ $validate_checksum -eq 1 ]; then + if $validate_checksum; then chk_csum_nr $csum_ns1 $csum_ns2 chk_fail_nr $fail_nr $fail_nr chk_rst_nr $rst_nr $rst_nr @@ -3630,10 +3630,10 @@ while getopts "${all_tests_args}cCih" opt; do tests+=("${all_tests[${opt}]}") ;; c) - capture=1 + capture=true ;; C) - checksum=1 + checksum=true ;; i) ip_mptcp=1 From patchwork Wed Nov 22 11:31:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464640 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2077.outbound.protection.outlook.com [40.107.21.77]) (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 78F0D4AF66 for ; Wed, 22 Nov 2023 11:34:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="05zY/aQf" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cs7ATyTvasZZNkkkRSEfG/6ZoVK45VzEoYFZpQLI0eA+C0hB8gVxDVXt/0y/hVaBXObaGZPZ+AYn47Q47zBbCKzO3FBOfT4JWdfieEWUtJIeh53KRNkbDL9G8rXoRBdkmuxUdTB36UUKTNcp0yPCir9Ta45/N6UO4m3hJFWVB8aSTDkFwqjEW71RTYxg36NV3U9VFMstgs72GHcW2m3J0lqVpMUsIjF7pCfvIBEzusvyvL+0x+/SnhtOOlN9iLuj+6DoGfO4g1rPsOyFE+ecadRN2SiNhsyMT7N9RdXvzOlLGWy3AxQDP6kwWCojIU1c/jiJ/wpftIYjt0O2pkL6TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=FklXwd1WMO0eLgu6KcNHcczXiArb7w3mYCRLahKA1KM=; b=SG1u6tNywHbHab/TksoatM+X3PXNLToa3+N4OgwZK3nG/5K78O+EjYjKhawV+TDO79Q8mQteRer6NjFiNEM14OsWN+GU3eqn/YnHJt17oqbYrUubdiCsiHZm01F2atRTWHXnUBtiwtZa59sSnzlrb2R0UYd5A+mA/8NYa6eU2AJ4XSSYw6uN63D5Fq9ZJYYjkpVNWzIxQdx8ZhGEHaJJb6dvhZsOQAIvfZ+MlfVMpzuAgMzOQJFOWobu/KzDex1r6FOIBq45dVhzCDsBzq9+uHOC/jH3W0hvaY6xhI6Sxedj/OMKzoF8GtzlAdi0njc/tDXFBDJWxDghcQ7jjLSpNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FklXwd1WMO0eLgu6KcNHcczXiArb7w3mYCRLahKA1KM=; b=05zY/aQfoab2QHKtZMVXXlACHGAR5tywSQ764fiqOkyWne8ThsaG6bR6ucg3PwnDLXSIGi0ZTUJz6x6NRzezMhhP0tfUuxgL1pMWmvQyQF0l3p7q0MzTwwKHTIHLnG2WfTr47UIk7tFB7y2/j3sRTrPuuxL7Vng2Ht4GuzhXzmkDa5CSRN199p2pjGwMz2THS6U/0ufxjdFYZC87yZH7HdqWrnWn4GZ9csv/EEne47q2CxMBw1UK/omA9CQGiEyf37oMLFPIB3sKAFrXP1SALZPxwbK8KNhASj9K3xqBZsoWo+SpHv3noGH5izZQM0DNhrfdoS6g/t43D5bxCO5i/Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by AM9PR04MB8858.eurprd04.prod.outlook.com (2603:10a6:20b:409::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Wed, 22 Nov 2023 11:34:29 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:34:29 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 29/33] selftests: mptcp: export capture/checksum vars Date: Wed, 22 Nov 2023 19:31:17 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SG2PR06CA0239.apcprd06.prod.outlook.com (2603:1096:4:ac::23) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|AM9PR04MB8858:EE_ X-MS-Office365-Filtering-Correlation-Id: a4536b3e-b31c-4cc0-a6e2-08dbeb4efd25 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c2K4YPp2CDjzL/kZ4gednpQuWKsojJuSHKa1vInF417IEMY1/1ZSEzihMTsvHdhVyLOVR/34TXR5z/SdiCTAviH7RndfCWXjSvnJPfUh3T/5D+uRt5qGJhWTGNbhAlHLbDUpPSx6MgEN56GPrFMjLb6jXoNSIBKpfke4fn5VcTjlbkxgM3erh2c6uAg0ID4ensC6gZiU3G9we05Vska07MQObFDO7uwqHTOKJ79kABKUpGP0rXeu7PJasOj0F8AkVotM7s1h5FRknjflFxeNWt9BJPwoRFwZ41kVcF6g8VuBlVtA6Wdk2bpsdp0pCyI3fEcFCsajMoYOfKzvanEUuWritetEOCVAG4yqLDgKgWHlAM02wljG1JMBRPoMaHczzSlpKAedPHV9aasp/TOGxqyxw0ZayRNGauyJHkSAabTN1mjDSewRDUUjwIr2QFpAOpIdvII8FylJ0DbwzucOKGt408m52zhswDn3tiuPQjOMFMTbSm4+cb6xSieGHtNpjfxdWBF1413H1/MHR+o+CMUwRWj0DfTZi8smCKGUNH/pgx1DqpHb+fZlgAeqxBKgUT3n7vtw+B5x0/xnrcGpHjCm/uEQW1NbibenInVkLGo= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(39860400002)(396003)(346002)(366004)(230922051799003)(186009)(1800799012)(451199024)(64100799003)(5660300002)(36756003)(8936002)(44832011)(8676002)(478600001)(6486002)(86362001)(4326008)(6512007)(316002)(6916009)(66476007)(66946007)(66556008)(41300700001)(38100700002)(2906002)(83380400001)(26005)(2616005)(107886003)(6666004)(6506007)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XWZD13HqmxSuShVasG9H30Ln3w3TWwRggVTXqN4iswr+MLt4ZFctXN5xSFyKfAknihiOFAvv8KsrsUx2BIH4DyCHiVVc0bUCCj3YtgwqobXhD8hhZ29P5MrclY23bzy5FK6+QgJmMQ8LjttuMjmA55Kc2nZReBzI7Wuw7Ixk0KYF8vyzLuC/frJtPYtwvEs00jn+Keiya9cZUfnHVBlhRJ+C3KcOuD//BHO/YZ3isN+b7VvVLVFCgpyhvcaUWI5ZNOnnjgwTE2EQu89BjpXXt3qfqYEt4NtvbeOT/13LZZEZKXi20sBTgNsbx8WIuciV8UtEL5QHB64JhnS0ifof6aZg8mnSoMXrFUdkEbRM+2X2LKvueSCUxVtFeLRsTJfhQoYb6hlAOdGfPd+wz5jcdM7SQG/7rySQE/UYtLuIao3WSpIhFF5wEHibxqqSZbQmrMvhgQYTrEX+XYb0Jo4AH3jfEArD/nxUY7kkhsW2ruGeWuHEpy9CKU7stXwZEQCGbj07kzE4OUhGwkShhWDJDv34vDLTUzXfBEsAwN9rEQ3RUvbspxlZagMip/8GOIKttYiyKWT4uQuQMaAertKbrY8EXEEDSKPR9wsi17NwnfOyTq38ynaARFhRiz2P+JJ9090ylV+SnLOv0602xzfGxjbGkoCHOOZQcIe8JbFhg30Xh6GCYIACdhwpBQzRrnScf+Yuaw6CFWvuKwPzrAN8fH7re3gVKYxEiLdP86bXizvzoHVV0wsSsb4t+s9bAGcbvv43D8v3SeymJUbadDfd+uSApJ39KPh2DTCZXi+uQ8M6CSVas7vCaJPVo/wNpCOMJUQz93NhHV9TBbnN6WTNiO6CiUcbylamJWl8dTVo641owIHFL07OrMp7M+r+h8loLOxnE/tf6UzqvpKJD9fLGKisRbm1jSkQs8+92BY91BNpwt/g5VP+d3h4Go6L/qOv/cfFCsdC/kYm8hpLKMUYlcof6gsJ5TzWXB0Y/q3eRbCJPAFADy+PZqumVVoOhvGoB7W0TpKkD/xpeR9s1O/eeOoS1ol3h1HZJmLcPBcQPi+6HsH4xyqzyoukIrgox6y5Rh7S3aNKiZ9txRDb1IDsJxvHi03fIkJHLOOIqirOR9qGXM+rlz5psudcIFzqlH6cIXXwbarXcc9FdZ3y6HwS8k7YwfACurH8CKly2Hkx9Fi5BVjDdPfojmfdaVmPx44x8/58HGFH7/1Yf6QuyZeh+4b80PTymNac53NvbTfWErWmQOZ4hrEhT8au+xjp0/x1f4RcME3lvp5vKRhGeLmBzADJ/KGQGMqn8xuPSDCkhHUzhYETYzlI8EGpDAi37ZFnAgCc2cfwBJFyc7LslNzxdifJJis7OcYim+4ZY6c47mNs16F/Rg7/5JFeTv/CE2FMRONwUrNhpzJS9F3iDMF8X9fbVmRDI6hGFvX+kjXbnmtP7iuZCR/oi+KfptducwZ8VmfyoSLAapAii1mEyLp6xJQuBtARtRD6wgNcxc9usgfzj/KJ/V4cDmIT8NVwD512RDWsP8BrvluqiUEw5Hq9O7lAEyh1+bXqQQwpc5Y/2P11KJw1JR56fIf6lTVD9/ED2mDR6pJMiTlc9Hy3vA+cEA== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4536b3e-b31c-4cc0-a6e2-08dbeb4efd25 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:34:29.1411 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VfQKPSBcDtoGPwaFmqip6OV7xHCVmkVU59dvQ7CeuEXPJjhz1RKoo1V7ex20HD6q46EGPeOmJX1LpGlLloGNUA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8858 The variables 'capture' and 'checksum' are defined in multiple scripts. So this patch moves them into mptcp_lib.sh as public variables. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/mptcp_connect.sh | 2 -- tools/testing/selftests/net/mptcp/mptcp_join.sh | 2 -- tools/testing/selftests/net/mptcp/mptcp_lib.sh | 3 +++ tools/testing/selftests/net/mptcp/simult_flows.sh | 1 - 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/testing/selftests/net/mptcp/mptcp_connect.sh index f412c6cf7d3c..6311deaeab8b 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@ -9,7 +9,6 @@ optstring="S:R:d:e:l:r:h4cm:f:tC" final_ret=0 cin_disconnect="" ksft_skip=4 -capture=false timeout_poll=30 timeout_test=$((timeout_poll * 2 + 1)) ipv6=true @@ -21,7 +20,6 @@ sndbuf=0 rcvbuf=0 options_log=true do_tcp=0 -checksum=false filesize=0 connect_per_transfer=1 PORT=0 diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index a3b895c845a3..da209af098a8 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -22,8 +22,6 @@ iptables="iptables" ip6tables="ip6tables" timeout_poll=30 timeout_test=$((timeout_poll * 2 + 1)) -capture=false -checksum=false ip_mptcp=0 check_invert=0 validate_checksum=false diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh index ea04b2888bf4..215dfae871e5 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -23,6 +23,9 @@ readonly AF_INET6=10 TEST_NAME="" TEST_COUNT=0 +capture=false +checksum=false + MPTCP_LIB_SUBTESTS=() sin=$(mktemp) diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/testing/selftests/net/mptcp/simult_flows.sh index de897b226d40..67643ffc5c08 100755 --- a/tools/testing/selftests/net/mptcp/simult_flows.sh +++ b/tools/testing/selftests/net/mptcp/simult_flows.sh @@ -4,7 +4,6 @@ . "$(dirname "${0}")/mptcp_lib.sh" mptcp_lib_ns_init -capture=false ksft_skip=4 timeout_poll=30 timeout_test=$((timeout_poll * 2 + 1)) From patchwork Wed Nov 22 11:31:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464641 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2083.outbound.protection.outlook.com [40.107.21.83]) (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 3374E4AF66 for ; Wed, 22 Nov 2023 11:34:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="nh5Qv3Pg" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vz4HCkjcYY0qivIWrLz1eQmmXDMKwvK9GeuNuaTpFOHA4nmSPQ6Ob24kbScIsKUpq/1iCBIuZrdwm/GWaRK/5EZkBQ43qpnlJ0LcFsTOFhh6vaOretT2WdhgNXSMC3RQb3nJJPdNP6CfwNP0WMzpNHK9+SvEJ6wdokoup1fns0tOD9QEbFK7299IzgeePiu/praypi7KxUutCPzm0UJtz/QWe/Lb8OdRugB5McccMwrXUlOpSCcLEtAYm2cf17VGelI4niGX8y3tGd7APSfvRwcL5bt9sbqMo0KUy2FUiP3aSyxe6qe6KqUEEPirliUNx3kMlPY0CtvtRzJqg0wHxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=QdUl1ixjV1bMwJiLktDaFUKI1bTI5vMYphE5VCSMZrE=; b=cJzAJjAn7xXgZ/8MIKM1I1lKWEwDjIMdh4soJ1vpNrIeinPujdXifa2DUpWZeqOAKvmnRiylUQnCNC0duyKTV3NeDLqH7i6ItUmHuy3mYhPcSbr/bS2DDjKTZHgpbmbW37e7uSmptJ3IPvmE9cC/ebegj2FmPni0wEHtb3tgqqCR0Ft+jz3vWUOsfK1mO7/Xjg40Pg89ndBTrzZB/jziwOYKPo5oWxqxAJCalUmpN6b5c/hoOXxHTluzCeqNl/7o1PNqEk6wVmqOlF08XvXt8TSRCl7aQfy4PS5kBnv2mpWSzJbgUY5ZlsHfnD0u9xsH7+YM3ZmiMd8cvCQGY3xXLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QdUl1ixjV1bMwJiLktDaFUKI1bTI5vMYphE5VCSMZrE=; b=nh5Qv3Pg7Kg83a4vJpMD6k6lsoSFaHjIMW5H6XatvTsJfzyjXXattxBebhC3fNm7v8jquhJmu0+2is9xxxDiKwHLE4apsM2TtCBSgIUGqlBoq4nqnobhntybZqrTzdohAwFFMMJw2XRYP06f2azaKXnk4d/HN9M3HXyRx61XnRmOfQEP+DKyKAIIasHL3tyYbUUMcCd6hn6jO/4jB5b68q0kBUKFjZPNdd5OQUB6lISPZQtw9CdY/bMGa+xEq7xeEVDmE7oQ6/WJy6ty+pYNO/vswiRXK45sYgvYvMzZhNV9peqVJje9HTQ2LLixImx+qiqHXnYY7jM7/mbENpdyUw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by AM9PR04MB8858.eurprd04.prod.outlook.com (2603:10a6:20b:409::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Wed, 22 Nov 2023 11:34:34 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:34:33 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 30/33] selftests: mptcp: diag: change timeout_poll to 30 Date: Wed, 22 Nov 2023 19:31:18 +0800 Message-Id: <41e3afed4d500ca463ad9f534317b5a6512a14d8.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SG2PR06CA0242.apcprd06.prod.outlook.com (2603:1096:4:ac::26) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|AM9PR04MB8858:EE_ X-MS-Office365-Filtering-Correlation-Id: e2be7d4c-6d5c-4ed8-344c-08dbeb4effff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xS4UlZBS28QctxebGBmfUPKslflDLBod6qD7snCD/4PowKZxVFa6YSN6NQIYVuWUDSYHvESrnOPpLG4FH9e4Tp3PHun6sRZrigwkYugWugV+O8suDmwX9h/iPyL/Slj6hI+pHwCdPLHt5QUBNY+ZAMAgtU+DNH1qJvNX74HZ46HF7VOO9yqOiG9WRDDmgg3mfl339D4hY0u9i9C41Ff+2bn6aA+q1MX30QRQcbQjAC1sWMINKsws1K9Azn1B2gZQfudD/nAt2VZaWs+BE1OBcAB+3lv57B2D1svcZtqG1jCjdqka9pZoZjtoONCCoz5ie1uEMPL8UyGXvusCpcUn2332afJ6xnS1fKtTY2DP3lqIcAYudWaWQgqzrqxKN9xrKtmHtsYSp8nRpV8Qe56Pxhb5TZ0HCUsnxN9/b5+tHKteS03AkMX+r3tsb6CuHhtCcqaWby6WXmh8r5AFy+hMUYODkctV/GhiKq4w14ZDUBTnl0hOt7ibgu42DiIuPP913oo34f4cbRgMmt2uT4sghi/TQVf5EGQLDP1VLSD2oNva1jtI5em6FwMCw+o1aHftI/ULbHYgWX+Cq4VPuj8D0C2W0v94NIoBx336GPn6RhM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(39860400002)(396003)(346002)(366004)(230922051799003)(186009)(1800799012)(451199024)(64100799003)(5660300002)(36756003)(8936002)(44832011)(8676002)(478600001)(6486002)(86362001)(4326008)(6512007)(316002)(6916009)(66476007)(66946007)(66556008)(4744005)(41300700001)(38100700002)(2906002)(83380400001)(26005)(2616005)(107886003)(6666004)(6506007)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jRtaimAAmax+/+Sc5EnclEGLWKE9kgBOU4NaL498o3defYva1JKBfpzJo8uKi+sS/8hFsa2tVYqpHLeFo2oqndUDltbiKIkCRRprGUcaHiX3rG5aXcnKv0kLR7Yxb+IOQ3DlVawYOqGhyelBt6OxsnE7S4ypzxq2aWul6SDflWfN/gaj2ESdzI0vZ5Wx/5js6S93tmMbYkr2SKu2u51yqU5vkyCYdwEzWkStbHiL8emAWnLDZoYWGQ8qUcvon6kcs0hsLkQebywNM+OxDPnUm75LwOXuiOWRz+X2543iiamw+RyJhTTEO+09KoJoM7EfqTAfBzc38c+HjUmmJdQFkEBC6i+ovJEKd24boQpzJ8hleGMcyVvMDNQcXNLuSoh9WVriYjmfrgtgQnQJkq6ETPsF2NaSCJ12X/c1hbYHT6JhLR0O2ASDtT5m4Hw/vkdTgD74fEd9J6Z3CLQzGIqjbsVbClTIrqWjz09JxHJAV9eMt0K3wGJqu8Jb1loXIMWJVCG57t7ogxz8Pr9bdVrXu8ay6KeE8YomqPa7Y0ITCAkoWa6xo1qE5hXw0bO7RYGdGHAsyPbutALv+ljpdHH0gAdGh3ZSzXrXYKE5LSEtPrpS2TxlN5IpMYjt0kbpExRJQ42hRlCDqvnB/Ihqg3P+yrlsp936eOlvVEbAmXrRUq8PlPfhR9ZXQqvpCtVQiWSRPEkephQ+T2PTFqUi3qsCqt4FdTQA+InLNuWoiMKhl0MURZtamsyj3yluwf+OWRRqf4dflMlibWalidsmX9t4GaQIJ8IndmYaa8EIPUErMhqxxk6BMQYnJxvFbLk/nSEC7bCYM63XONoAkH/qJxRCJsonjuZj3Xi6Goc5NDS1YAlxu47nLPPUcHgCTaX7yuSedrYJrxzR8sxHsDTPV76ZOX1jpjd/ZstQuZvqfWJi8c5QDjvZjI6FTXlJ5DL2QHSHuWKPumVXvZ+8lynLNdGFQniwAL1cKViIvlbWFZ+9jrdHbJeN6ATZjhG9qqFG2z2Bi2Q9AyVCykN0WJuAOnlq2gsTu0SWqqBgdr1xPonJnF7y6OBW2DZbYhtYlYUBaPZPyQiQjjOrkSLgsio1iMMTlRHDu48BRPN7izWnJuCYa1ENrrxowjauHg5sl8BdK4zGW2rGWUeKDM5C8cQH8mCo/8eqxTT7iW8GcWLLLwOEBPPp+Ue6O5z+ERgEUOKkZ68reqpprRM+eQKeciQS8A9kA3yiGCKxCCYTLUcgF4yFz4pQz/XfZYymkOjFqANRygcJTahU7L52eF56kR3y15WNHrVsb80sUTPoV8Rf6KQKkeFNZ4DyLLabLUgE/EMN1auLar4J8iTdc9LJz0eWa1q4w+xDM2ce0BgPWtjAlRsghZCMROcEABt2p2td8Hs/0+ZjOlsqM73lIvDTyi0OYHheEbDdjvYjkWB6RrEHy313ceFS2a/sfg4oQa5ti23J9tUrKPv3+PFzdeh31oEHJkhPbS9y/wrfi48K6hzUUyKVNC03erNu3aMU0sE3Y8JHjcG1PymISNjFrvyfSwUc/ZD5PGIrZmlCDEPQaTZ6HW8WPjk19yCx7KaUxNQJ8+fanSnRiPvmNMGAYA1JOii3bzPXsg== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: e2be7d4c-6d5c-4ed8-344c-08dbeb4effff X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:34:33.9065 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /3orPy2jIihNCmX0yipYhphQ3I1YT/TzK2AH3nfUqn1VhMzH+Nt50MebkbzI4QUo9JsUNAN8ulxoeLGZKj1OgA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8858 In most scripts timeout_poll is defined to 30, but in diag.sh, it's 100. To maintain consistency with other scripts, this patch changes it to 30. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/diag.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh index c7a7c0d2792c..b5a17d2b6723 100755 --- a/tools/testing/selftests/net/mptcp/diag.sh +++ b/tools/testing/selftests/net/mptcp/diag.sh @@ -5,7 +5,7 @@ mptcp_lib_ns_init ksft_skip=4 -timeout_poll=100 +timeout_poll=30 timeout_test=$((timeout_poll * 2 + 1)) flush_pids() From patchwork Wed Nov 22 11:31:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464642 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2083.outbound.protection.outlook.com [40.107.21.83]) (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 0D18C3FB06 for ; Wed, 22 Nov 2023 11:34:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="jaK0O3J7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j53na1v+ETleCrWpxyJ9C+Q26XI85TNpfv7o6UcM0oDRS+gWJOZufDowCX8PfhAw8Sn4/f2ciiga/urT74n6OceVYdia/9KchE9wjyN1xdXKG/Ozna0dxS6XUcSqyKqjitZbnq9L2pk8Whcmw1sjGB9QcfML/AzkPpOBMPHwgoy6tdBLj1WPr8n5eUJqrBAqPmNPkl4ZVrgce7NitNAWYquGF3oX4hob+G0eg100F3peK47xYHeJDHZkB9bHVZid72MoIBLKH4nNSUM4/cBqywuN2Rq1GwhDrg8QTyAV9Es6yExiw2V3VysfIhnYQLh/PH30gGyenafbphYFJvaveA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=ez5RHF4LfzfCD+GmVqTZxoW3gdpwWHF85PM84iNerfI=; b=ZZJEMmDVlF9xoR24hvuwfXkcp6M71NGJ95QU7L0oq+4UWeoTTHTRRjT33Rw+Jmi15GYWQXjVuNbJGH1jOAna5K3fEN1C9/nRJ2YBsJuwcxO7NUbHm1bld14uATDAm+4Xd6DH5KJAMBiN7ApqToF9zxyG44OxwIqHE8al7l1wF5ZKGvUEtOB/8Vh3joFLGVowCLOlYIg868Vzpca8YuWP5+U4wLgpBdYUBT1zy6yyOp9GTHOyZZDJMyZX/Rgs9/z0GCW7LaNlhBPru6BgjtgCYh9gLHYDEgyTHPtaNmbjKHPHx5unK3o+hFy3BbObhklFbWtxPfOX88G9aOLDBNPHuQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ez5RHF4LfzfCD+GmVqTZxoW3gdpwWHF85PM84iNerfI=; b=jaK0O3J7MLIFI2HDjJlFx1mqobAF70XzT+3QqQ89iagTdXoXZqpWmHYqIpSvkC6lwaRySCB2nvm8Jz8fEeYvNax3hudnmH8TIlu7R+k/iKhRXqrn91aa+t7pYSCw1MoabQPohS0F5bJ//7KFTO2XYlic1YER2raznSeCClA78pzLSNz1JH9iTmy+m6Idc1+tBSsvt/J2Z5vXiMXHZLuTMbl5GM4B+MAhtnVKrQYmKtEtJq+CWuI4G9g7GU27WPrK1GpxMFsVej87IA67/uHH8AzH1jblEjayeGJ3zxfKYkC8Bndqp1jN4fCmGvZGyKkJirV8WMjhBki0M8WVslo7qw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by AM9PR04MB8858.eurprd04.prod.outlook.com (2603:10a6:20b:409::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Wed, 22 Nov 2023 11:34:39 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:34:39 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 31/33] selftests: mptcp: export timeout_test to mptcp_lib Date: Wed, 22 Nov 2023 19:31:19 +0800 Message-Id: <9aa7b3c2c2bcfe9e92cff66789e787f63f539c77.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SG2PR06CA0232.apcprd06.prod.outlook.com (2603:1096:4:ac::16) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|AM9PR04MB8858:EE_ X-MS-Office365-Filtering-Correlation-Id: d926d0d5-bac4-4453-6c1d-08dbeb4f0365 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +XOUkEonDkPWyBfu6x6N+EZ3QxYen8jZBwntxiDvi2imkE0VDJRSZnIcCcp/B4q3gtSAHZywONR8RgwCRalWAw1Mzvf8yCqs0NhgxgWHaIIe5OdhUlR60dwraNwfbALfSA9SXhLGvrydv148/SA6sMhxrxQb7U9HCHb52bK6SpOWBGLNoFhhvYNC/10RII4uDxPwrwUErzUBZgNFF5SCWMdf5nWDwNZUusmgY72O7bJh15osaJtDRLI9pn7dy+jwRn3FAYKLdVSIUBOUBwrPSkcH2uPGpvRHQYTpsVPWlNcmAvIQAJE34B7vi06LRQK36P4/Rn1n6OxGf/E+AS+uOrLJ9GIi3FLwJt9UbuRjBU8AT8xzee2+MBYb0lt/1XoW+Fh/MFvXfuhgXP3CgfHmaX/7nQCfA3Me9J4+5UDsmBqjClIk1zULPfPsnR7K6Rj1MTiySp3exDO4qpfdF09xbBGTgZBjESKyWFtmXp9Ih528QABVYah5MftK5kDKGS7s5h1gjq6e7qW1dUKhyXHvozxLcCphrrCUBaOqa+LPSsV62Amb6hGqGevQYIoeo5my2VaAPEGmjyktrM1Is/GOn6r4Sl2RgRIJkVK5u+xVnPM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(39860400002)(396003)(346002)(366004)(230922051799003)(186009)(1800799012)(451199024)(64100799003)(5660300002)(36756003)(8936002)(44832011)(8676002)(478600001)(6486002)(86362001)(4326008)(6512007)(316002)(6916009)(66476007)(66946007)(66556008)(41300700001)(38100700002)(2906002)(83380400001)(26005)(2616005)(107886003)(6666004)(6506007)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 72Nv3vesFPz/U5p/OmyleEH5u9GOviL1uQ7WAy4aFcyouS17sKXC8cv9SZDbxXsm3XaeKOWN4Ys6FMlqavfpJR+vTIjCbBhpTNc97F7FtLeSARDcqNzlNG/M0rJHyU5XWW78rCZotEli5Hx4aY4zE3DW3DNdhOGPP8vg9fAp0HIxu9Jhy4Glryjs8KKweDBI1cHpA2amzwLjpTfms55kT1prbHL/HX6CnXS9ROSPmM6GMCf85WJrPbLUaa9uFNXTf+hx++Nn6Ad7hA0PSL/ot7PhpWSMuPTCypa6K4ANkE9Gkzb7zDaIvLN583WjWIoxhrmKIsXTeusgbkMRA396yXCet72A2t0qRjcUd6fF7O0DRtr/BTX0AOrisu8+5HRpr/cHLn/Qftd9aZ1FpeDOYjGyp+GVVUi5T7nT8C1PgjfVmDK8b3nnFCvSjOc2fzJuqGZSEwazKvyvOXKaUr75aUnKLS8ftlMyzbQvbaiIhwU1sIBMfgHDczA8/ZTIlSycRN5KFxxFtJ0xS57ZK4ZQWwatM1pa+XRDvsIh4JWedQqG9qb6awQA5MrHiW2+Lk0m7XdtTzhp6rO5t5N3PBKIiWnMt1PZQC01MMt8TbdmshsemU4ODFgYMrEsMNODMKf7L8F9ZnIunzDxwes3XCayEIyT0g1L3j3nrTGHKOdKWzwRjDpA74ciRLKCD1LGBk7QXXaY0Je2vahO836RC+DaXvuprD+y0O59Pva1amYxqv0hVIVhD0prlRemPGQNOFjPPjvjL82MzaCcQGymWZAWlzzvuD7uOk6+r6o6gkamRSEIiTM/k/nrPUcqXVyRNnbPG/XBGCV34hLG+JZZVwftJzvPxahh6iB+heBRdIdwbW7JKric/x0RqrU5TSqMnK9kdXfptQ5Ur9nUQGjBh9JlV+NU405A0F3wKh+6qL9706vaV5USpFV7CDgxakK8/rRcXW1kBCE5AHxg091bCpyrQ9WDbxSSfzfZBnbuXByuHg0NS6RN6cTVooU62WuLQicbxDG5ZCfUG6B4jcm3JOWQWADNdX9iPzo4rhbjHZFnXnE1mvqDSekaNBsdrCBZRmN3KwCSHgZmHWxoL6i3Ci1KaZLEnbEaOrnaiE1Kyz7y3IEgVsAyCc8nRINH2I4YbCLPCOWBJgebOJdREXy03gVywi724ry/BoTUlKTbXTYxJk6DF9nHupb2JYHwENLn2l5xhe5CNp5aerhuEYhu6RifUpDXQpz3d0kB+UIIhPHETaRa0Gg/tFVyFXvEXNqUSo2EoPZFMDp+UmI6PwwqVmOGOjnYnSgwHwAW2Cvrx5lpoaAw/HAi9177KCPZ5O5jIicWPezWxKte6hrywY0nN3hRgVJ4vSx8L2tq2EGvsaCZiuGFqHtQxXZZjA2rnGzBCXOj5lQc9tHNHsILfnftgiWOqn7Am5O4SWGejN1PhiD3hQyaTDaPVybqkq619xDIdE6CWDPiZt5xLAIxGpvgOYxvbHFGL9Pc6RLenx52tiKP/QHMNIRxTzFxOMaN83zdZOprP8bt2+jgP+aku9AD3wLiPXui11zlgu60w4IwjFKEJslQm1oy7sttjA7eqdXnjVpGtYh6gGDLbOIT+9WwvuCmcA== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: d926d0d5-bac4-4453-6c1d-08dbeb4f0365 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:34:39.7845 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fS4g48uMFGKH1Pu9fxepDhttfzAi7cGDJk7aeRdC8un2SkeaDPscYDrZqLNvObghHH9oE38q92bt6QAlESE/gg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8858 Move the variables 'timeout_poll' and 'timeout_test' into mptcp_lib.sh as public variables. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/diag.sh | 2 -- tools/testing/selftests/net/mptcp/mptcp_connect.sh | 2 -- tools/testing/selftests/net/mptcp/mptcp_join.sh | 2 -- tools/testing/selftests/net/mptcp/mptcp_lib.sh | 3 +++ tools/testing/selftests/net/mptcp/mptcp_sockopt.sh | 2 -- tools/testing/selftests/net/mptcp/simult_flows.sh | 2 -- 6 files changed, 3 insertions(+), 10 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh index b5a17d2b6723..f646fede9872 100755 --- a/tools/testing/selftests/net/mptcp/diag.sh +++ b/tools/testing/selftests/net/mptcp/diag.sh @@ -5,8 +5,6 @@ mptcp_lib_ns_init ksft_skip=4 -timeout_poll=30 -timeout_test=$((timeout_poll * 2 + 1)) flush_pids() { diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/testing/selftests/net/mptcp/mptcp_connect.sh index 6311deaeab8b..7bde17ffe20b 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@ -9,8 +9,6 @@ optstring="S:R:d:e:l:r:h4cm:f:tC" final_ret=0 cin_disconnect="" ksft_skip=4 -timeout_poll=30 -timeout_test=$((timeout_poll * 2 + 1)) ipv6=true ethtool_random_on=true tc_delay="$((RANDOM%50))" diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index da209af098a8..f49aa59ca326 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -20,8 +20,6 @@ capout="" ksft_skip=4 iptables="iptables" ip6tables="ip6tables" -timeout_poll=30 -timeout_test=$((timeout_poll * 2 + 1)) ip_mptcp=0 check_invert=0 validate_checksum=false diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh index 215dfae871e5..0f5dad2ba3b8 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -26,6 +26,9 @@ TEST_COUNT=0 capture=false checksum=false +readonly timeout_poll=30 +timeout_test=$((timeout_poll * 2 + 1)) + MPTCP_LIB_SUBTESTS=() sin=$(mktemp) diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh index 839ce692e099..139b3aff4c4f 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh @@ -4,8 +4,6 @@ . "$(dirname "${0}")/mptcp_lib.sh" ksft_skip=4 -timeout_poll=30 -timeout_test=$((timeout_poll * 2 + 1)) iptables="iptables" ip6tables="ip6tables" diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/testing/selftests/net/mptcp/simult_flows.sh index 67643ffc5c08..a598deaf890b 100755 --- a/tools/testing/selftests/net/mptcp/simult_flows.sh +++ b/tools/testing/selftests/net/mptcp/simult_flows.sh @@ -5,8 +5,6 @@ mptcp_lib_ns_init ksft_skip=4 -timeout_poll=30 -timeout_test=$((timeout_poll * 2 + 1)) bail=0 slack=50 large="" From patchwork Wed Nov 22 11:31:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464643 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2040.outbound.protection.outlook.com [40.107.21.40]) (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 34B0A1CAB6 for ; Wed, 22 Nov 2023 11:34:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="EWwZ/ztm" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BP6nuy9dvW2BiAXGSjE7wcf3x46kbyxgh18pRPWxmAAHyt0D3TKnPMTIjGFvfvFYFSwjx5XSvQ4kaAAM/a9hkRJD1nm0pgghwLYbC7eO02XwlxR1VfEPUfNf125VJ85xcFUPhIG6JtbyMeACuqCzQTeHUVKhvH5ElU0x4IkpdxL1SS3roMu0jOODuri3KEoYuAxAF7ZPc7hIZajmU+Aw42SI7e/XBL8ZN7MGDxIvL3q9AFTAUtraWKiuJL26gxRBFpUxTUTULHRKvehuvHSxkywNbUaz/KNoVe565xOt1MVJ4ILGQFLvrBGLQBYhDuH2TjJAVWuvaqt4syCFY1B/GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=IhdV+FL2LRMZ7aFfFeCFzlJaz0qQqLCWNLu8bRiQt1E=; b=ngYh6aqyag5GDnUQv6nHeFKhjSXw71nmIR/H6vKQi/oxOwYKULpHiWDa4Vo7Zdp1Hy6rORpXysY67JmgiweycFz7QSgVdRt2kmyB3yfHx+J8CIuFVHavUlX3syNr5D1qxnLmqWiUPyZaIiAeQ33sBsTpyHem953nXv7pfWNPeDw2Ri6X4GEc7oLy4g6lxivRUqXnOwCr3ZVFVcDwkYsHCd4WIPevPGCqRsiI7wFlsbY23DM8cgg1/DdePtp181ZFjm808KGVLcaUvGTfIt3x50z/+N5yl528MQaNR4FiaK626E44ldJ74ArInfqf/vWEGOtkq1nXCsUwolcF0vkLQw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IhdV+FL2LRMZ7aFfFeCFzlJaz0qQqLCWNLu8bRiQt1E=; b=EWwZ/ztm0aremPgr8t87PzElLKSh/6ZV90gAiqkUovHP5/GxUYIK7cXWthi7ZqXjgMxdxhFdhd0ttvr5Tu/KIptbAUIVxawBC6tdYeUZBHftKheLwale2PRiLY3ee9t5bsEYdtaWq6TpvDie/VSfaFEkJAlypNUIW2BoOMVg2sJRnE1Tiusiy1b2c2jckstom6AH+SVLBRMx6p3j+IE221XgyhT1qbnPnPhE2IXAZhgGVaOXUZs0v/YSzX2SKNH9IasuFaPbkj8tel9Ept5KNKWLEdP33MhvTghRPmoLMSz7TYKhpHdD1Eixnb+5rnyNHd6toovWhdRauAF8d47q2A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by AM9PR04MB8858.eurprd04.prod.outlook.com (2603:10a6:20b:409::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Wed, 22 Nov 2023 11:34:47 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:34:47 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 32/33] selftests: mptcp: use KSFT_SKIP instead ksft_skip Date: Wed, 22 Nov 2023 19:31:20 +0800 Message-Id: <93893e08fd111dd05fec34c8b17fd45d190c5b68.1700652422.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: TYCP301CA0002.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:386::20) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|AM9PR04MB8858:EE_ X-MS-Office365-Filtering-Correlation-Id: bb3db291-1da0-42db-8387-08dbeb4f07cf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R6TL7yAx9eyrFQ3MIfRyESwlDJLzgguBFeV7qzhOryIOa0L7NseLnefqkEZCJHqDl7VyeN/fwJp6oBJPodiIiz9tKNk9SK/FGeIfZIpOjtN5R31279Ie1HmZ2w+QSGmOwW/fa4Ahy7X0bcaLwrzp5E4lBUZZtKDo2X5RtpENxhpoF2dqdCJwhjmjPOaT0joinK2OZqteH+ZmksffILRQYbWCFwe3gewoj4lxnRMjpVDfWRNVUolYOjFiSFDQISdsAxmw6VlUUqxv0Kq1xH2lsKiIleJUIFuPTub/tLBKLTzrD2nfcMywwEgIrOKgr8MroMzY73V5SKd9vi6PXJ1cIabYmbniLDYLVm3Osb8az7akDFcFQh2mNMj7hvt64b9IuB7EVEOu7xkRNiRK2kbGfxR64j3697aho/IlbHIUz911fjwZg2r5xU85KK3Q7by4Q3GJQ9mHAn4N2jfTJv9H92j+NoWwVmoWRxXRPPL6MaU7d1cYUCsQaTs6WtnCh5AlKymHy9n2oySM1d3Wt503KANQeQSrh0vEcYxY6LZ3z3AgHGBRZAWgWaxqhhyemJu20cxM5w/VVlbDaqZYW0Vk6leAyBP6TRpWIBSZNxI0H1s= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(39860400002)(396003)(346002)(366004)(230922051799003)(186009)(1800799012)(451199024)(64100799003)(5660300002)(36756003)(8936002)(44832011)(8676002)(478600001)(6486002)(86362001)(4326008)(6512007)(316002)(6916009)(66476007)(66946007)(66556008)(41300700001)(38100700002)(2906002)(83380400001)(26005)(2616005)(107886003)(6666004)(6506007)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0+UmT5hvQiKYFsUsF4n3WfjrDnnT9jojicuscL1CoM8shFSXYPd/hwoHGMaQ+NTd3nI2b/axa2zkRjAvahRD7Fnss7PYaXx0fNUimHxE0ww3bj4HWhREdTkncQtGXPtdttwTkpW+WO1aznP/28OiLG400AH6BvJyKhiFwsdDG6fqiFhJnySWk6vRu5R06tMLUigCySXDuM83VOuMlUVKlgWCRMZ4OXCgNQ+R4HlOBmRzv6cSCDgDfZU4nXNR/hNpxGmcqM+aWW2qwfZwDF5NFD6dfMyz+yvKEjOz8qSeLZMbxkykYAuUt3W8AJ9kuxAq25M7sS8QakxRSxKrGsTMnI3NAAxwwIjj2DSLylg4QaqofmepkdS6U8RByIa8f1xu1epA5wRbisRcV0C2lwigUpGYXnXM3/l/xJR68Qe8xOMpESFUCEWxiSguI8rQsamjKapFyO2OWfmvuCFyBLhszCK6tKftLn7BlLvipj7uoHp2bYggxyocuMmjTRhNaY9ASG+o0Jd7UbppgnrEMI2sS0Fb+UsFvX6gEPn8KfYndw6bKdNFS+KHHOv1iPZkSIHlUxrvI4NWw5wbvXOlh6u42M/DL4aah4QgVPONtBgeoSImldvesAvQ2F9rTmtG/mHJHO4LSalkBHzz9ItLPi/sd/fTeJ4nJiVQq9tZDBhLL6XjePvEa8jwJPC0wu0Y8oqMP2QxcefimwAAWzVwWBdwcWqwDGHhITi+IV6LD+ywaIv+AiRxzcDlTttQKuPUJG0DAsVXz+CkCUyv5BWeNfHag/QCpuxApwtuVh9/iyD380MyN6vhtJD+oXSE8F0wqR1UclXe5IRIHZnPN01yoI53SQjnE0GZGGFFvO5bbdQUP5q0cRlF7vNhwrS8oAwnDv262uPKVqVpeZDCX5wbjHv0ea+f5lcnGOIY7SOgbXMcTp7dt/Q962MSRUFwgt715JngVB4bsC/RY6LBbjIMBJgWgzpHHZ4mxixUT25mFEZcQeuK2FViyWHIgq2DeK8EyBA+GfE21sjhQdbfqrAcQ8h8Cnnw1QPvr/FOtxch9YN55obpLsWAl/Joiq1Z0833Ea0k+YJ/JgyV2xasonJdS0+t3qiQaMb+ENi6+4twuSNdKnkaDwH8Z+nJQiVtx9dR1HxQwkTT1xzhST9xvftG7kmBDUkzZyCysUuXv0vLmmS54XSl9uP8vQkazGCJXozukWQbmJF1zhMATPrM7vR1gtz3f+olXpO3Eq6eah+8jlCOB1RVg8pcwb3nWEZRDUaMfJ2643kxKifxr8dNANC2JhLern4UG2U9klgtDM5PCVlxENGQ+Ir1xcTIp698+GOuGI6bcnQkhn2/7KG+UDTrnA7oCK6XsCXdCQ5iZFZPsym23acZzfnLOeo5dZWur0XFoGMvJOXhiNyzw8WOZJYcWC7Cv9nMQWPBJTujrbiOgRUqYOXUR1pHQWn6EdbGEH1PXBlKii/ajGyRte1VdPZbSJ527cW6UtFVWv2cMktk6ZOTw8OkOBPAwnaYEGYS3ua+sMeqXN4RczT1QHtq8rTelgvr0oOcjkH/uZQ6V+rQqctZyXVOPR8aL6QYQXTIdZ0c91yXtr6Rcund0hF7bCATFZvxbw== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb3db291-1da0-42db-8387-08dbeb4f07cf X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:34:47.2707 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QXDdbDmBrNm/x+AuY62y5HRe10aPpOZQFCjoQ6vYCBw3znRxtJ5Eg0LXnjbp2QEhZ0zOfmpSnAAIVx+cPd9WaQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8858 This patch uses the public var KSFT_SKIP in mptcp_lib.sh instead of ksft_skip, and drop every 'ksft_skip=4'. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/diag.sh | 5 ++--- .../testing/selftests/net/mptcp/mptcp_connect.sh | 5 ++--- tools/testing/selftests/net/mptcp/mptcp_join.sh | 15 +++++++-------- tools/testing/selftests/net/mptcp/mptcp_lib.sh | 2 +- .../testing/selftests/net/mptcp/mptcp_sockopt.sh | 7 +++---- tools/testing/selftests/net/mptcp/pm_netlink.sh | 4 +--- tools/testing/selftests/net/mptcp/simult_flows.sh | 3 +-- 7 files changed, 17 insertions(+), 24 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh index f646fede9872..f93f5bdc49ad 100755 --- a/tools/testing/selftests/net/mptcp/diag.sh +++ b/tools/testing/selftests/net/mptcp/diag.sh @@ -4,7 +4,6 @@ . "$(dirname "${0}")/mptcp_lib.sh" mptcp_lib_ns_init -ksft_skip=4 flush_pids() { @@ -33,12 +32,12 @@ mptcp_lib_check_mptcp ip -Version > /dev/null 2>&1 if [ $? -ne 0 ];then echo "SKIP: Could not run test without ip tool" - exit $ksft_skip + exit ${KSFT_SKIP} fi ss -h | grep -q MPTCP if [ $? -ne 0 ];then echo "SKIP: ss tool does not support MPTCP" - exit $ksft_skip + exit ${KSFT_SKIP} fi get_msk_inuse() diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/testing/selftests/net/mptcp/mptcp_connect.sh index 7bde17ffe20b..c2ca2cbcd211 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@ -8,7 +8,6 @@ time_start=$(date +%s) optstring="S:R:d:e:l:r:h4cm:f:tC" final_ret=0 cin_disconnect="" -ksft_skip=4 ipv6=true ethtool_random_on=true tc_delay="$((RANDOM%50))" @@ -132,7 +131,7 @@ mptcp_lib_check_kallsyms ip -Version > /dev/null 2>&1 if [ $? -ne 0 ];then echo "SKIP: Could not run test without ip tool" - exit $ksft_skip + exit ${KSFT_SKIP} fi capout=$(mktemp) @@ -229,7 +228,7 @@ fi check_mptcp_disabled() { local disabled_ns="ns_disabled-$rndh" - ip netns add ${disabled_ns} || exit $ksft_skip + ip netns add ${disabled_ns} || exit ${KSFT_SKIP} # net.mptcp.enabled should be enabled by default if [ "$(ip netns exec ${disabled_ns} sysctl net.mptcp.enabled | awk '{ print $3 }')" -ne 1 ]; then diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index f49aa59ca326..f0f464922783 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -17,7 +17,6 @@ cinfail="" cinsent="" tmpfile="" capout="" -ksft_skip=4 iptables="iptables" ip6tables="ip6tables" ip_mptcp=0 @@ -126,7 +125,7 @@ check_tools() if ! ip -Version &> /dev/null; then echo "SKIP: Could not run test without ip tool" - exit $ksft_skip + exit ${KSFT_SKIP} fi # Use the legacy version if available to support old kernel versions @@ -135,10 +134,10 @@ check_tools() ip6tables="ip6tables-legacy" elif ! iptables -V &> /dev/null; then echo "SKIP: Could not run all tests without iptables tool" - exit $ksft_skip + exit ${KSFT_SKIP} elif ! ip6tables -V &> /dev/null; then echo "SKIP: Could not run all tests without ip6tables tool" - exit $ksft_skip + exit ${KSFT_SKIP} fi } @@ -394,15 +393,15 @@ setup_fail_rules() -p tcp \ -m length --length 150:9999 \ -m statistic --mode nth --packet 1 --every 99999 \ - -j MARK --set-mark 42 || return ${ksft_skip} + -j MARK --set-mark 42 || return ${KSFT_SKIP} - tc -n $ns2 qdisc add dev ns2eth$i clsact || return ${ksft_skip} + tc -n $ns2 qdisc add dev ns2eth$i clsact || return ${KSFT_SKIP} tc -n $ns2 filter add dev ns2eth$i egress \ protocol ip prio 1000 \ handle 42 fw \ action pedit munge offset 148 u8 invert \ pipe csum tcp \ - index 100 || return ${ksft_skip} + index 100 || return ${KSFT_SKIP} } reset_with_fail() @@ -416,7 +415,7 @@ reset_with_fail() local rc=0 setup_fail_rules "${@}" || rc=$? - if [ ${rc} -eq ${ksft_skip} ]; then + if [ ${rc} -eq ${KSFT_SKIP} ]; then mark_as_skipped "unable to set the 'fail' rules" return 1 fi diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh index 0f5dad2ba3b8..e6972d0e1147 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -499,7 +499,7 @@ mptcp_lib_ns_init() { local netns for netns in "$ns1" "$ns2" "$ns3" "$ns4"; do - ip netns add $netns || exit ${ksft_skip} + ip netns add $netns || exit ${KSFT_SKIP} ip -net $netns link set lo up ip netns exec $netns sysctl -q net.ipv4.conf.all.rp_filter=0 diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh index 139b3aff4c4f..b6e604d03a23 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh @@ -3,7 +3,6 @@ . "$(dirname "${0}")/mptcp_lib.sh" -ksft_skip=4 iptables="iptables" ip6tables="ip6tables" @@ -74,7 +73,7 @@ mptcp_lib_check_kallsyms ip -Version > /dev/null 2>&1 if [ $? -ne 0 ];then echo "SKIP: Could not run test without ip tool" - exit $ksft_skip + exit ${KSFT_SKIP} fi # Use the legacy version if available to support old kernel versions @@ -83,10 +82,10 @@ if iptables-legacy -V &> /dev/null; then ip6tables="ip6tables-legacy" elif ! iptables -V &> /dev/null; then echo "SKIP: Could not run all tests without iptables tool" - exit $ksft_skip + exit ${KSFT_SKIP} elif ! ip6tables -V &> /dev/null; then echo "SKIP: Could not run all tests without ip6tables tool" - exit $ksft_skip + exit ${KSFT_SKIP} fi check_mark() diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testing/selftests/net/mptcp/pm_netlink.sh index e89b78e7d4a0..d68353c18996 100755 --- a/tools/testing/selftests/net/mptcp/pm_netlink.sh +++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh @@ -3,8 +3,6 @@ . "$(dirname "${0}")/mptcp_lib.sh" -ksft_skip=4 - usage() { echo "Usage: $0 [ -h ]" } @@ -36,7 +34,7 @@ mptcp_lib_check_mptcp ip -Version > /dev/null 2>&1 if [ $? -ne 0 ];then echo "SKIP: Could not run test without ip tool" - exit $ksft_skip + exit ${KSFT_SKIP} fi trap cleanup EXIT diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/testing/selftests/net/mptcp/simult_flows.sh index a598deaf890b..c660e1f8547c 100755 --- a/tools/testing/selftests/net/mptcp/simult_flows.sh +++ b/tools/testing/selftests/net/mptcp/simult_flows.sh @@ -4,7 +4,6 @@ . "$(dirname "${0}")/mptcp_lib.sh" mptcp_lib_ns_init -ksft_skip=4 bail=0 slack=50 large="" @@ -33,7 +32,7 @@ mptcp_lib_check_mptcp ip -Version > /dev/null 2>&1 if [ $? -ne 0 ];then echo "SKIP: Could not run test without ip tool" - exit $ksft_skip + exit ${KSFT_SKIP} fi # "$ns1" ns2 ns3 From patchwork Wed Nov 22 11:31:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13464644 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2064.outbound.protection.outlook.com [40.107.21.64]) (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 D46EF1CAB6 for ; Wed, 22 Nov 2023 11:34:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="lPUyAA/W" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T7bWWHLl0wOBO1j+ShiuPc+54WF7SThkG1Qy+TrKo0MQlAmvi7urqaMgUVwydyka5XT8TlbgBu4Cqy7e7Zu7yYIRRf5GwBpP3/WQ4DdcJlsoYomX/PdvZsfBwTD3byfC97ynHsJPS/a/WLqAFUrNtb0oJ9lfOKy6ykICOd+nEG/n0eM4cuOxAHz6GSnUzFV3Xk/LMC3LEs/Q9/yV2X/4FHfHgvcvL3Nc1N5DTe0mwJFm6Z9vOd6niFKM/qJxpKqjqUjzZp5Zrhs2RvHKG/vp1D+tQ//1Eh1IOjFfH4nHlKC0qgJA2HIGB995wTKvqbxSvHYGVsX3rAo/AZajPgGkcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=REVfFsoMxM5W3bfwncBbfAOpHcuaKeU03wO/aUM2aCo=; b=jDqNSdMmHZLCvFLRd6tw+KP6Y+VAThrblOseaerfZD0Cn5Zke60jf83/nPUDbfpZjkDp1U5TeE7hXxt6+whe2GfNwrrsa4aPPTCufKj2xqmOQQQIvbWoJrHQO9ZCpMlKpxVK4H6Zi3RCgJQ3WgjDoBBsV9FY1Q4+zJDZ5hVG+cTEocf+3Omv48KUdCN5GcGYnDoHi8WFDZ3Uo3nU+6zOEFiTSafdq21dYebBAHBeo0nyfd3FXWqPeul7QU/Z9+UFtUcFfpCX2hvbzD7VHyqlRvOJfonlWcogMVgUYxkF7u+68JJsLYqNU/GN/O9Zo4GZOFMYnZzKYKRLWQhXGJwJAg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=REVfFsoMxM5W3bfwncBbfAOpHcuaKeU03wO/aUM2aCo=; b=lPUyAA/W6O74pT6RaKJPcpZMUE/RJU+R2niBc8xxN4T2qRYKD/YQyqBGa27ESeQIvZ5CHdKQ3lAM0n3pVfQnjDWRfUJ0IZzmP+ESAKK3zEW3Ub6BiQ8ge2IxQsQbRPw1PKi5QZKXkijE8peBCuem+ei03Zyl2xRUv8Ku2dJJqM3UfavBdelwKIabGCveuyzuQJiKFGjLBUTOMZvryE2s4H7zx7KSKCyd7lrWzyJhwfoe+rJ+qOwBo2Fu3DUW/MHq1zHNqS0Wpr3AxTyZN/uUXbTExKp7Duiu9ncLoBVG/toHLSTV07eJwGDXlt8N95s/SufT/EeWjHqSB64o5Alq9w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by AM9PR04MB8858.eurprd04.prod.outlook.com (2603:10a6:20b:409::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Wed, 22 Nov 2023 11:34:55 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::7102:259:f268:5321%7]) with mapi id 15.20.7025.017; Wed, 22 Nov 2023 11:34:55 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 33/33] selftests: mptcp: netlink: fix positions of newline Date: Wed, 22 Nov 2023 19:31:21 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: TYCP301CA0008.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:386::6) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|AM9PR04MB8858:EE_ X-MS-Office365-Filtering-Correlation-Id: 11937c92-b7af-4f78-5c90-08dbeb4f0c7c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Tb8vIxlUteNVjkBOuQTCqILiigvz2cd7eEl8YLHa6AwnyFG0ApFPG0Astzf/+ZK6CHuYczhlnh5tlAfo/bLUKxKF6o77+p7YVK5Ioqr460IH9CTkDoi5QyEZKWFN4LFvBT6vKaED5k/GwYBMH2ijRqHgwPOz+W7woW9s+OL/EdVZySwrgYTlYz5+cgyJHdZO+G+Krl4x8esc68PSjMVQYGyxASJjwMLJ0ynAbzdATT87mddqvCZC7xsZI5mMb5oWNMbJL9nA6bqWKPX5z6Bu2h+QBEAhNzUzZDaEigtJQTAB+lwI2fFguQCd1V4bWuQmUM4bCJxSIqeTtKZKiG0XxS4v4hA2tDLR5m3gvTpOHhhtB0gqHoC4HbQi5vQnJOjjXjU9s0bSy6Ors3mxaA5dNGTchBL5qgd8/lk5EKnbb3uaqJeJ6I9LPCN7jwCZdKxUpT/6QChMFpiFig6LBblyTx2iqC+BH9/29tz1M6U97eIAWgpOKF2D395NEvXQBiBufVlhgq9UOTm/hg6vEdU1cc9jCrQrb/mneTsYkCSjwKYQoDpspQawrxuAbfSIunwUlpUyHkYKzc0COUgxBChKAb6s4iT/nWy5pKTPTk6F8xQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(39860400002)(396003)(346002)(366004)(230922051799003)(186009)(1800799012)(451199024)(64100799003)(5660300002)(36756003)(8936002)(44832011)(8676002)(478600001)(6486002)(86362001)(4326008)(6512007)(316002)(6916009)(66476007)(66946007)(66556008)(41300700001)(38100700002)(2906002)(83380400001)(26005)(2616005)(107886003)(6666004)(6506007)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1U8EKC0t9ZcHvr3/nPiuN3tAr/0+yo/10xHTShMsgeSCvZ5EkSH278kK1GvW/KQWMmeffo5dNRnf4Zb4n3NQdkHbAcztNE4tBcy91TjwXzleOLmUe+wztVfItkf1PcqvKj2CYF5wopYiw8fAS+fm8G9HVZ4VXL0HbN5yC6ijMm6BUrAE4QWfYBhqfR1f0D9blilRfu9Cpjxwz1EOh7XH4CERgNpzE4btuKFp+ZOrJSmTV867360VrmXx+ScEOsjdbdCl5WWQOq0XM2g3NJeoVIHWQxcFz1r3uJd+vHl+05w1JbS2iukawkUMRzfd5H0yUa3gNlQnv2Z7g2zVVmWl4Xsk4YaBsTyq/2mUI3nx7TH12bpt3woa9J0Tp32RGtBnny1G4t5EHXoeYq36TlPiTww1G73Mzcs3VxLErQIhKAB6HdXq4djgd6nDzfQr7L5Bxk6YQ4r+sXE6qpMz21bq1egUlVRZP2seFFjRJqIqOr4RYDWtEzIHV9B0xXM49kZX2CNiv6QhPt7hyNPKHQnxc03xZNfeIFWkgTUIpE3YnmVZFBilcp9quK+9JKKpkMJICP32PEVLVTU2J8CFwHIgr3FNC/1WF/PsjYdM9W59cT+JuoHEIpMzZO1onA3KN9setDyrHdFxGO0+ZitwlVEv3b1e9RaRcj9pRZHN7Wpf/tkLV8b0J/3vI0Bm4xbzhEH4fdzp9N0F7v/W0VsgGrcufaJB09jcMlIHELPmYb/s9w/Qj85WoIfwvcef+fzd1PgtoKceuA6bAV3LrWSQzmND1fdb2HHjWU29lEhae5r6d1PXd0mlrJBhFs1imtGKOw2wv5GgXcRAb2k395ncFGeaco3w4ZfbsxLIgvqYJnbdwljx43nnpqwKoTaGfO5td1nWCNfdIbaGtmaGJK2/JYADwzS2CKAIidvB4ZAHxwMDZywakeAtpGXRcAxJEyc+EJIpi6hGzaWp3/SROPC3rx2Co8ZSxH8pVFeoGsqwdY+zEr2X7FfC/YXxSNd+UKNtfBptzudbgejHp8rODylrXORNj2Oa+1TOgkgpaHNyM9otRlVIIAAVXx8K+1TX+Jd4hgQZijzhmqvVIhST0xELe874bbGHXxhHOJBFrLJZtJHemAmjJKpgZP+k0a3CiWqQFvtcij/2O8kk9WhDDk8C4d6MYDey4KbEnncIbqjM5R5/Zx293dy9+sCkmrshn+/0lzGLIYlVyh+FoHwGNBhdsoTVH/H0EHv3fBRZpeM51LkDXWmwo2XANmo9HIvVwdxnctdwvi+JFMUO/58vPyKsfPvFBxtQWF348141wn+LwRBrCnAk0ftWAVmTW+ZgTL/UElyT1g3SJPSehC4hBAvpC4aqEPOW76sAGhPZ8xoyYamSyie32EJhY8qkS0PQVVwIR0zjxsnqi/GqvfolMksadXLvOD1Rvb92HF7qJnv5w1oLWW2okvL9LfBv+mLtDCyLOntsITuB4Cw1nKNCLrfy+ZSsCjE5vtexi0RTBess9G1GGx8bsBEWq1IeiCC/yVfvJ30y2B1v++UL8DrgJfaaL/nGRwTDHGsncYOug/dKklKWCLo/AzEbN3+Y9Gw9GDlBstcKF0Zdu4qlt8G6z2t0z7mrkA== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11937c92-b7af-4f78-5c90-08dbeb4f0c7c X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 11:34:55.0031 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lHnTW2zaSCA2oFcRE5vhPHgnFBVAEbzIXLYS1RFp/BMkuGg/YhutqUuepskKnhAeXQGLgCkkv6ErkLJnI+hgug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8858 Some positions of the new line are arranged a bit strangely in script pm_netlink.sh. For example, the output of 'pm_nl_ctl limits': "accept 0 subflows 2" "defaults limits" This one can be refactored using $'...\n...': $'accept 0\nsubflows 2' "defaults limits" For longer output results, such as the output of 'pm_nl_ctl dump': "id 1 flags 10.0.1.1 id 3 flags signal,backup 10.0.1.3 id 4 flags signal 10.0.1.4 id 5 flags signal 10.0.1.5 id 6 flags signal 10.0.1.6 id 7 flags signal 10.0.1.7 id 8 flags signal 10.0.1.8" "id limit" This one can be refactored using "$(printf '%s\n' "..." "...")": "$(printf '%s\n' "id 1 flags 10.0.1.1" \ "id 3 flags signal,backup 10.0.1.3" \ "id 4 flags signal 10.0.1.4" "id 5 flags signal 10.0.1.5" \ "id 6 flags signal 10.0.1.6" \ "id 7 flags signal 10.0.1.7" "id 8 flags signal 10.0.1.8")" \ "id limit" This patch uses such methods to rearrange the outputs into different lines. Signed-off-by: Geliang Tang --- .../testing/selftests/net/mptcp/pm_netlink.sh | 80 +++++++++---------- 1 file changed, 38 insertions(+), 42 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testing/selftests/net/mptcp/pm_netlink.sh index d68353c18996..06446cec7f55 100755 --- a/tools/testing/selftests/net/mptcp/pm_netlink.sh +++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh @@ -61,8 +61,8 @@ check "ip netns exec $ns1 ./pm_nl_ctl dump" "" "defaults addr list" default_limits="$(ip netns exec $ns1 ./pm_nl_ctl limits)" if mptcp_lib_expect_all_features; then - check "ip netns exec $ns1 ./pm_nl_ctl limits" "accept 0 -subflows 2" "defaults limits" + check "ip netns exec $ns1 ./pm_nl_ctl limits" \ + $'accept 0\nsubflows 2' "defaults limits" fi ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.1 @@ -71,15 +71,15 @@ ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.3 flags signal,backup check "ip netns exec $ns1 ./pm_nl_ctl get 1" "id 1 flags 10.0.1.1" "simple add/get addr" check "ip netns exec $ns1 ./pm_nl_ctl dump" \ -"id 1 flags 10.0.1.1 -id 2 flags subflow dev lo 10.0.1.2 -id 3 flags signal,backup 10.0.1.3" "dump addrs" + "$(printf '%s\n' "id 1 flags 10.0.1.1" \ + "id 2 flags subflow dev lo 10.0.1.2" "id 3 flags signal,backup 10.0.1.3")" \ + "dump addrs" ip netns exec $ns1 ./pm_nl_ctl del 2 check "ip netns exec $ns1 ./pm_nl_ctl get 2" "" "simple del addr" check "ip netns exec $ns1 ./pm_nl_ctl dump" \ -"id 1 flags 10.0.1.1 -id 3 flags signal,backup 10.0.1.3" "dump addrs after del" + $'id 1 flags 10.0.1.1\nid 3 flags signal,backup 10.0.1.3' \ + "dump addrs after del" ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.3 2>/dev/null check "ip netns exec $ns1 ./pm_nl_ctl get 4" "" "duplicate addr" @@ -98,13 +98,11 @@ for i in `seq 10 255`; do ip netns exec $ns1 ./pm_nl_ctl add 10.0.0.9 id $i ip netns exec $ns1 ./pm_nl_ctl del $i done -check "ip netns exec $ns1 ./pm_nl_ctl dump" "id 1 flags 10.0.1.1 -id 3 flags signal,backup 10.0.1.3 -id 4 flags signal 10.0.1.4 -id 5 flags signal 10.0.1.5 -id 6 flags signal 10.0.1.6 -id 7 flags signal 10.0.1.7 -id 8 flags signal 10.0.1.8" "id limit" +check "ip netns exec $ns1 ./pm_nl_ctl dump" \ + "$(printf '%s\n' "id 1 flags 10.0.1.1" "id 3 flags signal,backup 10.0.1.3" \ + "id 4 flags signal 10.0.1.4" "id 5 flags signal 10.0.1.5" "id 6 flags signal 10.0.1.6" \ + "id 7 flags signal 10.0.1.7" "id 8 flags signal 10.0.1.8")" \ + "id limit" ip netns exec $ns1 ./pm_nl_ctl flush check "ip netns exec $ns1 ./pm_nl_ctl dump" "" "flush addrs" @@ -116,8 +114,7 @@ ip netns exec $ns1 ./pm_nl_ctl limits 1 9 2>/dev/null check "ip netns exec $ns1 ./pm_nl_ctl limits" "$default_limits" "subflows above hard limit" ip netns exec $ns1 ./pm_nl_ctl limits 8 8 -check "ip netns exec $ns1 ./pm_nl_ctl limits" "accept 8 -subflows 8" "set limits" +check "ip netns exec $ns1 ./pm_nl_ctl limits" $'accept 8\nsubflows 8' "set limits" ip netns exec $ns1 ./pm_nl_ctl flush ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.1 @@ -128,14 +125,11 @@ ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.5 id 254 ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.6 ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.7 ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.8 -check "ip netns exec $ns1 ./pm_nl_ctl dump" "id 1 flags 10.0.1.1 -id 2 flags 10.0.1.2 -id 3 flags 10.0.1.7 -id 4 flags 10.0.1.8 -id 100 flags 10.0.1.3 -id 101 flags 10.0.1.4 -id 254 flags 10.0.1.5 -id 255 flags 10.0.1.6" "set ids" +check "ip netns exec $ns1 ./pm_nl_ctl dump" \ + "$(printf '%s\n' "id 1 flags 10.0.1.1" "id 2 flags 10.0.1.2" "id 3 flags 10.0.1.7" \ + "id 4 flags 10.0.1.8" "id 100 flags 10.0.1.3" "id 101 flags 10.0.1.4" \ + "id 254 flags 10.0.1.5" "id 255 flags 10.0.1.6")" \ + "set ids" ip netns exec $ns1 ./pm_nl_ctl flush ip netns exec $ns1 ./pm_nl_ctl add 10.0.0.1 @@ -146,36 +140,38 @@ ip netns exec $ns1 ./pm_nl_ctl add 10.0.0.5 id 253 ip netns exec $ns1 ./pm_nl_ctl add 10.0.0.6 ip netns exec $ns1 ./pm_nl_ctl add 10.0.0.7 ip netns exec $ns1 ./pm_nl_ctl add 10.0.0.8 -check "ip netns exec $ns1 ./pm_nl_ctl dump" "id 1 flags 10.0.0.1 -id 2 flags 10.0.0.4 -id 3 flags 10.0.0.6 -id 4 flags 10.0.0.7 -id 5 flags 10.0.0.8 -id 253 flags 10.0.0.5 -id 254 flags 10.0.0.2 -id 255 flags 10.0.0.3" "wrap-around ids" +check "ip netns exec $ns1 ./pm_nl_ctl dump" \ + "$(printf '%s\n' "id 1 flags 10.0.0.1" "id 2 flags 10.0.0.4" "id 3 flags 10.0.0.6" \ + "id 4 flags 10.0.0.7" "id 5 flags 10.0.0.8" "id 253 flags 10.0.0.5" \ + "id 254 flags 10.0.0.2" "id 255 flags 10.0.0.3")" \ + "wrap-around ids" ip netns exec $ns1 ./pm_nl_ctl flush ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.1 flags subflow ip netns exec $ns1 ./pm_nl_ctl set 10.0.1.1 flags backup -check "ip netns exec $ns1 ./pm_nl_ctl dump" "id 1 flags \ -subflow,backup 10.0.1.1" "set flags (backup)" +check "ip netns exec $ns1 ./pm_nl_ctl dump" \ + "id 1 flags subflow,backup 10.0.1.1" \ + "set flags (backup)" ip netns exec $ns1 ./pm_nl_ctl set 10.0.1.1 flags nobackup -check "ip netns exec $ns1 ./pm_nl_ctl dump" "id 1 flags \ -subflow 10.0.1.1" " (nobackup)" +check "ip netns exec $ns1 ./pm_nl_ctl dump" \ + "id 1 flags subflow 10.0.1.1" \ + " (nobackup)" # fullmesh support has been added later ip netns exec $ns1 ./pm_nl_ctl set id 1 flags fullmesh if ip netns exec $ns1 ./pm_nl_ctl dump | grep -q "fullmesh" || mptcp_lib_expect_all_features; then - check "ip netns exec $ns1 ./pm_nl_ctl dump" "id 1 flags \ -subflow,fullmesh 10.0.1.1" " (fullmesh)" + check "ip netns exec $ns1 ./pm_nl_ctl dump" \ + "id 1 flags subflow,fullmesh 10.0.1.1" \ + " (fullmesh)" ip netns exec $ns1 ./pm_nl_ctl set id 1 flags nofullmesh - check "ip netns exec $ns1 ./pm_nl_ctl dump" "id 1 flags \ -subflow 10.0.1.1" " (nofullmesh)" + check "ip netns exec $ns1 ./pm_nl_ctl dump" \ + "id 1 flags subflow 10.0.1.1" \ + " (nofullmesh)" ip netns exec $ns1 ./pm_nl_ctl set id 1 flags backup,fullmesh - check "ip netns exec $ns1 ./pm_nl_ctl dump" "id 1 flags \ -subflow,backup,fullmesh 10.0.1.1" " (backup,fullmesh)" + check "ip netns exec $ns1 ./pm_nl_ctl dump" \ + "id 1 flags subflow,backup,fullmesh 10.0.1.1" \ + " (backup,fullmesh)" fi mptcp_lib_result_print_all_tap