[ovs-dev] [PATCH] tests: Fix sed usage in pmd test.

Ben Pfaff blp at ovn.org
Tue Apr 3 18:13:50 UTC 2018


On Sun, Apr 01, 2018 at 10:01:24AM -0700, Ben Pfaff wrote:
> SUSv7 2016 Edition says:
> 
>   [2addr] {editing command
>   editing command
>   ...
>   }
> 
>     Execute a list of sed editing commands only when the pattern space is
>     selected. The list of sed editing commands shall be surrounded by
>     braces. The braces can be preceded or followed by <blank> characters.
>     The <right-brace> shall be preceded by a <newline> or <semicolon>
>     (before any optional <blank> characters preceding the <right-brace>).
> 
> This usage in pmd.at omitted the semicolon before the right brace.  This
> commit fixes the problem, which was rejected by the sed utility on Alpine
> Linux (which presumably comes from some version of busybox, but BusyBox
> v1.22.1 (Debian 1:1.22.0-9+b1) on my system accepts the form without
> semicolon).
> 
> Reported-by: Stuart Cardall <developer at it-offshore.co.uk>
> Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2018-March/046460.html
> Signed-off-by: Ben Pfaff <blp at ovn.org>
> ---
>  tests/pmd.at | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/pmd.at b/tests/pmd.at
> index 1568ab991e2f..532a182ba8c2 100644
> --- a/tests/pmd.at
> +++ b/tests/pmd.at
> @@ -149,7 +149,7 @@ TMP=$(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])
>  AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=0x3])
>  CHECK_PMD_THREADS_CREATED([2], [], [+$TMP])
>  
> -AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | sed ':a;/AVAIL$/{N;s/\n//;ba}' | parse_pmd_rxq_show_group | sed SED_NUMA_CORE_QUEUE_PATTERN], [0], [dnl
> +AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | sed ':a;/AVAIL$/{N;s/\n//;ba;}' | parse_pmd_rxq_show_group | sed SED_NUMA_CORE_QUEUE_PATTERN], [0], [dnl
>  port: p0 queue-id: <group>
>  port: p0 queue-id: <group>
>  ])

I applied this to master and branch-2.9, on the strength of Stuart's
test results.


More information about the dev mailing list