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 529FDC77B6F for ; Tue, 11 Apr 2023 17:49:00 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0EDE885F1D; Tue, 11 Apr 2023 19:48:57 +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="lszJjvfT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E85D185F1D; Tue, 11 Apr 2023 19:48:53 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by phobos.denx.de (Postfix) with ESMTP id 9937A85AA1 for ; Tue, 11 Apr 2023 19:48:50 +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 9E1242171FAE; Tue, 11 Apr 2023 10:48:49 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9E1242171FAE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1681235329; bh=sB2pmxU7y3wUDhZFgKF4bqbBkxPlopo2twRangrpanw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lszJjvfTxnKNNnjbiKmlD89JX9a2u7ZjZZ/DmA1IICmi4zVRdSWFKrAb4FS28LaGF Vy50A5NaD8h8569joYZ1Tb+jNBVG/BgIh5w8v2xnZMCxxC9XvN0T1Hcs9JQ9TK94Kg I6uW7G3UaYnIfbzJoQr3WvhT58qCHG9/N/0uGQpM= 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 v3 3/3] net: dhcp6: Add a sandbox test for dhcp6 Date: Tue, 11 Apr 2023 10:48:48 -0700 Message-Id: <20230411174848.44175-4-seanedmond@linux.microsoft.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230411174848.44175-1-seanedmond@linux.microsoft.com> References: <20230411174848.44175-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 ca95b2c5d2..d7ceedd601 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -341,3 +341,4 @@ CONFIG_UNIT_TEST=y CONFIG_UT_TIME=y CONFIG_UT_DM=y CONFIG_CMD_2048=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