diff mbox series

[ovs-dev,v2,1/6] Documentation: Document the system-userspace testsuite.

Message ID 20201105051036.3271437-2-blp@ovn.org
State Superseded
Headers show
Series Add DDlog implementation of ovn-northd | expand

Commit Message

Ben Pfaff Nov. 5, 2020, 5:10 a.m. UTC
I hadn't run this before so I had to discover how it worked.

Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 Documentation/topics/testing.rst | 35 ++++++++++++++++++++++++++++++++
 tests/automake.mk                |  6 ++++--
 2 files changed, 39 insertions(+), 2 deletions(-)

Comments

Numan Siddique Nov. 5, 2020, 11:06 a.m. UTC | #1
On Thu, Nov 5, 2020 at 10:41 AM Ben Pfaff <blp@ovn.org> wrote:
>
> I hadn't run this before so I had to discover how it worked.
>
> Signed-off-by: Ben Pfaff <blp@ovn.org>
> ---
>  Documentation/topics/testing.rst | 35 ++++++++++++++++++++++++++++++++
>  tests/automake.mk                |  6 ++++--
>  2 files changed, 39 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/topics/testing.rst b/Documentation/topics/testing.rst
> index 242608a17340..95e57dd6b98e 100644
> --- a/Documentation/topics/testing.rst
> +++ b/Documentation/topics/testing.rst
> @@ -188,3 +188,38 @@ Instructions to setup travis-ci for your GitHub repository:
>
>  4. Pushing a commit to the repository which breaks the build or the
>     testsuite will now trigger a email sent to mylist@mydomain.org
> +
> +Datapath testing
> +~~~~~~~~~~~~~~~~
> +
> +OVN includes a suite of tests specifically for datapath functionality.
> +The datapath tests make some assumptions about the environment.  They
> +must be run under root privileges on a Linux system with support for
> +network namespaces.  Make sure no other Open vSwitch instance is
> +running the test suite.  These tests may take several minutes to
> +complete, and cannot be run in parallel.
> +
> +To invoke the datapath testsuite, run::
> +
> +    $ make check-system-userspace

OVN also supports running system tests using kernel datapath - make
check-kernel.
We can probably document that too ?

Thanks
Numan

> +
> +The tests themselves must run as root.  If you do not run ``make`` as
> +root, then you can specify a program to get superuser privileges as
> +``SUDO=<program>``, e.g. the following uses ``sudo`` (the ``-E``
> +option is needed to pass through environment variables)::
> +
> +    $ make check-system-userspace SUDO='sudo -E'
> +
> +The results of the testsuite are in ``tests/system-userspace-testsuite.dir``.
> +
> +The testsuite creates and destroys tap devices named ``ovs-netdev``
> +and ``br0``.  If it is interrupted during a test, then before it can
> +be restarted, you may need to destroy these devices with commands like
> +the following::
> +
> +    ip tuntap del dev ovs-netdev mode tap
> +    ip tuntap del dev br0 mode tap
> +
> +All the features documented under `Unit Tests`_ are available for the
> +userspace datapath testsuite, except that the datapath testsuite does
> +not support running tests in parallel.
> diff --git a/tests/automake.mk b/tests/automake.mk
> index b363928fd73d..e7ea01f95065 100644
> --- a/tests/automake.mk
> +++ b/tests/automake.mk
> @@ -157,9 +157,11 @@ check-kernel: all
>         set $(SHELL) '$(SYSTEM_KMOD_TESTSUITE)' -C tests  AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
>         "$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
>
> - check-system-userspace: all
> +
> +SUDO = sudo -E
> +check-system-userspace: all
>         set $(SHELL) '$(SYSTEM_USERSPACE_TESTSUITE)' -C tests  AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
> -       "$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
> +       $(SUDO) "$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && $(SUDO) "$$@" --recheck)
>
>  clean-local:
>         test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
> --
> 2.26.2
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
Ben Pfaff Nov. 5, 2020, 5:01 p.m. UTC | #2
On Thu, Nov 05, 2020 at 04:36:23PM +0530, Numan Siddique wrote:
> On Thu, Nov 5, 2020 at 10:41 AM Ben Pfaff <blp@ovn.org> wrote:
> >
> > I hadn't run this before so I had to discover how it worked.
> >
> > Signed-off-by: Ben Pfaff <blp@ovn.org>
> > ---
> >  Documentation/topics/testing.rst | 35 ++++++++++++++++++++++++++++++++
> >  tests/automake.mk                |  6 ++++--
> >  2 files changed, 39 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/topics/testing.rst b/Documentation/topics/testing.rst
> > index 242608a17340..95e57dd6b98e 100644
> > --- a/Documentation/topics/testing.rst
> > +++ b/Documentation/topics/testing.rst
> > @@ -188,3 +188,38 @@ Instructions to setup travis-ci for your GitHub repository:
> >
> >  4. Pushing a commit to the repository which breaks the build or the
> >     testsuite will now trigger a email sent to mylist@mydomain.org
> > +
> > +Datapath testing
> > +~~~~~~~~~~~~~~~~
> > +
> > +OVN includes a suite of tests specifically for datapath functionality.
> > +The datapath tests make some assumptions about the environment.  They
> > +must be run under root privileges on a Linux system with support for
> > +network namespaces.  Make sure no other Open vSwitch instance is
> > +running the test suite.  These tests may take several minutes to
> > +complete, and cannot be run in parallel.
> > +
> > +To invoke the datapath testsuite, run::
> > +
> > +    $ make check-system-userspace
> 
> OVN also supports running system tests using kernel datapath - make
> check-kernel.
> We can probably document that too ?

