diff mbox series

[ovs-dev,03/13] tests: Use fmt_pkt in VLAN transparency, ...

Message ID 20231010203400.1045353-4-mmichels@redhat.com
State Changes Requested
Headers show
Series tests: Convert some tests to use fmt_pkt. | expand

Checks

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

Commit Message

Mark Michelson Oct. 10, 2023, 8:33 p.m. UTC
...passthru=true, ARP responder disabled

Execution time: 2.466s
Execution time on "main" branch: 1.751s

Signed-off-by: Mark Michelson <mmichels@redhat.com>
---
 tests/ovn.at | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Comments

Ihar Hrachyshka Oct. 12, 2023, 8:18 p.m. UTC | #1
On Tue, Oct 10, 2023 at 4:34 PM Mark Michelson <mmichels@redhat.com> wrote:

> ...passthru=true, ARP responder disabled
>
> Execution time: 2.466s
> Execution time on "main" branch: 1.751s
>
> Signed-off-by: Mark Michelson <mmichels@redhat.com>
> ---
>  tests/ovn.at | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/tests/ovn.at b/tests/ovn.at
> index a8c483098..df2b0c774 100644
> --- a/tests/ovn.at
> +++ b/tests/ovn.at
> @@ -3701,12 +3701,15 @@ done
>
>  test_arp() {
>      local inport=$1 outport=$2 sha=$3 spa=$4 tpa=$5 reply_ha=$6
> -    tag=8100fefe
> -    local
> request=ffffffffffff${sha}${tag}08060001080006040001${sha}${spa}ffffffffffff${tpa}
> +    local request=$(fmt_pkt "Ether(dst='ff:ff:ff:ff:ff:ff',
> src='${sha}')/ \
> +                             Dot1Q(vlan=0xefe)/ \
> +                             ARP(hwsrc='${sha}',
> hwdst='ff:ff:ff:ff:ff:ff', psrc='${spa}', pdst='${tpa}')")
>      as hv-$inport ovs-appctl netdev-dummy/receive vif$inport $request
>      echo $request >> $outport.expected
>
> -    local
> reply=${sha}${reply_ha}${tag}08060001080006040002${reply_ha}${tpa}${sha}${spa}
> +    local reply=$(fmt_pkt "Ether(dst='${sha}', src='${reply_ha}')/ \
> +                           Dot1Q(vlan=0xefe)/ \
> +                           ARP(op=2, hwsrc='${reply_ha}', hwdst='${sha}',
> psrc='${tpa}', pdst='${spa}')")
>      as hv-$outport ovs-appctl netdev-dummy/receive vif$outport $reply
>      echo $reply >> $inport.expected
>  }
> @@ -3716,8 +3719,8 @@ test_arp() {
>  # for ARP resolution).
>  OVN_POPULATE_ARP
>
> -test_arp 1 2 f00000000001 0a000001 0a000002 f00000000002
> -test_arp 2 1 f00000000002 0a000002 0a000001 f00000000001
> +test_arp 1 2 f0:00:00:00:00:01 10.0.0.1 10.0.0.1 f0:00:00:00:00:02
>

You flipped $tpa from 10.0.0.2 to 10.0.0.1 above. Was it intentional?


> +test_arp 2 1 f0:00:00:00:00:02 10.0.0.2 10.0.0.1 f0:00:00:00:00:01
>
>  for i in 1 2; do
>      OVN_CHECK_PACKETS([vif$i-tx.pcap], [$i.expected])
> --
> 2.40.1
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
diff mbox series

Patch

diff --git a/tests/ovn.at b/tests/ovn.at
index a8c483098..df2b0c774 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -3701,12 +3701,15 @@  done
 
 test_arp() {
     local inport=$1 outport=$2 sha=$3 spa=$4 tpa=$5 reply_ha=$6
-    tag=8100fefe
-    local request=ffffffffffff${sha}${tag}08060001080006040001${sha}${spa}ffffffffffff${tpa}
+    local request=$(fmt_pkt "Ether(dst='ff:ff:ff:ff:ff:ff', src='${sha}')/ \
+                             Dot1Q(vlan=0xefe)/ \
+                             ARP(hwsrc='${sha}', hwdst='ff:ff:ff:ff:ff:ff', psrc='${spa}', pdst='${tpa}')")
     as hv-$inport ovs-appctl netdev-dummy/receive vif$inport $request
     echo $request >> $outport.expected
 
-    local reply=${sha}${reply_ha}${tag}08060001080006040002${reply_ha}${tpa}${sha}${spa}
+    local reply=$(fmt_pkt "Ether(dst='${sha}', src='${reply_ha}')/ \
+                           Dot1Q(vlan=0xefe)/ \
+                           ARP(op=2, hwsrc='${reply_ha}', hwdst='${sha}', psrc='${tpa}', pdst='${spa}')")
     as hv-$outport ovs-appctl netdev-dummy/receive vif$outport $reply
     echo $reply >> $inport.expected
 }
@@ -3716,8 +3719,8 @@  test_arp() {
 # for ARP resolution).
 OVN_POPULATE_ARP
 
-test_arp 1 2 f00000000001 0a000001 0a000002 f00000000002
-test_arp 2 1 f00000000002 0a000002 0a000001 f00000000001
+test_arp 1 2 f0:00:00:00:00:01 10.0.0.1 10.0.0.1 f0:00:00:00:00:02
+test_arp 2 1 f0:00:00:00:00:02 10.0.0.2 10.0.0.1 f0:00:00:00:00:01
 
 for i in 1 2; do
     OVN_CHECK_PACKETS([vif$i-tx.pcap], [$i.expected])