From patchwork Mon Jun 22 07:09:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1314096 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mysuse.onmicrosoft.com header.i=@mysuse.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-mysuse-onmicrosoft-com header.b=RY26Gaml; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49r0vx0PRWz9sSF for ; Mon, 22 Jun 2020 17:11:56 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 2F22C3C5E53 for ; Mon, 22 Jun 2020 09:11:53 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [217.194.8.6]) by picard.linux.it (Postfix) with ESMTP id D6E1B3C2B12 for ; Mon, 22 Jun 2020 09:09:46 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20066.outbound.protection.outlook.com [40.107.2.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id 71E9E14017F3 for ; Mon, 22 Jun 2020 09:09:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d+3FSqTE2DkLsTARlvbbNj3maq6OwmcHBsJGp82eqs2PGWsy0c3ILWORG+Qf6VBhX/GHxtgz1Naa51JEl3A0Kd0mXQKaaQPcQQsXI37LfzYw0RnSQ78M2/p3T3a/mXzMMB111rOwY4biP7VRfH2+GoEvcHCG8GkSzfHv1xi38yIrtsnxRy/1Ol2dgja2KnGVCKvS+8AUjthEojuEo+LAi6cZinmQUkEMo89ExkFMUgqbNWc5uGGrq1T1weEaGntRUGLGjnw5l1NNHzbGs/mMlEiu7nwC1BRLrRnkg0sybrwnqZuQQ+NsyOH/UMrkuT5CwHrk0uEg5QpNy9/dmBbBFA== 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-SenderADCheck; bh=nDkCqSRRS90xZNSGUduD1V0g/gizGkWRjzOtVFIvvlI=; b=lSw44dIIC0qv+TitYfgyE9FBXMuSbAnmVWJAx/cl7ollvpELU0aahMK/eEewGTWInlV6lasYdJwH0Lf9GGIbtKX0o22FVd2btnOJJ68umnjBCAcc0cVorRIVWIqY8sLtpz6H15gHOwfDvdiuf4rObAEVZJhJeWEhXiRTbYWNP5UycxG3SGNqCzxZM1MrDq3Low9noxX3LQwAz/2DkVpiVLJEJPT5NxvVTPJKW4bINIeix1hxbanWYJq+ptFcpt8ocMpz2+eYANwATIELyVm2Aa/Nc1Zl4yPbTCusIkN4NmPVypYI83mcW1KgQDac3yEp4JFGZu6ICtJe0BAcdQFDXw== 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=mysuse.onmicrosoft.com; s=selector1-mysuse-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nDkCqSRRS90xZNSGUduD1V0g/gizGkWRjzOtVFIvvlI=; b=RY26Gamllx+tao173KuCCWZqr5cotyhfEoMGZJUPVCXwvo1/rWCudw7puWz27nGzyxoUYMIAMRzdl891c8yy8OMOVjGJ84n6KXIq8qvo/FQvFhj04ilL00yvL6g9Vxxc9udMBKD3uCoVtcBEhO9jhQGv53yuWfJsmaLmcDvgceFQSb0guYIPHOHN63LmmUk11gtBkxHk5gSgHf4k6VI9WeTcObLzXunHwAx8l81IoYLx5RzXm7bUTdOfqeTYnN6c2JDdhWfrKK772sLz+h8w6sYhXdXhGiTIDx8HYW4NHgt2WNPvTkvZrzQ9T5QE9Td+E9jTxMxi9aRC+1Gt0PvWYg== Authentication-Results: lists.linux.it; dkim=none (message not signed) header.d=none;lists.linux.it; dmarc=none action=none header.from=suse.com; Received: from VI1PR04MB5503.eurprd04.prod.outlook.com (2603:10a6:803:d1::13) by VI1PR04MB5726.eurprd04.prod.outlook.com (2603:10a6:803:e5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Mon, 22 Jun 2020 07:09:44 +0000 Received: from VI1PR04MB5503.eurprd04.prod.outlook.com ([fe80::394b:92df:1d86:d33e]) by VI1PR04MB5503.eurprd04.prod.outlook.com ([fe80::394b:92df:1d86:d33e%3]) with mapi id 15.20.3109.027; Mon, 22 Jun 2020 07:09:44 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Mon, 22 Jun 2020 09:09:07 +0200 Message-Id: <20200622070911.16123-2-petr.vorel@suse.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200622070911.16123-1-petr.vorel@suse.com> References: <20200622070911.16123-1-petr.vorel@suse.com> X-ClientProxiedBy: AM0PR07CA0016.eurprd07.prod.outlook.com (2603:10a6:208:ac::29) To VI1PR04MB5503.eurprd04.prod.outlook.com (2603:10a6:803:d1::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dell5510.arch.suse.de (62.201.25.198) by AM0PR07CA0016.eurprd07.prod.outlook.com (2603:10a6:208:ac::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.10 via Frontend Transport; Mon, 22 Jun 2020 07:09:43 +0000 X-Mailer: git-send-email 2.27.0 X-Originating-IP: [62.201.25.198] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ecc07b10-647b-45e8-232b-08d8167b3d4b X-MS-TrafficTypeDiagnostic: VI1PR04MB5726: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 0442E569BC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AmM8yTuzIUTwiDxP5BaUnJ4z/91dAvqMH04rcDZVMcQZnREa7RZftwFU9MemDEHk7YnOfqUi0KIwFqiZpT4+HVce73DOhEdSrxuqX8AD2eU2NyLE++F5TDWvTvIFr52P/gJhx/Y/pYqXhwBjg7cdwHzscvLsZEQ4s3ag+z+f0q/KzNL8EdJf8io7rpvvXb5svpIwnNRdGW8LU+DycZ5kg05XHXD1eSIcMJIDz8zJMYKqKkGT2jSTtjK0sUduumMwiu0LIbM/shSOs2XgjkNJCbaV/MmSlYPTuy87rDFjSbahDNWiNKan6TMCKZImITap X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5503.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(366004)(346002)(376002)(39850400004)(136003)(396003)(6486002)(52116002)(956004)(36756003)(8676002)(2616005)(6512007)(44832011)(86362001)(6506007)(26005)(186003)(316002)(54906003)(4326008)(16526019)(1076003)(8936002)(478600001)(5660300002)(6916009)(66476007)(66946007)(83380400001)(2906002)(6666004)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: TegSk1oPAAP3QLNDQORLqT1SvmLC+eR27AhAnZUV78wTQ55bA7k1xia5LLJYtV1aRrSsk/dY0n6R2hSDVICd3QfjyxI/k9M5ZvxUOWikRsHnbzmEJSjqWto+Qpxz9vZIF2xGwoBQlGaegQDBMHMGhgjCNI/CG7o3Ffgi4yh+vWePrjt/iyFUOIG9t+nzqNBRpOv6TFFysSZGYSkkxRqWhGNbbkPbPxU4jQh7peQDIO+JnP1h2vDOc0/0axI1axyus3tviTSQfK1ajKw6edHjaKLSQ4X2S2+KTPRelrKl3WYeB3GX2ATICFPzJA4tpiWEijuUg3FniLxM6EuFH6ZTAiTPht++oIRpLm3P9d38jb9eAt8+qgtaITepriiZ8NGpKQ9n0paWbsn5ifQM371PUmztjpB/IxewGt6j5an+tJbpBOEvE+UabVcm/QIWjzdmLZm2IUFPrGObJalAPSI6kLVfvFe2bOLUcnNtaBVPxNQ= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: ecc07b10-647b-45e8-232b-08d8167b3d4b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2020 07:09:43.9617 (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: U2tVbVRsH+vqdlBn9k/1xB6O23pwi5P9eWS44WJciRr5EDf3GtlMFZDxycBC1DBqilnOBgH9Z8jBUydFOzfyqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5726 X-Virus-Scanned: clamav-milter 0.99.2 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, MSGID_FROM_MTA_HEADER, SPF_HELO_PASS, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-6.smtp.seeweb.it X-Mailman-Approved-At: Mon, 22 Jun 2020 09:11:40 +0200 Subject: [LTP] [RESENT PATCH 1/5] tst_net.sh: Remove rsh support X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" From: Petr Vorel rsh is not used nowadays. When was the first network library version added in 18739ff06 (2014), it was a default + and ssh replacement was optional. Netns based single machine testing was added in 5f8ca6cf0 (2016). After 6 years it's time to drop legacy rsh. ssh based testing setup requires only RHOST variable, TST_USE_SSH has been removed as unneeded. Also check for ssh in tst_rhost_run(). We still keep $LTP_RSH for some of the network stress tests, which has not been ported to tst_net.sh yet. Suggested-by: Alexey Kodanev Signed-off-by: Petr Vorel --- testcases/lib/tst_net.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh index 806b540cd..1b96b3bf4 100644 --- a/testcases/lib/tst_net.sh +++ b/testcases/lib/tst_net.sh @@ -136,7 +136,7 @@ init_ltp_netspace() # -b run in background # -c CMD specify command to run (this must be binary, not shell builtin/function) # -s safe option, if something goes wrong, will exit with TBROK -# -u USER for ssh/rsh (default root) +# -u USER for ssh (default root) # RETURN: 0 on success, 1 on failure tst_rhost_run() { @@ -166,14 +166,12 @@ tst_rhost_run() return 1 fi - if [ -n "${TST_USE_SSH:-}" ]; then - output=`ssh -n -q $user@$RHOST "sh -c \ - '$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'` - elif [ -n "${TST_USE_NETNS:-}" ]; then + if [ -n "${TST_USE_NETNS:-}" ]; then output=`$LTP_NETNS sh -c \ "$pre_cmd $cmd $post_cmd" $out 2>&1 || echo 'RTERR'` else - output=`rsh -n -l $user $RHOST "sh -c \ + tst_require_cmds ssh + output=`ssh -n -q $user@$RHOST "sh -c \ '$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'` fi echo "$output" | grep -q 'RTERR$' && ret=1 From patchwork Mon Jun 22 07:09:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1314097 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mysuse.onmicrosoft.com header.i=@mysuse.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-mysuse-onmicrosoft-com header.b=fMMKiAUn; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49r0w46PM3z9sSF for ; Mon, 22 Jun 2020 17:12:04 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 078063C5E8B for ; Mon, 22 Jun 2020 09:12:02 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [IPv6:2001:4b78:1:20::6]) by picard.linux.it (Postfix) with ESMTP id 926683C2B12 for ; Mon, 22 Jun 2020 09:09:47 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20066.outbound.protection.outlook.com [40.107.2.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id D85AA14017F5 for ; Mon, 22 Jun 2020 09:09:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FbnnXspiIivu2vHLEZx/14i6QXTGleCPUJ9WC+SO3sb5yExJq41BxbtAEjCMD99iJSigv3n4BwQ6+/wy0uPtwX+UuBVwLANP/pQdBcltczfOOMfKTAg7k2lSlK4W6jJPdcwWTeKRlbHJBpSh5btLiPm0hOCZlVw4xSKih7qDXsosiWHlgwbyLinV8BvjyDFxEXIXA2XIqhY831HWE4n3Pe9ABnS6yaaSmpwmgdq6a2oVyrNR563nHJ0k1tTYAJ+Pe+j7ki63QyGjS0CIgGf7zd9P8/mFKQ7ZZBYpA7QkzJUpwzQU6Oqb58QN1kKw77OQBNlHel9suppwfz+7CPaMXg== 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-SenderADCheck; bh=49ZLUdOhUe2VEmofHvUDnPC6xwdtH0J69Q43vrZv2rU=; b=WSNibayMk7LgMUM+1WmGz+u7X81LtHWLLIRjyaFkoaI9Na0CTVETQE/1oQfEApwcwXgmeSod5ihcFJRusZlxiCl5q5NeMZe+88BrBzhwP/z/rvP4mP6ateW1RLvWoV12ZrfLHe47NIHCYqMatlsqULCpqwA68sesyidw5t6qMXPhXQVfpaCQxMUXh5mFBwQUDo/aK5Q4aGMCXWqpp8UcKHK666n+Kbr2enSOW/k9SydamZ/cDbgbcokthZW9CxQArON9/ZJ7L6FGYGo6OlNVxxC4puclRi9aQxclUjV9SDKarpbRkJfKIRpF6+qynfVyR3zFomtYhgCpogUTE27gdw== 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=mysuse.onmicrosoft.com; s=selector1-mysuse-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=49ZLUdOhUe2VEmofHvUDnPC6xwdtH0J69Q43vrZv2rU=; b=fMMKiAUnRqM0Tmk1E8D3PwrCxeyMChm/Nlyg7f/SDdlMdDlgvS21tnplEXOkDNg/Iesg8cd06UjLiqetS67BpIX51koozVbM94L12i9xkgfvSvIX4zPPaLxLJVolioYMagjmpZSbhaVAdZl8LYz8HL5Tj9VMj09FQO/xCkmoio9DrOn3DzMRAmPW8wxPVYdGz6v/elB8FvKoH+P42vRwDKz0qctnzQZP6S424Iygs6CUOmxBTNHclJF30Y3DrKyGxZM71naYkpk1sJXZjl1IIoSfzJW8Pjsq5E/m9wwQPos3ZxwGVQIfGUYdzwOQgrLTpWwzigRM/xZ8SNLtbW+NcA== Authentication-Results: lists.linux.it; dkim=none (message not signed) header.d=none;lists.linux.it; dmarc=none action=none header.from=suse.com; Received: from VI1PR04MB5503.eurprd04.prod.outlook.com (2603:10a6:803:d1::13) by VI1PR04MB5726.eurprd04.prod.outlook.com (2603:10a6:803:e5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Mon, 22 Jun 2020 07:09:45 +0000 Received: from VI1PR04MB5503.eurprd04.prod.outlook.com ([fe80::394b:92df:1d86:d33e]) by VI1PR04MB5503.eurprd04.prod.outlook.com ([fe80::394b:92df:1d86:d33e%3]) with mapi id 15.20.3109.027; Mon, 22 Jun 2020 07:09:45 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Mon, 22 Jun 2020 09:09:08 +0200 Message-Id: <20200622070911.16123-3-petr.vorel@suse.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200622070911.16123-1-petr.vorel@suse.com> References: <20200622070911.16123-1-petr.vorel@suse.com> X-ClientProxiedBy: AM0PR07CA0016.eurprd07.prod.outlook.com (2603:10a6:208:ac::29) To VI1PR04MB5503.eurprd04.prod.outlook.com (2603:10a6:803:d1::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dell5510.arch.suse.de (62.201.25.198) by AM0PR07CA0016.eurprd07.prod.outlook.com (2603:10a6:208:ac::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.10 via Frontend Transport; Mon, 22 Jun 2020 07:09:44 +0000 X-Mailer: git-send-email 2.27.0 X-Originating-IP: [62.201.25.198] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b01901aa-932f-4f44-7c2b-08d8167b3daf X-MS-TrafficTypeDiagnostic: VI1PR04MB5726: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-Forefront-PRVS: 0442E569BC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jj21zBOyYC5RPmzVslxrytpI4G6+lq/kTtCnrZPM6iMWUZCL0ldnUZf9CvovHBNsAi9ooJJvnrWu9NWV82456Zlz3kbwR70kKki84jMfLRDDvLVueadbR9hxYRAXT2DZlKkntvQkJ7C5kVBQpDMMniWzjyr21a8hTFoOorB4oFZCviVc5/Ht71RLr1vkY5TQe4vIajbWTJhuJW0x0DOgzAqkETqGtfSFNKHYdVewIlPM++D80VhNyOiwlq/iUVut00XZYLfzCKnMyKdG5NQCTpZ5DTIezncViVGxvaQkQ/NbbqHKU79rSFZJsD1ek2Ze1KUsfOCtoB2Vf/yHziSGUw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5503.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(366004)(346002)(376002)(39850400004)(136003)(396003)(6486002)(52116002)(956004)(36756003)(8676002)(2616005)(6512007)(44832011)(86362001)(6506007)(26005)(186003)(316002)(54906003)(4326008)(16526019)(1076003)(8936002)(478600001)(5660300002)(15650500001)(6916009)(66476007)(66946007)(83380400001)(2906002)(6666004)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: MYfih61innzPtBNZNc5ZrQ8RlqL81aaHck0NT2SD4HfOdIZHyhKeQ7RGPLe109G7pdX+C09pb213NBkWnkp3p1gBqEmYQD/wvSxe/qdbiBiI+COmJnEEjy82LFFsJaXJQagrqdxPrO2pRwEKq1+0Fr2Q0mZtKVeskOdWJ5rzW6ABBrEVS+aXwfBYcwTiGKw6kzdSRB6Zq7E6QEJ91PJ08aAR/GtwB+oe+LPMb92xJ4nwjYcC4CRI03qDRlI57N9C5KPtkuJkC0JyEmU6xuVY1iosG93eem1V822t7BIbx42aN2bdDf6XlqrK5iMalTLZ9Br4sNQWHq49iWhPnLKtdLJRTaBFPsIwDLC4v9YQaTMb6/yWXS9xGQonpyLNSGdL6NYNGgBBfNdEd4MfFSjpdYSV1wGYguvd25i4FqIoE81FNoS6/8gWwTFYonDzygvxgfvdWf4DlKF9KJPxbiAh/oZw+RaiJoJJvtzwEcy508M= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: b01901aa-932f-4f44-7c2b-08d8167b3daf X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2020 07:09:44.5633 (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: nt7ZMjIa5UKqfZBppqdBqklEjmq7/MXtkRwrcdL+yKnmGllFlva+vhMPiHADGPV99TM6o6Gcq8F0d6jfYSuqhg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5726 X-Virus-Scanned: clamav-milter 0.99.2 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, MSGID_FROM_MTA_HEADER, SPF_HELO_PASS, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-6.smtp.seeweb.it X-Mailman-Approved-At: Mon, 22 Jun 2020 09:11:40 +0200 Subject: [LTP] [RESENT PATCH 2/5] net: Update README.md X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" From: Petr Vorel * to previous commit (dropped rsh based testing) * fix formatting * remove suggestion to run tests for 24 hrs (we lower variables for stress testing in the past) * update package names * mention testcases/network/stress/README Signed-off-by: Petr Vorel --- testcases/network/README.md | 73 +++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 39 deletions(-) diff --git a/testcases/network/README.md b/testcases/network/README.md index 3a9c98125..a7eb40974 100644 --- a/testcases/network/README.md +++ b/testcases/network/README.md @@ -1,25 +1,25 @@ # LTP Network Tests -## Pre-requisites -Enable all the networking services on test machine(s): rshd, nfsd, fingerd. - ## Single Host Configuration -It is a default configuration ('RHOST' is not defined). LTP adds 'ltp_ns' -network namespace and auto-configure 'veth' pair according to LTP network -environment variables. +It is a default configuration (if the `RHOST` environment variable is not +defined). LTP adds `ltp_ns` network namespace and auto-configure `veth` pair +according to LTP network environment variables. ## Two Host Configuration -This setup requires 'RHOST' environment variable to be set properly and -configured SSH or RSH (default) access to a remote host. +This setup requires the `RHOST` environment variable to be set properly and +configured SSH access to a remote host. The 'RHOST' variable name must be set to the hostname of the server -(test management link) and PASSWD should be set to the root password +(test management link) and `PASSWD` should be set to the root password of the remote server. -In order to have RSH access: -* Edit the "/root/.rhosts" file. Please note that the file may not exist, +Some of the network stress tests hasn't been ported to network API and still +use `rsh` via `LTP_RSH` environment variable. To workaround this is best to set +it to SSH, in order to run these tests with RSH following setup is needed: + +* Edit the `/root/.rhosts` file. Please note that the file may not exist, so you must create one if it does not. You must add the fully qualified hostname of the machine you are testing on to this file. By adding the test machine's hostname to this file, you will be allowing the machine to rsh to itself, @@ -29,13 +29,13 @@ as root, without the requirement of a password. echo $client_hostname >> /root/.rhosts ``` -You may need to re-label '.rhost' file to make sure rlogind will have access to it: +You may need to re-label `.rhost` file to make sure rlogind will have access to it: ```sh /sbin/restorecon -v /root/.rhosts ``` -* Add rlogin, rsh, rexec into /etc/securetty file: +* Add rlogin, rsh, rexec into `/etc/securetty` file: ```sh for i in rlogin rsh rexec; do echo $i >> /etc/securetty; done @@ -44,48 +44,43 @@ for i in rlogin rsh rexec; do echo $i >> /etc/securetty; done ## Server Services Configuration Verify that the below daemon services are running. If not, please install and start them: -rsh-server, telnet-server, finger-server, rdist, rsync, dhcp-server, http-server. +dhcp-server, dnsmasq, http-server, nfs-kernel-server, rpcbind, rsync, vsftpd + +RSH based testing requires also: +rsh-server, telnet-server, finger-server, rdist Note: If any of the above daemon is not running on server, the test related to that service running from client will fail. ### FTP setup -* In “/etc/ftpusers” [or vi /etc/vsftpd.ftpusers], comment the line containing -“root” string. This file lists all those users who are not given access to do ftp +* In `/etc/ftpusers` (or `/etc/vsftpd.ftpusers`), comment the line containing +"root" string. This file lists all those users who are not given access to do ftp on the current system. -* If you don’t want to do the previous step, put following entry into /root/.netrc -machine login root password . -Otherwise, ftp,rlogin & telnet fails for ‘root’ user & hence needs to be -executed using ‘test’ user to get successful results. +* If you don’t want to do the previous step, put following entry into `/root/.netrc`: +``` +machine +login root +password +``` +Otherwise, `ftp`, `rlogin` and `telnet` tests fails for `root` user. ## LTP setup -Install LTP testsuite. In case of two hosts configuration, make sure LTP is installed -on both client and server machines. - -Testcases and network tools must be in PATH, e.g.: +Install LTP testsuite. In case of two hosts configuration, LTP needs to be installed +and `LTPROOT` and `PATH` environment variables set on both client and server +machines (assuming using the default prefix `/opt/ltp`): ```sh -export PATH=/opt/ltp/testcases/bin:/usr/bin:$PATH +export LTPROOT="/opt/ltp"; export PATH="$LTPROOT/testcases/bin:$PATH" ``` -Default values for all LTP network variables are set in testcases/lib/tst_net.sh. -If you need to override some parameters please export them before test run or -specify them when running ltp-pan or testscripts/network.sh. +Default values for all LTP network parameters are set in `testcases/lib/tst_net.sh`. +Network stress parameters are documented in `testcases/network/stress/README`. ## Running the tests -To run the test type the following: ```sh TEST_VARS ./network.sh OPTIONS ``` Where -* TEST_VARS - non-default network parameters (see testcases/lib/tst_net.sh), they - could be exported before test run; -* OPTIONS - test group(s), use '-h' to see available ones. - -## Analyzing the results -Generally this test must be run more than 24 hours. When you want to stop the test -press CTRL+C to stop ./network.sh. - -Search failed tests in LTP logfile using grep FAIL . For any failures, -run the individual tests and then try to come to the conclusion. +* TEST_VARS - non-default network parameters +* OPTIONS - test group(s), use `-h` to see available ones. From patchwork Mon Jun 22 07:09:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1314098 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mysuse.onmicrosoft.com header.i=@mysuse.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-mysuse-onmicrosoft-com header.b=D6xTJzPP; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49r0wF6tz0z9sSc for ; Mon, 22 Jun 2020 17:12:13 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id C58123C6722 for ; Mon, 22 Jun 2020 09:12:10 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [217.194.8.6]) by picard.linux.it (Postfix) with ESMTP id DCCCC3C2B12 for ; Mon, 22 Jun 2020 09:09:47 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20066.outbound.protection.outlook.com [40.107.2.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id 92C3414017DB for ; Mon, 22 Jun 2020 09:09:47 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eOzD8W/fnSI0uLdFlByPI+7YMP8FXPTX8yQG0FQ2yS8+R0B2ahQT05R7DVTLS5Ry+FsZQ1kYIc4Q/b7F2IOyFicFCoeFELdm21zotF4QL5OY2R3s8WrR3nJMDDI+boSDidp6k3RhLoOBv5aK1CxqGzzqX7sAjLqnqREcH7WQKH/mjmhVqbeHgheP+KtPx0jBiZA0LzGFZOFH4PFrBXWQowHrprtpJrO8CsaspmgRjn8F0J0K+6zEpOWie2nd+U4ZhBhR1U0S6IHg6xJ59j76zZN0hfAwuaCf2zTBXE+HXAFRfwihbZGyfurgYyL9QOUgpzQfW0XHofVhJhRHHnwaeQ== 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-SenderADCheck; bh=2A8Gi9pqXZGkGjpfjUsI7KvSCZ0XZ7U1rLaLvz0Ln4Y=; b=j22MuzS3mat5fAWv+Nd+2iJeGcTQTLvyP5h6r/PKE6c3HENPB6RqtEv9j8c+Bl5jp//UhB4DB1GnlsoDyAeYMQCGCMQwETts0oIPsqbZRMukXYJ2gDrLhiAR/uc0we36u+mVjunaDJ/db5gjYxc23AD8Fm6rj3ttLMTpMsL8BtV8FbIIilB5OfJL4HoPKQl6wgirnwFXkORAywjFCKXveSbOa2uOZlp6rV9fqiNBiPUqyCrQVO/hyMz12v779t8X6Zg2diHp0M6IPr+yJN06+B4uNBva4fB6/TS6a+0H/1eUmNNlnJWysW1WuYcRyni3mNhvnOA4xaumYGLL1E0x9A== 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=mysuse.onmicrosoft.com; s=selector1-mysuse-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2A8Gi9pqXZGkGjpfjUsI7KvSCZ0XZ7U1rLaLvz0Ln4Y=; b=D6xTJzPPEp4DaAjIkCfV8hF3wVoNmMN5tuKU6d7nobPbyQHAkS6YfLwb2808do1tsvssE6F3uz+KjVzWMTOS8/U1EWH7uHgBInKF+5IyOzSjnlPDOO6vwFs/upQizCNwOeRoOzhnaN5+0l/lv+Lx3EpxxKzO6W4n9XYJYJKC6JTVhf9++TAq96HiBH6fpoq2nF0ZNgm+NaBz5oLIuCVq7oWSUmBzp523dyfsV2A51cHV3vrOFKoeo0kbvf47ljXWc02YV3xqmD2mPhyDiXi8Gx1omkJGklNTwJfbYM+cV8C78cYD83v2QTWby5+B+aTp9yvAAwyGhbJK6Lhfb8T7wQ== Authentication-Results: lists.linux.it; dkim=none (message not signed) header.d=none;lists.linux.it; dmarc=none action=none header.from=suse.com; Received: from VI1PR04MB5503.eurprd04.prod.outlook.com (2603:10a6:803:d1::13) by VI1PR04MB5726.eurprd04.prod.outlook.com (2603:10a6:803:e5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Mon, 22 Jun 2020 07:09:45 +0000 Received: from VI1PR04MB5503.eurprd04.prod.outlook.com ([fe80::394b:92df:1d86:d33e]) by VI1PR04MB5503.eurprd04.prod.outlook.com ([fe80::394b:92df:1d86:d33e%3]) with mapi id 15.20.3109.027; Mon, 22 Jun 2020 07:09:45 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Mon, 22 Jun 2020 09:09:09 +0200 Message-Id: <20200622070911.16123-4-petr.vorel@suse.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200622070911.16123-1-petr.vorel@suse.com> References: <20200622070911.16123-1-petr.vorel@suse.com> X-ClientProxiedBy: AM0PR07CA0016.eurprd07.prod.outlook.com (2603:10a6:208:ac::29) To VI1PR04MB5503.eurprd04.prod.outlook.com (2603:10a6:803:d1::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dell5510.arch.suse.de (62.201.25.198) by AM0PR07CA0016.eurprd07.prod.outlook.com (2603:10a6:208:ac::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.10 via Frontend Transport; Mon, 22 Jun 2020 07:09:44 +0000 X-Mailer: git-send-email 2.27.0 X-Originating-IP: [62.201.25.198] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9cddcdd6-5041-48c8-428d-08d8167b3e06 X-MS-TrafficTypeDiagnostic: VI1PR04MB5726: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 0442E569BC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SSrW2NBh5pKsOq7oeeP0l+MJMNihpDfeRfHKPyoYCTfnwVIv5ogBlJgEshtrp9MfGLmntbJ0av6fx1S/sC8tHBHZUctgK4R1qN10cAsrbMCfi/JQdaQfsdhtS3Dat2CaXzGdw9Cb2p5wKw3J1LZDxzVWo8zuaW1OqJ2Ltxs6+yt8lZFkI0M5qdXqXRCAGY+ZUHe4WGLbVGpXjvgYiOYCNFreszEN2gE5EvCQtbzmeYQulH1sy4to6QcUic0Y487haSYlmn+kiFKD7xSrC/Qv3cSgkaYYisVjFlJ6gKo3/CqEXNWrEXEzwLL4oYBKSM69qDvx5I4eGg7wtRvig2LZTg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5503.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(366004)(346002)(376002)(39850400004)(136003)(396003)(6486002)(52116002)(956004)(36756003)(8676002)(2616005)(6512007)(44832011)(86362001)(6506007)(26005)(186003)(316002)(54906003)(4326008)(16526019)(1076003)(8936002)(478600001)(5660300002)(6916009)(66476007)(66946007)(83380400001)(2906002)(6666004)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: cK/udthury0tX6Jmu5vBWepEd08caSzkvJi0m6ELNQp3cZyW9ICdbTAdoyit/e+oh71mHvu6jfA7vOblCtXRz0NO4oalECqyCnFHR7iEPUSbFMZbSkRvVuYQU4/MmsKh7j/wR4ScAccZHOZ0EwoC6HKDWS6rgekwmLSZsioN6OJqRfG1YYnaqpKfNK6ojcUd7f6SxyOzAK+ktObu5xk4DQsgPOUHTz46OxyXVCu07wLIzAe88g4GypHgvY80W3659YXeL4zHMHAPZWVpdZ0l+UCTR1ZDGDAE1p7PD1ssaS5zHtABhfAA/EftlxKtXcUInS2ahQXSH8et0JuLZuQdsNGahrgwiaNzw3HC9oEpF5OUHQZuheSuOt3NPauDFmZqcU61T1ojcN1ZL7l5E+bbb85kNPA+C0qYGfYxmoUf8w4nMYhNOcmxmvJ1E8S9AFPLrMLzITTgckJ8qqL28Ciq0O4ohq4kzd/L0FehF7pu/cY= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9cddcdd6-5041-48c8-428d-08d8167b3e06 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2020 07:09:45.1820 (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: 7epTKkcF5WdNX2QsxiTb5Or18DwJuPOnYbztxaxP3s3DderEFp/0zM8VD2g9gXJu+hDPrtIYRIgDCDxzwU+raQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5726 X-Virus-Scanned: clamav-milter 0.99.2 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, MSGID_FROM_MTA_HEADER, SPF_HELO_PASS, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-6.smtp.seeweb.it X-Mailman-Approved-At: Mon, 22 Jun 2020 09:11:41 +0200 Subject: [LTP] [RESENT PATCH 3/5] tst_net.sh: Drop 'sh -c' use from ssh in tst_rhost_run X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" From: Petr Vorel This simplifies the command and allows to use double quotes in command parameter for ssh, as it removes single nested quotes of command parameter (thus fixes like c1a2d53f6 "network/nfs_lib.sh: Use double quotes for grep pattern" are not needed any more). NOTE: 'sh -c' is still required for netns based testing, but does not use nested quotes. Now both variants use only double quotes. Suggested-by: Alexey Kodanev Signed-off-by: Petr Vorel Acked-by: Alexey Kodanev --- testcases/lib/tst_net.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh index 1b96b3bf4..2ed570a6b 100644 --- a/testcases/lib/tst_net.sh +++ b/testcases/lib/tst_net.sh @@ -167,12 +167,12 @@ tst_rhost_run() fi if [ -n "${TST_USE_NETNS:-}" ]; then - output=`$LTP_NETNS sh -c \ - "$pre_cmd $cmd $post_cmd" $out 2>&1 || echo 'RTERR'` + output=$($LTP_NETNS sh -c \ + "$pre_cmd $cmd $post_cmd" $out 2>&1 || echo 'RTERR') else tst_require_cmds ssh - output=`ssh -n -q $user@$RHOST "sh -c \ - '$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'` + output=$(ssh -n -q $user@$RHOST \ + "$pre_cmd $cmd $post_cmd" $out 2>&1 || echo 'RTERR') fi echo "$output" | grep -q 'RTERR$' && ret=1 if [ $ret -eq 1 ]; then From patchwork Mon Jun 22 07:09:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1314099 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mysuse.onmicrosoft.com header.i=@mysuse.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-mysuse-onmicrosoft-com header.b=EmaGgKEh; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49r0wQ3qKRz9sRN for ; Mon, 22 Jun 2020 17:12:22 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id D6D773C65E0 for ; Mon, 22 Jun 2020 09:12:19 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [217.194.8.6]) by picard.linux.it (Postfix) with ESMTP id 2D4C03C2B12 for ; Mon, 22 Jun 2020 09:09:48 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20066.outbound.protection.outlook.com [40.107.2.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id DE45F14017CE for ; Mon, 22 Jun 2020 09:09:47 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mQO54s3BznKF3p8xthmz1lK0x+eQiYVCrqydZ8LXWNlVNazQI5CkxeKSlGtTCrsR1NWIvpWA8wCu4t1qwMNcicLsuWlkCV124WW6S/3KCpbA0DRmFh9rj6GzT3q8ETjUqjSs9eR3CJ1/Uce7tJT0BGG3d9bHpAwF2yztFJJgKiwbgbuzoK4w+2whBDUSG5mzmRMSHoNAhrwzfn8eR2JI11IptJ3VC/CyeVgtkcF6BZ2rtoAy2xN2TBt4eeJKLaS8OImlq0GX6R9AAr2pGucbhtxmctgOxvrsGX1AyuZnbTP65ZKW/8t4TYEllVJcYXgf3tgkE7UG+RlA9Kr6/q52SQ== 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-SenderADCheck; bh=et5NVp5a8UEQy6MHkRztmhthoHyXWuz3sJ0Tu1x44jw=; b=F7rrcDltuRsjZ0X0GRWTwQMIjVza5m2dB1439l8ISL50wM3rlVqNnYhdDSewBCq6u56XFa3b2+QqWoWe0VUmX3KB3Owgt93mdcBya2yN6Ieb9nruUpR441pmFc+LCe1pr8y3lKLtCP9euayX9daW1HyN7zZH72XWjeBNYHbep+xMp7lUFCUWruxW4LtiKo7meroPLpV0xQuOS019B6E60x9xHjqxNJE1pf7XE7Ovk2wCBka4jrdhrHdDFgPumGv5PbB640wEmhF/5tKSZuBRRSk0lwf5ZvxuIi9gezKdtOPrMQ3mEEVE9BZZdfPAsdRi3sgUhixuhbjh3y52x586GA== 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=mysuse.onmicrosoft.com; s=selector1-mysuse-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=et5NVp5a8UEQy6MHkRztmhthoHyXWuz3sJ0Tu1x44jw=; b=EmaGgKEhDeoID2rKfyAKkHvwOyZR6nMnOrY8RLxIWTXW0j9zt+TzpCe5JdeLtSYEnLco4AomGWVlgtg1nVZ20tyH/wTc0N2GhFZUOcqfj0O4HXM3QPLS6mwtYW5Vuk2okhZ+lTTz4a5q6rwibIRVtk0dcqQmN3sVxES+zFhDzpmlRczAswD/6gif/kwK2Of0MoKdpAQhnTNSjn46JSnoJY43zTzMUI6MJdNL8yAVUnSRP2z4155HzlywHoHDBI8azD86L9ZT64F9FGPy1mSDejzx1GLnWNzZ2e2XTTq9DCONLHxgVKYyEe1owGPgewG/fbCYaNxG0iGJHk+ELGlVrA== Authentication-Results: lists.linux.it; dkim=none (message not signed) header.d=none;lists.linux.it; dmarc=none action=none header.from=suse.com; Received: from VI1PR04MB5503.eurprd04.prod.outlook.com (2603:10a6:803:d1::13) by VI1PR04MB5726.eurprd04.prod.outlook.com (2603:10a6:803:e5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Mon, 22 Jun 2020 07:09:46 +0000 Received: from VI1PR04MB5503.eurprd04.prod.outlook.com ([fe80::394b:92df:1d86:d33e]) by VI1PR04MB5503.eurprd04.prod.outlook.com ([fe80::394b:92df:1d86:d33e%3]) with mapi id 15.20.3109.027; Mon, 22 Jun 2020 07:09:46 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Mon, 22 Jun 2020 09:09:10 +0200 Message-Id: <20200622070911.16123-5-petr.vorel@suse.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200622070911.16123-1-petr.vorel@suse.com> References: <20200622070911.16123-1-petr.vorel@suse.com> X-ClientProxiedBy: AM0PR07CA0016.eurprd07.prod.outlook.com (2603:10a6:208:ac::29) To VI1PR04MB5503.eurprd04.prod.outlook.com (2603:10a6:803:d1::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dell5510.arch.suse.de (62.201.25.198) by AM0PR07CA0016.eurprd07.prod.outlook.com (2603:10a6:208:ac::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.10 via Frontend Transport; Mon, 22 Jun 2020 07:09:45 +0000 X-Mailer: git-send-email 2.27.0 X-Originating-IP: [62.201.25.198] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fe303318-9414-4297-e99f-08d8167b3e6a X-MS-TrafficTypeDiagnostic: VI1PR04MB5726: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:60; X-Forefront-PRVS: 0442E569BC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5x89unNfFZseXIyR3MBox/GfxAWqNUqyaqsbx4OBwEYb7KBBka65Y7NmOmWXENo3F8ZhQFPPVnD8f2rIS0hh7tgDZ94s284mVs72s+gCUl30FtoihrUZFmViz+jtgNpEWnaadCpl3ErIUeJImI6p3YcQx1jru+E4PzxTL6mOo2oYR+lRk+zEg/GPhmgpyqU95QU8lWs94kr2s+Up0oT98TbN1yOuJ0IVPWCuLTmpKya2UFwdGzpbCylb73T81wFG3YzjaGgTCtOfSLXkEFBDiETRg0M6GKdGSZ8ZoCnDl5+/TezvObRA1IpPwRYDmANv X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5503.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(366004)(346002)(376002)(39850400004)(136003)(396003)(6486002)(52116002)(956004)(36756003)(8676002)(2616005)(6512007)(44832011)(86362001)(6506007)(26005)(186003)(316002)(54906003)(4326008)(16526019)(1076003)(8936002)(478600001)(5660300002)(6916009)(66476007)(66946007)(2906002)(6666004)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: o8t9SnAkV+ieoSejsIAI//AnEHmdv/lkO1FDgFn81dQR/qQOCm7shGrmwEiSF6UNZVuiQIUHvgq6zmWYef/Mqk1uP0bu5BJBG6rcy+I+W4rggXPvz+rxD/0MkP5NSZPNAvBMaQsvIsznqBvZQRMR8Js2D7i5oJDCJ3XUnvRkrK5ZqLj5y0r8GAHm+qGEpeGimmRydO6Rl4/T/PSqOKZY1YdYRBzbBy00askwnHtBldN7H5XNQmQwvMR0DX0WfuFqOvRIxEqf0NlUiRjoF7dX0SZEnC5UEIFkClEO43QT69+ts85fW7uNgBHEl5qwPCjxL9VF6FE1tR2jG66N7VRpbkpqUnfZHji3beL0FS3Bo8CV4BN3Q1QXI5hp6uOS2NfU0cY6K0k+zt/DdY/lgcucjYChBazUvGPrHNDWX88r7qQCr9B+2GIHLDu0Be3Ajew11yg7ajLgaqdu5PICGkyp9FcGsrcrEc3KMgHWAL9xSuo= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: fe303318-9414-4297-e99f-08d8167b3e6a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2020 07:09:45.8346 (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: bEM/fK9Qghi7q4inmh/fhFUVafK0O3JFj/ybNALmsKDTYtI5+Q+IaRmNY9JbmS6IOvAy23KrpQh2xzOFQsWpPw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5726 X-Virus-Scanned: clamav-milter 0.99.2 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, MSGID_FROM_MTA_HEADER, SPF_HELO_PASS, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-6.smtp.seeweb.it X-Mailman-Approved-At: Mon, 22 Jun 2020 09:11:41 +0200 Subject: [LTP] [RESENT PATCH 4/5] net/test: Add basic testing for tst_rhost_run X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" From: Petr Vorel Regression test for use of nested single quotes (fixed in previous commit). Signed-off-by: Petr Vorel Acked-by: Alexey Kodanev --- lib/newlib_tests/shell/net/tst_rhost_run.sh | 25 +++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 lib/newlib_tests/shell/net/tst_rhost_run.sh diff --git a/lib/newlib_tests/shell/net/tst_rhost_run.sh b/lib/newlib_tests/shell/net/tst_rhost_run.sh new file mode 100755 index 000000000..4c034a4ac --- /dev/null +++ b/lib/newlib_tests/shell/net/tst_rhost_run.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2020 Petr Vorel + +TST_TESTFUNC=do_test +PATH="$(dirname $0)/../../../../testcases/lib/:$PATH" +. tst_net.sh + +do_test() +{ + local file="/etc/fstab" + + tst_rhost_run -c 'which grep > /dev/null' || \ + tst_res TCONF "grep not found on rhost" + + tst_rhost_run -c "[ -f $file ]" || \ + tst_res TCONF "$file not found on rhost" + + tst_rhost_run -s -c "grep -q \"[^ ]\" $file" + tst_rhost_run -s -c "grep -q '[^ ]' $file" + + tst_res TPASS "tst_rhost_run is working" +} + +tst_run From patchwork Mon Jun 22 07:09:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1314100 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mysuse.onmicrosoft.com header.i=@mysuse.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-mysuse-onmicrosoft-com header.b=G9jlfmgd; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49r0wc5MK6z9sRN for ; Mon, 22 Jun 2020 17:12:32 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 8421E3C6766 for ; Mon, 22 Jun 2020 09:12:29 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [217.194.8.6]) by picard.linux.it (Postfix) with ESMTP id F0D523C2B12 for ; Mon, 22 Jun 2020 09:09:48 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20066.outbound.protection.outlook.com [40.107.2.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id 2EEDC14017DB for ; Mon, 22 Jun 2020 09:09:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R4SBG++XMx49mbUgozcQ/aA1/F/iuRGHSi+5sYc/v9IBRzfvkHXs+YxtxvuEGhSSAI36hWtqgZ/AU1MGIp08TnDSNjZm8FYUgHWTDPyjoaJqfDlZsVEz3l4qMCOi5vy00q+METR8mv+lJrnwnjnkoIVoqwUlwVckutRxoik+LsN/rT0IcGpTspI0LMLow+k8Jm9Y4atpiVzq4Af5iP0Bkx5CAkXSMJiY4wzuyPLQoiv4sw09xAM1BG75IML3fiWk5AdA6ZrRAmxCRm/stoLbnEbUtOocOS/wx+eI/TaiXLnIhkSY3rzdC20mA7JJD0dIL8VxjI2wbhYoWatgH6mtLQ== 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-SenderADCheck; bh=RVMmX4r7Usv9dDc7BC8eU7WLO3N+zl1+/ZFm0ZdrNb4=; b=WSH9un0BP1r8yZ94dWjlXKitUXULOSIa6Xp6rbAzqYkM/gofM9GlDVOjHztOSAEe8Dp7/2wQPKg8COYQBe/7aNObQi/I9J9tLLnfRe8You86zyETssHkn+ap2TxsrJG1+yh+CAoR4FXDbcx0Zm5yc4CWJZdCgFb+Uof4/vDWD3scyxuK3MZuHu/WEut+R8yYpBBFzttsv2TA026oALfQ/J9BCO/SZD0oXrjmeRjHfhZGGMGp8tnWVglYvRXG4XdrilQ7yMBculJErvtj9K8og9NndPXGXArEhqmXonllE8XzQwLz7NU8nK1p2ETn5k27a6fjsC/7q+Is9mqgGLXFsg== 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=mysuse.onmicrosoft.com; s=selector1-mysuse-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RVMmX4r7Usv9dDc7BC8eU7WLO3N+zl1+/ZFm0ZdrNb4=; b=G9jlfmgdtijLRMSGd1hVKQBRzIPnycy5We4TTfMZHpNo2pqlTkdajV5ijgRf3znaEDePgYunmLUFYrHn80hgHMUVvP1z4Aa5ZnR5nPP6wM2CqYNbfjp+vx0r41wF7YYW5unOk0l9k0q8rn6a5c/63e8QdvZMDJIyX3MbnaCpK/in4q6t5deVE/X3EaC9eMpUFrIa3ca1DIW0WGa5EXUz9wgT+EJKL+E62VafHJOw3ZoQXOKoSH4jDSrvWdIT6k6FeNJJgVDAOSjIBFDGzl/PWVlU0JtJrkBIgtfFQa9pB3z+NFabiSbYLDvwTzACNpy/HNrbb/B9ItKLLiavUcILHA== Authentication-Results: lists.linux.it; dkim=none (message not signed) header.d=none;lists.linux.it; dmarc=none action=none header.from=suse.com; Received: from VI1PR04MB5503.eurprd04.prod.outlook.com (2603:10a6:803:d1::13) by VI1PR04MB5726.eurprd04.prod.outlook.com (2603:10a6:803:e5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Mon, 22 Jun 2020 07:09:46 +0000 Received: from VI1PR04MB5503.eurprd04.prod.outlook.com ([fe80::394b:92df:1d86:d33e]) by VI1PR04MB5503.eurprd04.prod.outlook.com ([fe80::394b:92df:1d86:d33e%3]) with mapi id 15.20.3109.027; Mon, 22 Jun 2020 07:09:46 +0000 From: Petr Vorel To: ltp@lists.linux.it Date: Mon, 22 Jun 2020 09:09:11 +0200 Message-Id: <20200622070911.16123-6-petr.vorel@suse.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200622070911.16123-1-petr.vorel@suse.com> References: <20200622070911.16123-1-petr.vorel@suse.com> X-ClientProxiedBy: AM0PR07CA0016.eurprd07.prod.outlook.com (2603:10a6:208:ac::29) To VI1PR04MB5503.eurprd04.prod.outlook.com (2603:10a6:803:d1::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dell5510.arch.suse.de (62.201.25.198) by AM0PR07CA0016.eurprd07.prod.outlook.com (2603:10a6:208:ac::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.10 via Frontend Transport; Mon, 22 Jun 2020 07:09:45 +0000 X-Mailer: git-send-email 2.27.0 X-Originating-IP: [62.201.25.198] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cbde07fe-a31c-438c-6536-08d8167b3ed1 X-MS-TrafficTypeDiagnostic: VI1PR04MB5726: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:421; X-Forefront-PRVS: 0442E569BC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KzV5St4CEdeakoHnGHtd8S/wIZ18Lv5MHaZRp/3gLSGxafo3yf6+EnZU/EaqgA4lvgmCw2zxOSU0RR/aTvWr2xgCuYLqJ7l8xpVTRG2doFPuV8PpZVJFd7xnSJUdo6vAB5Mh98k6gUX4Nt+9q6/io+6fmc21Lr0A6Ebglu6p7wZYX94SwV577h6qR3nVoy8hrqDMHBGCNi+U5tjVLbjIXPWewN9Klwe8A1J67MhBJ/785bQM1/yM+3v4zKo+ZNUX+YQf64h0LT3TxEXKbUvFmuo6cXK/0Yesw3+TQErrtCMueWQ+20uLs3rQtRgguD8xUwPRUy/kW7RhS7FVF0w9I1IOn+vikuUB2Wzlv6cAkgoBSzHMS6FDtNdJmxOMKQC6RMs/jbZnd6XSCLZR8pTUKQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5503.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(366004)(346002)(376002)(39850400004)(136003)(396003)(6486002)(52116002)(956004)(36756003)(8676002)(2616005)(6512007)(44832011)(86362001)(6506007)(26005)(186003)(316002)(54906003)(4326008)(16526019)(1076003)(8936002)(478600001)(5660300002)(6916009)(66476007)(66946007)(966005)(83380400001)(2906002)(6666004)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: YKb6F8zh17qQE+UVn/3gwgpIOdQUSXHFX8jV3isZAQScI9zJ2c8xc1H+7X93JH9SkT9IeFJ8Kc3BRvLoZCj2D+uZzA2F6hozcP2wHsUVeviPcsa8wlFjnqAdCW7YdegkPFqCjIxGXp6Zivwj2xecDGYm1nErF9jeYlbxSSQgN2jbxUKhOlloaqLOB5Gj987nK/crfbPgQfosdozoKJoo9M7iuUAeDS5BZMgijoEpRMSsXJ4VMfZgrhDww3nThEaLRV7pzPFTRBiBIi92/oGrL3Yjm2I5vmfY/I2Sh+7VgU1OhXEFVE8SrTTZAG/eADyFCznSkmJATtNyq8PcVDHLNHFEVJmkjN2CrfRZ020D4Y6br1tHPnyJ7TrBtCCqBphwK5tD+RSg3B8y514eHWlBmV3qMnk07IJ77mNzPS1aopS/K0VFbQoSmkhaJ21fG4IiiUU30Btq5v/FnVlp4ewMRxHIYQQ+qno93dDtAlQssPM= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: cbde07fe-a31c-438c-6536-08d8167b3ed1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2020 07:09:46.4643 (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: EnKGvbdxUui/W6HhuA6mqYU491LTwSLiMrwHJA58iotBjj8xx9FXKb6a/bCvsqSpUUJbP/nN9iP1uvHz42M8lQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5726 X-Virus-Scanned: clamav-milter 0.99.2 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, MSGID_FROM_MTA_HEADER, SPF_HELO_PASS, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-6.smtp.seeweb.it X-Mailman-Approved-At: Mon, 22 Jun 2020 09:11:41 +0200 Subject: [LTP] [RESENT RFC PATCH 5/5] st_net.sh: tst_rhost_run: Add -d option (debug) X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" From: Petr Vorel -d debug mode (print command and netns/ssh handling into stderr) Add tst_net_debug() simple helper for printing into stderr. Also use new parameter in tst_rhost_run.sh. Signed-off-by: Petr Vorel --- Hi, RFC: I use it quite a lot, but not sure if needed. Probably using $TST_NET_DEBUG instead of -d would be better. If we merge "tst_test.sh: Print tst_{res, brk} into stdout" [1], simple tst_res_ could be used. I was also thinking about adding new flag "DEBUG", but that's probably not needed. Kind regards, Petr [1] https://patchwork.ozlabs.org/project/ltp/patch/20200619192542.20113-1-pvorel@suse.cz/ lib/newlib_tests/shell/net/tst_rhost_run.sh | 8 +++--- testcases/lib/tst_net.sh | 29 ++++++++++++++++----- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/lib/newlib_tests/shell/net/tst_rhost_run.sh b/lib/newlib_tests/shell/net/tst_rhost_run.sh index 4c034a4ac..ebcd4ca03 100755 --- a/lib/newlib_tests/shell/net/tst_rhost_run.sh +++ b/lib/newlib_tests/shell/net/tst_rhost_run.sh @@ -10,14 +10,14 @@ do_test() { local file="/etc/fstab" - tst_rhost_run -c 'which grep > /dev/null' || \ + tst_rhost_run -d -c 'which grep > /dev/null' || \ tst_res TCONF "grep not found on rhost" - tst_rhost_run -c "[ -f $file ]" || \ + tst_rhost_run -d -c "[ -f $file ]" || \ tst_res TCONF "$file not found on rhost" - tst_rhost_run -s -c "grep -q \"[^ ]\" $file" - tst_rhost_run -s -c "grep -q '[^ ]' $file" + tst_rhost_run -ds -c "grep -q \"[^ ]\" $file" + tst_rhost_run -ds -c "grep -q '[^ ]' $file" tst_res TPASS "tst_rhost_run is working" } diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh index 2ed570a6b..d6845618d 100644 --- a/testcases/lib/tst_net.sh +++ b/testcases/lib/tst_net.sh @@ -130,11 +130,17 @@ init_ltp_netspace() tst_restore_ipaddr rhost } +tst_net_debug() +{ + echo "DEBUG: $@" >&2 +} + # Run command on remote host. # tst_rhost_run -c CMD [-b] [-s] [-u USER] # Options: # -b run in background # -c CMD specify command to run (this must be binary, not shell builtin/function) +# -d debug mode (print command and netns/ssh handling into stderr) # -s safe option, if something goes wrong, will exit with TBROK # -u USER for ssh (default root) # RETURN: 0 on success, 1 on failure @@ -143,16 +149,17 @@ tst_rhost_run() local post_cmd=' || echo RTERR' local user="root" local ret=0 - local cmd out output pre_cmd safe + local cmd debug out output pre_cmd rcmd sh_cmd safe use local OPTIND - while getopts :bsc:u: opt; do + while getopts :bc:dsu: opt; do case "$opt" in b) [ "${TST_USE_NETNS:-}" ] && pre_cmd= || pre_cmd="nohup" post_cmd=" > /dev/null 2>&1 &" out="1> /dev/null" ;; c) cmd="$OPTARG" ;; + d) debug=1 ;; s) safe=1 ;; u) user="$OPTARG" ;; *) tst_brk_ TBROK "tst_rhost_run: unknown option: $OPTARG" ;; @@ -166,14 +173,24 @@ tst_rhost_run() return 1 fi + sh_cmd="$pre_cmd $cmd $post_cmd" + if [ -n "${TST_USE_NETNS:-}" ]; then - output=$($LTP_NETNS sh -c \ - "$pre_cmd $cmd $post_cmd" $out 2>&1 || echo 'RTERR') + use="NETNS" + rcmd="$LTP_NETNS sh -c" else tst_require_cmds ssh - output=$(ssh -n -q $user@$RHOST \ - "$pre_cmd $cmd $post_cmd" $out 2>&1 || echo 'RTERR') + use="SSH" + rcmd="ssh -n -q $user@$RHOST" fi + + if [ "$debug" ]; then + tst_net_debug "tst_rhost_run: cmd: $cmd" + tst_net_debug "$use: $rcmd \"$sh_cmd\" $out 2>&1" + fi + + output=$($rcmd "$sh_cmd" $out 2>&1 || echo 'RTERR') + echo "$output" | grep -q 'RTERR$' && ret=1 if [ $ret -eq 1 ]; then output=$(echo "$output" | sed 's/RTERR//')