[PATCH v8 03/11] app/test: replace POSIX specific code

Jie Zhou jizh at linux.microsoft.com
Wed Dec 1 02:05:38 CET 2021


On Wed, Nov 24, 2021 at 01:02:06AM +0300, Dmitry Kozlyuk wrote:
> 2021-10-25 19:45 (UTC-0700), Jie Zhou:
> > - Include rte_os_shim.h
> > - Replace sleep and usleep with rte_delay_us_sleep
> > - #ifndef RTE_EXEC_ENV_WINDOWS for POSIX code only
> > 
> > Signed-off-by: Jie Zhou <jizh at linux.microsoft.com>
> > ---
> 
> This patch can be combined with the previous one:
> they serve the same purpose---to remove Unix-specific code.
> 
> Please try to summarize in the commit message
> which parts of the tests suites are excluded, e.g. multi-process.
> It is more useful then stating what was changed in the code.
>
Will combine and revise the message.
 
> [...]
> > diff --git a/app/test/test_cmdline.c b/app/test/test_cmdline.c
> > index 115bee966d..9a76bd299f 100644
> > --- a/app/test/test_cmdline.c
> > +++ b/app/test/test_cmdline.c
> > @@ -31,6 +31,7 @@ test_cmdline(void)
> >  		return -1;
> >  	if (test_parse_num_invalid_param() < 0)
> >  		return -1;
> > +#ifndef RTE_EXEC_ENV_WINDOWS
> >  	printf("Testing parsing IP addresses...\n");
> >  	if (test_parse_ipaddr_valid() < 0)
> >  		return -1;
> > @@ -38,6 +39,7 @@ test_cmdline(void)
> >  		return -1;
> >  	if (test_parse_ipaddr_invalid_param() < 0)
> >  		return -1;
> > +#endif
> >  	printf("Testing parsing strings...\n");
> >  	if (test_parse_string_valid() < 0)
> >  		return -1;
> 
> What's wrong with parsing IP addresses on Windows?
> 
test_cmdline_ipaddr.c uses linux netinet/in.h specific u6_addr. Skip these 3 cases for now and prefer a separate patch to make it work on Windows. Or maybe there is already DPDK support on this which I am not aware of? Thanks.

> [...]
> > diff --git a/app/test/test_mp_secondary.c b/app/test/test_mp_secondary.c
> > index 5b6f05dbb1..da035348bd 100644
> > --- a/app/test/test_mp_secondary.c
> > +++ b/app/test/test_mp_secondary.c
> > @@ -14,7 +14,9 @@
> >  #include <errno.h>
> >  #include <string.h>
> >  #include <unistd.h>
> > +#ifndef RTE_EXEC_ENV_WINDOWS
> >  #include <sys/wait.h>
> > +#endif
> >  #include <libgen.h>
> >  #include <dirent.h>
> >  #include <limits.h>
> 
> <libgen.h> is absent on Windows for sure, but you don't exclude it.
> Does this file even need modification?
> It's not going to be compiled for Windows.
> 
This is replaced with the test stub in the patch#11 (of V8) to make it compile on Windows. Sorry for the confusion. Will make sure remove this unnecessary part from V9.

> [...]
> > diff --git a/app/test/test_ring_stress.c b/app/test/test_ring_stress.c
> > index 1af45e0fc8..ce3535c6b2 100644
> > --- a/app/test/test_ring_stress.c
> > +++ b/app/test/test_ring_stress.c
> > @@ -43,9 +43,10 @@ test_ring_stress(void)
> >  	n += test_ring_rts_stress.nb_case;
> >  	k += run_test(&test_ring_rts_stress);
> >  
> > +#ifndef RTE_EXEC_ENV_WINDOWS
> >  	n += test_ring_hts_stress.nb_case;
> >  	k += run_test(&test_ring_hts_stress);
> > -
> > +#endif
> 
> Can you please elaborate what is the issue with this case?
> It is also one of the details you usually want to put
> into the commit message.

Cannot remember what caused this case being skipped in the first place, but it can work now. So removed the ifndef. Thanks.


More information about the dev mailing list