Re: [ovs-dev] [PATCH ovn 3/4] tests: Factor out reset_pcap_file() helper.

2022-07-19 Thread Dumitru Ceara
On 7/19/22 19:17, Numan Siddique wrote:
> On Tue, Jul 5, 2022 at 7:11 AM Dumitru Ceara  wrote:
>>
>> Signed-off-by: Dumitru Ceara 
> 
> 
> Thanks for this patch.
>

Thanks for reviewing this patch set!

> The below test cases is failing with this patch
> 
> 347. ovn.at:14447: 347. localnet connectivity with multiple
> requested-chassis -- ovn-northd -- parallelization=yes --
> ovn_monitor_all=yes (ovn.at:14447): FAILED (--)
> 348. ovn.at:14447: 348. localnet connectivity with multiple
> requested-chassis -- ovn-northd -- parallelization=yes --
> ovn_monitor_all=no (ovn.at:14447): FAILED (--)
> 349. ovn.at:14447: 349. localnet connectivity with multiple
> requested-chassis -- ovn-northd -- parallelization=no --
> ovn_monitor_all=yes (ovn.at:14447): FAILED (--)
> 
> +ovs-vsctl: no row "hv1" in table Interface
> ../../tests/ovn-macros.at:384: exit code was 1, expected 0
> 350. ovn.at:14447: 350. localnet connectivity with multiple
> requested-chassis -- ovn-northd -- parallelization=no --
> ovn_monitor_all=no (ovn.at:14447): FAILED (--)
> 
> Can you please take  a look.
> 

It just needed a rebase and fixing up a new call to reset_pcap_file().
I posted v2:

https://patchwork.ozlabs.org/project/ovn/list/?series=310294=*

Thanks,
Dumitru

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


Re: [ovs-dev] [PATCH ovn 3/4] tests: Factor out reset_pcap_file() helper.

2022-07-19 Thread Numan Siddique
On Tue, Jul 5, 2022 at 7:11 AM Dumitru Ceara  wrote:
>
> Signed-off-by: Dumitru Ceara 


Thanks for this patch.

The below test cases is failing with this patch

347. ovn.at:14447: 347. localnet connectivity with multiple
requested-chassis -- ovn-northd -- parallelization=yes --
ovn_monitor_all=yes (ovn.at:14447): FAILED (--)
348. ovn.at:14447: 348. localnet connectivity with multiple
requested-chassis -- ovn-northd -- parallelization=yes --
ovn_monitor_all=no (ovn.at:14447): FAILED (--)
349. ovn.at:14447: 349. localnet connectivity with multiple
requested-chassis -- ovn-northd -- parallelization=no --
ovn_monitor_all=yes (ovn.at:14447): FAILED (--)

+ovs-vsctl: no row "hv1" in table Interface
../../tests/ovn-macros.at:384: exit code was 1, expected 0
350. ovn.at:14447: 350. localnet connectivity with multiple
requested-chassis -- ovn-northd -- parallelization=no --
ovn_monitor_all=no (ovn.at:14447): FAILED (--)

Can you please take  a look.

Numan

