[ovs-dev] [PATCH] tests: Avoid nonportable "sed -i".

Ben Pfaff blp at nicira.com
Wed Aug 26 22:55:28 UTC 2015


Thanks.  I tested this and realized that it introduced a bug, and that
there was another place to fix too, so I sent a v2:
        http://openvswitch.org/pipermail/dev/2015-August/059256.html

On Wed, Aug 26, 2015 at 02:49:11PM -0700, Alex Wang wrote:
> Thx for informing the portability issue.
> 
> I used 'sed -i' since I only saw this in ovsdb-server.log, so originally,
> did not
> want to miss same error logs in other *.log file,
> 
> But, since 'sed -i' is not portable, I think it is good to do it in
> check_log()
> 
> Acked-by: Alex Wang <alexw at nicira.com>
> 
> On Wed, Aug 26, 2015 at 2:44 PM, Ben Pfaff <blp at nicira.com> wrote:
> 
> > "sed -i" isn't entirely portable, and we can avoid it by using the
> > argument to check_logs as intended.
> >
> > CC: Alex Wang <alexw at nicira.com>
> > Signed-off-by: Ben Pfaff <blp at nicira.com>
> > ---
> >  tests/ovn-controller-vtep.at | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/tests/ovn-controller-vtep.at b/tests/ovn-controller-vtep.at
> > index 9fc1526..4c32efd 100644
> > --- a/tests/ovn-controller-vtep.at
> > +++ b/tests/ovn-controller-vtep.at
> > @@ -89,8 +89,7 @@ m4_define([OVN_CONTROLLER_VTEP_STOP],
> >     # sending update back to *ctl command if *ctl has not proceeded to
> > exit yet.
> >     # and if *ctl command exits before database calling send, the send from
> >     # database will fail with 'Broken pipe' error.
> > -   AT_CHECK([sed -i '/Broken pipe/d' ovsdb-server.log])
> > -   AT_CHECK([check_logs $1])
> > +   AT_CHECK([check_logs '/Broken pipe/d'])
> >     AT_CHECK([ovs-appctl -t ovs-vtep exit])
> >     AT_CHECK([ovs-appctl -t ovn-northd exit])
> >     AT_CHECK([ovs-appctl -t ovn-controller-vtep exit])
> > --
> > 2.1.3
> >
> >



More information about the dev mailing list