[ovs-dev] ovn.at: Fix "ovn -- 1 LR with distributed router gateway port" test

Submitted by Takashi YAMAMOTO on April 21, 2017, 1:32 a.m.

Details

Message ID 1492738377-12802-1-git-send-email-yamamoto@ovn.org
State Superseded
Headers show

Commit Message

Takashi YAMAMOTO April 21, 2017, 1:32 a.m.
NetBSD implementation of wc command outputs extra whitespaces
like the following.  Tweak the test to success on such environments.

    % echo hoge|wc -l|hexdump -C
    00000000  20 20 20 20 20 20 20 31  0a                       |       1.|
    00000009
    %

The failing test was introduced by
commit 41a15b71ed1ef35aa612a1128082219fbfc3f327
(ovn: Introduce distributed gateway port and "chassisredirect" port binding)

Signed-off-by: YAMAMOTO Takashi <yamamoto@ovn.org>
---
 tests/ovn.at | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

Comments

Mickey Spiegel April 24, 2017, 12:48 a.m.
On Thu, Apr 20, 2017 at 6:32 PM, YAMAMOTO Takashi <yamamoto@ovn.org> wrote:

> NetBSD implementation of wc command outputs extra whitespaces
> like the following.  Tweak the test to success on such environments.
>
>     % echo hoge|wc -l|hexdump -C
>     00000000  20 20 20 20 20 20 20 31  0a                       |       1.|
>     00000009
>     %
>
> The failing test was introduced by
> commit 41a15b71ed1ef35aa612a1128082219fbfc3f327
> (ovn: Introduce distributed gateway port and "chassisredirect" port
> binding)
>
> Signed-off-by: YAMAMOTO Takashi <yamamoto@ovn.org>
>

There are three more in one of the tests in system-ovn.at, affecting make
check-kernel.

Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>



