From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 04448C6FD1D for ; Fri, 7 Apr 2023 06:56:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0CCAF86154; Fri, 7 Apr 2023 08:56:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="XJKHJKPM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DC20786157; Fri, 7 Apr 2023 08:56:24 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by phobos.denx.de (Postfix) with ESMTP id DD8A58614D for ; Fri, 7 Apr 2023 08:56:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanedmond@linux.microsoft.com Received: from ovlvm106.redmond.corp.microsoft.com (unknown [131.107.174.57]) by linux.microsoft.com (Postfix) with ESMTPSA id 7103F2131DF1; Thu, 6 Apr 2023 23:56:20 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7103F2131DF1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1680850580; bh=qPtm6UJ4UmVspSjNFOIW72I6Z4bxG58VrqQBNrs++m8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XJKHJKPM9elIh8aWrcrDExU4X+rf5tw/jbPmPt0rwqxVS6ZjiF+R5sa9xtIA/vY3b +jL8EZeC55CwXIhUlG0wFWLZUsgwa/L7cqbRuDu7ebExu5gtezzcb6fBWE6m9mG1DO IGyUNkIN6KlwxBhWNkK7HiM60No7nv7hE3owTqO8= From: seanedmond@linux.microsoft.com To: u-boot@lists.denx.de Cc: joe.hershberger@ni.com, rfried.dev@gmail.com, sjg@chromium.org, v.v.mitrofanov@yadro.com, seanedmond@microsoft.com Subject: [PATCH v2 3/3] net: dhcp6: Add a sandbox test for dhcp6 Date: Thu, 6 Apr 2023 23:56:19 -0700 Message-Id: <20230407065619.15908-4-seanedmond@linux.microsoft.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230407065619.15908-1-seanedmond@linux.microsoft.com> References: <20230407065619.15908-1-seanedmond@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Sean Edmond Requires proper environment with DHCP6 server provisioned. Signed-off-by: Sean Edmond --- configs/sandbox_defconfig | 1 + test/py/tests/test_net.py | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig index 3a1f14c60f..f65965f864 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -340,3 +340,4 @@ CONFIG_TEST_FDTDEC=y CONFIG_UNIT_TEST=y CONFIG_UT_TIME=y CONFIG_UT_DM=y +CONFIG_CMD_DHCP6=y diff --git a/test/py/tests/test_net.py b/test/py/tests/test_net.py index 9ca6743afd..0447c0b2e0 100644 --- a/test/py/tests/test_net.py +++ b/test/py/tests/test_net.py @@ -29,6 +29,11 @@ env__net_uses_pci = True # set to False. env__net_dhcp_server = True +# True if a DHCPv6 server is attached to the network, and should be tested. +# If DHCPv6 testing is not possible or desired, this variable may be omitted or +# set to False. +env__net_dhcp6_server = True + # A list of environment variables that should be set in order to configure a # static IP. If solely relying on DHCP, this variable may be omitted or set to # an empty list. @@ -58,6 +63,7 @@ env__net_nfs_readable_file = { """ net_set_up = False +net6_set_up = False def test_net_pre_commands(u_boot_console): """Execute any commands required to enable network hardware. @@ -93,6 +99,25 @@ def test_net_dhcp(u_boot_console): global net_set_up net_set_up = True +@pytest.mark.buildconfigspec('cmd_dhcp6') +def test_net_dhcp6(u_boot_console): + """Test the dhcp6 command. + + The boardenv_* file may be used to enable/disable this test; see the + comment at the beginning of this file. + """ + + test_dhcp6 = u_boot_console.config.env.get('env__net_dhcp6_server', False) + if not test_dhcp6: + pytest.skip('No DHCP6 server available') + + u_boot_console.run_command('setenv autoload no') + output = u_boot_console.run_command('dhcp6') + assert 'DHCP6 client bound to ' in output + + global net6_set_up + net6_set_up = True + @pytest.mark.buildconfigspec('net') def test_net_setup_static(u_boot_console): """Set up a static IP configuration. -- 2.40.0