diff mbox series

test/cmd/wget.c: move net_test_wget() to the cmd test suite

Message ID 20241105120653.99438-1-jerome.forissier@linaro.org
State New
Headers show
Series test/cmd/wget.c: move net_test_wget() to the cmd test suite | expand

Commit Message

Jerome Forissier Nov. 5, 2024, 12:06 p.m. UTC
Since net_test_wget() is testing a command and is in test/cmd it
should be in the 'cmd' test suite, not 'lib'.

Reported-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
---
 test/cmd/wget.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Simon Glass Nov. 5, 2024, 3:12 p.m. UTC | #1
On Tue, 5 Nov 2024 at 05:07, Jerome Forissier
<jerome.forissier@linaro.org> wrote:
>
> Since net_test_wget() is testing a command and is in test/cmd it
> should be in the 'cmd' test suite, not 'lib'.
>
> Reported-by: Simon Glass <sjg@chromium.org>
> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
> ---
>  test/cmd/wget.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini Nov. 15, 2024, 12:14 a.m. UTC | #2
On Tue, Nov 05, 2024 at 01:06:53PM +0100, Jerome Forissier wrote:

> Since net_test_wget() is testing a command and is in test/cmd it
> should be in the 'cmd' test suite, not 'lib'.
> 
> Reported-by: Simon Glass <sjg@chromium.org>
> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
>  test/cmd/wget.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

This leads to a sequencing error in tests:
------------------------------------ Captured stdout call -------------------------------------
=> ut dm dm_test_eth_act
Test: dm_test_eth_act: eth.c

Error: eth@10002000 No valid MAC address found.

Error: eth@10002000 No valid MAC address found.

Error: eth@10002000 No valid MAC address found.

Error: eth@10002000 No valid MAC address found.

Error: eth@10002000 No valid MAC address found.

Error: eth@10004000 No valid MAC address found.

Error: eth@10002000 No valid MAC address found.

Error: eth@10004000 No valid MAC address found.

Error: eth@10002000 No valid MAC address found.

Error: eth@10002000 No valid MAC address found.
test/dm/eth.c:284, dm_test_eth_act(): -ENODEV == net_loop(PING): Expected 0xffffffed (-19), got 0xffffffea (-22)
Test: dm_test_eth_act: eth.c (flat tree)
test/dm/eth.c:273, dm_test_eth_act(): addr = NULL: Expected non-null, got NULL
Test 'dm_test_eth_act' failed 2 times
Failures: 2
=>

Where it's fine when run by itself, but fails in CI/etc when running all
unit tests.
Jerome Forissier Nov. 15, 2024, 10:53 a.m. UTC | #3
On 11/15/24 01:14, Tom Rini wrote:
> On Tue, Nov 05, 2024 at 01:06:53PM +0100, Jerome Forissier wrote:
> 
>> Since net_test_wget() is testing a command and is in test/cmd it
>> should be in the 'cmd' test suite, not 'lib'.
>>
>> Reported-by: Simon Glass <sjg@chromium.org>
>> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
>> Reviewed-by: Simon Glass <sjg@chromium.org>
>> ---
>>  test/cmd/wget.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> This leads to a sequencing error in tests:
> ------------------------------------ Captured stdout call -------------------------------------
> => ut dm dm_test_eth_act
> Test: dm_test_eth_act: eth.c
> 
> Error: eth@10002000 No valid MAC address found.
> 
> Error: eth@10002000 No valid MAC address found.
> 
> Error: eth@10002000 No valid MAC address found.
> 
> Error: eth@10002000 No valid MAC address found.
> 
> Error: eth@10002000 No valid MAC address found.
> 
> Error: eth@10004000 No valid MAC address found.
> 
> Error: eth@10002000 No valid MAC address found.
> 
> Error: eth@10004000 No valid MAC address found.
> 
> Error: eth@10002000 No valid MAC address found.
> 
> Error: eth@10002000 No valid MAC address found.
> test/dm/eth.c:284, dm_test_eth_act(): -ENODEV == net_loop(PING): Expected 0xffffffed (-19), got 0xffffffea (-22)
> Test: dm_test_eth_act: eth.c (flat tree)
> test/dm/eth.c:273, dm_test_eth_act(): addr = NULL: Expected non-null, got NULL
> Test 'dm_test_eth_act' failed 2 times
> Failures: 2
> =>
> 
> Where it's fine when run by itself, but fails in CI/etc when running all
> unit tests.

How annoying ;) Any idea how to reproduce locally?

Thanks,
Tom Rini Nov. 15, 2024, 1:32 p.m. UTC | #4
On Fri, Nov 15, 2024 at 11:53:59AM +0100, Jerome Forissier wrote:
> 
> 
> On 11/15/24 01:14, Tom Rini wrote:
> > On Tue, Nov 05, 2024 at 01:06:53PM +0100, Jerome Forissier wrote:
> > 
> >> Since net_test_wget() is testing a command and is in test/cmd it
> >> should be in the 'cmd' test suite, not 'lib'.
> >>
> >> Reported-by: Simon Glass <sjg@chromium.org>
> >> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
> >> Reviewed-by: Simon Glass <sjg@chromium.org>
> >> ---
> >>  test/cmd/wget.c | 3 ++-
> >>  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > This leads to a sequencing error in tests:
> > ------------------------------------ Captured stdout call -------------------------------------
> > => ut dm dm_test_eth_act
> > Test: dm_test_eth_act: eth.c
> > 
> > Error: eth@10002000 No valid MAC address found.
> > 
> > Error: eth@10002000 No valid MAC address found.
> > 
> > Error: eth@10002000 No valid MAC address found.
> > 
> > Error: eth@10002000 No valid MAC address found.
> > 
> > Error: eth@10002000 No valid MAC address found.
> > 
> > Error: eth@10004000 No valid MAC address found.
> > 
> > Error: eth@10002000 No valid MAC address found.
> > 
> > Error: eth@10004000 No valid MAC address found.
> > 
> > Error: eth@10002000 No valid MAC address found.
> > 
> > Error: eth@10002000 No valid MAC address found.
> > test/dm/eth.c:284, dm_test_eth_act(): -ENODEV == net_loop(PING): Expected 0xffffffed (-19), got 0xffffffea (-22)
> > Test: dm_test_eth_act: eth.c (flat tree)
> > test/dm/eth.c:273, dm_test_eth_act(): addr = NULL: Expected non-null, got NULL
> > Test 'dm_test_eth_act' failed 2 times
> > Failures: 2
> > =>
> > 
> > Where it's fine when run by itself, but fails in CI/etc when running all
> > unit tests.
> 
> How annoying ;) Any idea how to reproduce locally?

Running all of the tests (or at least all of the "ut" unit tests) in
sandbox should do it.
diff mbox series

Patch

diff --git a/test/cmd/wget.c b/test/cmd/wget.c
index fe26fee54c9..9dde699db58 100644
--- a/test/cmd/wget.c
+++ b/test/cmd/wget.c
@@ -19,6 +19,7 @@ 
 #include <dm/test.h>
 #include <dm/device-internal.h>
 #include <dm/uclass-internal.h>
+#include <test/cmd.h>
 #include <test/lib.h>
 #include <test/test.h>
 #include <test/ut.h>
@@ -225,4 +226,4 @@  static int net_test_wget(struct unit_test_state *uts)
 
 	return 0;
 }
-LIB_TEST(net_test_wget, UTF_CONSOLE);
+CMD_TEST(net_test_wget, UTF_CONSOLE);