> ---
>  tests/ovn.at | 18 ++++++------------
>  1 file changed, 6 insertions(+), 12 deletions(-)
>
> diff --git a/tests/ovn.at b/tests/ovn.at
> index af77c19..1bffc4c 100644
> --- a/tests/ovn.at
> +++ b/tests/ovn.at
> @@ -6567,20 +6567,14 @@ as hv3 ovs-ofctl dump-flows br-int
>  echo "--------------------------"
>
>  # Check that redirect mapping is programmed only on hv2
> -AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=33 | grep
> =0x3,metadata=0x1 | wc -l], [0], [0
> -])
> -AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=33 | grep
> =0x3,metadata=0x1 | grep load:0x2- | wc -l], [0], [1
> -])
> +AT_CHECK([test `as hv1 ovs-ofctl dump-flows br-int table=33 | grep
> =0x3,metadata=0x1 | wc -l` -eq 0])
> +AT_CHECK([test `as hv2 ovs-ofctl dump-flows br-int table=33 | grep
> =0x3,metadata=0x1 | grep load:0x2- | wc -l` -eq 1])
>  # Check that hv1 sends chassisredirect port traffic to hv2
> -AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=32 | grep
> =0x3,metadata=0x1 | grep output | wc -l], [0], [1
> -])
> -AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=32 | grep
> =0x3,metadata=0x1 | wc -l], [0], [0
> -])
> +AT_CHECK([test `as hv1 ovs-ofctl dump-flows br-int table=32 | grep
> =0x3,metadata=0x1 | grep output | wc -l` -eq 1])
> +AT_CHECK([test `as hv2 ovs-ofctl dump-flows br-int table=32 | grep
> =0x3,metadata=0x1 | wc -l` -eq 0])
>  # Check that arp reply on distributed gateway port is only programmed on
> hv2
> -AT_CHECK([as hv1 ovs-ofctl dump-flows br-int | grep arp | grep
> =0x2,metadata=0x1 | wc -l], [0], [0
> -])
> -AT_CHECK([as hv2 ovs-ofctl dump-flows br-int | grep arp | grep
> =0x2,metadata=0x1 | wc -l], [0], [1
> -])
> +AT_CHECK([test `as hv1 ovs-ofctl dump-flows br-int | grep arp | grep
> =0x2,metadata=0x1 | wc -l` -eq 0])
> +AT_CHECK([test `as hv2 ovs-ofctl dump-flows br-int | grep arp | grep
> =0x2,metadata=0x1 | wc -l` -eq 1])
>
>
>  ip_to_hex() {
> --
> 2.5.4 (Apple Git-61)
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
Takashi YAMAMOTO April 24, 2017, 6:16 a.m.
On Mon, Apr 24, 2017 at 9:48 AM, Mickey Spiegel <mickeys.dev@gmail.com>
wrote:

>
> On Thu, Apr 20, 2017 at 6:32 PM, YAMAMOTO Takashi <yamamoto@ovn.org>
> wrote:
>
>> NetBSD implementation of wc command outputs extra whitespaces
>> like the following.  Tweak the test to success on such environments.
>>
>>     % echo hoge|wc -l|hexdump -C
>>     00000000  20 20 20 20 20 20 20 31  0a                       |
>>  1.|
>>     00000009
>>     %
>>
>> The failing test was introduced by
>> commit 41a15b71ed1ef35aa612a1128082219fbfc3f327
>> (ovn: Introduce distributed gateway port and "chassisredirect" port
>> binding)
>>
>> Signed-off-by: YAMAMOTO Takashi <yamamoto@ovn.org>
>>
>
> There are three more in one of the tests in system-ovn.at, affecting make
> check-kernel.
>

sure.
but those tests seem heavily linux-centric anyway for other reasons.


>
> Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
>
>
>
>> ---
>>  tests/ovn.at | 18 ++++++------------
>>  1 file changed, 6 insertions(+), 12 deletions(-)
>>
>> diff --git a/tests/ovn.at b/tests/ovn.at
>> index af77c19..1bffc4c 100644
>> --- a/tests/ovn.at
>> +++ b/tests/ovn.at
>> @@ -6567,20 +6567,14 @@ as hv3 ovs-ofctl dump-flows br-int
>>  echo "--------------------------"
>>
>>  # Check that redirect mapping is programmed only on hv2
>> -AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=33 | grep
>> =0x3,metadata=0x1 | wc -l], [0], [0
>> -])
>> -AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=33 | grep
>> =0x3,metadata=0x1 | grep load:0x2- | wc -l], [0], [1
>> -])
>> +AT_CHECK([test `as hv1 ovs-ofctl dump-flows br-int table=33 | grep
>> =0x3,metadata=0x1 | wc -l` -eq 0])
>> +AT_CHECK([test `as hv2 ovs-ofctl dump-flows br-int table=33 | grep
>> =0x3,metadata=0x1 | grep load:0x2- | wc -l` -eq 1])
>>  # Check that hv1 sends chassisredirect port traffic to hv2
>> -AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=32 | grep
>> =0x3,metadata=0x1 | grep output | wc -l], [0], [1
>> -])
>> -AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=32 | grep
>> =0x3,metadata=0x1 | wc -l], [0], [0
>> -])
>> +AT_CHECK([test `as hv1 ovs-ofctl dump-flows br-int table=32 | grep
>> =0x3,metadata=0x1 | grep output | wc -l` -eq 1])
>> +AT_CHECK([test `as hv2 ovs-ofctl dump-flows br-int table=32 | grep
>> =0x3,metadata=0x1 | wc -l` -eq 0])
>>  # Check that arp reply on distributed gateway port is only programmed on
>> hv2
>> -AT_CHECK([as hv1 ovs-ofctl dump-flows br-int | grep arp | grep
>> =0x2,metadata=0x1 | wc -l], [0], [0
>> -])
>> -AT_CHECK([as hv2 ovs-ofctl dump-flows br-int | grep arp | grep
>> =0x2,metadata=0x1 | wc -l], [0], [1
>> -])
>> +AT_CHECK([test `as hv1 ovs-ofctl dump-flows br-int | grep arp | grep
>> =0x2,metadata=0x1 | wc -l` -eq 0])
>> +AT_CHECK([test `as hv2 ovs-ofctl dump-flows br-int | grep arp | grep
>> =0x2,metadata=0x1 | wc -l` -eq 1])
>>
>>
>>  ip_to_hex() {
>> --
>> 2.5.4 (Apple Git-61)
>>
>> _______________________________________________
>> dev mailing list
>> dev@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>>
>
>

Patch hide | download patch | download mbox

diff --git a/tests/ovn.at b/tests/ovn.at
index af77c19..1bffc4c 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -6567,20 +6567,14 @@  as hv3 ovs-ofctl dump-flows br-int
 echo "--------------------------"
 
 # Check that redirect mapping is programmed only on hv2
-AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=33 | grep =0x3,metadata=0x1 | wc -l], [0], [0
-])
-AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=33 | grep =0x3,metadata=0x1 | grep load:0x2- | wc -l], [0], [1
-])
+AT_CHECK([test `as hv1 ovs-ofctl dump-flows br-int table=33 | grep =0x3,metadata=0x1 | wc -l` -eq 0])
+AT_CHECK([test `as hv2 ovs-ofctl dump-flows br-int table=33 | grep =0x3,metadata=0x1 | grep load:0x2- | wc -l` -eq 1])
 # Check that hv1 sends chassisredirect port traffic to hv2
-AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=32 | grep =0x3,metadata=0x1 | grep output | wc -l], [0], [1
-])
-AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=32 | grep =0x3,metadata=0x1 | wc -l], [0], [0
-])
+AT_CHECK([test `as hv1 ovs-ofctl dump-flows br-int table=32 | grep =0x3,metadata=0x1 | grep output | wc -l` -eq 1])
+AT_CHECK([test `as hv2 ovs-ofctl dump-flows br-int table=32 | grep =0x3,metadata=0x1 | wc -l` -eq 0])
 # Check that arp reply on distributed gateway port is only programmed on hv2
-AT_CHECK([as hv1 ovs-ofctl dump-flows br-int | grep arp | grep =0x2,metadata=0x1 | wc -l], [0], [0
-])
-AT_CHECK([as hv2 ovs-ofctl dump-flows br-int | grep arp | grep =0x2,metadata=0x1 | wc -l], [0], [1
-])
+AT_CHECK([test `as hv1 ovs-ofctl dump-flows br-int | grep arp | grep =0x2,metadata=0x1 | wc -l` -eq 0])
+AT_CHECK([test `as hv2 ovs-ofctl dump-flows br-int | grep arp | grep =0x2,metadata=0x1 | wc -l` -eq 1])
 
 
 ip_to_hex() {