Oh, you're right.  I guess I've never paid attention to these
testsuites.  Revised patch:

-8<--------------------------cut here-------------------------->8--

From: Ben Pfaff <blp@ovn.org>
Date: Wed, 4 Nov 2020 14:13:02 -0800
Subject: [PATCH ovn] Documentation: Document the system testsuites.

I hadn't run this before so I had to discover how it worked.

Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 Documentation/topics/testing.rst | 44 ++++++++++++++++++++++++++++++++
 tests/automake.mk                |  7 ++---
 2 files changed, 48 insertions(+), 3 deletions(-)

diff --git a/Documentation/topics/testing.rst b/Documentation/topics/testing.rst
index 242608a17340..152a8d733067 100644
--- a/Documentation/topics/testing.rst
+++ b/Documentation/topics/testing.rst
@@ -188,3 +188,47 @@ Instructions to setup travis-ci for your GitHub repository:
 
 4. Pushing a commit to the repository which breaks the build or the
    testsuite will now trigger a email sent to mylist@mydomain.org
+
+Datapath testing
+~~~~~~~~~~~~~~~~
+
+OVN includes a suite of tests specifically for datapath functionality.
+The datapath tests make some assumptions about the environment.  They
+must be run under root privileges on a Linux system with support for
+network namespaces.  Make sure no other Open vSwitch instance is
+running the test suite.  These tests may take several minutes to
+complete, and cannot be run in parallel.
+
+To invoke the datapath testsuite with the OVS userspace datapath,
+run::
+
+    $ make check-system-userspace
+
+The results of the userspace testsuite appear in
+``tests/system-userspace-testsuite.dir``.
+
+To invoke the datapath testsuite with the OVS kernel datapath, run::
+
+    $ make check-kernel
+
+The results of the kernel testsuite appear in
+``tests/system-kmod-testsuite.dir``.
+
+The tests themselves must run as root.  If you do not run ``make`` as
+root, then you can specify a program to get superuser privileges as
+``SUDO=<program>``, e.g. the following uses ``sudo`` (the ``-E``
+option is needed to pass through environment variables)::
+
+    $ make check-system-userspace SUDO='sudo -E'
+
+The testsuite creates and destroys tap devices named ``ovs-netdev``
+and ``br0``.  If it is interrupted during a test, then before it can
+be restarted, you may need to destroy these devices with commands like
+the following::
+
+    $ ip tuntap del dev ovs-netdev mode tap
+    $ ip tuntap del dev br0 mode tap
+
+All the features documented under `Unit Tests`_ are available for the
+datapath testsuites, except that the datapath testsuites do not
+support running tests in parallel.
diff --git a/tests/automake.mk b/tests/automake.mk
index b363928fd73d..44be2095a4cf 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -155,11 +155,12 @@ check-helgrind: all $(valgrind_wrappers) $(check_DATA)
 # Run kmod tests. Assume kernel modules has been installed or linked into the kernel
 check-kernel: all
 	set $(SHELL) '$(SYSTEM_KMOD_TESTSUITE)' -C tests  AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
-	"$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
+	$(SUDO) "$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && $(SUDO) "$$@" --recheck)
 
-check-system-userspace: all
+
+check-system-userspace: all
 	set $(SHELL) '$(SYSTEM_USERSPACE_TESTSUITE)' -C tests  AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
-	"$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
+	$(SUDO) "$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && $(SUDO) "$$@" --recheck)
 
 clean-local:
 	test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
Numan Siddique Nov. 5, 2020, 7:04 p.m. UTC | #3
On Thu, Nov 5, 2020, 10:32 PM Ben Pfaff <blp@ovn.org> wrote:

