[ovs-dev] [PATCH] ovn: expose c validator to python

Aaron Rosen aaronorosen at gmail.com
Wed Jul 13 21:11:24 UTC 2016


Yea I totally agree.

In the latest patch I sent out it skips these tests if the user doesn't
have the ovs python lib installed.  I'll try and see what I can do to fix
this.

On Wed, Jul 13, 2016 at 10:56 AM, Ben Pfaff <blp at ovn.org> wrote:

> On Mon, Jul 04, 2016 at 12:17:54PM -0700, Aaron Rosen wrote:
> > On Sun, Jul 3, 2016 at 12:04 PM, Ben Pfaff <blp at ovn.org> wrote:
> >
> > > On Thu, Jun 30, 2016 at 02:27:19PM -0700, Aaron Rosen wrote:
> > > > This patch exposes the c function expr_parse_string() to be called
> via
> > > > python. The motivation for this is so that clients interfacing with
> > > > ovn can call this method in order to validate the data they are
> writting
> > > > to ovn.
> > > >
> > > > Previously, there were several bugs in the neutron/ovn integration
> > > > that went unnoticed due to the client writing invalid data. This
> should
> > > > hopefully help catch errors like this earlier as it can now be
> detected
> > > on
> > > > the client side and an error can be raised.
>
> > > I don't yet understand how to use this, though.  When I run a normal
> > > "make check" I get failures like this:
> > >
> > >     #                             -*- compilation -*-
> > >     2132. test-ovn-utils.at:12: testing test-ovn-utils - Python2 ...
> > >     ../../tests/test-ovn-utils.at:12: $PYTHON
> $srcdir/test-ovn-utils.py
> > >     stderr:
> > >     Traceback (most recent call last):
> > >       File "../../../../tests/test-ovn-utils.py", line 17, in <module>
> > >         from ovs import ovn_utils
> > >     ImportError: cannot import name ovn_utils
> > >     stdout:
> > >     ../../tests/test-ovn-utils.at:12: exit code was 1, expected 0
> > >     2132. test-ovn-utils.at:12: 2132. test-ovn-utils - Python2 (
> > > test-ovn-utils.at:12): FAILED (test-ovn-utils.at:12)
> > >
> > > Is some extra step required?
> >
> >
> > Looks like you need to run:
> >
> > sudo python setup.py install
> > and
> > sudo python3 setup.py install (if you want the python3 tests to run).
> >
> > inside of  ovs/python first.
> >
> > Is there a good place were we could add a hook to make that occur?  I
> think
> > the other issue that we are facing before that is in order to build
> these C
> > extensions it currently is relying on the openvswitch-dev package being
> > installed on the system rather than able to use it from the current
> source
> > tree: https://github.com/openvswitch/ovs/blob/master/python/setup.py#L80
>
> These changes are going to break the OVS build process, then.  Building
> and testing OVS doesn't currently require root.  It sounds like a step
> backwards to start requiring it.
>



More information about the dev mailing list