From patchwork Wed Apr 17 11:47:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 1086923 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) 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=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="ml8RmJ65"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44kgRC0Zzxz9s4V for ; Wed, 17 Apr 2019 21:45:39 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 78C903EB023 for ; Wed, 17 Apr 2019 13:45:30 +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 2A2933EB010 for ; Wed, 17 Apr 2019 13:45:28 +0200 (CEST) Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) (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 180DF140097A for ; Wed, 17 Apr 2019 13:45:26 +0200 (CEST) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x3HBjMIq182981 for ; Wed, 17 Apr 2019 11:45:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=avfCgmyhcjFumWzadk4KuImkVOXCoQEEPBZuGu/YELs=; b=ml8RmJ65pQv+HCT4dL4dDlf41kZjBCsxPG0Q/sYoUTkUwfHKDNDcnzG0Znxg79nfLH1z xtJaZU/QhuPpNAEx0gH/eWEP2NBvq63YCXK1ospi4F0FR5aC+Ec3EO6m4T7OHc8E0l21 wvBoKLSEIS1roj9UCF6i47xiDXMT5IdsRR7TTsQ7UEZjQo4o8lSRxa1O3fuTxA1VqKAM 1AEulCwxp7VGpcABY7q35RXR7ld4qslzLR3q+s2DhbOgLcv0Tsc6GbaCiMXXFmYFpxic qUHgZqQAE+x/AVvFLv0M+BwB7v+y3PXFmNXOhtikXCVOuUG6vqg8pgqKDsPhVwCdR0K4 dA== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 2rusnf0ba5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 17 Apr 2019 11:45:22 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x3HBj3YQ097341 for ; Wed, 17 Apr 2019 11:45:22 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 2ru4vtrqd5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 17 Apr 2019 11:45:22 +0000 Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x3HBjK1h009131 for ; Wed, 17 Apr 2019 11:45:21 GMT Received: from ak.ru.oracle.com (/10.162.80.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 17 Apr 2019 04:45:20 -0700 From: Alexey Kodanev To: ltp@lists.linux.it Date: Wed, 17 Apr 2019 14:47:29 +0300 Message-Id: <1555501650-16626-2-git-send-email-alexey.kodanev@oracle.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1555501650-16626-1-git-send-email-alexey.kodanev@oracle.com> References: <1555501650-16626-1-git-send-email-alexey.kodanev@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9229 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904170082 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9229 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904170083 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, DKIM_VALID_AU, 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 Subject: [LTP] [PATCH 2/3][COMMITTED] network/clockdiff01: convert to new API X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Use SPDX-License-Identifier. Signed-off-by: Alexey Kodanev --- testcases/network/tcp_cmds/clockdiff/Makefile | 16 +----- .../network/tcp_cmds/clockdiff/clockdiff01.sh | 51 ++++++++------------ 2 files changed, 22 insertions(+), 45 deletions(-) diff --git a/testcases/network/tcp_cmds/clockdiff/Makefile b/testcases/network/tcp_cmds/clockdiff/Makefile index 3b212a9..d2e7251 100644 --- a/testcases/network/tcp_cmds/clockdiff/Makefile +++ b/testcases/network/tcp_cmds/clockdiff/Makefile @@ -1,17 +1,5 @@ -# Copyright (c) 2016 Oracle and/or its affiliates. All Rights Reserved. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# This program is distributed in the hope that it would be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2016-2019 Oracle and/or its affiliates. All Rights Reserved. top_srcdir ?= ../../../.. diff --git a/testcases/network/tcp_cmds/clockdiff/clockdiff01.sh b/testcases/network/tcp_cmds/clockdiff/clockdiff01.sh index e664391..db1b8d5 100755 --- a/testcases/network/tcp_cmds/clockdiff/clockdiff01.sh +++ b/testcases/network/tcp_cmds/clockdiff/clockdiff01.sh @@ -1,42 +1,31 @@ #!/bin/sh -# Copyright (c) 2016-2017 Oracle and/or its affiliates. All Rights Reserved. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# This program is distributed in the hope that it would be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2016-2019 Oracle and/or its affiliates. All Rights Reserved. # # Author: Alexey Kodanev -TCID=clockdiff01 -TST_TOTAL=1 -TST_USE_LEGACY_API=1 -. tst_net.sh +TST_TESTFUNC="do_test" +TST_NEEDS_ROOT=1 +TST_NEEDS_CMDS="cut clockdiff" -tst_require_root -tst_test_cmds cut clockdiff +. tst_net.sh -tst_resm TINFO "check time delta for $(tst_ipaddr)" +do_test() +{ + tst_res TINFO "check time delta for $(tst_ipaddr)" -output=$(clockdiff $(tst_ipaddr)) + local output=$(clockdiff $(tst_ipaddr)) -if [ $? -ne 0 ]; then - tst_resm TFAIL "clockdiff failed to get delta" -else - delta=$(echo "$output" | cut -d' ' -f2,3) - if [ "$delta" = "0 0" ]; then - tst_resm TPASS "delta is 0 as expected" + if [ $? -ne 0 ]; then + tst_res TFAIL "clockdiff failed to get delta" else - tst_resm TFAIL "not expected data received: '$output'" + delta=$(echo "$output" | cut -d' ' -f2,3) + if [ "$delta" = "0 0" ]; then + tst_res TPASS "delta is 0 as expected" + else + tst_res TFAIL "not expected data received: '$output'" + fi fi -fi +} -tst_exit +tst_run