> ---
>  tests/ovn-macros.at |   20 +++
>  tests/ovn.at|  358 
> +++
>  2 files changed, 43 insertions(+), 335 deletions(-)
>
> diff --git a/tests/ovn-macros.at b/tests/ovn-macros.at
> index 335f9158c..77e89f6b4 100644
> --- a/tests/ovn-macros.at
> +++ b/tests/ovn-macros.at
> @@ -508,9 +508,13 @@ wait_for_ports_up() {
>  fi
>  }
>
> -# reset_pcap_file iface pcap_file
> +# reset_iface_pcap_file iface pcap_file
>  # Resets the pcap file associates with OVS interface.  should be used
>  # with dummy datapath.
> +#
> +# XXX: This should actually replace reset_pcap_file() as they do almost
> +# exactly the same thing but the "wait while the pcap file has the size
> +# of the PCAP header" check causes tests to fail.
>  reset_iface_pcap_file() {
>  local iface=$1
>  local pcap_file=$2
> @@ -525,6 +529,20 @@ options:rxq_pcap=${pcap_file}-rx.pcap
>  OVS_WAIT_WHILE([test 24 = $(wc -c ${pcap_file}-tx.pcap | cut -d " " 
> -f1)])
>  }
>
> +# reset_pcap_file iface pcap_file
> +# Resets the pcap file associates with OVS interface.  should be used
> +# with dummy datapath.
> +reset_pcap_file() {
> +local iface=$1
> +local pcap_file=$2
> +check rm -f dummy-*.pcap
> +check ovs-vsctl -- set Interface $iface options:tx_pcap=dummy-tx.pcap \
> +options:rxq_pcap=dummy-rx.pcap
> +check rm -f ${pcap_file}*.pcap
> +check ovs-vsctl -- set Interface $iface 
> options:tx_pcap=${pcap_file}-tx.pcap \
> +options:rxq_pcap=${pcap_file}-rx.pcap
> +}
> +
>  # Receive a packet on a dummy netdev interface. If we expect packets to be
>  # recorded, then wait until the pcap file reflects the change.
>  netdev_dummy_receive() {
> diff --git a/tests/ovn.at b/tests/ovn.at
> index 0e868ae66..9512fd033 100644
> --- a/tests/ovn.at
> +++ b/tests/ovn.at
> @@ -6479,16 +6479,6 @@ compare_dhcp_packets() {
>  fi
>  }
>
> -reset_pcap_file() {
> -local iface=$1
> -local pcap_file=$2
> -check ovs-vsctl -- set Interface $iface options:tx_pcap=dummy-tx.pcap \
> -options:rxq_pcap=dummy-rx.pcap
> -rm -f ${pcap_file}*.pcap
> -check ovs-vsctl -- set Interface $iface 
> options:tx_pcap=${pcap_file}-tx.pcap \
> -options:rxq_pcap=${pcap_file}-rx.pcap
> -}
> -
>  AT_CAPTURE_FILE([sbflows])
>  ovn-sbctl dump-flows > sbflows
>
> @@ -7074,16 +7064,6 @@ test_dhcpv6() {
>  as hv1 ovs-appctl netdev-dummy/receive hv1-vif$inport $request
>  }
>
> -reset_pcap_file() {
> -local iface=$1
> -local pcap_file=$2
> -ovs-vsctl -- set Interface $iface options:tx_pcap=dummy-tx.pcap \
> -options:rxq_pcap=dummy-rx.pcap
> -rm -f ${pcap_file}*.pcap
> -ovs-vsctl -- set Interface $iface options:tx_pcap=${pcap_file}-tx.pcap \
> -options:rxq_pcap=${pcap_file}-rx.pcap
> -}
> -
>  AT_CAPTURE_FILE([ofctl_monitor0.log])
>  as hv1 ovs-ofctl monitor br-int resume --detach --no-chdir \
>  --pidfile=ovs-ofctl0.pid 2> ofctl_monitor0.log
> @@ -8781,16 +8761,6 @@ OVS_WAIT_UNTIL([
>  ])
>  ovn-nbctl lsp-set-options lrp0-rp router-port=lrp0 
> nat-addresses="f0:00:00:00:00:03 192.168.0.3"
>
> -reset_pcap_file() {
> -local iface=$1
> -local pcap_file=$2
> -ovs-vsctl -- set Interface $iface options:tx_pcap=dummy-tx.pcap \
> -options:rxq_pcap=dummy-rx.pcap
> -rm -f ${pcap_file}*.pcap
> -ovs-vsctl -- set Interface $iface options:tx_pcap=${pcap_file}-tx.pcap \
> -options:rxq_pcap=${pcap_file}-rx.pcap
> -}
> -
>  reset_pcap_file snoopvif hv1/snoopvif
>  OVS_WAIT_UNTIL([test `wc -c < "hv1/snoopvif-tx.pcap"` -ge 140])
>
> @@ -8865,20 +8835,8 @@ grep "Port patch-br-int-to-ln_port" | wc -l`])
>  # Temporarily remove lr0 chassis
>  AT_CHECK([ovn-nbctl remove logical_router lr0 options chassis])
>
> -reset_pcap_file() {
> -local hv=$1
> -local iface=$2
> -local pcap_file=$3
> -as $hv
> -ovs-vsctl -- set Interface $iface options:tx_pcap=dummy-tx.pcap \
> -options:rxq_pcap=dummy-rx.pcap
> -rm -f ${pcap_file}*.pcap
> -ovs-vsctl -- set Interface $iface options:tx_pcap=${pcap_file}-tx.pcap 

[ovs-dev] [PATCH ovn 3/4] tests: Factor out reset_pcap_file() helper.

2022-07-05 Thread Dumitru Ceara
Signed-off-by: Dumitru Ceara 
---
 tests/ovn-macros.at |   20 +++
 tests/ovn.at|  358 +++
 2 files changed, 43 insertions(+), 335 deletions(-)

diff --git a/tests/ovn-macros.at b/tests/ovn-macros.at
index 335f9158c..77e89f6b4 100644
--- a/tests/ovn-macros.at
+++ b/tests/ovn-macros.at
@@ -508,9 +508,13 @@ wait_for_ports_up() {
 fi
 }
 
-# reset_pcap_file iface pcap_file
+# reset_iface_pcap_file iface pcap_file
 # Resets the pcap file associates with OVS interface.  should be used
 # with dummy datapath.
+#
+# XXX: This should actually replace reset_pcap_file() as they do almost
+# exactly the same thing but the "wait while the pcap file has the size
+# of the PCAP header" check causes tests to fail.
 reset_iface_pcap_file() {
 local iface=$1
 local pcap_file=$2
@@ -525,6 +529,20 @@ options:rxq_pcap=${pcap_file}-rx.pcap
 OVS_WAIT_WHILE([test 24 = $(wc -c ${pcap_file}-tx.pcap | cut -d " " -f1)])
 }
 
+# reset_pcap_file iface pcap_file
+# Resets the pcap file associates with OVS interface.  should be used
+# with dummy datapath.
+reset_pcap_file() {
+local iface=$1
+local pcap_file=$2
+check rm -f dummy-*.pcap
+check ovs-vsctl -- set Interface $iface options:tx_pcap=dummy-tx.pcap \
+options:rxq_pcap=dummy-rx.pcap
+check rm -f ${pcap_file}*.pcap
+check ovs-vsctl -- set Interface $iface 
options:tx_pcap=${pcap_file}-tx.pcap \
+options:rxq_pcap=${pcap_file}-rx.pcap
+}
+
 # Receive a packet on a dummy netdev interface. If we expect packets to be
 # recorded, then wait until the pcap file reflects the change.
 netdev_dummy_receive() {
diff --git a/tests/ovn.at b/tests/ovn.at
index 0e868ae66..9512fd033 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -6479,16 +6479,6 @@ compare_dhcp_packets() {
 fi
 }
 
-reset_pcap_file() {
-local iface=$1
-local pcap_file=$2
-check ovs-vsctl -- set Interface $iface options:tx_pcap=dummy-tx.pcap \
-options:rxq_pcap=dummy-rx.pcap
-rm -f ${pcap_file}*.pcap
-check ovs-vsctl -- set Interface $iface 
options:tx_pcap=${pcap_file}-tx.pcap \
-options:rxq_pcap=${pcap_file}-rx.pcap
-}
-
 AT_CAPTURE_FILE([sbflows])
 ovn-sbctl dump-flows > sbflows
 
@@ -7074,16 +7064,6 @@ test_dhcpv6() {
 as hv1 ovs-appctl netdev-dummy/receive hv1-vif$inport $request
 }
 
-reset_pcap_file() {
-local iface=$1
-local pcap_file=$2
-ovs-vsctl -- set Interface $iface options:tx_pcap=dummy-tx.pcap \
-options:rxq_pcap=dummy-rx.pcap
-rm -f ${pcap_file}*.pcap
-ovs-vsctl -- set Interface $iface options:tx_pcap=${pcap_file}-tx.pcap \
-options:rxq_pcap=${pcap_file}-rx.pcap
-}
-
 AT_CAPTURE_FILE([ofctl_monitor0.log])
 as hv1 ovs-ofctl monitor br-int resume --detach --no-chdir \
 --pidfile=ovs-ofctl0.pid 2> ofctl_monitor0.log
@@ -8781,16 +8761,6 @@ OVS_WAIT_UNTIL([
 ])
 ovn-nbctl lsp-set-options lrp0-rp router-port=lrp0 
nat-addresses="f0:00:00:00:00:03 192.168.0.3"
 
-reset_pcap_file() {
-local iface=$1
-local pcap_file=$2
-ovs-vsctl -- set Interface $iface options:tx_pcap=dummy-tx.pcap \
-options:rxq_pcap=dummy-rx.pcap
-rm -f ${pcap_file}*.pcap
-ovs-vsctl -- set Interface $iface options:tx_pcap=${pcap_file}-tx.pcap \
-options:rxq_pcap=${pcap_file}-rx.pcap
-}
-
 reset_pcap_file snoopvif hv1/snoopvif
 OVS_WAIT_UNTIL([test `wc -c < "hv1/snoopvif-tx.pcap"` -ge 140])
 
@@ -8865,20 +8835,8 @@ grep "Port patch-br-int-to-ln_port" | wc -l`])
 # Temporarily remove lr0 chassis
 AT_CHECK([ovn-nbctl remove logical_router lr0 options chassis])
 
