Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2073330/?format=api
{ "id": 2073330, "url": "http://patchwork.ozlabs.org/api/patches/2073330/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20250415211819.1254435-9-jerome.forissier@linaro.org/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20250415211819.1254435-9-jerome.forissier@linaro.org>", "list_archive_url": null, "date": "2025-04-15T21:17:43", "name": "[v2,08/11] test: dm: eth, dsa: update tests for NET_LWIP", "commit_ref": "58ea7c3b507d2544f9dfe1712fe0fdb73086c733", "pull_url": null, "state": "accepted", "archived": false, "hash": "e43971c80a2fe73864c84d56cba5a8a70fa303c1", "submitter": { "id": 69192, "url": "http://patchwork.ozlabs.org/api/people/69192/?format=api", "name": "Jerome Forissier", "email": "jerome.forissier@linaro.org" }, "delegate": { "id": 157425, "url": "http://patchwork.ozlabs.org/api/users/157425/?format=api", "username": "jforissier", "first_name": "Jerome", "last_name": "Forissier", "email": "jerome.forissier@linaro.org" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20250415211819.1254435-9-jerome.forissier@linaro.org/mbox/", "series": [ { "id": 452941, "url": "http://patchwork.ozlabs.org/api/series/452941/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=452941", "date": "2025-04-15T21:17:35", "name": "lwIP sandbox tests", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/452941/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2073330/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2073330/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=ajrblWOn;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linaro.org", "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de", "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.b=\"ajrblWOn\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linaro.org", "phobos.denx.de;\n spf=pass smtp.mailfrom=jerome.forissier@linaro.org" ], "Received": [ "from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature ECDSA (secp384r1))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4ZccVW3chLz1yJ9\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 16 Apr 2025 07:19:31 +1000 (AEST)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 5909282C49;\n\tTue, 15 Apr 2025 23:18:40 +0200 (CEST)", "by phobos.denx.de (Postfix, from userid 109)\n id 6891B82BDC; Tue, 15 Apr 2025 23:18:38 +0200 (CEST)", "from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com\n [IPv6:2a00:1450:4864:20::42c])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 28D3181E1F\n for <u-boot@lists.denx.de>; Tue, 15 Apr 2025 23:18:36 +0200 (CEST)", "by mail-wr1-x42c.google.com with SMTP id\n ffacd0b85a97d-39c1efbefc6so3665713f8f.1\n for <u-boot@lists.denx.de>; Tue, 15 Apr 2025 14:18:36 -0700 (PDT)", "from builder.. ([2a01:e0a:3cb:7bb0:6ebc:6ce:770e:95f9])\n by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-39eaf43cce3sm15530917f8f.74.2025.04.15.14.18.34\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 15 Apr 2025 14:18:35 -0700 (PDT)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1744751915; x=1745356715; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=ErFDwS1/r/w248TiTv9376n3jwj/iLkxpAWYvgK53Js=;\n b=ajrblWOnIx5a7rlf2db8D593WVD6WL4BPxGHeqYPUa5Rw37TAsdkEp3JIxA8BE8YLp\n 7l6WUJcMfJHtSZE7/P9Ors65PYNEk9VDFcqgcvCCZSvKskIYOU2TLkI5yCSt8vMP0FnZ\n J8dK3fAMpLnJG2Pt6KwxEWQnLRH+r7znw8+1YTRkiN1TaJuaEVBLo/tqDrjLuWKcdYPC\n +50yx6MQr/dYoEn1KYKqdYh3EOD6w8UljAM4Rqka82shx1Ondy2k/P0sPxQnkPZ4mByK\n xMwvzQE5Rgm69HWK7ZT1QS/OFphBAIFdcX4PxvW64GVAevzWxibj2LhNbmJaHudtsJM9\n 4KaA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1744751915; x=1745356715;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=ErFDwS1/r/w248TiTv9376n3jwj/iLkxpAWYvgK53Js=;\n b=YgqpcxE2oV6hNfn/tvsjJ74PC7vOl42tglBkIL5WUyainPdZYtxrBd0K0TvhSo8bgN\n lVme5L77L0bjAzRVI1uN4Zra+bGFKNEzupwPqdXLPZ9n7hDWlhNsiMRSNVVGCPwhvTIg\n tz0HmXDcTLwtUPOooriG7Ug/EwL+hcF1xGNNJegF9JtcF2dDk9t9LpOPNzEDMb19q6+7\n 8a+6oCqiSKF5q75Cn9yuygRx/JCoQhfBjm6TorBYOYoCKMkJLIddyVJ8H2yfLCZt9No5\n OnLORV4qNLwJrf8xrGGNUwiD3ainJG4tp6ND/xzrhm/z2vNheEXaCURjN5i3JMaXqrwQ\n 4/LQ==", "X-Gm-Message-State": "AOJu0YyGfDAyWjzV/kaLgnp7ID3QlBtf6q3AHA7zXDAuyxwTNbl02/RS\n VC9+1wwPCPkgkqSisXl4RkDJSDGchf8+d9txOhNBx9xtqio4k+tjI1n+jvysd7loYnvdP3UXK/f\n o8Ec=", "X-Gm-Gg": "ASbGnctXSWGgcexkHb54aNti8PWl2kCpb9WOTxxJTC6mKvPLcrfnedrv8/zCQwqoQeN\n bVLjAKTNnPqpDfIkBnWEMosYglJn+NsWrotKqmLTTqMgfG68VwkJxM0BTjZVVc8Azn9SoI5iZOF\n 0GU+msei2nu3ZJ52lrYDxTehVDTGmGyDzXZu4p542QW4orjlhV8iw+JC9XQo5c1uRRA/daK6nzG\n Xx2/09UHthOmX7jxFbv33BqPaRusErkOsJA8TmBFtNjIwYbVoNwlMJEY7PuNzZONh0qiewqpayF\n AOLIhOWS0l+mafDckRpVK8uUEsz4wU2+AddL9PSu795/7AUT", "X-Google-Smtp-Source": "\n AGHT+IEHaIKs5k+28R5VptqBC583N5T3rvXkx0dAn3+BNnTtDnVLcNvhjMOwCZcqGpszY/CZcX2SVA==", "X-Received": "by 2002:a05:6000:2913:b0:391:3094:d696 with SMTP id\n ffacd0b85a97d-39ee27706e6mr827274f8f.54.1744751915290;\n Tue, 15 Apr 2025 14:18:35 -0700 (PDT)", "From": "Jerome Forissier <jerome.forissier@linaro.org>", "To": "U-Boot mailing list <u-boot@lists.denx.de>", "Cc": "Jerome Forissier <jerome.forissier@linaro.org>,\n Simon Glass <sjg@chromium.org>,\n Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n Marek Vasut <marex@denx.de>, Svyatoslav Ryhel <clamor95@gmail.com>,\n Tom Rini <trini@konsulko.com>", "Subject": "[PATCH v2 08/11] test: dm: eth, dsa: update tests for NET_LWIP", "Date": "Tue, 15 Apr 2025 23:17:43 +0200", "Message-ID": "<20250415211819.1254435-9-jerome.forissier@linaro.org>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20250415211819.1254435-1-jerome.forissier@linaro.org>", "References": "<20250415211819.1254435-1-jerome.forissier@linaro.org>", "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 <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>", "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de", "X-Virus-Status": "Clean" }, "content": "Convert the tests to use the do_ping() interface which is now\ncommon to NET and NET_LWIP. This allows running most network test with\nSANDBOX and NET_LWIP. A few things to note though:\n\n1. The ARP and IPv6 tests are enabled for NET only\n\n2. The net_retry test is modified to use eth0 (eth@10002000) as the\nactive (but disabled) interface, and therefore we expect eth1\n(eth@10003000) to be the fallback when \"netretry\" is \"yes\". This is in\nreplacement of eth7 (lan1) and eth0 (eth@10002000) respectively.\nIndeed, it seems eth7 works with NET by chance and it certainly does not\nwork with NET_LWIP. I observed that even with NET,\nsandbox_eth_disable_response(1, true) has no effect: remove it and\nthe test still passes. The interface ID is not correct to begin with; 1\ncorresponds to eth1 (eth@10003000) as shown by debug traces, it is not\neth7 (lan1). And using index 7 causes a SEGV. In fact, it is not the\ncall to sandbox_eth_disable_response() that prevents the stack from\nprocessing the ICMP reply but the timeout caused by the call to\nsandbox_eth_skip_timeout(). Here is what happens when trying to ping\nusing the eth7 (lan1) interface with NET:\n\n do_ping(...)\n net_loop(PING)\n ping_start()\n eth_rx()\n sb_eth_recv()\n time_test_add_offset(11000UL);\n if (get_timer(0) - time_start > time_delta)\n ping_timeout_handler() // ping error, as expected\n\nAnd the same with NET_LWIP:\n\n do_ping(...)\n ping_loop(...)\n sys_check_timeouts()\n net_lwip_rx(...)\n sb_eth_recv()\n time_test_add_offset(11000UL);\n netif->input(...) // the packet is processed succesfully\n\nBy choosing eth0 and sandbox_eth_disable_response(0, true), the incoming\npacket is indeed discarded and things work as expected with both network\nstacks.\n\nSigned-off-by: Jerome Forissier <jerome.forissier@linaro.org>\nReviewed-by: Simon Glass <sjg@chromium.org>\n---\n\n(no changes since v1)\n\n test/dm/Makefile | 2 --\n test/dm/dsa.c | 8 ++---\n test/dm/eth.c | 77 +++++++++++++++++++++++++++---------------------\n 3 files changed, 47 insertions(+), 40 deletions(-)", "diff": "diff --git a/test/dm/Makefile b/test/dm/Makefile\nindex 3afcc26ca57..917dafe7d22 100644\n--- a/test/dm/Makefile\n+++ b/test/dm/Makefile\n@@ -46,9 +46,7 @@ obj-$(CONFIG_VIDEO_MIPI_DSI) += dsi_host.o\n obj-$(CONFIG_DM_DSA) += dsa.o\n obj-$(CONFIG_ECDSA_VERIFY) += ecdsa.o\n obj-$(CONFIG_EFI_MEDIA_SANDBOX) += efi_media.o\n-ifdef CONFIG_NET\n obj-$(CONFIG_DM_ETH) += eth.o\n-endif\n obj-$(CONFIG_EXTCON) += extcon.o\n ifneq ($(CONFIG_EFI_PARTITION),)\n obj-$(CONFIG_FASTBOOT_FLASH_MMC) += fastboot.o\ndiff --git a/test/dm/dsa.c b/test/dm/dsa.c\nindex c6b4e12a758..9a31ae39d95 100644\n--- a/test/dm/dsa.c\n+++ b/test/dm/dsa.c\n@@ -63,15 +63,15 @@ DM_TEST(dm_test_dsa_probe, UTF_SCAN_FDT);\n */\n static int dm_test_dsa(struct unit_test_state *uts)\n {\n-\tnet_ping_ip = string_to_ip(\"1.2.3.5\");\n+\tchar *argv[] = { \"ping\", \"1.1.2.2\" };\n \n \tenv_set(\"ethact\", \"eth2\");\n-\tut_assertok(net_loop(PING));\n+\tut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv));\n \n \tenv_set(\"ethact\", \"lan0\");\n-\tut_assertok(net_loop(PING));\n+\tut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv));\n \tenv_set(\"ethact\", \"lan1\");\n-\tut_assertok(net_loop(PING));\n+\tut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv));\n \n \tenv_set(\"ethact\", \"\");\n \ndiff --git a/test/dm/eth.c b/test/dm/eth.c\nindex 467495863e1..1087ae9572d 100644\n--- a/test/dm/eth.c\n+++ b/test/dm/eth.c\n@@ -171,18 +171,18 @@ DM_TEST(dm_test_ip6_make_lladdr, UTF_SCAN_FDT);\n \n static int dm_test_eth(struct unit_test_state *uts)\n {\n-\tnet_ping_ip = string_to_ip(\"1.1.2.2\");\n+\tchar *argv[] = { \"ping\", \"1.1.2.2\" };\n \n \tenv_set(\"ethact\", \"eth@10002000\");\n-\tut_assertok(net_loop(PING));\n+\tut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv));\n \tut_asserteq_str(\"eth@10002000\", env_get(\"ethact\"));\n \n \tenv_set(\"ethact\", \"eth@10003000\");\n-\tut_assertok(net_loop(PING));\n+\tut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv));\n \tut_asserteq_str(\"eth@10003000\", env_get(\"ethact\"));\n \n \tenv_set(\"ethact\", \"eth@10004000\");\n-\tut_assertok(net_loop(PING));\n+\tut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv));\n \tut_asserteq_str(\"eth@10004000\", env_get(\"ethact\"));\n \n \treturn 0;\n@@ -191,22 +191,23 @@ DM_TEST(dm_test_eth, UTF_SCAN_FDT);\n \n static int dm_test_eth_alias(struct unit_test_state *uts)\n {\n-\tnet_ping_ip = string_to_ip(\"1.1.2.2\");\n+\tchar *argv[] = { \"ping\", \"1.1.2.2\" };\n+\n \tenv_set(\"ethact\", \"eth0\");\n-\tut_assertok(net_loop(PING));\n+\tut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv));\n \tut_asserteq_str(\"eth@10002000\", env_get(\"ethact\"));\n \n \tenv_set(\"ethact\", \"eth6\");\n-\tut_assertok(net_loop(PING));\n+\tut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv));\n \tut_asserteq_str(\"eth@10004000\", env_get(\"ethact\"));\n \n \t/* Expected to fail since eth1 is not defined in the device tree */\n \tenv_set(\"ethact\", \"eth1\");\n-\tut_assertok(net_loop(PING));\n+\tut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv));\n \tut_asserteq_str(\"eth@10002000\", env_get(\"ethact\"));\n \n \tenv_set(\"ethact\", \"eth5\");\n-\tut_assertok(net_loop(PING));\n+\tut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv));\n \tut_asserteq_str(\"eth@10003000\", env_get(\"ethact\"));\n \n \treturn 0;\n@@ -215,18 +216,18 @@ DM_TEST(dm_test_eth_alias, UTF_SCAN_FDT);\n \n static int dm_test_eth_prime(struct unit_test_state *uts)\n {\n-\tnet_ping_ip = string_to_ip(\"1.1.2.2\");\n+\tchar *argv[] = { \"ping\", \"1.1.2.2\" };\n \n \t/* Expected to be \"eth@10003000\" because of ethprime variable */\n \tenv_set(\"ethact\", NULL);\n \tenv_set(\"ethprime\", \"eth5\");\n-\tut_assertok(net_loop(PING));\n+\tut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv));\n \tut_asserteq_str(\"eth@10003000\", env_get(\"ethact\"));\n \n \t/* Expected to be \"eth@10002000\" because it is first */\n \tenv_set(\"ethact\", NULL);\n \tenv_set(\"ethprime\", NULL);\n-\tut_assertok(net_loop(PING));\n+\tut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv));\n \tut_asserteq_str(\"eth@10002000\", env_get(\"ethact\"));\n \n \treturn 0;\n@@ -249,6 +250,7 @@ DM_TEST(dm_test_eth_prime, UTF_SCAN_FDT);\n */\n static int dm_test_eth_act(struct unit_test_state *uts)\n {\n+\tchar *argv[] = { \"ping\", \"1.1.2.2\" };\n \tstruct udevice *dev[DM_TEST_ETH_NUM];\n \tconst char *ethname[DM_TEST_ETH_NUM] = {\"eth@10002000\", \"eth@10003000\",\n \t\t\t\t\t\t\"sbe5\", \"eth@10004000\"};\n@@ -258,7 +260,6 @@ static int dm_test_eth_act(struct unit_test_state *uts)\n \tint i;\n \n \tmemset(ethaddr, '\\0', sizeof(ethaddr));\n-\tnet_ping_ip = string_to_ip(\"1.1.2.2\");\n \n \t/* Prepare the test scenario */\n \tfor (i = 0; i < DM_TEST_ETH_NUM; i++) {\n@@ -281,7 +282,7 @@ static int dm_test_eth_act(struct unit_test_state *uts)\n \tenv_set(\"ethact\", ethname[0]);\n \n \t/* Segment fault might happen if something is wrong */\n-\tut_asserteq(-ENODEV, net_loop(PING));\n+\tut_asserteq(CMD_RET_FAILURE, do_ping(NULL, 0, ARRAY_SIZE(argv), argv));\n \n \tfor (i = 0; i < DM_TEST_ETH_NUM; i++) {\n \t\t/* Restore the env */\n@@ -334,15 +335,17 @@ DM_TEST(dm_test_ethaddr, UTF_SCAN_FDT);\n /* The asserts include a return on fail; cleanup in the caller */\n static int _dm_test_eth_rotate1(struct unit_test_state *uts)\n {\n+\tchar *argv[] = { \"ping\", \"1.1.2.2\" };\n+\n \t/* Make sure that the default is to rotate to the next interface */\n \tenv_set(\"ethact\", \"eth@10004000\");\n-\tut_assertok(net_loop(PING));\n+\tut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv));\n \tut_asserteq_str(\"eth@10002000\", env_get(\"ethact\"));\n \n \t/* If ethrotate is no, then we should fail on a bad MAC */\n \tenv_set(\"ethact\", \"eth@10004000\");\n \tenv_set(\"ethrotate\", \"no\");\n-\tut_asserteq(-EINVAL, net_loop(PING));\n+\tut_asserteq(CMD_RET_FAILURE, do_ping(NULL, 0, ARRAY_SIZE(argv), argv));\n \tut_asserteq_str(\"eth@10004000\", env_get(\"ethact\"));\n \n \treturn 0;\n@@ -350,14 +353,16 @@ static int _dm_test_eth_rotate1(struct unit_test_state *uts)\n \n static int _dm_test_eth_rotate2(struct unit_test_state *uts)\n {\n+\tchar *argv[] = { \"ping\", \"1.1.2.2\" };\n+\n \t/* Make sure we can skip invalid devices */\n \tenv_set(\"ethact\", \"eth@10004000\");\n-\tut_assertok(net_loop(PING));\n+\tut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv));\n \tut_asserteq_str(\"eth@10004000\", env_get(\"ethact\"));\n \n \t/* Make sure we can handle device name which is not eth# */\n \tenv_set(\"ethact\", \"sbe5\");\n-\tut_assertok(net_loop(PING));\n+\tut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv));\n \tut_asserteq_str(\"sbe5\", env_get(\"ethact\"));\n \n \treturn 0;\n@@ -368,9 +373,6 @@ static int dm_test_eth_rotate(struct unit_test_state *uts)\n \tchar ethaddr[18];\n \tint retval;\n \n-\t/* Set target IP to mock ping */\n-\tnet_ping_ip = string_to_ip(\"1.1.2.2\");\n-\n \t/* Invalidate eth1's MAC address */\n \tmemset(ethaddr, '\\0', sizeof(ethaddr));\n \tstrncpy(ethaddr, env_get(\"eth6addr\"), 17);\n@@ -396,6 +398,7 @@ static int dm_test_eth_rotate(struct unit_test_state *uts)\n \t\t/* Restore the env */\n \t\tenv_set(\"ethaddr\", ethaddr);\n \t}\n+\n \t/* Restore the env */\n \tenv_set(\".flags\", NULL);\n \n@@ -406,26 +409,28 @@ DM_TEST(dm_test_eth_rotate, UTF_SCAN_FDT);\n /* The asserts include a return on fail; cleanup in the caller */\n static int _dm_test_net_retry(struct unit_test_state *uts)\n {\n+\tchar *argv[] = { \"ping\", \"1.1.2.2\" };\n+\n \t/*\n-\t * eth1 is disabled and netretry is yes, so the ping should succeed and\n-\t * the active device should be eth0\n+\t * eth0 is disabled and netretry is yes, so the ping should succeed and\n+\t * the active device should be eth1\n \t */\n-\tsandbox_eth_disable_response(1, true);\n-\tenv_set(\"ethact\", \"lan1\");\n+\tsandbox_eth_disable_response(0, true);\n+\tenv_set(\"ethact\", \"eth@10002000\");\n \tenv_set(\"netretry\", \"yes\");\n \tsandbox_eth_skip_timeout();\n-\tut_assertok(net_loop(PING));\n-\tut_asserteq_str(\"eth@10002000\", env_get(\"ethact\"));\n+\tut_assertok(do_ping(NULL, 0, ARRAY_SIZE(argv), argv));\n+\tut_asserteq_str(\"eth@10003000\", env_get(\"ethact\"));\n \n \t/*\n-\t * eth1 is disabled and netretry is no, so the ping should fail and the\n-\t * active device should be eth1\n+\t * eth0 is disabled and netretry is no, so the ping should fail and the\n+\t * active device should be eth0\n \t */\n-\tenv_set(\"ethact\", \"lan1\");\n+\tenv_set(\"ethact\", \"eth@10002000\");\n \tenv_set(\"netretry\", \"no\");\n \tsandbox_eth_skip_timeout();\n-\tut_asserteq(-ENONET, net_loop(PING));\n-\tut_asserteq_str(\"lan1\", env_get(\"ethact\"));\n+\tut_asserteq(CMD_RET_FAILURE, do_ping(NULL, 0, ARRAY_SIZE(argv), argv));\n+\tut_asserteq_str(\"eth@10002000\", env_get(\"ethact\"));\n \n \treturn 0;\n }\n@@ -434,8 +439,6 @@ static int dm_test_net_retry(struct unit_test_state *uts)\n {\n \tint retval;\n \n-\tnet_ping_ip = string_to_ip(\"1.1.2.2\");\n-\n \tretval = _dm_test_net_retry(uts);\n \n \t/* Restore the env */\n@@ -446,6 +449,7 @@ static int dm_test_net_retry(struct unit_test_state *uts)\n }\n DM_TEST(dm_test_net_retry, UTF_SCAN_FDT);\n \n+#if CONFIG_IS_ENABLED(NET)\n static int sb_check_arp_reply(struct udevice *dev, void *packet,\n \t\t\t unsigned int len)\n {\n@@ -511,7 +515,9 @@ static int sb_with_async_arp_handler(struct udevice *dev, void *packet,\n \n \treturn sb_check_arp_reply(dev, packet, len);\n }\n+#endif\n \n+#if CONFIG_IS_ENABLED(NET)\n static int dm_test_eth_async_arp_reply(struct unit_test_state *uts)\n {\n \tnet_ping_ip = string_to_ip(\"1.1.2.2\");\n@@ -529,7 +535,9 @@ static int dm_test_eth_async_arp_reply(struct unit_test_state *uts)\n \treturn 0;\n }\n DM_TEST(dm_test_eth_async_arp_reply, UTF_SCAN_FDT);\n+#endif\n \n+#if CONFIG_IS_ENABLED(NET)\n static int sb_check_ping_reply(struct udevice *dev, void *packet,\n \t\t\t unsigned int len)\n {\n@@ -613,6 +621,7 @@ static int dm_test_eth_async_ping_reply(struct unit_test_state *uts)\n \treturn 0;\n }\n DM_TEST(dm_test_eth_async_ping_reply, UTF_SCAN_FDT);\n+#endif\n \n #if IS_ENABLED(CONFIG_IPV6_ROUTER_DISCOVERY)\n \n", "prefixes": [ "v2", "08/11" ] }