> On Thu, Nov 05, 2020 at 04:36:23PM +0530, Numan Siddique wrote:
> > On Thu, Nov 5, 2020 at 10:41 AM Ben Pfaff <blp@ovn.org> wrote:
> > >
> > > I hadn't run this before so I had to discover how it worked.
> > >
> > > Signed-off-by: Ben Pfaff <blp@ovn.org>
>


Thanks. Revised version looks good.

Acked-by: Numan Siddique <numans@ovn.org>

Numan

> > ---
> > >  Documentation/topics/testing.rst | 35 ++++++++++++++++++++++++++++++++
> > >  tests/automake.mk                |  6 ++++--
> > >  2 files changed, 39 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/Documentation/topics/testing.rst
> b/Documentation/topics/testing.rst
> > > index 242608a17340..95e57dd6b98e 100644
> > > --- a/Documentation/topics/testing.rst
> > > +++ b/Documentation/topics/testing.rst
> > > @@ -188,3 +188,38 @@ Instructions to setup travis-ci for your GitHub
> repository:
> > >
> > >  4. Pushing a commit to the repository which breaks the build or the
> > >     testsuite will now trigger a email sent to mylist@mydomain.org
> > > +
> > > +Datapath testing
> > > +~~~~~~~~~~~~~~~~
> > > +
> > > +OVN includes a suite of tests specifically for datapath functionality.
> > > +The datapath tests make some assumptions about the environment.  They
> > > +must be run under root privileges on a Linux system with support for
> > > +network namespaces.  Make sure no other Open vSwitch instance is
> > > +running the test suite.  These tests may take several minutes to
> > > +complete, and cannot be run in parallel.
> > > +
> > > +To invoke the datapath testsuite, run::
> > > +
> > > +    $ make check-system-userspace
> >
> > OVN also supports running system tests using kernel datapath - make
> > check-kernel.
> > We can probably document that too ?
>
> Oh, you're right.  I guess I've never paid attention to these
> testsuites.  Revised patch:
>
> -8<--------------------------cut here-------------------------->8--
>
> From: Ben Pfaff <blp@ovn.org>
> Date: Wed, 4 Nov 2020 14:13:02 -0800
> Subject: [PATCH ovn] Documentation: Document the system testsuites.
>
> I hadn't run this before so I had to discover how it worked.
>
> Signed-off-by: Ben Pfaff <blp@ovn.org>
> ---
>  Documentation/topics/testing.rst | 44 ++++++++++++++++++++++++++++++++
>  tests/automake.mk                |  7 ++---
>  2 files changed, 48 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/topics/testing.rst
> b/Documentation/topics/testing.rst
> index 242608a17340..152a8d733067 100644
> --- a/Documentation/topics/testing.rst
> +++ b/Documentation/topics/testing.rst
> @@ -188,3 +188,47 @@ Instructions to setup travis-ci for your GitHub
> repository:
>
>  4. Pushing a commit to the repository which breaks the build or the
>     testsuite will now trigger a email sent to mylist@mydomain.org
> +
> +Datapath testing
> +~~~~~~~~~~~~~~~~
> +
> +OVN includes a suite of tests specifically for datapath functionality.
> +The datapath tests make some assumptions about the environment.  They
> +must be run under root privileges on a Linux system with support for
> +network namespaces.  Make sure no other Open vSwitch instance is
> +running the test suite.  These tests may take several minutes to
> +complete, and cannot be run in parallel.
> +
> +To invoke the datapath testsuite with the OVS userspace datapath,
> +run::
> +
> +    $ make check-system-userspace
> +
> +The results of the userspace testsuite appear in
> +``tests/system-userspace-testsuite.dir``.
> +
> +To invoke the datapath testsuite with the OVS kernel datapath, run::
> +
> +    $ make check-kernel
> +
> +The results of the kernel testsuite appear in
> +``tests/system-kmod-testsuite.dir``.
> +
> +The tests themselves must run as root.  If you do not run ``make`` as
> +root, then you can specify a program to get superuser privileges as
> +``SUDO=<program>``, e.g. the following uses ``sudo`` (the ``-E``
> +option is needed to pass through environment variables)::
> +
> +    $ make check-system-userspace SUDO='sudo -E'
> +
> +The testsuite creates and destroys tap devices named ``ovs-netdev``
> +and ``br0``.  If it is interrupted during a test, then before it can
> +be restarted, you may need to destroy these devices with commands like
> +the following::
> +
> +    $ ip tuntap del dev ovs-netdev mode tap
> +    $ ip tuntap del dev br0 mode tap
> +
> +All the features documented under `Unit Tests`_ are available for the
> +datapath testsuites, except that the datapath testsuites do not
> +support running tests in parallel.
> diff --git a/tests/automake.mk b/tests/automake.mk
> index b363928fd73d..44be2095a4cf 100644
> --- a/tests/automake.mk
> +++ b/tests/automake.mk
> @@ -155,11 +155,12 @@ check-helgrind: all $(valgrind_wrappers)
> $(check_DATA)
>  # Run kmod tests. Assume kernel modules has been installed or linked into
> the kernel
>  check-kernel: all
>         set $(SHELL) '$(SYSTEM_KMOD_TESTSUITE)' -C tests
> AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
> -       "$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@"
> --recheck)
> +       $(SUDO) "$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes
> && $(SUDO) "$$@" --recheck)
>
> - check-system-userspace: all
> +
> +check-system-userspace: all
>         set $(SHELL) '$(SYSTEM_USERSPACE_TESTSUITE)' -C tests
> AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
> -       "$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@"
> --recheck)
> +       $(SUDO) "$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes
> && $(SUDO) "$$@" --recheck)
>
>  clean-local:
>         test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests
> --clean
> --
> 2.26.2
>
>
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
Ben Pfaff Nov. 6, 2020, 3:21 a.m. UTC | #4
On Fri, Nov 06, 2020 at 12:34:37AM +0530, Numan Siddique wrote:
> On Thu, Nov 5, 2020, 10:32 PM Ben Pfaff <blp@ovn.org> wrote:
> 
> > On Thu, Nov 05, 2020 at 04:36:23PM +0530, Numan Siddique wrote:
> > > On Thu, Nov 5, 2020 at 10:41 AM Ben Pfaff <blp@ovn.org> wrote:
> > > >
> > > > I hadn't run this before so I had to discover how it worked.
> > > >
> > > > Signed-off-by: Ben Pfaff <blp@ovn.org>
> >
> 
> 
> Thanks. Revised version looks good.
> 
> Acked-by: Numan Siddique <numans@ovn.org>

