# may immediately update the database. this later update may cause database
# sending update back to *ctl command if *ctl has not proceeded to exit yet.
# and if *ctl command exits before database calling send, the send from
- # database will fail with 'Broken pipe' error.
+ # database will fail with 'Broken pipe' error. Also removes all "connection
+ # reset" warning logs by a similar rationale (either EPIPE or ECONNRESET can
+ # be returned on a send depending on whether the peer had unconsumed data when
+ # it closed the socket).
AT_CHECK([check_logs "$1
+/reset by peer/d
/Broken pipe/d"])
OVS_APP_EXIT_AND_WAIT([ovsdb-server])])
-AT_SETUP([ovn-nbctl - basic lswitch commands])
+AT_SETUP([ovn-nbctl - basic switch commands])
OVN_NBCTL_TEST_START
-AT_CHECK([ovn-nbctl lswitch-add ls0])
-AT_CHECK([ovn-nbctl lswitch-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl
+AT_CHECK([ovn-nbctl ls-add ls0])
+AT_CHECK([ovn-nbctl ls-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl
<0> (ls0)
])
-AT_CHECK([ovn-nbctl lswitch-add ls1])
-AT_CHECK([ovn-nbctl lswitch-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl
+AT_CHECK([ovn-nbctl ls-add ls1])
+AT_CHECK([ovn-nbctl ls-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl
<0> (ls0)
<1> (ls1)
])
-AT_CHECK([ovn-nbctl lswitch-del ls0])
-AT_CHECK([ovn-nbctl lswitch-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl
+AT_CHECK([ovn-nbctl ls-del ls0])
+AT_CHECK([ovn-nbctl ls-list | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl
<0> (ls1)
])
AT_CHECK([ovn-nbctl show ls0])
-AT_CHECK([ovn-nbctl lswitch-add ls0])
+AT_CHECK([ovn-nbctl ls-add ls0])
AT_CHECK([ovn-nbctl show ls0 | ${PERL} $srcdir/uuidfilt.pl], [0],
- [ lswitch <0> (ls0)
+ [ switch <0> (ls0)
])
-AT_CHECK([ovn-nbctl lswitch-add ls0], [1], [],
- [ovn-nbctl: ls0: an lswitch with this name already exists
+AT_CHECK([ovn-nbctl ls-add ls0], [1], [],
+ [ovn-nbctl: ls0: a switch with this name already exists
])
-AT_CHECK([ovn-nbctl --may-exist lswitch-add ls0])
+AT_CHECK([ovn-nbctl --may-exist ls-add ls0])
AT_CHECK([ovn-nbctl show ls0 | ${PERL} $srcdir/uuidfilt.pl], [0],
- [ lswitch <0> (ls0)
+ [ switch <0> (ls0)
])
-AT_CHECK([ovn-nbctl --add-duplicate lswitch-add ls0])
-AT_CHECK([ovn-nbctl --may-exist --add-duplicate lswitch-add ls0], [1], [],
+AT_CHECK([ovn-nbctl --add-duplicate ls-add ls0])
+AT_CHECK([ovn-nbctl --may-exist --add-duplicate ls-add ls0], [1], [],
[ovn-nbctl: --may-exist and --add-duplicate may not be used together
])
-AT_CHECK([ovn-nbctl lswitch-del ls0], [1], [],
+AT_CHECK([ovn-nbctl ls-del ls0], [1], [],
[ovn-nbctl: Multiple logical switches named 'ls0'. Use a UUID.
])
-AT_CHECK([ovn-nbctl lswitch-del ls2], [1], [],
- [ovn-nbctl: ls2: lswitch name not found
+AT_CHECK([ovn-nbctl ls-del ls2], [1], [],
+ [ovn-nbctl: ls2: switch name not found
])
-AT_CHECK([ovn-nbctl --if-exists lswitch-del ls2])
+AT_CHECK([ovn-nbctl --if-exists ls-del ls2])
-AT_CHECK([ovn-nbctl lswitch-add])
-AT_CHECK([ovn-nbctl lswitch-add])
-AT_CHECK([ovn-nbctl --add-duplicate lswitch-add], [1], [],
+AT_CHECK([ovn-nbctl ls-add])
+AT_CHECK([ovn-nbctl ls-add])
+AT_CHECK([ovn-nbctl --add-duplicate ls-add], [1], [],
[ovn-nbctl: --add-duplicate requires specifying a name
])
-AT_CHECK([ovn-nbctl --may-exist lswitch-add], [1], [],
+AT_CHECK([ovn-nbctl --may-exist ls-add], [1], [],
[ovn-nbctl: --may-exist requires specifying a name
])
AT_SETUP([ovn-nbctl - basic logical switch port commands])
OVN_NBCTL_TEST_START
-AT_CHECK([ovn-nbctl lswitch-add ls0])
+AT_CHECK([ovn-nbctl ls-add ls0])
AT_CHECK([ovn-nbctl lsp-add ls0 lp0])
AT_CHECK([ovn-nbctl lsp-add ls0 lp0], [1], [],
[ovn-nbctl: lp0: a port with this name already exists
<1> (lp1)
])
-AT_CHECK([ovn-nbctl lswitch-add ls1])
+AT_CHECK([ovn-nbctl ls-add ls1])
AT_CHECK([ovn-nbctl lsp-add ls0 lp1], [1], [],
[ovn-nbctl: lp1: a port with this name already exists
])
AT_CHECK([ovn-nbctl --may-exist lsp-add ls1 lp1], [1], [],
- [ovn-nbctl: lp1: port already exists but in lswitch ls0
+ [ovn-nbctl: lp1: port already exists but in switch ls0
])
AT_CHECK([ovn-nbctl --may-exist lsp-add ls0 lp1 lp0 5], [1], [],
[ovn-nbctl: lp1: port already exists but has no parent
AT_SETUP([ovn-nbctl - lport addresses])
OVN_NBCTL_TEST_START
-AT_CHECK([ovn-nbctl lswitch-add ls0])
+AT_CHECK([ovn-nbctl ls-add ls0])
AT_CHECK([ovn-nbctl lsp-add ls0 lp0])
AT_CHECK([ovn-nbctl lsp-get-addresses lp0], [0], [dnl
])
AT_SETUP([ovn-nbctl - port security])
OVN_NBCTL_TEST_START
-AT_CHECK([ovn-nbctl lswitch-add ls0])
+AT_CHECK([ovn-nbctl ls-add ls0])
AT_CHECK([ovn-nbctl lsp-add ls0 lp0])
AT_CHECK([ovn-nbctl lsp-get-addresses lp0], [0], [dnl
])
AT_SETUP([ovn-nbctl - ACLs])
OVN_NBCTL_TEST_START
-AT_CHECK([ovn-nbctl lswitch-add ls0])
+AT_CHECK([ovn-nbctl ls-add ls0])
AT_CHECK([ovn-nbctl --log acl-add ls0 from-lport 600 udp drop])
AT_CHECK([ovn-nbctl --log acl-add ls0 to-lport 500 udp drop])
AT_CHECK([ovn-nbctl acl-add ls0 from-lport 400 tcp drop])
AT_CHECK([ovn-nbctl lr-add lr0])
AT_CHECK([ovn-nbctl lrp-add lr0 lrp0 00:00:00:01:02:03 192.168.1.1/24])
+
+AT_CHECK([ovn-nbctl show lr0 | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl
+ router <0> (lr0)
+ port lrp0
+ mac: "00:00:00:01:02:03"
+ networks: [["192.168.1.1/24"]]
+])
+
AT_CHECK([ovn-nbctl lrp-add lr0 lrp0 00:00:00:01:02:03 192.168.1.1/24], [1], [],
[ovn-nbctl: lrp0: a port with this name already exists
])
<0> (lrp0)
])
-AT_CHECK([ovn-nbctl lrp-add lr0 lrp1 00:00:00:01:02:03 192.168.1.1/24 lrp1-peer])
+AT_CHECK([ovn-nbctl lrp-add lr0 lrp1 00:00:00:01:02:03 192.168.1.1/24 peer=lrp1-peer])
AT_CHECK([ovn-nbctl lrp-list lr0 | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl
<0> (lrp0)
<1> (lrp1)
[ovn-nbctl: lrp1: port already exists with mismatching peer
])
-AT_CHECK([ovn-nbctl --may-exist lrp-add lr0 lrp1 00:00:00:01:02:03 192.168.1.1/24 lrp1-peer])
+AT_CHECK([ovn-nbctl --may-exist lrp-add lr0 lrp1 00:00:00:01:02:03 10.0.0.1/24 peer=lrp1-peer], [1], [],
+ [ovn-nbctl: lrp1: port already exists with different network
+])
+
+AT_CHECK([ovn-nbctl --may-exist lrp-add lr0 lrp1 00:00:00:01:02:03 192.168.1.1/24 peer=lrp1-peer])
AT_CHECK([ovn-nbctl lrp-del lrp1])
AT_CHECK([ovn-nbctl lrp-list lr0 | ${PERL} $srcdir/uuidfilt.pl], [0], [dnl
<0> (lrp0)
])
+AT_CHECK([ovn-nbctl --may-exist lrp-add lr0 lrp1 00:00:00:01:02:03 192.168.1.1/24 10.0.0.1/24 peer=lrp1-peer])
+
+AT_CHECK([ovn-nbctl --may-exist lrp-add lr0 lrp1 00:00:00:01:02:03 192.168.1.1/24 172.16.0.1/24 peer=lrp1-peer], [1], [],
+ [ovn-nbctl: lrp1: port already exists with different network
+])
+
+AT_CHECK([ovn-nbctl --may-exist lrp-add lr0 lrp1 00:00:00:01:02:03 10.0.0.1/24 192.168.1.1/24 peer=lrp1-peer])
+
OVN_NBCTL_TEST_STOP
AT_CLEANUP
0.0.0.0/0 192.168.0.1
])
+AT_CHECK([ovn-nbctl --may-exist lr-route-add lr0 10.0.0.111/24 11.0.0.1 lp1])
+AT_CHECK([ovn-nbctl lr-route-list lr0], [0], [dnl
+IPv4 Routes
+ 10.0.0.0/24 11.0.0.1 lp1
+ 10.0.1.0/24 11.0.1.1 lp0
+ 0.0.0.0/0 192.168.0.1
+])
+
dnl Delete non-existent prefix
AT_CHECK([ovn-nbctl lr-route-del lr0 10.0.2.1/24], [1], [],
[ovn-nbctl: no matching prefix: 10.0.2.0/24
AT_CHECK([ovn-nbctl lr-route-list lr0], [0], [dnl
IPv4 Routes
- 10.0.0.0/24 11.0.0.1
+ 10.0.0.0/24 11.0.0.1 lp1
0.0.0.0/0 192.168.0.1
])
])
dnl Check IPv6 routes
-AT_CHECK([ovn-nbctl lr-route-add lr0 ::/0 2001:0db8:0:f101::1])
+AT_CHECK([ovn-nbctl lr-route-add lr0 0:0:0:0:0:0:0:0/0 2001:0db8:0:f101::1])
AT_CHECK([ovn-nbctl lr-route-add lr0 2001:0db8:0::/64 2001:0db8:0:f102::1 lp0])
AT_CHECK([ovn-nbctl lr-route-add lr0 2001:0db8:1::/64 2001:0db8:0:f103::1])
AT_CHECK([ovn-nbctl lr-route-add lr0 0.0.0.0/0 192.168.0.1])
AT_CHECK([ovn-nbctl lr-route-add lr0 10.0.1.1/24 11.0.1.1 lp0])
AT_CHECK([ovn-nbctl lr-route-add lr0 10.0.0.1/24 11.0.0.1])
-AT_CHECK([ovn-nbctl lr-route-add lr0 ::/0 2001:0db8:0:f101::1])
+AT_CHECK([ovn-nbctl lr-route-add lr0 0:0:0:0:0:0:0:0/0 2001:0db8:0:f101::1])
AT_CHECK([ovn-nbctl lr-route-add lr0 2001:0db8:0::/64 2001:0db8:0:f102::1 lp0])
AT_CHECK([ovn-nbctl lr-route-add lr0 2001:0db8:1::/64 2001:0db8:0:f103::1])