[ovs-dev] [PATCH 2/3] autotest: add autotest framework for adding kernel module unit tests

Ben Pfaff blp at nicira.com
Thu Jan 15 21:58:23 UTC 2015


On Thu, Jan 15, 2015 at 11:32:15AM -0800, Andy Zhou wrote:
> On Thu, Jan 15, 2015 at 8:12 AM, Ben Pfaff <blp at nicira.com> wrote:
> > On Tue, Jan 13, 2015 at 05:28:06PM -0800, Andy Zhou wrote:
> >> This patch adds a basic infrastructure for developing and running
> >> kernel module unit tests. Currently OVS contains thousands
> >> of useful unit tests for user space programs. It is desirable to
> >> have corresponding kernel module unit tests.

...

> >> +   OVS_SWITCHD_STOP($1)
> >> +   AT_CHECK([modprobe -r openvswitch])
> >> +  ])
> >
> > I think that as written this will expand literally without any spacing,
> > e.g. DEL_NAMESPACES([a], [b], [c]) will become:
> >         ip netns del aip netns del bip netns del c
> >> +m4_define([DEL_NAMESPACES],
> >> +   [m4_foreach([ns], [$@],
> >> +               [ip netns del ns])
> >> +   ]
> >> +)
> >
> Would "[ip netns del ns; ] work?

That would work.  I'd be inclined just add a newline though:

   [m4_foreach([ns], [$@],
               [ip netns del ns
])
   ]

> > I find myself wondering whether we should adopt some naming convention
> > for namespaces created by the testsuite, such as a prefix.  That would
> > make it safe(r) to delete all of the namespaces created by the tests.
> 
> Any suggestions? How about "at_" ?

Sure, that's likely to be unique.



More information about the dev mailing list