diff mbox

[ovs-dev] system-traffic: Don't rely on --field-separator.

Message ID 20160818225629.4969-1-joe@ovn.org
State Accepted
Headers show

Commit Message

Joe Stringer Aug. 18, 2016, 10:56 p.m. UTC
This is available in GNU awk, but not other awks (eg mawk). Drop this in
favour of "ofctl_strip" to produce reliable output.

Signed-off-by: Joe Stringer <joe@ovn.org>
---
 tests/system-traffic.at | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

William Tu Aug. 18, 2016, 11:41 p.m. UTC | #1
LGTM, tested it and no problem. thanks for the fix.

Acked-by: William Tu <u9012063@gmail.com>

On Thu, Aug 18, 2016 at 3:56 PM, Joe Stringer <joe@ovn.org> wrote:
> This is available in GNU awk, but not other awks (eg mawk). Drop this in
> favour of "ofctl_strip" to produce reliable output.
>
> Signed-off-by: Joe Stringer <joe@ovn.org>
> ---
>  tests/system-traffic.at | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tests/system-traffic.at b/tests/system-traffic.at
> index 0de1aa4920c2..10b2647260ad 100644
> --- a/tests/system-traffic.at
> +++ b/tests/system-traffic.at
> @@ -442,8 +442,8 @@ dnl check tunnel pop path, from at_ns0 to at_ns1
>  NS_CHECK_EXEC([at_ns0], [nc $NC_EOF_OPT -u 10.1.1.2 5678 < payload200.bin])
>  dnl After truncation = 100 byte at loopback device p2(4)
>  AT_CHECK([ovs-appctl revalidator/purge], [0])
> -AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=4" | awk --field-separator=', '  '{print $5}'], [0], [dnl
> -n_bytes=100
> +AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=4" | ofctl_strip], [0], [dnl
> + n_packets=1, n_bytes=100, priority=1,ip,in_port=4 actions=drop
>  ])
>
>  dnl SLOW_ACTION: disable datapath truncate support
> @@ -479,8 +479,8 @@ dnl check tunnel pop path, from at_ns0 to at_ns1
>  NS_CHECK_EXEC([at_ns0], [nc $NC_EOF_OPT -u 10.1.1.2 5678 < payload200.bin])
>  dnl After truncation = 100 byte at loopback device p2(4)
>  AT_CHECK([ovs-appctl revalidator/purge], [0])
> -AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=4" | awk --field-separator=', '  '{print $5}'], [0], [dnl
> -n_bytes=100
> +AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=4" | ofctl_strip], [0], [dnl
> + n_packets=1, n_bytes=100, priority=1,ip,in_port=4 actions=drop
>  ])
>
>  OVS_TRAFFIC_VSWITCHD_STOP
> --
> 2.9.2
>
Joe Stringer Aug. 18, 2016, 11:49 p.m. UTC | #2
On 18 August 2016 at 16:41, William Tu <u9012063@gmail.com> wrote:
> LGTM, tested it and no problem. thanks for the fix.
>
> Acked-by: William Tu <u9012063@gmail.com>

Thanks, applied to master and branch-2.6.
diff mbox

Patch

diff --git a/tests/system-traffic.at b/tests/system-traffic.at
index 0de1aa4920c2..10b2647260ad 100644
--- a/tests/system-traffic.at
+++ b/tests/system-traffic.at
@@ -442,8 +442,8 @@  dnl check tunnel pop path, from at_ns0 to at_ns1
 NS_CHECK_EXEC([at_ns0], [nc $NC_EOF_OPT -u 10.1.1.2 5678 < payload200.bin])
 dnl After truncation = 100 byte at loopback device p2(4)
 AT_CHECK([ovs-appctl revalidator/purge], [0])
-AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=4" | awk --field-separator=', '  '{print $5}'], [0], [dnl
-n_bytes=100
+AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=4" | ofctl_strip], [0], [dnl
+ n_packets=1, n_bytes=100, priority=1,ip,in_port=4 actions=drop
 ])
 
 dnl SLOW_ACTION: disable datapath truncate support
@@ -479,8 +479,8 @@  dnl check tunnel pop path, from at_ns0 to at_ns1
 NS_CHECK_EXEC([at_ns0], [nc $NC_EOF_OPT -u 10.1.1.2 5678 < payload200.bin])
 dnl After truncation = 100 byte at loopback device p2(4)
 AT_CHECK([ovs-appctl revalidator/purge], [0])
-AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=4" | awk --field-separator=', '  '{print $5}'], [0], [dnl
-n_bytes=100
+AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=4" | ofctl_strip], [0], [dnl
+ n_packets=1, n_bytes=100, priority=1,ip,in_port=4 actions=drop
 ])
 
 OVS_TRAFFIC_VSWITCHD_STOP