diff mbox series

[ovs-dev,branch-22.09,1/3] ovn-macros: support ipv6 in ovn_attach

Message ID 20230131091047.184728-1-amusil@redhat.com
State Accepted
Headers show
Series [ovs-dev,branch-22.09,1/3] ovn-macros: support ipv6 in ovn_attach | expand

Checks

Context Check Description
ovsrobot/apply-robot warning apply and check: warning
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes fail github build: failed

Commit Message

Ales Musil Jan. 31, 2023, 9:10 a.m. UTC
From: Felix Hüttner <felix.huettner@mail.schwarz>

in order to easily add future ipv6 test cases the common `ovn_attach`
function should also support ipv6 addresses.

Acked-by: Numan Siddique <numans@ovn.org>
Signed-off-by: Felix Huettner <felix.huettner@mail.schwarz>
Signed-off-by: Numan Siddique <numans@ovn.org>
Signed-off-by: Ales Musil <amusil@redhat.com>
(cherry picked from commit 1c6167d2)
---
 tests/ovn-macros.at | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Comments

0-day Robot Jan. 31, 2023, 9:18 a.m. UTC | #1
Bleep bloop.  Greetings Ales Musil, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
ERROR: Author Felix Hüttner <felix.huettner@mail.schwarz> needs to sign off.
WARNING: Unexpected sign-offs from developers who are not authors or co-authors or committers: Felix Huettner <felix.huettner@mail.schwarz>, Numan Siddique <numans@ovn.org>, Ales Musil <amusil@redhat.com>
Lines checked: 56, Warnings: 1, Errors: 1


Please check this out.  If you feel there has been an error, please email aconole@redhat.com

Thanks,
0-day Robot
diff mbox series

Patch

diff --git a/tests/ovn-macros.at b/tests/ovn-macros.at
index a3c7f8125..d48ea6916 100644
--- a/tests/ovn-macros.at
+++ b/tests/ovn-macros.at
@@ -288,14 +288,19 @@  net_attach () {
         || return 1
 }
 
-# ovn_az_attach AZ NETWORK BRIDGE IP [MASKLEN]
+# ovn_az_attach AZ NETWORK BRIDGE IP [MASKLEN] [ENCAP]
 ovn_az_attach() {
     local az=$1 net=$2 bridge=$3 ip=$4 masklen=${5-24} encap=${6-geneve,vxlan}
     net_attach $net $bridge || return 1
 
     mac=`ovs-vsctl get Interface $bridge mac_in_use | sed s/\"//g`
     arp_table="$arp_table $sandbox,$bridge,$ip,$mac"
-    ovs-appctl netdev-dummy/ip4addr $bridge $ip/$masklen >/dev/null || return 1
+    if test -z $(echo $ip | sed '/:/d'); then
+        ipversion="6"
+    else
+        ipversion="4"
+    fi
+    ovs-appctl netdev-dummy/ip${ipversion}addr $bridge $ip/$masklen >/dev/null || return 1
     ovs-appctl ovs/route/add $ip/$masklen $bridge >/dev/null || return 1
 
     local ovn_remote
@@ -329,7 +334,7 @@  ovn_az_attach() {
     start_daemon ovn-controller --enable-dummy-vif-plug || return 1
 }
 
-# ovn_attach NETWORK BRIDGE IP [MASKLEN]
+# ovn_attach NETWORK BRIDGE IP [MASKLEN] [ENCAP]
 #
 # First, this command attaches BRIDGE to interconnection network NETWORK, just
 # like "net_attach NETWORK BRIDGE".  Second, it configures (simulated) IP