Thanks!  Applied to OVN master.
diff mbox series

Patch

diff --git a/Documentation/topics/testing.rst b/Documentation/topics/testing.rst
index 242608a17340..95e57dd6b98e 100644
--- a/Documentation/topics/testing.rst
+++ b/Documentation/topics/testing.rst
@@ -188,3 +188,38 @@  Instructions to setup travis-ci for your GitHub repository:
 
 4. Pushing a commit to the repository which breaks the build or the
    testsuite will now trigger a email sent to mylist@mydomain.org
+
+Datapath testing
+~~~~~~~~~~~~~~~~
+
+OVN includes a suite of tests specifically for datapath functionality.
+The datapath tests make some assumptions about the environment.  They
+must be run under root privileges on a Linux system with support for
+network namespaces.  Make sure no other Open vSwitch instance is
+running the test suite.  These tests may take several minutes to
+complete, and cannot be run in parallel.
+
+To invoke the datapath testsuite, run::
+
+    $ make check-system-userspace
+
+The tests themselves must run as root.  If you do not run ``make`` as
+root, then you can specify a program to get superuser privileges as
+``SUDO=<program>``, e.g. the following uses ``sudo`` (the ``-E``
+option is needed to pass through environment variables)::
+
+    $ make check-system-userspace SUDO='sudo -E'
+
+The results of the testsuite are in ``tests/system-userspace-testsuite.dir``.
+
+The testsuite creates and destroys tap devices named ``ovs-netdev``
+and ``br0``.  If it is interrupted during a test, then before it can
+be restarted, you may need to destroy these devices with commands like
+the following::
+
+    ip tuntap del dev ovs-netdev mode tap
+    ip tuntap del dev br0 mode tap
+
+All the features documented under `Unit Tests`_ are available for the
+userspace datapath testsuite, except that the datapath testsuite does
+not support running tests in parallel.
diff --git a/tests/automake.mk b/tests/automake.mk
index b363928fd73d..e7ea01f95065 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -157,9 +157,11 @@  check-kernel: all
 	set $(SHELL) '$(SYSTEM_KMOD_TESTSUITE)' -C tests  AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
 	"$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
 
-check-system-userspace: all
+
+SUDO = sudo -E
+check-system-userspace: all
 	set $(SHELL) '$(SYSTEM_USERSPACE_TESTSUITE)' -C tests  AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
-	"$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
+	$(SUDO) "$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && $(SUDO) "$$@" --recheck)
 
 clean-local:
 	test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean