[ovs-dev] [PATCH v3] tests: Simplify and improve the daemon tests.

Ben Pfaff blp at ovn.org
Sun Dec 16 16:28:00 UTC 2018


On Sun, Dec 16, 2018 at 01:11:15PM +0100, Timothy Redaelli wrote:
> On Mon, 10 Dec 2018 09:43:19 -0800
> Ben Pfaff <blp at ovn.org> wrote:
> 
> > The daemon tests used files a lot when shell variables were easier to use
> > and easier to understand.  This commit changes that.
> > 
> > The tests created empty databases that aren't really needed anymore.  This
> > commit changes them to use the ovsdb-server --no-db option instead.
> > 
> > The tests had a lot of common code for checking the ancestry of processes.
> > This commit factors out a new shell function check_ancestors.
> > 
> > The tests tended to use random pidfile names.  This switches to just using
> > the defaults, which are fine.
> > 
> > The tests didn't check the names of the child processes.  This adds those
> > checks using the new check_process_name shell function.  This should avoid
> > regression of the bug fixed by commit 266f79e32c60 ("daemon-unix: Use
> > same name for original or restarted children.")
> > 
> > Other minor improvements too.
> > 
> > I only made small updates to the Windows-specific test, because it is hard
> > for me to verify.
> > 
> > Acked-by: Alin Gabriel Serdean <aserdean at ovn.org>
> > Signed-off-by: Ben Pfaff <blp at ovn.org>
> > ---
> > v1->v2: Rebased, added ack.
> > v2->v3: Fix some mixups in v2 from muddling two patches together.
> > 
> >  tests/daemon-py.at | 218 +++++++++++++++++++++++++----------------------------
> >  tests/daemon.at    | 212 ++++++++++++++++++++++++++++-----------------------
> >  2 files changed, 220 insertions(+), 210 deletions(-)
> > 
> [...]
> > diff --git a/tests/daemon.at b/tests/daemon.at
> > index fa4844ae8eaa..6382d856bd95 100644
> > --- a/tests/daemon.at
> > +++ b/tests/daemon.at
> > @@ -1,5 +1,48 @@
> >  AT_BANNER([daemon unit tests - C])
> >  
> > +OVS_START_SHELL_HELPERS
> > +# check_process_name PID NAME
> > +#
> > +# On Linux, make sure that the name of process PID is NAME.
> > +# (On other systems, don't bother.)
> > +if test -e /proc/$$/comm; then
> > +    check_process_name() {
> > +        AT_CHECK_UNQUOTED([cat /proc/$1/comm], [0], [$2
> > +])
> 
> Hi,
> this function doesn't work when you build OVS with --enable-shared
> since, in this case, ovsdb-server is launched by libtool and so
> cat /proc/$1/comm is lt-ovsdb-server:

Thanks for the report.  I don't normally build with --enable-shared, so
that's why I missed it.

I rebuilt with --enable-shared and, oddly, couldn't reproduce the
problem, but the fix should be easy and I posted it:
        https://patchwork.ozlabs.org/patch/1014162/

Does it fix the problem you see?

Thanks,

Ben.


More information about the dev mailing list