From patchwork Wed Apr 3 17:02:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 1076200 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="pwV73BnD"; 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 44ZC4Y0cnYz9sNy for ; Thu, 4 Apr 2019 04:00:11 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 9D4ED3EA30F for ; Wed, 3 Apr 2019 19:00:08 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it [IPv6:2001:4b78:1:20::5]) by picard.linux.it (Postfix) with ESMTP id 56DF83EA2BA for ; Wed, 3 Apr 2019 19:00:07 +0200 (CEST) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-5.smtp.seeweb.it (Postfix) with ESMTPS id 0A3F2601209 for ; Wed, 3 Apr 2019 19:00:07 +0200 (CEST) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x33GrrPp139930 for ; Wed, 3 Apr 2019 17:00:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=YAOkIQMYE1i8lTnbbgIDHkRySWMVsx44TloEVA6f8eU=; b=pwV73BnD1xIRKNxBtwqJ8ffkYjh+vXAPMT27ZSMDXnI4ZNsjznL60z2zjjEfadw/qW+B +aP4W4foyESsaa2OhFrNYo4j6XiqyGgKGy/fMu/0odSS1fTOTwERkxDzmvvFxboBfnT3 0XrNfUbyrCqxPPqmE0oDhYbeo7Gm+EsAI7M1RR4oUO4uqPK6tZHNNDD7rl9skM+8tl2h TUd/043DgQQ1xt0LI0rV8rvQS4w4bnevbTJOhTnzvimsgBUWOhIHC1V16vPIEo2Y0vB9 6xx7u1XAdZ/+go4Y5gLtqkJUmjFe6Q1Y4+QgfU9hmgbq4sOOtEs9NoJGu/8iBodM2gBm FQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 2rhyvtabcg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 03 Apr 2019 17:00:02 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x33GxJNf016989 for ; Wed, 3 Apr 2019 17:00:02 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3030.oracle.com with ESMTP id 2rm8f5fct4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 03 Apr 2019 17:00:02 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x33GxvIx009180 for ; Wed, 3 Apr 2019 17:00:01 GMT Received: from ak.ru.oracle.com (/10.162.80.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 03 Apr 2019 09:59:56 -0700 From: Alexey Kodanev To: ltp@lists.linux.it Date: Wed, 3 Apr 2019 20:02:04 +0300 Message-Id: <1554310924-24751-1-git-send-email-alexey.kodanev@oracle.com> X-Mailer: git-send-email 1.7.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9216 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 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-1904030115 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9216 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 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-1904030115 X-Virus-Scanned: clamav-milter 0.99.2 at in-5.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-5.smtp.seeweb.it Subject: [LTP] [PATCH] network/dhcp: correct prefix for expected IPv6 address 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" Assuming a /64 prefix from DHCPv6 server is wrong [1], fixed dhclient sets /128 prefix. With this patch the test also checks the configured address without the prefix, when the first check fails, and reports a more verbose message, plus shows an output from 'ip addr show $iface' command. [1] https://bugs.launchpad.net/ubuntu/+source/isc-dhcp/+bug/1609898 Signed-off-by: Alexey Kodanev Reviewed-by: Petr Vorel --- testcases/network/dhcp/dhcp_lib.sh | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/testcases/network/dhcp/dhcp_lib.sh b/testcases/network/dhcp/dhcp_lib.sh index c92117f..434ac1d 100755 --- a/testcases/network/dhcp/dhcp_lib.sh +++ b/testcases/network/dhcp/dhcp_lib.sh @@ -42,10 +42,12 @@ dhcp_lib_setup() if [ $TST_IPV6 ]; then ip_addr="fd00:1:1:2::12/64" - ip_addr_check="fd00:1:1:2::100/64" + ip_addr_check_nm="fd00:1:1:2::100" + ip_addr_check="$ip_addr_check_nm/128" else ip_addr="10.1.1.12/24" - ip_addr_check="10.1.1.100/24" + ip_addr_check_nm="10.1.1.100" + ip_addr_check="$ip_addr_check_nm/24" fi lsmod | grep -q '^veth ' && veth_loaded=yes || veth_loaded=no @@ -141,8 +143,13 @@ test01() if [ $? -eq 0 ]; then tst_res TPASS "'$ip_addr_check' configured by DHCPv$TST_IPVER" else - tst_res TFAIL "'$ip_addr_check' not configured by DHCPv$TST_IPVER" - print_dhcp_log + if ip addr show $iface1 | grep -q $ip_addr_check_nm; then + tst_res TFAIL "'$ip_addr_check_nm' configured but has wrong prefix, expect '$ip_addr_check'" + ip addr show $iface1 + else + tst_res TFAIL "'$ip_addr_check' not configured by DHCPv$TST_IPVER" + print_dhcp_log + fi fi if [ "$wicked" ]; then