-reset_pcap_file() {
-local hv=$1
-local iface=$2
-local pcap_file=$3
-as $hv
-ovs-vsctl -- set Interface $iface options:tx_pcap=dummy-tx.pcap \
-options:rxq_pcap=dummy-rx.pcap
-rm -f ${pcap_file}*.pcap
-ovs-vsctl -- set Interface $iface options:tx_pcap=${pcap_file}-tx.pcap \
-options:rxq_pcap=${pcap_file}-rx.pcap
-}
-
-reset_pcap_file hv1 snoopvif hv1/snoopvif
-reset_pcap_file hv2 snoopvif hv2/snoopvif
+as hv1 reset_pcap_file snoopvif hv1/snoopvif
+as hv2 reset_pcap_file snoopvif hv2/snoopvif
 
 hv1_uuid=$(ovn-sbctl --bare --columns _uuid list chassis hv1)
 AT_CHECK([ovn-nbctl set logical_router lr0 options:chassis=hv1])
@@ -8894,8 +8852,8 @@ OVN_CHECK_PACKETS([hv2/snoopvif-tx.pcap], 
[empty_expected])
 # Temporarily remove lr0 chassis
 AT_CHECK([ovn-nbctl remove logical_router lr0 options chassis])
 
-reset_pcap_file hv1 snoopvif hv1/snoopvif
-reset_pcap_file hv2 snoopvif hv2/snoopvif
+as hv1 reset_pcap_file snoopvif hv1/snoopvif
+as hv2 reset_pcap_file snoopvif hv2/snoopvif
 
 hv2_uuid=$(ovn-sbctl --bare --columns _uuid list chassis hv2)
 AT_CHECK([ovn-nbctl set logical_router lr0 options:chassis=hv2])
@@ -8980,16 +8938,6 @@ AT_CHECK([sort packets], [0], [expout])
 # due to GARP backoff
 ovn-nbctl lsp-set-options lrp0-rp router-port=lrp0 nat-addresses=""
 
-reset_pcap_file() {
-local iface=$1
-local pcap_file=$2
-ovs-vsctl -- set Interface $iface options:tx_pcap=dummy-tx.pcap \