diff mbox series

[ovs-dev] Fwd: [PATCH] tests: introduced tests for adding/deleting logical routers in VTEP database

Message ID CABi-v1BLHqfVpJeL0UziLCvmTKpeN1m6uYTsrd=EoYtSMBf06Q@mail.gmail.com
State Superseded
Headers show
Series [ovs-dev] Fwd: [PATCH] tests: introduced tests for adding/deleting logical routers in VTEP database | expand

Commit Message

Damijan Skvarc Dec. 13, 2019, 9:23 a.m. UTC
new tests were introduced based on lcov report, which point out this
part of the code is not covered by ovs test suites.

Signed-off-by: Damijan Skvarc <damjan.skvarc@gmail.com>
---
 tests/vtep-ctl.at | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 87 insertions(+)

dev mailing list
dev@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Comments

Ben Pfaff Dec. 13, 2019, 7:09 p.m. UTC | #1
On Fri, Dec 13, 2019 at 10:23:53AM +0100, Damijan Skvarc wrote:
> new tests were introduced based on lcov report, which point out this
> part of the code is not covered by ovs test suites.
> 
> Signed-off-by: Damijan Skvarc <damjan.skvarc@gmail.com>

This patch does not apply for me.  "git am" reports that it is corrupted.
Damijan Skvarc Dec. 13, 2019, 7:24 p.m. UTC | #2
Thanks for trying. Yes, I know it is corupted, I had some problems with
mailing and while manually trying to fix the issue I did a mess.
Unfortunately, I am not able to resend the patch within a short time. I'll
do this ASAP.

Thanks, damijan

On Fri, 13 Dec 2019, 20:09 Ben Pfaff, <blp@ovn.org> wrote:

> On Fri, Dec 13, 2019 at 10:23:53AM +0100, Damijan Skvarc wrote:
> > new tests were introduced based on lcov report, which point out this
> > part of the code is not covered by ovs test suites.
> >
> > Signed-off-by: Damijan Skvarc <damjan.skvarc@gmail.com>
>
> This patch does not apply for me.  "git am" reports that it is corrupted.
>
diff mbox series

Patch

diff --git a/tests/vtep-ctl.at b/tests/vtep-ctl.at
index 3949f16..9806765 100644
--- a/tests/vtep-ctl.at
+++ b/tests/vtep-ctl.at
@@ -129,6 +129,39 @@  m4_define([CHECK_LSWITCHES],
    AT_CHECK([RUN_VTEP_CTL([ls-exists nonexistent])], [2], [], [],
             [VTEP_CTL_CLEANUP])])

+
+dnl CHECK_LROUTERS([LROUTER], ...)
+dnl
+dnl Verifies that "vtep-ctl list-lr" prints the specified list of
+dnl logical routers, which must be in alphabetical order.
+m4_define([CHECK_LROUTERS],
+  [dnl Check that the lrouters appear on list-lr, without --oneline.
+   AT_CHECK(
+     [RUN_VTEP_CTL([list-lr])],
+     [0],
+     [m4_foreach([lrinfo], [$@], [m4_car(lrinfo)
+])],
+     [],
+     [VTEP_CTL_CLEANUP])
+
+   dnl Check that the lswitches appear on list-lr, with --oneline.
+   AT_CHECK(
+     [RUN_VTEP_CTL_ONELINE([list-lr])],
+     [0],
+     [m4_join([\n], m4_foreach([lrinfo], [$@], [m4_car(lrinfo),]))
+],
+     [],
+     [VTEP_CTL_CLEANUP])
+
+   dnl Check that each lrouter exists according to lr-exists and that
+   dnl a prouter that should not exist does not.
+   m4_foreach([lrinfo], [$@],
+              [AT_CHECK([RUN_VTEP_CTL([lr-exists m4_car(lrinfo)])], [0], [],
+                        [], [VTEP_CTL_CLEANUP])])
+   AT_CHECK([RUN_VTEP_CTL([lr-exists nonexistent])], [2], [], [],
+            [VTEP_CTL_CLEANUP])])
+
+
 dnl ----------------------------------------------------------------------
 AT_BANNER([vtep-ctl unit tests -- physical switch tests])

@@ -351,6 +384,60 @@  AT_CHECK([RUN_VTEP_CTL(
 VTEP_CTL_CLEANUP
 AT_CLEANUP

+
+dnl ----------------------------------------------------------------------
+AT_BANNER([vtep-ctl unit tests -- logical router tests])
+
+AT_SETUP([add-lr a])
+AT_KEYWORDS([vtep-ctl])
+VTEP_CTL_SETUP
+AT_CHECK([RUN_VTEP_CTL([add-lr a])], [0], [], [], [VTEP_CTL_CLEANUP])
+CHECK_LROUTERS([a])
+VTEP_CTL_CLEANUP
+AT_CLEANUP
+
+AT_SETUP([add-lr a, add-lr a])
+AT_KEYWORDS([vtep-ctl])
+VTEP_CTL_SETUP
+AT_CHECK([RUN_VTEP_CTL([add-lr a])], [0], [], [], [VTEP_CTL_CLEANUP])
+AT_CHECK([RUN_VTEP_CTL([add-lr a])], [1], [],
+  [vtep-ctl: cannot create logical router a because it already exists
+], [VTEP_CTL_CLEANUP])
+VTEP_CTL_CLEANUP
+AT_CLEANUP
+
+AT_SETUP([add-lr a, add-lr b])
+AT_KEYWORDS([vtep-ctl])
+VTEP_CTL_SETUP
+AT_CHECK([RUN_VTEP_CTL([add-lr a], [add-lr b])], [0], [], [],
+         [VTEP_CTL_CLEANUP])
+CHECK_LROUTERS([a], [b])
+VTEP_CTL_CLEANUP
+AT_CLEANUP
+
+AT_SETUP([add-lr a, add-lr b, del-lr a])
+AT_KEYWORDS([vtep-ctl])
+VTEP_CTL_SETUP
+AT_CHECK([RUN_VTEP_CTL([add-lr a], [add-lr b], [del-lr a])], [0], [], [],
+         [VTEP_CTL_CLEANUP])
+CHECK_LROUTERS([b])
+VTEP_CTL_CLEANUP
+AT_CLEANUP
+
+AT_SETUP([add-lr a, del-lr a, add-lr a])
+AT_KEYWORDS([vtep-ctl])
+VTEP_CTL_SETUP
+AT_CHECK([RUN_VTEP_CTL_TOGETHER(
+  [add-lr a],
+  [del-lr a],
+  [add-lr a])], [0], [
+
+
+], [], [VTEP_CTL_CLEANUP])
+CHECK_LROUTERS([a])
+VTEP_CTL_CLEANUP
+AT_CLEANUP
+
 dnl ----------------------------------------------------------------------
 AT_BANNER([vtep-ctl unit tests -- logical binding tests])
_______________________________________________